ploppyperson / StackMob-3

A plugin designed for bukkit servers, aiming to reduce the lag that both the server and players experience.
GNU General Public License v3.0
24 stars 22 forks source link

Mob cache doesn't work #64

Closed wasder closed 6 years ago

wasder commented 6 years ago

Mobs stacks don't persist between restarts. In fact I can't find any cache.yml file anywhere in server's folder. plugins/StackMob/ has only 2 files: config.yml lang.yml

Tried to create a cache.yml manually, but it got deleted after restart. I guess that's why: https://github.com/Nathat23/StackMob-2/blob/306e02b49d28701aa162c3df179e7a856acd14f1/src/main/java/uk/antiperson/stackmob/tools/config/CacheFile.java#L34

StackMob v2.2.9


# Report issues that you have experienced in the discussion thread.

# The size of the area around an entity that should be checked for matching entities to stack with.
check-area:
    x: 5
    y: 4
    z: 5

# Everything related to the tag seen above entities
tag:
    # The delay between updates of the name tag.
    interval: 5
    # The formatting of the tag.
    # Placeholders:
    # %size% - Stack size.
    # %type% - Formatted type name.
    # %bukkit_type% - The entity type as bukkit calls it.
    # Normal Minecraft color codes are also supported, by using '&' before the letter/number.
    format: '&cx%size%'
    # Whether the tag above the entity should be seen at all times, or only when hovering over.
    always-visible: true
    # If the stack size if equal to or below this number, don't show the tag.
    remove-at: 1
    # Only update the tag when a player is near that entity.
    update-nearby: true
    # Only show the name tag if the player is near the entity. (requires ProtocolLib)
    show-player-nearby:
        enabled: true
        # Only display the tag to the player if the player is in this area of the entity.
        x: 5
        y: 3
        z: 5

 # Custom rules for specific entities.
custom:
    # Example (remove hashtags to make this work):
    #PIG:
    #    stack-max: 25
    #    tag:
    #        format: '%size%x Piggy'
    #        always-visible: true
    #        remove-at: 1

# The delay between each time the stacking task is ran (in ticks.)
task-delay: 100
# The maximum size a single stack can be.
stack-max: 100
# If bigger stacks should get priority when stacking on the task.
big-priority: true
# If the entity was spawned by these causes, then don't stack.
# Reasons list can be found at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html
no-stack-reasons:
    - CUSTOM
# Don't stack if the entity is one of these types.
# List of the bukkit names can be found at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html
no-stack-types:
    - RABBIT
    - OCELOT
    - SHULKER
    - VILLAGER
    - SLIME
    - IRON_GOLEM
    - SKELETON_HORSE
    - WITHER
    - PARROT
    - LLAMA
    - ENDER_DRAGON
    - WITHER
    - BAT
    - POLAR_BEAR
    - HORSE
    - ILLUSIONER
# If the entity is located in one of these worlds, then don't stack.
no-stack-worlds:
    - ''
# Don't stack until there are more than the number specified of entities of the same type in the check area set above.
# Set to 0 to disable this feature.
dont-stack-until: 5

# Enables/disables the comparing of mob type specific attributes before stacking together.
compare:
    villager-profession: true
    sheep-wool-sheared: true
    sheep-wool-color: true
    slime-size: true
    horse-color: true
    # Apply to more than one type of entity.
    entity-age: true
    can-breed: true
    # Only for 1.8.x and below.
    zombie-is-villager: true
    # Only 1.10.x and below.
    skeleton-type: true
    zombie-villager-profession: true
    # 1.11 and above.
    llama-color: true
    # 1.12 and above.
    parrot-color: true

# Check these attributes before stacking.
check:
    tamed: true
    leashed: true
    is-miniature-pet: true

# Things that should be duplicated.
multiply:
     # Make creeper explosions bigger
     creeper-explosion: true
     # Chicken lay eggs, so make more eggs be dropped
     chicken-eggs: true
     # When sheep are sheared, multiply all the wool.
     sheep-wool: false
     # Multiply mushrooms for all of the cows.
     mooshroom-mushrooms: false
     # Multiply the amount of small slimes spawned when a big slime is killed.
     small-slimes: true
     # When an entity is fed it's food, spawn a new stack with the correct number of children.
     breed: false

# If the stack should split into more when these things happen.
divide-on:
    # If sheep should split into separate stacks when sheared.
    sheep-shear: true
    # If dying sheep should cause the stack to split.
    sheep-dye: true
    # When a mooshroom gets sheared, spilt the stack.
    mooshroom-shear: true
    # When a stack is fed it's food, spilt, so the stack can be bred.
    breed: true
    # When a player tames an entity.
    tame: true
    # When an entity it named using a name tag.
    name: true

# Make every entity die in the stack on death.
kill-all:
    enabled: false
    # DeathEvent reasons that shouldn't trigger kill-all.
    # List of bukkit names for death reasons can be found at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html
    reason-blacklist:
        - ''
    # Entity types that shouldn't trigger kill-all.
    type-blacklist:
        - ''

# Only kill some of the stack
kill-step:
    enabled: true
    # DeathEvent reasons that shouldn't trigger kill-step.
    # List of bukkit names for death reasons can be found at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html
    reason-blacklist:
        - ''
    # Entity types that shouldn't trigger kill-step.
    type-blacklist:
        - ''
    # The maximum amount by which the stack should decrease by.
    # Setting this to 0 will cause errors!
    max-step: 5

# Multiply the amount of drops depending on the size of the stack killed.
# Only needed if kill-all OR kill-step is enabled above.
multiply-drops:
    enabled: true
    # The amount of entities that the loot should be dropped for in a stack.
    # Useful if there is a high max-stack value, to prevent lag.
    entity-limit: 50
    # Item types that should be duplicated.
    # A list of materials can be found at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    drops-whitelist:
        - STRING
        - SULPHUR
        - ROTTEN_FLESH
        - BONE
        - BLAZE_ROD
        - GHAST_TEAR
        - ENDER_PEARL
        - MAGMA_CREAM
        - ARROW
        - SLIME_BALL
        - COOKED_BEEF
        - COOKED_CHICKEN
        - COOKED_MUTTON
        - COOKED_RABBIT
        - GRILLED_PORK
        - RAW_BEEF
        - RAW_CHICKEN
        - MUTTON
        - PORK
        - RABBIT
        - FEATHER
        - RED_MUSHROOM
        - LEATHER
        - RABBIT_FOOT
        - RABBIT_HIDE
        - NETHER_STAR
        - GLASS_BOTTLE
        - GLOWSTONE_DUST
        - REDSTONE
        - SPIDER_EYE
        - SUGAR
        - STICK
        - IRON_INGOT
        - GOLD_NUGGET
        - GOLD_INGOT
        - PRISMARINE_SHARD
        - EMERALD
    # Only drop one item per entity.
    drop-one-per:
        - EMERALD
        - NETHER_STAR
        - TOTEM

# Multiplies the experience dropped on kill-all/kill-step.
multiply-exp-enabled: true

# Multiplies the damage that an entity gives to the player.
multiply-damage-done: false

# Multiplies the damage that the entities receives, if multiplied damage is more than the max health, remove stacks.
multiply-damage-received:
    enabled: true
    # Blacklist of damage causes.
    cause-blacklist:
        - ''

# Prevent entities from targeting players.
# Like no-ai but the entities can move.
no-targeting:
    enabled: false
    types-blacklist:
       - ''

# Everything to do with mcMMO
mcmmo:
    # Give no mcmmo experience
    no-experience:
        enabled: true
        # Blacklist of entity types that should still give mcmmo experience.
        blacklist:
            - ''
mythicmobs:
    # If Mythicmobs should stack together
    enabled: true
    # MythicMob types that shouldn't stack, use the 'internal name'
    blacklist:
       - ''

# If WorldGuard is installed, enable support for it.
worldguard-support: true

# When the server is restarted, all the stack sizes are saved to disk.
caching:
   # Stack data can be saved to disk every x minutes.
    # This is useful so that in the event of a server crash, not all stack data will be lost.
    autosave:
        enabled: true
        # The amount of time between saves, in seconds.
        interval: 180
    # Instead of using flat files for storage, a mysql server can be used.```
ploppyperson commented 6 years ago

The auto-save feature was removed when the code was reverted. #66