Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Leaf Config v3 #81

Merged
merged 13 commits into from
Jul 11, 2024
Merged

Refactor: Leaf Config v3 #81

merged 13 commits into from
Jul 11, 2024

Conversation

Dreeam-qwq
Copy link
Member

@Dreeam-qwq Dreeam-qwq commented Jul 9, 2024

Leaf Config v3

I used ConfigMaster-API as config framework to refactor current Leaf Config.
For now, the config file format is yaml/yml instead of toml. And is also support
loaded by spark web profiler.

Note:

  • I didn't write convertor for this new config, so you need to transfer to it manually.
    I believe the new config is enough easy to look and easy to find keys.

Changes:

  • Use ConfigMaster-API to refactor config
  • New leaf config path: config/leaf-global.yml
  • Add missing config header
  • Changes some config key path and names.
  • Support spark load extra server config
  • Purge and backup Leaf's old config and Pufferfish config, backup path config/backup#Date&Time

Current config preview:

leaf-global.yml
# Leaf Config
# Github Repo: https://github.com/Winds-Studio/Leaf
# Discord: https://discord.com/invite/gfgAwdSEuM
# QQ Group: 715128273
config-version: 3.0

###########
#  ASYNC  #
###########
async:
  async-pathfinding:
    enabled: false
    max-threads: 0
    keepalive: 60

##########
#  PERF  #
##########
performance:
  # Use the new Virtual Thread introduced in JDK 21 for CraftAsyncScheduler.
  use-virtual-thread-for-async-scheduler: true
  # Throttles the AI goal selector in entity inactive ticks.
  # This can improve performance by a few percent, but has minor gameplay implications.
  inactive-goal-selector-throttle: true
  skip-map-item-data-updates-if-map-does-not-have-craftmaprenderer: true
  optimized-powered-rails: true
  optimize-minecart:
    # Enable this feature to handle large amount of stacked Minecart better.
    # By skipping tick collisions to reduce expense getting entities list
    # and bukkit event calls, useful for the anarchy server.
    enabled: false
    skip-tick-count: 30
  # May cause the inconsistent order of future compose tasks.
  faster-structure-gen-future-sequencing: true
  # Use faster random generator? (Up to 100X faster)
  # Requires a JVM that supports RandomGenerator and the LXM generators.
  # Some JREs don't support this and will cause a crash.
  use-faster-random-generator: false
  # These values define a entity's maximum lifespan. If an
  # entity is in this list and it has survived for longer than
  # that number of ticks, then it will be removed. Setting a value to
  # -1 disables this feature.
  entity-timeouts:
    SNOWBALL: -1
    LLAMA_SPIT: -1
    ALLAY: -1
    AREA_EFFECT_CLOUD: -1
    ARMADILLO: -1
    ARMOR_STAND: -1
    ARROW: -1
    AXOLOTL: -1
    BAT: -1
    BEE: -1
    BLAZE: -1
    BLOCK_DISPLAY: -1
    BOAT: -1
    BOGGED: -1
    BREEZE: -1
    BREEZE_WIND_CHARGE: -1
    CAMEL: -1
    CAT: -1
    CAVE_SPIDER: -1
    CHEST_BOAT: -1
    CHEST_MINECART: -1
    CHICKEN: -1
    COD: -1
    COMMAND_BLOCK_MINECART: -1
    COW: -1
    CREEPER: -1
    DOLPHIN: -1
    DONKEY: -1
    DRAGON_FIREBALL: -1
    DROWNED: -1
    EGG: -1
    ELDER_GUARDIAN: -1
    END_CRYSTAL: -1
    ENDER_DRAGON: -1
    ENDER_PEARL: -1
    ENDERMAN: -1
    ENDERMITE: -1
    EVOKER: -1
    EVOKER_FANGS: -1
    EXPERIENCE_BOTTLE: -1
    EXPERIENCE_ORB: -1
    EYE_OF_ENDER: -1
    FALLING_BLOCK: -1
    FIREWORK_ROCKET: -1
    FOX: -1
    FROG: -1
    FURNACE_MINECART: -1
    GHAST: -1
    GIANT: -1
    GLOW_ITEM_FRAME: -1
    GLOW_SQUID: -1
    GOAT: -1
    GUARDIAN: -1
    HOGLIN: -1
    HOPPER_MINECART: -1
    HORSE: -1
    HUSK: -1
    ILLUSIONER: -1
    INTERACTION: -1
    IRON_GOLEM: -1
    ITEM: -1
    ITEM_DISPLAY: -1
    ITEM_FRAME: -1
    OMINOUS_ITEM_SPAWNER: -1
    FIREBALL: -1
    LEASH_KNOT: -1
    LIGHTNING_BOLT: -1
    LLAMA: -1
    MAGMA_CUBE: -1
    MARKER: -1
    MINECART: -1
    MOOSHROOM: -1
    MULE: -1
    OCELOT: -1
    PAINTING: -1
    PANDA: -1
    PARROT: -1
    PHANTOM: -1
    PIG: -1
    PIGLIN: -1
    PIGLIN_BRUTE: -1
    PILLAGER: -1
    POLAR_BEAR: -1
    POTION: -1
    PUFFERFISH: -1
    RABBIT: -1
    RAVAGER: -1
    SALMON: -1
    SHEEP: -1
    SHULKER: -1
    SHULKER_BULLET: -1
    SILVERFISH: -1
    SKELETON: -1
    SKELETON_HORSE: -1
    SLIME: -1
    SMALL_FIREBALL: -1
    SNIFFER: -1
    SNOW_GOLEM: -1
    SPAWNER_MINECART: -1
    SPECTRAL_ARROW: -1
    SPIDER: -1
    SQUID: -1
    STRAY: -1
    STRIDER: -1
    TADPOLE: -1
    TEXT_DISPLAY: -1
    TNT: -1
    TNT_MINECART: -1
    TRADER_LLAMA: -1
    TRIDENT: -1
    TROPICAL_FISH: -1
    TURTLE: -1
    VEX: -1
    VILLAGER: -1
    VINDICATOR: -1
    WANDERING_TRADER: -1
    WARDEN: -1
    WIND_CHARGE: -1
    WITCH: -1
    WITHER: -1
    WITHER_SKELETON: -1
    WITHER_SKULL: -1
    WOLF: -1
    ZOGLIN: -1
    ZOMBIE: -1
    ZOMBIE_HORSE: -1
    ZOMBIE_VILLAGER: -1
    ZOMBIFIED_PIGLIN: -1
    PLAYER: -1
    FISHING_BOBBER: -1
  # Optimizes entity brains when
  # they're far away from the player
  dab:
    enabled: true
    # This value determines how far away an entity has to be
    # from the player to start being effected by DEAR.
    start-distance: 12
    # This value defines how often in ticks, the furthest entity
    # will get their pathfinders and behaviors ticked. 20 = 1s
    max-tick-freq: 20
    # This value defines how much distance modifies an entity's
    # tick frequency. freq = (distanceToPlayer^2) / (2^value)",
    # If you want further away entities to tick less often, use 7.
    # If you want further away entities to tick more often, try 9.
    activation-dist-mod: 8
    # A list of entities to ignore for activation
    blacklisted-entities: []
  dont-save-entity:
    # Disable save primed tnt on chunk unloads.
    # Useful for redstone server, can prevent machine be exploded by TNT,
    # when player disconnected caused by Internet issue.
    dont-save-primed-tnt: false
    dont-save-falling-block: false

###########
#  FIXES  #
###########
fixes: null

##############
#  GAMEPLAY  #
##############
gameplay-mechanisms:
  use-spigot-item-merging-mechanism: true
  knockback:
    # Make snowball can knockback players
    snowball-knockback-players: false
    # Make egg can knockback players
    egg-knockback-players: false
  player:
    # Disable moved quickly/wrongly checks
    disable-moved-wrongly-threshold: false
    # The max distance of UseItem for players.
    # Set to -1 to disable max-distance-check.
    # NOTE: if set to -1 to disable the check,
    # players are able to use some packet modules of hack clients,
    # and NoCom Exploit!!
    max-use-item-distance: 1.0000001

#############
#  NETWORK  #
#############
network:
  protocol-support:
    jade-protocol: false
    appleskin-protocol: false
    asteorbar-protocol: false
    chatimage-protocol: false
    xaero-map-protocol: false
    xaero-map-server-id: 2088437216
  # Whether or not enable chat message signature,
  # disable will prevent players to report chat messages.
  # And also disables the popup when joining a server without
  # 'secure chat', such as offline-mode servers.
  chat-message-signature: true

##########
#  MISC  #
##########
misc:
  rebrand:
    server-mod-name: Leaf
    server-gui-name: Leaf Console
  # Sentry DSN for improved error logging, leave blank to disable,
  # Obtain from https://sentry.io/
  sentry-dsn: ''
  # Remove Vanilla username check
  # allowing all characters as username
  remove-vanilla-username-check: true
  # Enable player enter backend server through proxy
  # without backend server enabling its bungee mode
  remove-spigot-check-bungee-config: true
  # Enable to prevent console spam.
  remove-change-non-editable-sign-warning: false
  including-5s-in-get-tps: true
  # Connection message using MiniMessage format, set to 'default' to use vanilla join message.
  # available placeholders:
  # %player_name% - player name
  # %player_displayname% - player display name
  connection-message:
    join:
      enabled: true
      # Join message of player
      message: default
    quit:
      enabled: true
      # Quit message of player
      message: default
  cache:
    # Cache the player profile result on they first join.
    # It's useful if Mojang's verification server is down.
    cache-player-profile-result: true
    # The timeout of the cache. Unit: Minutes.
    cache-player-profile-result-timeout: 1440

Welcome to leave comments under this pull request to provide suggestions, like additional key name change or key path change or something else.

@BrailleBennett
Copy link

Enable this feature to handle large amount of stacked Minecart better. Should be Enable this feature to handle large amount of stacked minecarts better.

@BrailleBennett
Copy link

Or Enable this feature to handle a large amount of stacked minecarts better.

@BrailleBennett
Copy link

Useful for redstone server, can prevent machine be exploded by TNT, should be Useful for redstone server, can prevent machines from being exploded by TnT

@BrailleBennett
Copy link

Or: Useful for redstone servers, can prevent machines from being exploded by TnT

@Dreeam-qwq Dreeam-qwq merged commit 4a06d00 into ver/1.21 Jul 11, 2024
1 check passed
@Dreeam-qwq Dreeam-qwq deleted the refactor/config-v3 branch July 11, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants