From c7b279fe1bc55120c2902609d124f2940f74b231 Mon Sep 17 00:00:00 2001 From: jmp Date: Fri, 1 Jan 2021 15:36:31 -0800 Subject: [PATCH] Updated Upstream (Paper & Tuinity) Upstream has released updates that appear to apply and compile correctly Paper Changes: 05af2837c [CI-SKIP] Improved the annotation test output 586966949 abstract custom set tags, add entity tags c7667378e Added PlayerLoomPatternSelectEvent 00972e80d Reimplement GS4QueryEvent 544c5c278 Re-add coral block tags (#4987) 7d56c8deb Added PlayerLecternPageChangeEvent c7cdf255b Add BlockFailedDispenseEvent c8a8d6fbe Added world settings for mobs picking up loot 91eda5bd3 Added ServerResourcesReloadedEvent be81b4f5c Add a Enchantable MaterialTag 975d18703 Add doors to material tags d075e748e colorful itemdump f3ba3dee0 Added WorldGameRuleChangeEvent 086d20118 Guardian beam workaround b63c890ec Support spawning item stacks d7d74c552 added height config for bamboo 7878e3bc2 Use setAmount for Recipe Amount 50e70697b Add EntityLoadCrossbowEvent f344e092c Add Anti-Xray bypass permission 9fd31e675 fix for nerfed slime mobs splitting 4a7962cd1 Zombie API - breaking doors 5650a41f5 Fix interact event not being called in adventure 2c9ed4335 Add PlayerFlowerPotManipulateEvent 1f32290b6 [Auto] Updated Upstream (CraftBukkit) d87694a20 Redact Velocity forwarding secret properly (#4980) 24a0b0206 [Auto] Updated Upstream (CraftBukkit) 7681042ef [Auto] Updated Upstream (Bukkit/CraftBukkit) 7dea3dba6 [Auto] Updated Upstream (CraftBukkit) 4b3792920 JavaDoc fixes f13b4727e Allow disabling mob spawner spawn egg transformation 525b50737 Cache burn durations 2c37d1077 Optimized tick ready check b4000b01a Add API to get the Material of Boats and Minecarts f1317386d Fix sign lazy initialisation 9f61759d9 Updated Upstream (CraftBukkit/Spigot) (#4972) aaff430b6 [CI-SKIP] Use GitHub Actions for build status 9f4055d99 Fix harming potion dupe 7bfb781ff Additional Block Material API's 0eaffd008 Micro Optimize DataBits Tuinity Changes: 9e5cabb6e Port starlight changes --- Paper | 2 +- patches/api/0001-Tuinity-API-Changes.patch | 2 +- patches/api/0007-AFK-API.patch | 4 +- .../api/0018-Player-invulnerabilities.patch | 4 +- .../0020-ItemStack-convenience-methods.patch | 4 +- ...oc-warnings-missing-param-and-return.patch | 162 +-- .../server/0001-Tuinity-Server-Changes.patch | 1286 +++++++++-------- patches/server/0002-Rebrand.patch | 6 +- patches/server/0003-Purpur-config-files.patch | 4 +- patches/server/0009-AFK-API.patch | 4 +- .../0011-Configurable-server-mod-name.patch | 4 +- patches/server/0013-Lagging-threshold.patch | 6 +- .../0014-ItemFactory-getMonsterEgg.patch | 2 +- ...015-PlayerSetSpawnerTypeWithEggEvent.patch | 2 +- patches/server/0017-EntityMoveEvent.patch | 4 +- .../0018-Player-invulnerabilities.patch | 4 +- .../0021-Alternative-Keepalive-Handling.patch | 2 +- .../server/0048-Signs-allow-color-codes.patch | 4 +- .../server/0050-Controllable-Minecarts.patch | 2 +- ...052-Players-should-not-cram-to-death.patch | 2 +- .../0059-Configurable-TPS-Catchup.patch | 4 +- ...Projectile-load-save-limit-per-chunk.patch | 14 +- .../0071-Add-canSaveToDisk-to-Entity.patch | 4 +- ...n-for-boats-to-eject-players-on-land.patch | 4 +- ...077-Add-5-second-tps-average-in-tps.patch} | 8 +- ...077-Implement-bamboo-growth-settings.patch | 82 -- ...h => 0078-Implement-elytra-settings.patch} | 2 +- ...atch => 0079-Item-entity-immunities.patch} | 2 +- ...mand.patch => 0080-Add-ping-command.patch} | 0 ...=> 0081-Configurable-jockey-options.patch} | 16 +- ...d-to-crystals-and-crystals-shoot-ph.patch} | 4 +- ...> 0083-Add-phantom-spawning-options.patch} | 8 +- ...084-Implement-bed-explosion-options.patch} | 6 +- ...nt-respawn-anchor-explosion-options.patch} | 4 +- ...Add-allow-water-in-end-world-option.patch} | 4 +- ... => 0087-Allow-color-codes-in-books.patch} | 2 +- ...espan.patch => 0088-Entity-lifespan.patch} | 4 +- ...eport-to-spawn-if-outside-world-bor.patch} | 4 +- ...ty.patch => 0090-Squid-EAR-immunity.patch} | 4 +- ...=> 0091-Configurable-end-spike-seed.patch} | 0 ...h => 0092-Configurable-dungeon-seed.patch} | 0 ...atch => 0093-Phantoms-burn-in-light.patch} | 6 +- ...0094-Configurable-villager-breeding.patch} | 6 +- ... 0095-Redstone-deactivates-spawners.patch} | 4 +- ...ch => 0096-Totems-work-in-inventory.patch} | 2 +- ...ch => 0097-Fix-death-message-colors.patch} | 2 +- ...-vanilla-scoreboard-colors-patch-to.patch} | 2 +- ...tch => 0099-Populator-seed-controls.patch} | 0 ...-Add-vindicator-johnny-spawn-chance.patch} | 2 +- ...t.patch => 0101-DragonEggPlaceEvent.patch} | 0 ...n-to-disable-mushroom-block-updates.patch} | 0 ...0103-Dispensers-place-anvils-option.patch} | 4 +- ...rs.patch => 0104-Allow-anvil-colors.patch} | 8 +- ...atch => 0105-Add-no-tick-block-list.patch} | 2 +- ...-disable-dolphin-treasure-searching.patch} | 4 +- ...patch => 0107-Short-enderman-height.patch} | 0 ...top-squids-floating-on-top-of-water.patch} | 4 +- ...110-Ridables.patch => 0109-Ridables.patch} | 54 +- ...-height-for-nether-surface-builders.patch} | 0 ...ng-obsidian-valid-for-portal-frames.patch} | 0 ...ities-can-use-portals-configuration.patch} | 2 +- ...113-LivingEntity-broadcastItemBreak.patch} | 0 ...tomizable-wither-health-and-healing.patch} | 4 +- ...gling-special-MobSpawners-per-world.patch} | 4 +- ...patch => 0116-Raid-cooldown-setting.patch} | 2 +- ...-config-options-per-projectile-type.patch} | 2 +- ...olor-code-support-for-console-loggi.patch} | 0 ...able-zombie-aggressiveness-towards-.patch} | 6 +- ...ent-TileEntity-Lore-and-DisplayName.patch} | 2 +- ...-to-recipe-s-ExactChoice-ingredient.patch} | 0 ...y.patch => 0122-Flying-squids-Oh-my.patch} | 4 +- ...patch => 0123-Infinity-bow-settings.patch} | 2 +- ...ge.patch => 0124-Stonecutter-damage.patch} | 4 +- ...=> 0125-Configurable-daylight-cycle.patch} | 6 +- ...e-and-mending-enchantments-together.patch} | 0 ...patch => 0127-Infinite-fuel-furnace.patch} | 10 +- ...ws-should-not-reset-despawn-counter.patch} | 0 ...9-Add-tablist-suffix-option-for-afk.patch} | 2 +- ...e-add-farmland-mechanics-from-Alpha.patch} | 4 +- ...ustable-breeding-cooldown-to-config.patch} | 4 +- ...-animal-breeding-times-configurable.patch} | 34 +- ...es-from-item-forms-of-entities-to-e.patch} | 14 +- ...when-using-a-Name-Tag-on-an-Armor-S.patch} | 2 +- ...ting-and-weeping-vines-growth-rates.patch} | 4 +- ...twisting-vines-configurable-max-gro.patch} | 6 +- ...lowing-Endermen-to-despawn-even-whi.patch} | 4 +- ...check-to-EntityDamagedByEntityEvent.patch} | 4 +- ...39-Add-configurable-snowball-damage.patch} | 2 +- ...reak-door-minimum-difficulty-option.patch} | 6 +- ...mand.patch => 0141-Add-demo-command.patch} | 0 ...d-API.patch => 0142-Left-handed-API.patch} | 0 ...i-Fix-ProtocolLib-issues-on-Java-15.patch} | 0 ...4-Changeable-Mob-Left-Handed-Chance.patch} | 2 +- ...=> 0145-Add-boat-fall-damage-config.patch} | 4 +- ...disable-saving-projectiles-to-disk-.patch} | 2 +- ...0147-Snow-Golem-rate-of-fire-config.patch} | 4 +- ...-option-for-Piglins-guarding-chests.patch} | 4 +- ...-Configurable-disable-give-dropping.patch} | 0 ...climbing-should-not-bypass-cramming.patch} | 2 +- ... => 0151-Lobotomize-stuck-villagers.patch} | 6 +- ...illager-Clerics-to-farm-Nether-Wart.patch} | 6 +- ...ied-Piglin-death-always-counting-as.patch} | 4 +- ...-out-and-optimise-player-list-ticks.patch} | 0 ...le-chance-for-wolves-to-spawn-rabid.patch} | 4 +- ...figurable-default-wolf-collar-color.patch} | 4 +- ...Configurable-entity-base-attributes.patch} | 60 +- ...tch => 0158-Phantom-flames-on-swoop.patch} | 6 +- ...-to-open-even-with-a-solid-block-on.patch} | 4 +- ...SBar.patch => 0160-Implement-TPSBar.patch} | 6 +- ...h => 0161-Striders-give-saddle-back.patch} | 4 +- ...tch => 0162-PlayerBookTooLargeEvent.patch} | 2 +- ...herite-armor-grants-fire-resistance.patch} | 2 +- 112 files changed, 974 insertions(+), 1072 deletions(-) rename patches/server/{0078-Add-5-second-tps-average-in-tps.patch => 0077-Add-5-second-tps-average-in-tps.patch} (94%) delete mode 100644 patches/server/0077-Implement-bamboo-growth-settings.patch rename patches/server/{0079-Implement-elytra-settings.patch => 0078-Implement-elytra-settings.patch} (98%) rename patches/server/{0080-Item-entity-immunities.patch => 0079-Item-entity-immunities.patch} (98%) rename patches/server/{0081-Add-ping-command.patch => 0080-Add-ping-command.patch} (100%) rename patches/server/{0082-Configurable-jockey-options.patch => 0081-Configurable-jockey-options.patch} (95%) rename patches/server/{0083-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch => 0082-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch} (99%) rename patches/server/{0084-Add-phantom-spawning-options.patch => 0083-Add-phantom-spawning-options.patch} (98%) rename patches/server/{0085-Implement-bed-explosion-options.patch => 0084-Implement-bed-explosion-options.patch} (93%) rename patches/server/{0086-Implement-respawn-anchor-explosion-options.patch => 0085-Implement-respawn-anchor-explosion-options.patch} (96%) rename patches/server/{0087-Add-allow-water-in-end-world-option.patch => 0086-Add-allow-water-in-end-world-option.patch} (97%) rename patches/server/{0088-Allow-color-codes-in-books.patch => 0087-Allow-color-codes-in-books.patch} (96%) rename patches/server/{0089-Entity-lifespan.patch => 0088-Entity-lifespan.patch} (96%) rename patches/server/{0090-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch => 0089-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch} (94%) rename patches/server/{0091-Squid-EAR-immunity.patch => 0090-Squid-EAR-immunity.patch} (91%) rename patches/server/{0092-Configurable-end-spike-seed.patch => 0091-Configurable-end-spike-seed.patch} (100%) rename patches/server/{0093-Configurable-dungeon-seed.patch => 0092-Configurable-dungeon-seed.patch} (100%) rename patches/server/{0094-Phantoms-burn-in-light.patch => 0093-Phantoms-burn-in-light.patch} (97%) rename patches/server/{0095-Configurable-villager-breeding.patch => 0094-Configurable-villager-breeding.patch} (91%) rename patches/server/{0096-Redstone-deactivates-spawners.patch => 0095-Redstone-deactivates-spawners.patch} (93%) rename patches/server/{0097-Totems-work-in-inventory.patch => 0096-Totems-work-in-inventory.patch} (96%) rename patches/server/{0098-Fix-death-message-colors.patch => 0097-Fix-death-message-colors.patch} (95%) rename patches/server/{0099-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch => 0098-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch} (97%) rename patches/server/{0100-Populator-seed-controls.patch => 0099-Populator-seed-controls.patch} (100%) rename patches/server/{0101-Add-vindicator-johnny-spawn-chance.patch => 0100-Add-vindicator-johnny-spawn-chance.patch} (95%) rename patches/server/{0102-DragonEggPlaceEvent.patch => 0101-DragonEggPlaceEvent.patch} (100%) rename patches/server/{0103-Add-option-to-disable-mushroom-block-updates.patch => 0102-Add-option-to-disable-mushroom-block-updates.patch} (100%) rename patches/server/{0104-Dispensers-place-anvils-option.patch => 0103-Dispensers-place-anvils-option.patch} (96%) rename patches/server/{0105-Allow-anvil-colors.patch => 0104-Allow-anvil-colors.patch} (92%) rename patches/server/{0106-Add-no-tick-block-list.patch => 0105-Add-no-tick-block-list.patch} (97%) rename patches/server/{0107-Add-option-to-disable-dolphin-treasure-searching.patch => 0106-Add-option-to-disable-dolphin-treasure-searching.patch} (92%) rename patches/server/{0108-Short-enderman-height.patch => 0107-Short-enderman-height.patch} (100%) rename patches/server/{0109-Stop-squids-floating-on-top-of-water.patch => 0108-Stop-squids-floating-on-top-of-water.patch} (94%) rename patches/server/{0110-Ridables.patch => 0109-Ridables.patch} (99%) rename patches/server/{0111-Use-configured-height-for-nether-surface-builders.patch => 0110-Use-configured-height-for-nether-surface-builders.patch} (100%) rename patches/server/{0112-Crying-obsidian-valid-for-portal-frames.patch => 0111-Crying-obsidian-valid-for-portal-frames.patch} (100%) rename patches/server/{0113-Entities-can-use-portals-configuration.patch => 0112-Entities-can-use-portals-configuration.patch} (96%) rename patches/server/{0114-LivingEntity-broadcastItemBreak.patch => 0113-LivingEntity-broadcastItemBreak.patch} (100%) rename patches/server/{0115-Customizable-wither-health-and-healing.patch => 0114-Customizable-wither-health-and-healing.patch} (96%) rename patches/server/{0116-Allow-toggling-special-MobSpawners-per-world.patch => 0115-Allow-toggling-special-MobSpawners-per-world.patch} (97%) rename patches/server/{0117-Raid-cooldown-setting.patch => 0116-Raid-cooldown-setting.patch} (97%) rename patches/server/{0118-Despawn-rate-config-options-per-projectile-type.patch => 0117-Despawn-rate-config-options-per-projectile-type.patch} (99%) rename patches/server/{0119-PaperPR-Add-hex-color-code-support-for-console-loggi.patch => 0118-PaperPR-Add-hex-color-code-support-for-console-loggi.patch} (100%) rename patches/server/{0120-Add-option-to-disable-zombie-aggressiveness-towards-.patch => 0119-Add-option-to-disable-zombie-aggressiveness-towards-.patch} (96%) rename patches/server/{0121-Persistent-TileEntity-Lore-and-DisplayName.patch => 0120-Persistent-TileEntity-Lore-and-DisplayName.patch} (99%) rename patches/server/{0122-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch => 0121-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch} (100%) rename patches/server/{0123-Flying-squids-Oh-my.patch => 0122-Flying-squids-Oh-my.patch} (94%) rename patches/server/{0124-Infinity-bow-settings.patch => 0123-Infinity-bow-settings.patch} (96%) rename patches/server/{0125-Stonecutter-damage.patch => 0124-Stonecutter-damage.patch} (95%) rename patches/server/{0126-Configurable-daylight-cycle.patch => 0125-Configurable-daylight-cycle.patch} (92%) rename patches/server/{0127-Allow-infinite-and-mending-enchantments-together.patch => 0126-Allow-infinite-and-mending-enchantments-together.patch} (100%) rename patches/server/{0128-Infinite-fuel-furnace.patch => 0127-Infinite-fuel-furnace.patch} (88%) rename patches/server/{0129-Arrows-should-not-reset-despawn-counter.patch => 0128-Arrows-should-not-reset-despawn-counter.patch} (100%) rename patches/server/{0130-Add-tablist-suffix-option-for-afk.patch => 0129-Add-tablist-suffix-option-for-afk.patch} (96%) rename patches/server/{0131-Ability-to-re-add-farmland-mechanics-from-Alpha.patch => 0130-Ability-to-re-add-farmland-mechanics-from-Alpha.patch} (92%) rename patches/server/{0132-Add-adjustable-breeding-cooldown-to-config.patch => 0131-Add-adjustable-breeding-cooldown-to-config.patch} (97%) rename patches/server/{0133-Make-animal-breeding-times-configurable.patch => 0132-Make-animal-breeding-times-configurable.patch} (96%) rename patches/server/{0134-Apply-display-names-from-item-forms-of-entities-to-e.patch => 0133-Apply-display-names-from-item-forms-of-entities-to-e.patch} (96%) rename patches/server/{0135-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch => 0134-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch} (95%) rename patches/server/{0136-Add-twisting-and-weeping-vines-growth-rates.patch => 0135-Add-twisting-and-weeping-vines-growth-rates.patch} (96%) rename patches/server/{0137-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch => 0136-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch} (96%) rename patches/server/{0138-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch => 0137-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch} (93%) rename patches/server/{0139-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch => 0138-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch} (94%) rename patches/server/{0140-Add-configurable-snowball-damage.patch => 0139-Add-configurable-snowball-damage.patch} (95%) rename patches/server/{0141-Zombie-break-door-minimum-difficulty-option.patch => 0140-Zombie-break-door-minimum-difficulty-option.patch} (94%) rename patches/server/{0142-Add-demo-command.patch => 0141-Add-demo-command.patch} (100%) rename patches/server/{0143-Left-handed-API.patch => 0142-Left-handed-API.patch} (100%) rename patches/server/{0144-Origami-Fix-ProtocolLib-issues-on-Java-15.patch => 0143-Origami-Fix-ProtocolLib-issues-on-Java-15.patch} (100%) rename patches/server/{0145-Changeable-Mob-Left-Handed-Chance.patch => 0144-Changeable-Mob-Left-Handed-Chance.patch} (95%) rename patches/server/{0146-Add-boat-fall-damage-config.patch => 0145-Add-boat-fall-damage-config.patch} (94%) rename patches/server/{0147-Config-migration-disable-saving-projectiles-to-disk-.patch => 0146-Config-migration-disable-saving-projectiles-to-disk-.patch} (97%) rename patches/server/{0148-Snow-Golem-rate-of-fire-config.patch => 0147-Snow-Golem-rate-of-fire-config.patch} (95%) rename patches/server/{0149-PaperPR-Config-option-for-Piglins-guarding-chests.patch => 0148-PaperPR-Config-option-for-Piglins-guarding-chests.patch} (91%) rename patches/server/{0150-EMC-Configurable-disable-give-dropping.patch => 0149-EMC-Configurable-disable-give-dropping.patch} (100%) rename patches/server/{0151-Config-migration-climbing-should-not-bypass-cramming.patch => 0150-Config-migration-climbing-should-not-bypass-cramming.patch} (96%) rename patches/server/{0152-Lobotomize-stuck-villagers.patch => 0151-Lobotomize-stuck-villagers.patch} (96%) rename patches/server/{0153-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch => 0152-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch} (98%) rename patches/server/{0154-Toggle-for-Zombified-Piglin-death-always-counting-as.patch => 0153-Toggle-for-Zombified-Piglin-death-always-counting-as.patch} (95%) rename patches/server/{0155-Spread-out-and-optimise-player-list-ticks.patch => 0154-Spread-out-and-optimise-player-list-ticks.patch} (100%) rename patches/server/{0156-Configurable-chance-for-wolves-to-spawn-rabid.patch => 0155-Configurable-chance-for-wolves-to-spawn-rabid.patch} (98%) rename patches/server/{0157-Configurable-default-wolf-collar-color.patch => 0156-Configurable-default-wolf-collar-color.patch} (94%) rename patches/server/{0158-Configurable-entity-base-attributes.patch => 0157-Configurable-entity-base-attributes.patch} (98%) rename patches/server/{0159-Phantom-flames-on-swoop.patch => 0158-Phantom-flames-on-swoop.patch} (91%) rename patches/server/{0160-Option-for-chests-to-open-even-with-a-solid-block-on.patch => 0159-Option-for-chests-to-open-even-with-a-solid-block-on.patch} (91%) rename patches/server/{0161-Implement-TPSBar.patch => 0160-Implement-TPSBar.patch} (97%) rename patches/server/{0162-Striders-give-saddle-back.patch => 0161-Striders-give-saddle-back.patch} (94%) rename patches/server/{0163-PlayerBookTooLargeEvent.patch => 0162-PlayerBookTooLargeEvent.patch} (96%) rename patches/server/{0164-Full-netherite-armor-grants-fire-resistance.patch => 0163-Full-netherite-armor-grants-fire-resistance.patch} (97%) diff --git a/Paper b/Paper index 8ccb7fd67..05af2837c 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit 8ccb7fd67952717b28fb370930f14e2d1dfed79d +Subproject commit 05af2837cd508bf36dda470aecd08249b1fdfea0 diff --git a/patches/api/0001-Tuinity-API-Changes.patch b/patches/api/0001-Tuinity-API-Changes.patch index 02f814992..e033b5aea 100644 --- a/patches/api/0001-Tuinity-API-Changes.patch +++ b/patches/api/0001-Tuinity-API-Changes.patch @@ -8,7 +8,7 @@ Tuinity config API to retrieve raw YamlConfiguration + timing exports diff --git a/pom.xml b/pom.xml -index 1c33b1f4d2366116dd45478b8ad9cdb51fd6bb57..4516ba097e8afc3e422efc368311fa66e967c05a 100644 +index 35599164b24185bc51813ae58090f6f4bffdba4a..024be926afb1219c6443c496721f4bd0a4fec222 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,18 @@ diff --git a/patches/api/0007-AFK-API.patch b/patches/api/0007-AFK-API.patch index 22b443232..ccbd4f303 100644 --- a/patches/api/0007-AFK-API.patch +++ b/patches/api/0007-AFK-API.patch @@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..0c8b3e5e4ba412624357ea5662a78862 + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index f7fd13dc6056817819c1dbffcaf19c25b95fe2c0..250b434af848546fa3a6ffd748f03a910095b33d 100644 +index ea5257cc94d084fe4e0b9d9685e51d8f70cb84cb..183333a7468100271676b74709dcbb26d2b2b363 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1933,4 +1933,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1927,4 +1927,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Override Spigot spigot(); // Spigot end diff --git a/patches/api/0018-Player-invulnerabilities.patch b/patches/api/0018-Player-invulnerabilities.patch index f1a07fc14..298aa43ab 100644 --- a/patches/api/0018-Player-invulnerabilities.patch +++ b/patches/api/0018-Player-invulnerabilities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player invulnerabilities diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 250b434af848546fa3a6ffd748f03a910095b33d..e398da35bef48b5846d8c66df75b1df11b43e382 100644 +index 183333a7468100271676b74709dcbb26d2b2b363..e0ceb4d285ef977398a083bc4f4295ebd0c91277 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1953,5 +1953,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1947,5 +1947,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * Reset the idle timer back to 0 */ void resetIdleTimer(); diff --git a/patches/api/0020-ItemStack-convenience-methods.patch b/patches/api/0020-ItemStack-convenience-methods.patch index 5825e1a14..1d5242c5c 100644 --- a/patches/api/0020-ItemStack-convenience-methods.patch +++ b/patches/api/0020-ItemStack-convenience-methods.patch @@ -46,7 +46,7 @@ index 4ba991b79f13219182df35b4ce0c5cf57cbd208b..a2e476f154344f9473dd9b4886650544 + // Purpur end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index ccd81fca25233c2a9c2a8c3f4dda3053d7b2e723..3fecde7a0d2dd45ca090dbcc49e6d85169bda443 100644 +index 4f2520f7a4ca6d57a85924ada1068a055b9a01fb..23cef1e67236a879525f39da994efc9a9c5cd289 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta; @@ -68,7 +68,7 @@ index ccd81fca25233c2a9c2a8c3f4dda3053d7b2e723..3fecde7a0d2dd45ca090dbcc49e6d851 /** * Represents a stack of items. -@@ -791,4 +803,627 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -792,4 +804,627 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { return itemMeta.hasItemFlag(flag); } // Paper end diff --git a/patches/api/0035-Fix-javadoc-warnings-missing-param-and-return.patch b/patches/api/0035-Fix-javadoc-warnings-missing-param-and-return.patch index 728a7b11f..f083c4e45 100644 --- a/patches/api/0035-Fix-javadoc-warnings-missing-param-and-return.patch +++ b/patches/api/0035-Fix-javadoc-warnings-missing-param-and-return.patch @@ -33,20 +33,17 @@ index 9dad814cf51bc59ec5dfbf14474fea6557de38aa..7baf7ee3b62135eda8f0d9c1d761b79f public Class getType() { return type; diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java -index c91ea2a0679a7f3a5627b5a008e0b39df3332889..dbca3a2196cf2d7722226224e7f85237267e9d4d 100644 +index a02a02aa0c87e0f0ed9e509e4dcab01565b3d92a..6c99f4b4960f8f982557bb42717a2868d57ce4b7 100644 --- a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java +++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java -@@ -22,6 +22,9 @@ import java.util.stream.Stream; +@@ -21,10 +21,14 @@ import java.util.stream.Stream; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/** + * Material set tag + */ - public class MaterialSetTag implements Tag { - - private final NamespacedKey key; -@@ -29,6 +32,7 @@ public class MaterialSetTag implements Tag { + public class MaterialSetTag extends BaseTag { /** * @deprecated Use NamespacedKey version of constructor @@ -54,7 +51,7 @@ index c91ea2a0679a7f3a5627b5a008e0b39df3332889..dbca3a2196cf2d7722226224e7f85237 */ @Deprecated public MaterialSetTag(@NotNull Predicate filter) { -@@ -37,6 +41,7 @@ public class MaterialSetTag implements Tag { +@@ -33,6 +37,7 @@ public class MaterialSetTag extends BaseTag { /** * @deprecated Use NamespacedKey version of constructor @@ -62,7 +59,7 @@ index c91ea2a0679a7f3a5627b5a008e0b39df3332889..dbca3a2196cf2d7722226224e7f85237 */ @Deprecated public MaterialSetTag(@NotNull Collection materials) { -@@ -45,6 +50,7 @@ public class MaterialSetTag implements Tag { +@@ -41,6 +46,7 @@ public class MaterialSetTag extends BaseTag { /** * @deprecated Use NamespacedKey version of constructor @@ -541,74 +538,6 @@ index 931ffa38faab86445a5d63364a47cb653ca3d4ed..97b9ade0e771eae663fb42f91e155450 */ public int nextEntityId(); -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index e6d2abf284c103a8bcddd8b4f9cb34d86a4f2fa6..4df6482da0cc498cad50eabdac183bea3634c74b 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -3131,7 +3131,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param count the number of particles - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); - -@@ -3148,7 +3147,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param count the number of particles - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); - -@@ -3199,7 +3197,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param offsetZ the maximum random offset on the Z axis - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); - -@@ -3220,7 +3217,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param offsetZ the maximum random offset on the Z axis - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); - -@@ -3277,7 +3273,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * particle used (normally speed) - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); - -@@ -3300,7 +3295,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * particle used (normally speed) - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public default void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API - /** -@@ -3374,7 +3368,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param force whether to send the particle to players within an extended - * range and encourage their client to render it regardless of - * settings -- * @param Particle data type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); - -@@ -3400,7 +3393,6 @@ public interface World extends PluginMessageRecipient, Metadatable { - * @param force whether to send the particle to players within an extended - * range and encourage their client to render it regardless of - * settings -- * @param Particle data type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); - diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java index afb7b136b461202026290624836446cff9f9e45d..087579fdff09237409c9f80446e7a15a78f9040c 100644 --- a/src/main/java/org/bukkit/WorldBorder.java @@ -670,7 +599,7 @@ index d1757f3d456ff9efce26ce8baa1d16d896908cc2..a5db52386e11e4b5511ae417a0e7ac92 TASK(ChatColor.GREEN), CHALLENGE(ChatColor.DARK_PURPLE), diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 6933fd6ad353a2d008c4a64c52a64bf36bd8035c..2966d876af3a77966fab927f8714ebf06bf6c926 100644 +index 0c72d00ad238ab69d7ae0941e3ecb6c86e71624d..73cf7437795ef185860bfefe51d9481fa297a939 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -183,6 +183,9 @@ public interface Block extends Metadatable { @@ -805,18 +734,6 @@ index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..9382234722792b5920a2456187e07958 public interface AnimalTamer { /** -diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java -index bca9d3659f6fceeca4b7fecbc7034d6fdbc4581e..c2096b5344d48d855d031538ec32e0154bd9054d 100644 ---- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java -+++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java -@@ -142,7 +142,6 @@ public interface AreaEffectCloud extends Entity { - * @param particle the new particle type - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param the particle data type // Paper - */ - void setParticle(@NotNull Particle particle, @Nullable T data); - diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java index 8ca6c9eba926f436203af211c6e274a59ddb15e8..f61419d3ce15bd553a864e4e9cd988b57d8f9695 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java @@ -1015,58 +932,10 @@ index a6a7429ed2e1eefb2b12b7480ed74fcc3963a864..e8027e1d505dda6effbb1698550016e8 NORMAL(false), diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e398da35bef48b5846d8c66df75b1df11b43e382..8da3ce6d1ba6911cb1a4be2e425266bd4760c052 100644 +index e0ceb4d285ef977398a083bc4f4295ebd0c91277..8da3ce6d1ba6911cb1a4be2e425266bd4760c052 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1433,7 +1433,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param count the number of particles - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); - -@@ -1450,7 +1449,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param count the number of particles - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); - -@@ -1501,7 +1499,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param offsetZ the maximum random offset on the Z axis - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); - -@@ -1522,7 +1519,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param offsetZ the maximum random offset on the Z axis - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); - -@@ -1579,7 +1575,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * particle used (normally speed) - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); - -@@ -1602,7 +1597,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * particle used (normally speed) - * @param data the data to use for the particle or null, - * the type of this depends on {@link Particle#getDataType()} -- * @param Type - */ - public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); - -@@ -1782,6 +1776,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1776,6 +1776,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM void resetCooldown(); /** @@ -1075,7 +944,7 @@ index e398da35bef48b5846d8c66df75b1df11b43e382..8da3ce6d1ba6911cb1a4be2e425266bd * @return the client option value of the player */ @NotNull -@@ -1802,6 +1798,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1796,6 +1798,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM // Paper end // Spigot start @@ -1495,19 +1364,6 @@ index 23d55f756b2bb5a557bfae102d7039d8394fbe69..50e58cf9a494c2cf17b7f55918e3d21f * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack */ @NotNull -diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 3fecde7a0d2dd45ca090dbcc49e6d85169bda443..595cf92aeab37e06e5409d2a34387e56340b49e3 100644 ---- a/src/main/java/org/bukkit/inventory/ItemStack.java -+++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -631,6 +631,8 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { - * - * This expects that the DataVersion was stored on the root of the Compound, as saved from - * the {@link #serializeAsBytes()} API returned. -+ * -+ * @param bytes Bytes to deserialize - * @return ItemStack migrated to this version of Minecraft if needed. - */ - @NotNull diff --git a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java index 7944f26a3e2a92601c3be0e55c00c39cc16cf177..8e7bb66c96d34b73959c0653b2a8e7b422da35fe 100644 --- a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java diff --git a/patches/server/0001-Tuinity-Server-Changes.patch b/patches/server/0001-Tuinity-Server-Changes.patch index 8afbe6983..57db329ac 100644 --- a/patches/server/0001-Tuinity-Server-Changes.patch +++ b/patches/server/0001-Tuinity-Server-Changes.patch @@ -435,7 +435,7 @@ This patch also prevents the saving/unloading of POI data when world saving is disabled. diff --git a/pom.xml b/pom.xml -index 80f165291385f5f54def1a8e8487b209fb06a4a3..78c2a8bbcc0132f891c8aa545529d20aa0d9eb57 100644 +index f641d2a79cbc38bc4ecffdbd8d1e1a5f9aa118f5..174c0b67c1c5b41d80613128ebf2d78ee27f3cee 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ @@ -585,23 +585,19 @@ index dee00aac05f1acf050f05d4db557a08dd0f301c8..52c0ab1ce46e1f3233ef746d9bc69935 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index ad6b15f401ce7493a2a247e2a2af23f73ade02ca..ead20b6b95780859b628f917e29e390970228178 100644 +index 196648e65c6f58c18e19623474d69d780d542689..57863d913c67750cdd794a65513f3daf93580c52 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java -@@ -182,6 +182,68 @@ public class PaperCommand extends Command { +@@ -182,6 +182,44 @@ public class PaperCommand extends Command { } } -+ private long relightCounter; -+ + private void starlightFixLight(EntityPlayer sender, WorldServer world, LightEngineThreaded lightengine, int radius) { + long start = System.nanoTime(); + LinkedHashSet chunks = new LinkedHashSet<>(MCUtil.getSpiralOutChunks(sender.getChunkCoordinates(), radius)); // getChunkCoordinates is actually just bad mappings, this function rets position as blockpos + -+ // add tickets -+ Map ticketIds = new HashMap<>(); -+ int[] totalChunks = new int[1]; -+ for (Iterator iterator = chunks.iterator(); iterator.hasNext();) { ++ int[] pending = new int[1]; ++ for (java.util.Iterator iterator = chunks.iterator(); iterator.hasNext();) { + final ChunkCoordIntPair chunkPos = iterator.next(); + + final IChunkAccess chunk = world.getChunkProvider().getChunkAtImmediately(chunkPos.x, chunkPos.z); @@ -611,53 +607,42 @@ index ad6b15f401ce7493a2a247e2a2af23f73ade02ca..ead20b6b95780859b628f917e29e3909 + continue; + } + -+ final Long id = Long.valueOf(this.relightCounter++); -+ -+ world.getChunkProvider().addTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), id); -+ ticketIds.put(chunkPos, id); -+ -+ ++totalChunks[0]; ++ ++pending[0]; + } + -+ sender.getBukkitEntity().sendMessage(ChatColor.BLUE + "Relighting " + ChatColor.DARK_AQUA + totalChunks[0] + ChatColor.BLUE + " chunks"); -+ + int[] relitChunks = new int[1]; -+ -+ Set blockLightDone = new HashSet<>(); -+ -+ final java.util.function.Consumer callback = (ChunkCoordIntPair chunkPos) -> { -+ if (blockLightDone.add(chunkPos)) { -+ return; -+ } -+ ++relitChunks[0]; -+ sender.getBukkitEntity().sendMessage( -+ ChatColor.BLUE + "Relit chunk " + ChatColor.DARK_AQUA + chunkPos + ChatColor.BLUE + -+ ", progress: " + ChatColor.DARK_AQUA + (int)(Math.round(100.0 * (double)(relitChunks[0])/(double)totalChunks[0])) + "%" -+ ); -+ -+ ((java.util.concurrent.Executor)world.getChunkProvider().serverThreadQueue).execute(() -> { -+ world.getChunkProvider().playerChunkMap.getUpdatingChunk(chunkPos.pair()).sendPacketToTrackedPlayers(new PacketPlayOutLightUpdate(chunkPos, lightengine, true), false); -+ world.getChunkProvider().removeTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), ticketIds.get(chunkPos)); -+ }); -+ -+ if (relitChunks[0] == totalChunks[0]) { -+ final long end = System.nanoTime(); -+ final long diff = Math.round(1.0e-6*(end - start)); -+ sender.getBukkitEntity().sendMessage( -+ ChatColor.BLUE + "Relit " + ChatColor.DARK_AQUA + totalChunks[0] + ChatColor.BLUE + " chunks. Took " + -+ ChatColor.DARK_AQUA + diff + "ms" -+ ); -+ } -+ }; -+ -+ lightengine.relight(chunks, callback); -+ lightengine.queueUpdate(); ++ lightengine.relight(chunks, ++ (ChunkCoordIntPair chunkPos) -> { ++ ++relitChunks[0]; ++ sender.getBukkitEntity().sendMessage( ++ ChatColor.BLUE + "Relit chunk " + ChatColor.DARK_AQUA + chunkPos + ChatColor.BLUE + ++ ", progress: " + ChatColor.DARK_AQUA + (int)(Math.round(100.0 * (double)(relitChunks[0])/(double)pending[0])) + "%" ++ ); ++ }, ++ (int totalRelit) -> { ++ final long end = System.nanoTime(); ++ final long diff = Math.round(1.0e-6*(end - start)); ++ sender.getBukkitEntity().sendMessage( ++ ChatColor.BLUE + "Relit " + ChatColor.DARK_AQUA + totalRelit + ChatColor.BLUE + " chunks. Took " + ++ ChatColor.DARK_AQUA + diff + "ms" ++ ); ++ }); ++ sender.getBukkitEntity().sendMessage(ChatColor.BLUE + "Relighting " + ChatColor.DARK_AQUA + pending[0] + ChatColor.BLUE + " chunks"); + } + private void doFixLight(CommandSender sender, String[] args) { if (!(sender instanceof Player)) { sender.sendMessage("Only players can use this command"); -@@ -203,6 +265,13 @@ public class PaperCommand extends Command { +@@ -190,7 +228,7 @@ public class PaperCommand extends Command { + int radius = 2; + if (args.length > 1) { + try { +- radius = Math.min(5, Integer.parseInt(args[1])); ++ radius = Math.min(15, Integer.parseInt(args[1])); // Tuinity - MOOOOOORE + } catch (Exception e) { + sender.sendMessage("Not a number"); + return; +@@ -203,6 +241,13 @@ public class PaperCommand extends Command { net.minecraft.server.WorldServer world = (WorldServer) handle.world; LightEngineThreaded lightengine = world.getChunkProvider().getLightEngine(); @@ -1560,10 +1545,10 @@ index 0000000000000000000000000000000000000000..cae06962d80cdd00962236891472ba81 \ No newline at end of file diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java new file mode 100644 -index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e8d9b6221 +index 0000000000000000000000000000000000000000..297ba951a5bdef70312d1dc2f243f0716760d04c --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java -@@ -0,0 +1,176 @@ +@@ -0,0 +1,185 @@ +package com.tuinity.tuinity.chunk.light; + +import net.minecraft.server.BlockPosition; @@ -1575,6 +1560,7 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e +import net.minecraft.server.IChunkAccess; +import net.minecraft.server.ILightAccess; +import net.minecraft.server.ProtoChunkExtension; ++import net.minecraft.server.World; +import net.minecraft.server.WorldServer; +import java.util.ArrayList; +import java.util.HashSet; @@ -1584,11 +1570,19 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e + +public final class BlockStarLightEngine extends StarLightEngine { + -+ public BlockStarLightEngine(final boolean isClientSide) { -+ super(false, isClientSide); ++ public BlockStarLightEngine(final World world) { ++ super(false, world); + } + + @Override ++ protected boolean[] getEmptinessMap(final IChunkAccess chunk) { ++ return null; ++ } ++ ++ @Override ++ protected void setEmptinessMap(final IChunkAccess chunk, final boolean[] to) {} ++ ++ @Override + protected SWMRNibbleArray[] getNibblesOnChunk(final IChunkAccess chunk) { + return chunk.getBlockNibbles(); + } @@ -1604,15 +1598,12 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e + } + + @Override -+ protected boolean[][] getEmptinessMap(IChunkAccess chunk) { ++ protected boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, ++ final Boolean[] emptinessChanges, final boolean unlit) { + return null; + } + + @Override -+ protected void handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit) {} -+ -+ @Override + protected final void checkBlock(final ILightAccess lightAccess, final int worldX, final int worldY, final int worldZ) { + // blocks can change opacity + // blocks can change emitted light @@ -1629,23 +1620,25 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e + this.setLightLevel(worldX, worldY, worldZ, emittedLevel); + // this accounts for change in emitted light that would cause an increase + if (emittedLevel != 0) { -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((worldX + (worldZ << 6) + (worldY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (emittedLevel & 0xFL) << (6 + 6 + 16) + | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)) -+ | (blockState.isConditionallyFullOpaque() ? FLAG_HAS_SIDED_TRANSPARENT_BLOCKS : 0); ++ | (blockState.isConditionallyFullOpaque() ? FLAG_HAS_SIDED_TRANSPARENT_BLOCKS : 0) ++ ); + } + // this also accounts for a change in emitted light that would cause a decrease + // this also accounts for the change of direction of propagation (i.e old block was full transparent, new block is full opaque or vice versa) + // as it checks all neighbours (even if current level is 0) -+ this.decreaseQueue[this.decreaseQueueInitialLength++] = ++ this.appendToDecreaseQueue( + ((worldX + (worldZ << 6) + (worldY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (currentLevel & 0xFL) << (6 + 6 + 16) -+ | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)); -+ // always keep sided transparent false here, new block might be conditionally transparent which would -+ // prevent us from decreasing sources in the directions where the new block is opaque -+ // if it turns out we were wrong to de-propagate the source, the re-propagate logic WILL always -+ // catch that and fix it. ++ | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)) ++ // always keep sided transparent false here, new block might be conditionally transparent which would ++ // prevent us from decreasing sources in the directions where the new block is opaque ++ // if it turns out we were wrong to de-propagate the source, the re-propagate logic WILL always ++ // catch that and fix it. ++ ); + // re-propagating neighbours (done by the decrease queue) will also account for opacity changes in this block + } + @@ -1716,11 +1709,12 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e + continue; + } + -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((pos.getX() + (pos.getZ() << 6) + (pos.getY() << (6 + 6)) + this.coordinateOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (emittedLight & 0xFL) << (6 + 6 + 16) + | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)) -+ | (blockState.isConditionallyFullOpaque() ? FLAG_HAS_SIDED_TRANSPARENT_BLOCKS : 0); ++ | (blockState.isConditionallyFullOpaque() ? FLAG_HAS_SIDED_TRANSPARENT_BLOCKS : 0) ++ ); + + + // propagation wont set this for us @@ -1732,9 +1726,9 @@ index 0000000000000000000000000000000000000000..80773f755b16c755bdf9f8f804011c8e + this.performLightIncrease(lightAccess); + + // verify neighbour edges -+ this.checkChunkEdges(lightAccess, chunk, -1, 16); ++ this.checkChunkEdges(lightAccess, chunk, this.minLightSection, this.maxLightSection); + } else { -+ this.propagateNeighbourLevels(lightAccess, chunk, -1, 16); ++ this.propagateNeighbourLevels(lightAccess, chunk, this.minLightSection, this.maxLightSection); + + this.performLightIncrease(lightAccess); + } @@ -2065,12 +2059,13 @@ index 0000000000000000000000000000000000000000..9910dc9f1a087f5baf404a5b8ebb5a9f +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/SkyStarLightEngine.java b/src/main/java/com/tuinity/tuinity/chunk/light/SkyStarLightEngine.java new file mode 100644 -index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965af4665aee +index 0000000000000000000000000000000000000000..8df35be7224c3e499c2fd46931e3ad325ec2f1b5 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/SkyStarLightEngine.java -@@ -0,0 +1,785 @@ +@@ -0,0 +1,748 @@ +package com.tuinity.tuinity.chunk.light; + ++import com.tuinity.tuinity.util.WorldUtil; +import it.unimi.dsi.fastutil.shorts.ShortCollection; +import net.minecraft.server.BlockPosition; +import net.minecraft.server.ChunkCoordIntPair; @@ -2082,6 +2077,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a +import net.minecraft.server.ILightAccess; +import net.minecraft.server.VoxelShape; +import net.minecraft.server.VoxelShapes; ++import net.minecraft.server.World; +import java.util.Arrays; +import java.util.Set; + @@ -2111,178 +2107,143 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + around those. + */ + ++ protected final int[] heightMapBlockChange = new int[16 * 16]; ++ { ++ Arrays.fill(this.heightMapBlockChange, Integer.MIN_VALUE); // clear heightmap ++ } ++ ++ protected final boolean[] nullPropagationCheckCache; ++ ++ public SkyStarLightEngine(final World world) { ++ super(true, world); ++ this.nullPropagationCheckCache = new boolean[WorldUtil.getTotalLightSections(world)]; ++ } ++ + @Override -+ protected void handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit) { ++ protected boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, ++ final Boolean[] emptinessChanges, final boolean unlit) { ++ final World world = (World)lightAccess.getWorld(); + final int chunkX = chunk.getPos().x; + final int chunkZ = chunk.getPos().z; + -+ final boolean[][] chunkEmptinessMap = this.getEmptinessMap(chunkX, chunkZ); -+ -+ // index = (cx + 2) + 5*(cz + 2) -+ long loadedNeighboursBitset = 0L; -+ long unloadedNeighbourBitset = 0L; -+ -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ final IChunkAccess neighbour = this.getChunkInCache(dx + chunkX, dz + chunkZ); -+ if (neighbour == null) { -+ continue; -+ } -+ -+ final boolean[][] neighbourEmptinessMap = this.getEmptinessMap(dx + chunkX, dz + chunkZ); -+ for (int i = 0; i < neighbourEmptinessMap.length; ++i) { -+ // index = (cx + 1) + 3*(cz + 1) -+ final int dx2 = (i % 3) - 1; -+ final int dz2 = (i / 3) - 1; -+ -+ final int bitsetIndex = (dx2 + dx + 2) + 5*(dz2 + dz + 2); -+ if (neighbourEmptinessMap[i] == null) { -+ unloadedNeighbourBitset |= 1L << bitsetIndex; -+ } else { -+ loadedNeighboursBitset |= 1L << bitsetIndex; -+ } -+ } -+ } -+ } -+ -+ loadedNeighboursBitset &= ~unloadedNeighbourBitset; -+ loadedNeighboursBitset |= 1L << ((0 + 2) + 5*(0 + 2)); -+ -+ final boolean[] needsDeInitCheck = new boolean[9]; -+ final boolean needsInit = unlit || chunkEmptinessMap[IChunkAccess.getEmptinessMapIndex(0, 0)] == null; ++ boolean[] chunkEmptinessMap = this.getEmptinessMap(chunkX, chunkZ); ++ boolean[] ret = null; ++ final boolean needsInit = unlit || chunkEmptinessMap == null; + if (needsInit) { -+ chunkEmptinessMap[IChunkAccess.getEmptinessMapIndex(0, 0)] = new boolean[16]; ++ this.setEmptinessMapCache(chunkX, chunkZ, ret = chunkEmptinessMap = new boolean[WorldUtil.getTotalSections(world)]); + } + -+ // this chunk is new, so we need to init neighbours -+ // because this chunk might have been modified inbetween loading/saving, we have to rewrite the emptiness map -+ // for our neighbours, so don't bother checking if they exist & whether they even needed a de-init recalc -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ final IChunkAccess neighbour = this.getChunkInCache(dx + chunkX, dz + chunkZ); -+ if (neighbour == null) { -+ // if the neighbour hasn't initialised its own empty map, we can't use it -+ // when it does though, it'll come by and initialise our map for it -+ continue; -+ } -+ final boolean[][] neighbourEmptinessMap = this.getEmptinessMap(dx + chunkX, dz + chunkZ); -+ -+ if (needsInit && (dx | dz) != 0) { -+ // init neighbour -+ neighbourEmptinessMap[IChunkAccess.getEmptinessMapIndex(-dx, -dz)] = new boolean[16]; -+ -+ if (neighbourEmptinessMap[IChunkAccess.getEmptinessMapIndex(0, 0)] != null) { -+ // init ourselves -+ System.arraycopy( -+ neighbourEmptinessMap[IChunkAccess.getEmptinessMapIndex(0, 0)], -+ 0, -+ chunkEmptinessMap[IChunkAccess.getEmptinessMapIndex(dx, dz)] = new boolean[16], -+ 0, -+ 16 -+ ); -+ } -+ } -+ -+ // check if our neighbours are ready for a recalc -+ -+ long neighboursMask = 0L; -+ for (int dz2 = -1; dz2 <= 1; ++dz2) { -+ for (int dx2 = -1; dx2 <= 1; ++dx2) { -+ neighboursMask |= 1L << ((dx2 + dx + 2) + 5*(dz2 + dz + 2)); -+ } -+ } -+ -+ if ((loadedNeighboursBitset & neighboursMask) == neighboursMask) { -+ // can check for de-init -+ needsDeInitCheck[(dx + 1) + 3 * (dz + 1)] = true; ++ // update emptiness map ++ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { ++ final Boolean valueBoxed = emptinessChanges[sectionIndex]; ++ if (valueBoxed == null) { ++ if (needsInit) { ++ throw new IllegalStateException("Current chunk has not initialised emptiness map yet supplied emptiness map isn't filled?"); + } ++ continue; + } ++ chunkEmptinessMap[sectionIndex] = valueBoxed.booleanValue(); + } + -+ for (int sectionY = (emptinessChanges.length - 1); sectionY >= 0; --sectionY) { -+ final Boolean valueBoxed = emptinessChanges[sectionY]; ++ // now init neighbour nibbles ++ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { ++ final Boolean valueBoxed = emptinessChanges[sectionIndex]; ++ final int sectionY = sectionIndex + this.minSection; + if (valueBoxed == null) { + continue; + } + + final boolean empty = valueBoxed.booleanValue(); + -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ final IChunkAccess neighbour = this.getChunkInCache(dx + chunkX, dz + chunkZ); -+ if (neighbour == null) { -+ // this is the case on the client, we _assume_ the server inits and sends to us. -+ // or we're on the server, and the neighbours haven't generated light yet. -+ continue; -+ } -+ -+ // init nibbles as needed -+ -+ if (!empty) { -+ // if we're not empty, we also need to initialise nibbles -+ // note: if we're unlit, we absolutely do not want to extrude, as light data isn't set up -+ final boolean extrude = (dx | dz) != 0 || !unlit; -+ for (int dy = 1; dy >= -1; --dy) { -+ this.initNibbleForLitChunk(dx + chunkX, dy + sectionY, dz + chunkZ, extrude, false); -+ } -+ } -+ -+ // update neighbour map -+ this.getEmptinessMap(dx + chunkX, dz + chunkZ)[IChunkAccess.getEmptinessMapIndex(-dx, -dz)][sectionY] = empty; -+ } -+ } -+ } -+ -+ // check for de-init, only runs if this just had data loaded in (or is being lit) -+ for (int i = 0; i < needsDeInitCheck.length; ++i) { -+ if (!needsDeInitCheck[i]) { ++ if (empty) { + continue; + } + -+ // index = (cx + 1) + 3*(cz + 1) -+ final int neighbourX = (i % 3) - 1 + chunkX; -+ final int neighbourZ = (i / 3) - 1 + chunkZ; -+ -+ final boolean[][] neighbourEmptinessMap = this.getEmptinessMap(neighbourX, neighbourZ); -+ -+ for (int sectionY = 16; sectionY >= -1; --sectionY) { -+ final SWMRNibbleArray nibble = this.getNibbleFromCache(neighbourX, sectionY, neighbourZ); -+ if (nibble == null || nibble.isNullNibbleUpdating()) { -+ // already null -+ continue; ++ for (int dz = -1; dz <= 1; ++dz) { ++ for (int dx = -1; dx <= 1; ++dx) { ++ // if we're not empty, we also need to initialise nibbles ++ // note: if we're unlit, we absolutely do not want to extrude, as light data isn't set up ++ final boolean extrude = (dx | dz) != 0 || !unlit; ++ for (int dy = 1; dy >= -1; --dy) { ++ this.initNibbleForLitChunk(dx + chunkX, dy + sectionY, dz + chunkZ, extrude, false); ++ } + } ++ } ++ } + -+ // check neighbours to see if we need to de-init this one -+ boolean allEmpty = true; -+ neighbour_search: -+ for (int dy = -1; dy <= 1; ++dy) { -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ final int y = sectionY + dy; -+ if (y < 0 || y > 15) { -+ // empty -+ continue; -+ } -+ if (!neighbourEmptinessMap[IChunkAccess.getEmptinessMapIndex(dx, dz)][y]) { -+ allEmpty = false; -+ break neighbour_search; -+ } ++ // check for de-init and lazy-init ++ // lazy init is when chunks are being lit, so at the time they weren't loaded when their neighbours were running ++ // init checks. ++ for (int dz = -1; dz <= 1; ++dz) { ++ for (int dx = -1; dx <= 1; ++dx) { ++ // does this neighbour have 1 radius loaded? ++ boolean neighboursLoaded = true; ++ neighbour_loaded_search: ++ for (int dz2 = -1; dz2 <= 1; ++dz2) { ++ for (int dx2 = -1; dx2 <= 1; ++dx2) { ++ if (this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ) == null) { ++ neighboursLoaded = false; ++ break neighbour_loaded_search; + } + } + } + -+ if (allEmpty) { -+ // all were empty, so de-init -+ nibble.setNull(); ++ for (int sectionY = this.maxLightSection; sectionY >= this.minLightSection; --sectionY) { ++ final SWMRNibbleArray nibble = this.getNibbleFromCache(dx + chunkX, sectionY, dz + chunkZ); ++ ++ // check neighbours to see if we need to de-init this one ++ boolean allEmpty = true; ++ neighbour_search: ++ for (int dy2 = -1; dy2 <= 1; ++dy2) { ++ for (int dz2 = -1; dz2 <= 1; ++dz2) { ++ for (int dx2 = -1; dx2 <= 1; ++dx2) { ++ final int y = sectionY + dy2; ++ if (y < this.minSection || y > this.maxSection) { ++ // empty ++ continue; ++ } ++ final boolean[] emptinessMap = this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ); ++ if (emptinessMap != null) { ++ if (!emptinessMap[y - this.minSection]) { ++ allEmpty = false; ++ break neighbour_search; ++ } ++ } else { ++ final ChunkSection section = this.getChunkSection(dx + dx2 + chunkX, y, dz + dz2 + chunkZ); ++ if (section != null && section != EMPTY_CHUNK_SECTION) { ++ allEmpty = false; ++ break neighbour_search; ++ } ++ } ++ } ++ } ++ } ++ ++ if (allEmpty & neighboursLoaded) { ++ // can only de-init when neighbours are loaded ++ // de-init is fine to delay, as de-init is just an optimisation - it's not required for lighting ++ // to be correct ++ ++ // all were empty, so de-init ++ if (nibble != null) { ++ nibble.setNull(); ++ } ++ } else if (!allEmpty) { ++ // must init ++ final boolean extrude = (dx | dz) != 0 || !unlit; ++ this.initNibbleForLitChunk(dx + chunkX, sectionY, dz + chunkZ, extrude, false); ++ } + } + } + } ++ ++ return ret; + } + ++ + protected final void initNibbleForLitChunk(final int chunkX, final int chunkY, final int chunkZ, final boolean extrude, + final boolean initRemovedNibbles) { -+ if (chunkY < -1 || chunkY > 16 || this.getChunkInCache(chunkX, chunkZ) == null) { ++ if (chunkY < this.minLightSection || chunkY > this.maxLightSection || this.getChunkInCache(chunkX, chunkZ) == null) { + return; + } + SWMRNibbleArray nibble = this.getNibbleFromCache(chunkX, chunkY, chunkZ); @@ -2302,11 +2263,11 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + return; + } + -+ final boolean[] emptinessMap = this.getEmptinessMap(chunkX, chunkZ)[IChunkAccess.getEmptinessMapIndex(0, 0)]; ++ final boolean[] emptinessMap = this.getEmptinessMap(chunkX, chunkZ); + + // are we above this chunk's lowest empty section? -+ int lowestY = -2; -+ for (int currY = 15; currY >= 0; --currY) { ++ int lowestY = this.minLightSection - 1; ++ for (int currY = this.maxSection; currY >= this.minSection; --currY) { + if (emptinessMap == null) { + // cannot delay nibble init for lit chunks, as we need to init to propagate into them. + final ChunkSection current = this.getChunkSection(chunkX, currY, chunkZ); @@ -2314,7 +2275,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + continue; + } + } else { -+ if (emptinessMap[currY]) { ++ if (emptinessMap[currY - this.minSection]) { + continue; + } + } @@ -2333,7 +2294,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + if (extrude) { + // this nibble is going to depend solely on the skylight data above it + // find first non-null data above (there does exist one, as we just found it above) -+ for (int currY = chunkY + 1; currY <= 16; ++currY) { ++ for (int currY = chunkY + 1; currY <= this.maxLightSection; ++currY) { + final SWMRNibbleArray nibble = this.getNibbleFromCache(chunkX, currY, chunkZ); + if (nibble != null && !nibble.isNullNibbleUpdating()) { + currNibble.extrudeLower(nibble); @@ -2356,8 +2317,6 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + } + -+ protected final boolean[] nullPropagationCheckCache = new boolean[16 - (-1) + 1]; -+ + // rets whether neighbours were init'd + + protected final boolean checkNullSection(final int chunkX, final int chunkY, final int chunkZ, @@ -2368,10 +2327,10 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + // this nibble would be initialised). So, we don't have to initialise + // the neighbours in the full 1 radius, because there's no worry that any "paths" + // to the neighbours on this horizontal plane are blocked. -+ if (chunkY < -1 || chunkY > 16 || this.nullPropagationCheckCache[chunkY + 1]) { ++ if (chunkY < this.minLightSection || chunkY > this.maxLightSection || this.nullPropagationCheckCache[chunkY - this.minLightSection]) { + return false; + } -+ this.nullPropagationCheckCache[chunkY + 1] = true; ++ this.nullPropagationCheckCache[chunkY - this.minLightSection] = true; + + // check horizontal neighbours + boolean needInitNeighbours = false; @@ -2408,7 +2367,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + + for (;;) { -+ if (++chunkY > 16) { ++ if (++chunkY > this.maxLightSection) { + return 15; + } + @@ -2420,8 +2379,14 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + } + -+ public SkyStarLightEngine(final boolean isClientSide) { -+ super(true, isClientSide); ++ @Override ++ protected boolean[] getEmptinessMap(final IChunkAccess chunk) { ++ return chunk.getEmptinessMap(); ++ } ++ ++ @Override ++ protected void setEmptinessMap(final IChunkAccess chunk, final boolean[] to) { ++ chunk.setEmptinessMap(to); + } + + @Override @@ -2430,11 +2395,6 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + + @Override -+ protected boolean[][] getEmptinessMap(final IChunkAccess chunk) { -+ return chunk.getEmptinessMap(); -+ } -+ -+ @Override + protected void setNibbles(final IChunkAccess chunk, final SWMRNibbleArray[] to) { + chunk.setSkyNibbles(to); + } @@ -2442,8 +2402,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + @Override + protected boolean canUseChunk(final IChunkAccess chunk) { + // can only use chunks for sky stuff if their sections have been init'd -+ return chunk.getChunkStatus().isAtLeastStatus(ChunkStatus.LIGHT) -+ && (this.isClientSide ? chunk.getEmptinessMap()[IChunkAccess.getEmptinessMapIndex(0, 0)] != null : chunk.isLit()); ++ return chunk.getChunkStatus().isAtLeastStatus(ChunkStatus.LIGHT) && (this.isClientSide ? true : chunk.isLit()); + } + + @Override @@ -2472,24 +2431,21 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + + if (currentLevel == 15) { + // must re-propagate clobbered source -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((worldX + (worldZ << 6) + (worldY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (currentLevel & 0xFL) << (6 + 6 + 16) + | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)) -+ | FLAG_HAS_SIDED_TRANSPARENT_BLOCKS; // don't know if the block is conditionally transparent ++ | FLAG_HAS_SIDED_TRANSPARENT_BLOCKS // don't know if the block is conditionally transparent ++ ); + } else { + this.setLightLevel(worldX, worldY, worldZ, 0); + } + -+ this.decreaseQueue[this.decreaseQueueInitialLength++] = ++ this.appendToDecreaseQueue( + ((worldX + (worldZ << 6) + (worldY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (currentLevel & 0xFL) << (6 + 6 + 16) -+ | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)); -+ } -+ -+ protected final int[] heightMapBlockChange = new int[16 * 16]; -+ { -+ Arrays.fill(this.heightMapBlockChange, -1024); // clear heightmap ++ | (((long)ALL_DIRECTIONS_BITSET) << (6 + 6 + 16 + 4)) ++ ); + } + + @Override @@ -2503,16 +2459,12 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + final int heightMapOffset = chunkX * -16 + (chunkZ * (-16 * 16)); + + // setup heightmap for changes -+ int highestBlockY = -1024; + for (final BlockPosition pos : positions) { + final int index = pos.getX() + (pos.getZ() << 4) + heightMapOffset; + final int curr = this.heightMapBlockChange[index]; + if (pos.getY() > curr) { + this.heightMapBlockChange[index] = pos.getY(); + } -+ if (pos.getY() > highestBlockY) { -+ highestBlockY = pos.getY(); -+ } + } + + // note: light sets are delayed while processing skylight source changes due to how @@ -2522,11 +2474,11 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + // now we can recalculate the sources for the changed columns + for (int index = 0; index < (16 * 16); ++index) { + final int maxY = this.heightMapBlockChange[index]; -+ if (maxY == -1024) { ++ if (maxY == Integer.MIN_VALUE) { + // not changed + continue; + } -+ this.heightMapBlockChange[index] = -1024; // restore default for next caller ++ this.heightMapBlockChange[index] = Integer.MIN_VALUE; // restore default for next caller + + final int columnX = (index & 15) | (chunkX << 4); + final int columnZ = (index >>> 4) | (chunkZ << 4); @@ -2545,7 +2497,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + // ensure section is checked + this.checkNullSection(columnX >> 4, maxPropagationY >> 4, columnZ >> 4, true); + -+ for (int currY = maxPropagationY; currY >= (-1 << 4); --currY) { ++ for (int currY = maxPropagationY; currY >= (this.minLightSection << 4); --currY) { + if ((currY & 15) == 15) { + // ensure section is checked + this.checkNullSection(columnX >> 4, (currY >> 4), columnZ >> 4, true); @@ -2566,11 +2518,12 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + + // delay light set until after processing all sources to setup -+ this.decreaseQueue[this.decreaseQueueInitialLength++] = ++ this.appendToDecreaseQueue( + ((columnX + (columnZ << 6) + (currY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (15L << (6 + 6 + 16)) -+ | (propagateDirection << (6 + 6 + 16 + 4)); ++ | (propagateDirection << (6 + 6 + 16 + 4)) + // do not set transparent blocks for the same reason we don't in the checkBlock method ++ ); + } + } + } @@ -2599,9 +2552,9 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + + final ChunkSection[] sections = chunk.getSections(); + -+ int highestNonEmptySection = 15; -+ while (highestNonEmptySection == -1 || -+ sections[highestNonEmptySection] == null || sections[highestNonEmptySection].isFullOfAir()) { ++ int highestNonEmptySection = this.maxSection; ++ while (highestNonEmptySection == (this.minSection - 1) || ++ sections[highestNonEmptySection - this.minSection] == null || sections[highestNonEmptySection - this.minSection].isFullOfAir()) { + this.checkNullSection(chunkX, highestNonEmptySection, chunkZ, false); + // try propagate FULL to neighbours + @@ -2654,21 +2607,22 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + + for (int currY = highestNonEmptySection << 4, maxY = currY | 15; currY <= maxY; ++currY) { + for (int i = 0, currX = startX, currZ = startZ; i < 16; ++i, currX += incX, currZ += incZ) { -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((currX + (currZ << 6) + (currY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (15L << (6 + 6 + 16)) // we know we're at full lit here -+ | (propagateDirection << (6 + 6 + 16 + 4)); ++ | (propagateDirection << (6 + 6 + 16 + 4)) + // no transparent flag, we know for a fact there are no blocks here that could be directionally transparent (as the section is EMPTY) ++ ); + } + } + } + -+ if (highestNonEmptySection-- == -1) { ++ if (highestNonEmptySection-- == (this.minSection - 1)) { + break; + } + } + -+ if (highestNonEmptySection >= 0) { ++ if (highestNonEmptySection >= this.minSection) { + // fill out our other sources + final int minX = chunkPos.x << 4; + final int maxX = chunkPos.x << 4 | 15; @@ -2680,12 +2634,13 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + final int end = this.tryPropagateSkylight(world, currX, startY, currZ, false, false); + if (end == startY) { + // we need to propagate this one ourselves. -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((currX + (currZ << 6) + (startY << (6 + 6)) + this.coordinateOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (15L << (6 + 6 + 16)) // we know we're at full lit here -+ | (AxisDirection.POSITIVE_Y.everythingButThisDirection << (6 + 6 + 16 + 4)); // no need to check upwards, we know it's 15. ++ | (AxisDirection.POSITIVE_Y.everythingButThisDirection << (6 + 6 + 16 + 4)) // no need to check upwards, we know it's 15. + // we know this block is air because the section is empty, so it's obviously not sidedly + // transparent. ++ ); + } + } + } @@ -2695,15 +2650,15 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + // not required to propagate here, but this will reduce the hit of the edge checks + this.performLightIncrease(lightAccess); + -+ for (int y = 16; y >= -1; --y) { ++ for (int y = this.maxLightSection; y >= this.minLightSection; --y) { + this.checkNullSection(chunkX, y, chunkZ, false); + } -+ this.checkChunkEdges(lightAccess, chunk, -1, 16); ++ this.checkChunkEdges(lightAccess, chunk, this.minLightSection, this.maxLightSection); + } else { -+ for (int y = highestNonEmptySection; y >= -1; --y) { ++ for (int y = highestNonEmptySection; y >= this.minLightSection; --y) { + this.checkNullSection(chunkX, y, chunkZ, false); + } -+ this.propagateNeighbourLevels(lightAccess, chunk, -1, highestNonEmptySection); ++ this.propagateNeighbourLevels(lightAccess, chunk, this.minLightSection, highestNonEmptySection); + + this.performLightIncrease(lightAccess); + } @@ -2767,7 +2722,7 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + above = AIR_BLOCK_STATE; + } + -+ for (;startY >= (-1 << 4); --startY) { ++ for (;startY >= (this.minLightSection << 4); --startY) { + if ((startY & 15) == 15) { + // ensure this section is always checked + this.checkNullSection(worldX >> 4, startY >> 4, worldZ >> 4, extrudeInitialised); @@ -2799,10 +2754,11 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + // most of the time it falls here. + // add to propagate + // light set delayed until we determine if this nibble section is null -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((worldX + (worldZ << 6) + (startY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (15L << (6 + 6 + 16)) // we know we're at full lit here -+ | (propagateDirection << (6 + 6 + 16 + 4)); ++ | (propagateDirection << (6 + 6 + 16 + 4)) ++ ); + } else { + mutablePos.setValues(worldX, startY, worldZ); + long flags = 0L; @@ -2823,11 +2779,12 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a + } + + // light set delayed until we determine if this nibble section is null -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((worldX + (worldZ << 6) + (startY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | (15L << (6 + 6 + 16)) // we know we're at full lit here + | (propagateDirection << (6 + 6 + 16 + 4)) -+ | flags; ++ | flags ++ ); + } + + above = current; @@ -2856,14 +2813,15 @@ index 0000000000000000000000000000000000000000..d84da5fefe3f4efd25aef01102c5965a +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/StarLightEngine.java b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightEngine.java new file mode 100644 -index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f5f0ca00e +index 0000000000000000000000000000000000000000..976b1ba5f7d85f7170fa1c714d4d281afeb41d80 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightEngine.java -@@ -0,0 +1,1376 @@ +@@ -0,0 +1,1426 @@ +package com.tuinity.tuinity.chunk.light; + +import com.tuinity.tuinity.util.CoordinateUtils; +import com.tuinity.tuinity.util.IntegerUtil; ++import com.tuinity.tuinity.util.WorldUtil; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.shorts.ShortCollection; +import it.unimi.dsi.fastutil.shorts.ShortIterator; @@ -2880,12 +2838,14 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f +import net.minecraft.server.SectionPosition; +import net.minecraft.server.VoxelShape; +import net.minecraft.server.VoxelShapes; ++import net.minecraft.server.World; +import net.minecraft.server.WorldServer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; ++import java.util.function.IntConsumer; + +public abstract class StarLightEngine { + @@ -2944,27 +2904,27 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + // exactly how the vanilla light engine should behave for minecraft. + + // similar to the above, except the chunk section indices vary from [-1, 1], or [0, 2] -+ // for the y chunk section it's from [-1, 16] or [0, 17] ++ // for the y chunk section it's from [minLightSection, maxLightSection] or [0, maxLightSection - minLightSection] + // index = x + (z * 5) + (y * 25) + // null index indicates the chunk section doesn't exist (empty or out of bounds) -+ protected final ChunkSection[] sectionCache = new ChunkSection[5 * 5 * (16 + 2 + 2)]; // add two extra sections for buffer ++ protected final ChunkSection[] sectionCache; + + // the exact same as above, except for storing fast access to SWMRNibbleArray -+ // for the y chunk section it's from [-1, 16] or [0, 17] ++ // for the y chunk section it's from [minLightSection, maxLightSection] or [0, maxLightSection - minLightSection] + // index = x + (z * 5) + (y * 25) -+ protected final SWMRNibbleArray[] nibbleCache = new SWMRNibbleArray[5 * 5 * (16 + 2 + 2)]; // add two extra sections for buffer ++ protected final SWMRNibbleArray[] nibbleCache; + + // the exact same as above, except for storing fast access to nibbles to call change callbacks for -+ // for the y chunk section it's from [-1, 16] or [0, 17] ++ // for the y chunk section it's from [minLightSection, maxLightSection] or [0, maxLightSection - minLightSection] + // index = x + (z * 5) + (y * 25) -+ protected final boolean[] notifyUpdateCache = new boolean[5 * 5 * (16 + 2 + 2)]; ++ protected final boolean[] notifyUpdateCache; + + // always initialsed during start of lighting. no index is null. + // index = x + (z * 5) + protected final IChunkAccess[] chunkCache = new IChunkAccess[5 * 5]; + + // index = x + (z * 5) -+ protected final boolean[][][] emptinessMapCache = new boolean[5 * 5][][]; ++ protected final boolean[][] emptinessMapCache = new boolean[5 * 5][]; + + protected final BlockPosition.MutableBlockPosition mutablePos1 = new BlockPosition.MutableBlockPosition(); + protected final BlockPosition.MutableBlockPosition mutablePos2 = new BlockPosition.MutableBlockPosition(); @@ -2987,16 +2947,31 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + protected final int emittedLightMask; + protected static final boolean isClientSide = false; + -+ protected StarLightEngine(final boolean skylightPropagator, final boolean isClientSide) { ++ protected final World world; ++ protected final int minLightSection; ++ protected final int maxLightSection; ++ protected final int minSection; ++ protected final int maxSection; ++ ++ protected StarLightEngine(final boolean skylightPropagator, final World world) { + this.skylightPropagator = skylightPropagator; + this.emittedLightMask = skylightPropagator ? 0 : 0xF; + //this.isClientSide = isClientSide; ++ this.world = world; ++ this.minLightSection = WorldUtil.getMinLightSection(world); ++ this.maxLightSection = WorldUtil.getMaxLightSection(world); ++ this.minSection = WorldUtil.getMinSection(world); ++ this.maxSection = WorldUtil.getMaxSection(world); ++ ++ this.sectionCache = new ChunkSection[5 * 5 * ((this.maxLightSection - this.minLightSection + 1) + 2)]; // add two extra sections for buffer ++ this.nibbleCache = new SWMRNibbleArray[5 * 5 * ((this.maxLightSection - this.minLightSection + 1) + 2)]; // add two extra sections for buffer ++ this.notifyUpdateCache = new boolean[5 * 5 * ((this.maxLightSection - this.minLightSection + 1) + 2)]; // add two extra sections for buffer + } + + protected final void setupEncodeOffset(final int centerX, final int centerY, final int centerZ) { + // 31 = center + encodeOffset + this.encodeOffsetX = 31 - centerX; -+ this.encodeOffsetY = 31; // we want 0 to be the smallest encoded value ++ this.encodeOffsetY = (-(this.minLightSection - 1) << 4); // we want 0 to be the smallest encoded value + this.encodeOffsetZ = 31 - centerZ; + + // coordinateIndex = x | (z << 6) | (y << 12) @@ -3004,7 +2979,7 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + // 2 = (centerX >> 4) + chunkOffset + this.chunkOffsetX = 2 - (centerX >> 4); -+ this.chunkOffsetY = 2; // lowest should be 0, not -2 ++ this.chunkOffsetY = -(this.minLightSection - 1); // lowest should be 0 + this.chunkOffsetZ = 2 - (centerZ >> 4); + + // chunk index = x + (5 * z) @@ -3014,24 +2989,25 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.chunkSectionIndexOffset = this.chunkIndexOffset + ((5 * 5) * this.chunkOffsetY); + } + -+ protected final void setupCaches(final ILightAccess chunkProvider, final int centerX, final int centerY, final int centerZ, final boolean relaxed) { ++ protected final void setupCaches(final ILightAccess chunkProvider, final int centerX, final int centerY, final int centerZ, ++ final boolean relaxed, final boolean tryToLoadChunksFor2Radius) { + final int centerChunkX = centerX >> 4; + final int centerChunkY = centerY >> 4; + final int centerChunkZ = centerZ >> 4; + + this.setupEncodeOffset(centerChunkX * 16 + 7, centerChunkY * 16 + 7, centerChunkZ * 16 + 7); + -+ final int minX = centerChunkX - 1; -+ final int minZ = centerChunkZ - 1; -+ final int maxX = centerChunkX + 1; -+ final int maxZ = centerChunkZ + 1; ++ final int radius = tryToLoadChunksFor2Radius ? 2 : 1; + -+ for (int cx = minX; cx <= maxX; ++cx) { -+ for (int cz = minZ; cz <= maxZ; ++cz) { ++ for (int dz = -radius; dz <= radius; ++dz) { ++ for (int dx = -radius; dx <= radius; ++dx) { ++ final int cx = centerChunkX + dx; ++ final int cz = centerChunkZ + dz; ++ final boolean isTwoRadius = Math.max(IntegerUtil.branchlessAbs(dx), IntegerUtil.branchlessAbs(dz)) == 2; + final IChunkAccess chunk = (IChunkAccess)chunkProvider.getFeaturesReadyChunk(cx, cz); // mappings are awful here, this is the "get chunk at if at least features" + + if (chunk == null) { -+ if (relaxed) { ++ if (relaxed | isTwoRadius) { + continue; + } + throw new IllegalArgumentException("Trying to propagate light update before 1 radius neighbours ready"); @@ -3042,9 +3018,11 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + this.setChunkInCache(cx, cz, chunk); -+ this.setBlocksForChunkInCache(cx, cz, chunk.getSections()); -+ this.setNibblesForChunkInCache(cx, cz, this.getNibblesOnChunk(chunk)); + this.setEmptinessMapCache(cx, cz, this.getEmptinessMap(chunk)); ++ if (!isTwoRadius) { ++ this.setBlocksForChunkInCache(cx, cz, chunk.getSections()); ++ this.setNibblesForChunkInCache(cx, cz, this.getNibblesOnChunk(chunk)); ++ } + } + } + } @@ -3066,9 +3044,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + protected final void setBlocksForChunkInCache(final int chunkX, final int chunkZ, final ChunkSection[] sections) { -+ for (int cy = -1; cy <= 16; ++cy) { ++ for (int cy = this.minLightSection; cy <= this.maxLightSection; ++cy) { + this.setChunkSectionInCache(chunkX, cy, chunkZ, -+ sections == null ? null : (cy >= 0 && cy <= 15 ? (sections[cy] == null || sections[cy].isFullOfAir() ? EMPTY_CHUNK_SECTION : sections[cy]) : EMPTY_CHUNK_SECTION)); ++ sections == null ? null : (cy >= this.minSection && cy <= this.maxSection ? (sections[cy - this.minSection] == null || sections[cy - this.minSection].isFullOfAir() ? EMPTY_CHUNK_SECTION : sections[cy - this.minSection]) : EMPTY_CHUNK_SECTION)); + } + } + @@ -3077,10 +3055,10 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + protected final SWMRNibbleArray[] getNibblesForChunkFromCache(final int chunkX, final int chunkZ) { -+ final SWMRNibbleArray[] ret = getEmptyLightArray(); ++ final SWMRNibbleArray[] ret = new SWMRNibbleArray[this.maxLightSection - this.minLightSection + 1]; + -+ for (int cy = -1; cy <= 16; ++cy) { -+ ret[cy + 1] = this.nibbleCache[chunkX + 5*chunkZ + (cy * (5 * 5)) + this.chunkSectionIndexOffset]; ++ for (int cy = this.minLightSection; cy <= this.maxLightSection; ++cy) { ++ ret[cy - this.minLightSection] = this.nibbleCache[chunkX + 5*chunkZ + (cy * (5 * 5)) + this.chunkSectionIndexOffset]; + } + + return ret; @@ -3091,8 +3069,8 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + protected final void setNibblesForChunkInCache(final int chunkX, final int chunkZ, final SWMRNibbleArray[] nibbles) { -+ for (int cy = -1; cy <= 16; ++cy) { -+ this.setNibbleInCache(chunkX, cy, chunkZ, nibbles == null ? null : nibbles[cy + 1]); ++ for (int cy = this.minLightSection; cy <= this.maxLightSection; ++cy) { ++ this.setNibbleInCache(chunkX, cy, chunkZ, nibbles == null ? null : nibbles[cy - this.minLightSection]); + } + } + @@ -3219,11 +3197,11 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + } + -+ protected final boolean[][] getEmptinessMap(final int chunkX, final int chunkZ) { ++ protected final boolean[] getEmptinessMap(final int chunkX, final int chunkZ) { + return this.emptinessMapCache[chunkX + 5*chunkZ + this.chunkIndexOffset]; + } + -+ protected final void setEmptinessMapCache(final int chunkX, final int chunkZ, final boolean[][] emptinessMap) { ++ protected final void setEmptinessMapCache(final int chunkX, final int chunkZ, final boolean[] emptinessMap) { + this.emptinessMapCache[chunkX + 5*chunkZ + this.chunkIndexOffset] = emptinessMap; + } + @@ -3233,8 +3211,20 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + return ret == -1 ? dfl : ret; + } + ++ /** ++ * @deprecated To be removed in 1.17 due to variable section count ++ */ ++ @Deprecated + public static SWMRNibbleArray[] getFilledEmptyLight() { -+ final SWMRNibbleArray[] ret = getEmptyLightArray(); ++ return getFilledEmptyLight(16 - (-1) + 1); ++ } ++ ++ public static SWMRNibbleArray[] getFilledEmptyLight(final World world) { ++ return getFilledEmptyLight(WorldUtil.getTotalLightSections(world)); ++ } ++ ++ private static SWMRNibbleArray[] getFilledEmptyLight(final int totalLightSections) { ++ final SWMRNibbleArray[] ret = new SWMRNibbleArray[totalLightSections]; + + for (int i = 0, len = ret.length; i < len; ++i) { + ret[i] = new SWMRNibbleArray(null, true); @@ -3243,11 +3233,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + return ret; + } + -+ public static SWMRNibbleArray[] getEmptyLightArray() { -+ return new SWMRNibbleArray[16 - (-1) + 1]; -+ } ++ protected abstract boolean[] getEmptinessMap(final IChunkAccess chunk); + -+ protected abstract boolean[][] getEmptinessMap(final IChunkAccess chunk); ++ protected abstract void setEmptinessMap(final IChunkAccess chunk, final boolean[] to); + + protected abstract SWMRNibbleArray[] getNibblesOnChunk(final IChunkAccess chunk); + @@ -3257,14 +3245,17 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + public final void blocksChangedInChunk(final ILightAccess lightAccess, final int chunkX, final int chunkZ, + final Set positions, final Boolean[] changedSections) { -+ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, this.isClientSide); ++ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, this.isClientSide, true); + try { + final IChunkAccess chunk = this.getChunkInCache(chunkX, chunkZ); + if (this.isClientSide && chunk == null) { + return; + } + if (changedSections != null) { -+ this.handleEmptySectionChanges(lightAccess, chunk, changedSections, false); ++ final boolean[] ret = this.handleEmptySectionChanges(lightAccess, chunk, changedSections, false); ++ if (ret != null) { ++ this.setEmptinessMap(chunk, ret); ++ } + } + if (!positions.isEmpty()) { + this.propagateBlockChanges(lightAccess, chunk, positions); @@ -3474,11 +3465,12 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + continue; + } + -+ this.increaseQueue[this.increaseQueueInitialLength++] = ++ this.appendToIncreaseQueue( + ((currX + (currZ << 6) + (currY << (6 + 6)) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((level & 0xFL) << (6 + 6 + 16)) + | (propagateDirection << (6 + 6 + 16 + 4)) -+ | FLAG_HAS_SIDED_TRANSPARENT_BLOCKS; // don't know if the current block is transparent, must check. ++ | FLAG_HAS_SIDED_TRANSPARENT_BLOCKS // don't know if the current block is transparent, must check. ++ ); + } + } + } @@ -3486,9 +3478,8 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + public static Boolean[] getEmptySectionsForChunk(final IChunkAccess chunk) { -+ final Boolean[] ret = new Boolean[16]; -+ + final ChunkSection[] sections = chunk.getSections(); ++ final Boolean[] ret = new Boolean[sections.length]; + + for (int i = 0; i < sections.length; ++i) { + if (sections[i] == null || sections[i].isFullOfAir()) { @@ -3503,7 +3494,7 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + public final void handleEmptySectionChanges(final ILightAccess lightAccess, final int chunkX, final int chunkZ, + final Boolean[] emptinessChanges) { -+ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, this.isClientSide); ++ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, this.isClientSide, true); + if (this.isClientSide) { + // force current chunk into cache + final IChunkAccess chunk = (IChunkAccess)lightAccess.getFeaturesReadyChunk(chunkX, chunkZ); @@ -3521,7 +3512,10 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + if (chunk == null) { + return; + } -+ this.handleEmptySectionChanges(lightAccess, chunk, emptinessChanges, false); ++ final boolean[] ret = this.handleEmptySectionChanges(lightAccess, chunk, emptinessChanges, false); ++ if (ret != null) { ++ this.setEmptinessMap(chunk, ret); ++ } + this.updateVisible(lightAccess); + } finally { + this.destroyCaches(); @@ -3532,11 +3526,12 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + // subclasses should not invoke updateVisible, as this will always be done by the super call + // subclasses are guaranteed that this is always called before a changed block set + // newChunk specifies whether the changes describe a "first load" of a chunk or changes to existing, already loaded chunks -+ protected abstract void handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit); ++ // rets non-null when the emptiness map changed and needs to be updated ++ protected abstract boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, ++ final Boolean[] emptinessChanges, final boolean unlit); + + public final void checkChunkEdges(final ILightAccess lightAccess, final int chunkX, final int chunkZ) { -+ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, true); ++ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, true, false); + try { + final IChunkAccess chunk = this.getChunkInCache(chunkX, chunkZ); + if (chunk == null) { @@ -3550,7 +3545,7 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + + public final void checkChunkEdges(final ILightAccess lightAccess, final int chunkX, final int chunkZ, final ShortCollection sections) { -+ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, true); ++ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, true, false); + try { + final IChunkAccess chunk = this.getChunkInCache(chunkX, chunkZ); + if (chunk == null) { @@ -3572,7 +3567,7 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + protected abstract void lightChunk(final ILightAccess lightAccess, final IChunkAccess chunk, final boolean needsEdgeChecks); + + public final void light(final ILightAccess lightAccess, final int chunkX, final int chunkZ, final Boolean[] emptySections) { -+ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, false); ++ this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, false, true); + // force current chunk into cache + final IChunkAccess chunk = (IChunkAccess)lightAccess.getFeaturesReadyChunk(chunkX, chunkZ); + this.setChunkInCache(chunkX, chunkZ, chunk); @@ -3581,7 +3576,10 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.setEmptinessMapCache(chunkX, chunkZ, this.getEmptinessMap(chunk)); + + try { -+ this.handleEmptySectionChanges(lightAccess, chunk, emptySections, true); ++ final boolean[] ret = this.handleEmptySectionChanges(lightAccess, chunk, emptySections, true); ++ if (ret != null) { ++ this.setEmptinessMap(chunk, ret); ++ } + this.lightChunk(lightAccess, chunk, false); + this.updateVisible(lightAccess); + } finally { @@ -3589,90 +3587,13 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + } + } + -+ public final void relight(final ILightAccess lightAccess, final int chunkX, final int chunkZ) { -+ final IChunkAccess chunk = (IChunkAccess)lightAccess.getFeaturesReadyChunk(chunkX, chunkZ); -+ this.relightChunk(lightAccess, chunk); -+ } -+ -+ protected final void relightChunk(final ILightAccess lightAccess, final IChunkAccess chunk) { -+ final ChunkCoordIntPair chunkPos = chunk.getPos(); -+ -+ // ensure the emptiness map will be correct for the chunk -+ this.handleEmptySectionChanges(lightAccess, chunkPos.x, chunkPos.z, getEmptySectionsForChunk(chunk)); -+ -+ this.setupEncodeOffset(chunkPos.x * 16 + 7, 128, chunkPos.z * 16 + 7); -+ -+ try { -+ final SWMRNibbleArray[][] chunkNibbles = new SWMRNibbleArray[(2 * 1 + 1) * (2 * 1 + 1)][]; -+ for (int i = 0; i < chunkNibbles.length; ++i) { -+ chunkNibbles[i] = getFilledEmptyLight(); -+ } -+ -+ this.setChunkInCache(chunkPos.x, chunkPos.z, chunk); -+ this.setBlocksForChunkInCache(chunkPos.x, chunkPos.z, chunk.getSections()); -+ this.setNibblesForChunkInCache(chunkPos.x, chunkPos.z, chunkNibbles[IChunkAccess.getEmptinessMapIndex(0, 0)]); -+ this.setEmptinessMapCache(chunkPos.x, chunkPos.z, new boolean[9][]); -+ -+ this.handleEmptySectionChanges(lightAccess, chunk, getEmptySectionsForChunk(chunk), true); -+ this.lightChunk(lightAccess, chunk, false); -+ -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ if ((dx | dz) == 0) { -+ continue; -+ } -+ -+ final int cx = dx + chunkPos.x; -+ final int cz = dz + chunkPos.z; -+ final IChunkAccess neighbourChunk = (IChunkAccess)lightAccess.getFeaturesReadyChunk(cx, cz); -+ -+ if (neighbourChunk == null || !this.canUseChunk(neighbourChunk)) { -+ continue; -+ } -+ -+ for (int dz2 = -1; dz2 <= 1; ++dz2) { -+ for (int dx2 = -1; dx2 <= 1; ++dx2) { -+ final IChunkAccess neighbour = this.getChunkInCache(dx2 + chunkPos.x, dz2 + chunkPos.z); -+ if (neighbour == null) { -+ continue; -+ } -+ -+ // re-insert nibbles for chunk, they might have been removed due to the emptiness map -+ this.setNibblesForChunkInCache(dx2 + chunkPos.x, dz2 + chunkPos.z, chunkNibbles[IChunkAccess.getEmptinessMapIndex(dx2, dz2)]); -+ } -+ } -+ -+ this.setChunkInCache(cx, cz, neighbourChunk); -+ this.setBlocksForChunkInCache(cx, cz, neighbourChunk.getSections()); -+ this.setNibblesForChunkInCache(cx, cz, chunkNibbles[IChunkAccess.getEmptinessMapIndex(dx, dz)]); -+ this.setEmptinessMapCache(cx, cz, new boolean[9][]); -+ -+ this.handleEmptySectionChanges(lightAccess, neighbourChunk, getEmptySectionsForChunk(neighbourChunk), true); -+ this.lightChunk(lightAccess, neighbourChunk, false); -+ } -+ } -+ -+ for (final SWMRNibbleArray nibble : chunkNibbles[IChunkAccess.getEmptinessMapIndex(0, 0)]) { -+ nibble.updateVisible(); -+ } -+ -+ this.setNibbles(chunk, chunkNibbles[IChunkAccess.getEmptinessMapIndex(0, 0)]); -+ -+ for (int y = -1; y <= 16; ++y) { -+ lightAccess.markLightSectionDirty(this.skylightPropagator ? EnumSkyBlock.SKY : EnumSkyBlock.BLOCK, new SectionPosition(chunkPos.x, y, chunkPos.z)); -+ } -+ } finally { -+ this.destroyCaches(); -+ } -+ } -+ + public final void relightChunks(final ILightAccess lightAccess, final Set chunks, -+ final Consumer chunkLightCallback) { ++ final Consumer chunkLightCallback, final IntConsumer onComplete) { + // it's recommended for maximum performance that the set is ordered according to a BFS from the center of + // the region of chunks to relight + // it's required that tickets are added for each chunk to keep them loaded + final Long2ObjectOpenHashMap nibblesByChunk = new Long2ObjectOpenHashMap<>(); -+ final Long2ObjectOpenHashMap emptinessMapByChunk = new Long2ObjectOpenHashMap<>(); ++ final Long2ObjectOpenHashMap emptinessMapByChunk = new Long2ObjectOpenHashMap<>(); + + final int[] neighbourLightOrder = new int[] { + // d = 0 @@ -3689,24 +3610,23 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + 1, -1, + }; + ++ int lightCalls = 0; ++ + for (final ChunkCoordIntPair chunkPos : chunks) { + final int chunkX = chunkPos.x; + final int chunkZ = chunkPos.z; -+ final IChunkAccess chunk = (IChunkAccess)lightAccess.getFeaturesReadyChunk(chunkX, chunkZ); ++ final IChunkAccess chunk = (IChunkAccess) lightAccess.getFeaturesReadyChunk(chunkX, chunkZ); + if (chunk == null || !this.canUseChunk(chunk)) { + throw new IllegalStateException(); + } + -+ // force update emptiness map so we can guarantee it's correct after we're done -+ this.handleEmptySectionChanges(lightAccess, chunkX, chunkZ, getEmptySectionsForChunk(chunk)); -+ + for (int i = 0, len = neighbourLightOrder.length; i < len; i += 2) { + final int dx = neighbourLightOrder[i]; + final int dz = neighbourLightOrder[i + 1]; + final int neighbourX = dx + chunkX; + final int neighbourZ = dz + chunkZ; + -+ final IChunkAccess neighbour = (IChunkAccess)lightAccess.getFeaturesReadyChunk(neighbourX, neighbourZ); ++ final IChunkAccess neighbour = (IChunkAccess) lightAccess.getFeaturesReadyChunk(neighbourX, neighbourZ); + if (neighbour == null || !this.canUseChunk(neighbour)) { + continue; + } @@ -3746,17 +3666,19 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final long key = CoordinateUtils.getChunkKey(neighbourX, neighbourZ); + + // now insert the neighbour chunk and light it -+ final SWMRNibbleArray[] nibbles = getFilledEmptyLight(); -+ final boolean[][] emptinessMap = new boolean[(2 * 1 + 1) * (2 * 1 + 1)][]; ++ final SWMRNibbleArray[] nibbles = getFilledEmptyLight(this.world); + nibblesByChunk.put(key, nibbles); -+ emptinessMapByChunk.put(key, emptinessMap); + + this.setChunkInCache(neighbourX, neighbourZ, neighbour); + this.setBlocksForChunkInCache(neighbourX, neighbourZ, neighbour.getSections()); + this.setNibblesForChunkInCache(neighbourX, neighbourZ, nibbles); -+ this.setEmptinessMapCache(neighbourX, neighbourZ, emptinessMap); + -+ this.handleEmptySectionChanges(lightAccess, neighbour, getEmptySectionsForChunk(neighbour), true); ++ final boolean[] neighbourEmptiness = this.handleEmptySectionChanges(lightAccess, neighbour, getEmptySectionsForChunk(neighbour), true); ++ emptinessMapByChunk.put(key, neighbourEmptiness); ++ if (chunks.contains(new ChunkCoordIntPair(neighbourX, neighbourZ))) { ++ this.setEmptinessMap(neighbour, neighbourEmptiness); ++ } ++ + this.lightChunk(lightAccess, neighbour, false); + } finally { + this.destroyCaches(); @@ -3773,12 +3695,19 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + this.setNibbles(chunk, nibbles); + -+ for (int y = -1; y <= 16; ++y) { ++ for (int y = this.minLightSection; y <= this.maxLightSection; ++y) { + lightAccess.markLightSectionDirty(this.skylightPropagator ? EnumSkyBlock.SKY : EnumSkyBlock.BLOCK, new SectionPosition(chunkX, y, chunkX)); + } + + // now do callback -+ chunkLightCallback.accept(chunkPos); ++ if (chunkLightCallback != null) { ++ chunkLightCallback.accept(chunkPos); ++ } ++ ++lightCalls; ++ } ++ ++ if (onComplete != null) { ++ onComplete.accept(lightCalls); + } + } + @@ -3799,11 +3728,41 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + // whether the propagation needs to consider if its block is conditionally transparent + protected static final long FLAG_HAS_SIDED_TRANSPARENT_BLOCKS = Long.MIN_VALUE; + -+ protected final long[] increaseQueue = new long[16 * 16 * (16 * (16 + 2)) * 9 + 1]; ++ protected long[] increaseQueue = new long[16 * 16 * 16]; + protected int increaseQueueInitialLength; -+ protected final long[] decreaseQueue = new long[16 * 16 * (16 * (16 + 2)) * 9 + 1]; ++ protected long[] decreaseQueue = new long[16 * 16 * 16]; + protected int decreaseQueueInitialLength; + ++ protected final long[] resizeIncreaseQueue() { ++ return this.increaseQueue = Arrays.copyOf(this.increaseQueue, this.increaseQueue.length * 2); ++ } ++ ++ protected final long[] resizeDecreaseQueue() { ++ return this.decreaseQueue = Arrays.copyOf(this.decreaseQueue, this.decreaseQueue.length * 2); ++ } ++ ++ protected final void appendToIncreaseQueue(final long value) { ++ final int idx = this.increaseQueueInitialLength++; ++ long[] queue = this.increaseQueue; ++ if (idx >= queue.length) { ++ queue = this.resizeIncreaseQueue(); ++ queue[idx] = value; ++ } else { ++ queue[idx] = value; ++ } ++ } ++ ++ protected final void appendToDecreaseQueue(final long value) { ++ final int idx = this.decreaseQueueInitialLength++; ++ long[] queue = this.decreaseQueue; ++ if (idx >= queue.length) { ++ queue = this.resizeDecreaseQueue(); ++ queue[idx] = value; ++ } else { ++ queue[idx] = value; ++ } ++ } ++ + protected static final AxisDirection[][] OLD_CHECK_DIRECTIONS = new AxisDirection[1 << 6][]; + protected static final int ALL_DIRECTIONS_BITSET = (1 << 6) - 1; + static { @@ -3818,7 +3777,7 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + protected final void performLightIncrease(final ILightAccess lightAccess) { + final IBlockAccess world = lightAccess.getWorld(); -+ final long[] queue = this.increaseQueue; ++ long[] queue = this.increaseQueue; + int queueReadIndex = 0; + int queueLength = this.increaseQueueInitialLength; + this.increaseQueueInitialLength = 0; @@ -3873,6 +3832,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 1) { ++ if (queueLength >= queue.length) { ++ queue = this.resizeIncreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -3903,6 +3865,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 1) { ++ if (queueLength >= queue.length) { ++ queue = this.resizeIncreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -3950,6 +3915,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 1) { ++ if (queueLength >= queue.length) { ++ queue = this.resizeIncreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -3980,6 +3948,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 1) { ++ if (queueLength >= queue.length) { ++ queue = this.resizeIncreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -3995,8 +3966,8 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + + protected final void performLightDecrease(final ILightAccess lightAccess) { + final IBlockAccess world = lightAccess.getWorld(); -+ final long[] queue = this.decreaseQueue; -+ final long[] increaseQueue = this.increaseQueue; ++ long[] queue = this.decreaseQueue; ++ long[] increaseQueue = this.increaseQueue; + int queueReadIndex = 0; + int queueLength = this.decreaseQueueInitialLength; + this.decreaseQueueInitialLength = 0; @@ -4045,6 +4016,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int targetLevel = Math.max(0, propagatedLightLevel - Math.max(1, opacityCached)); + if (lightLevel > targetLevel) { + // it looks like another source propagated here, so re-propagate it ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((lightLevel & 0xFL) << (6 + 6 + 16)) @@ -4055,6 +4029,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int emittedLight = (customLightHandler != null ? this.getCustomLightLevel(customLightHandler, offX, offY, offZ, blockState.getEmittedLight()) : blockState.getEmittedLight()) & emittedMask; + if (emittedLight != 0) { + // re-propagate source ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((emittedLight & 0xFL) << (6 + 6 + 16)) @@ -4066,6 +4043,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 0) { // we actually need to propagate 0 just in case we find a neighbour... ++ if (queueLength >= queue.length) { ++ queue = this.resizeDecreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -4089,6 +4069,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int targetLevel = Math.max(0, propagatedLightLevel - Math.max(1, opacity)); + if (lightLevel > targetLevel) { + // it looks like another source propagated here, so re-propagate it ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((lightLevel & 0xFL) << (6 + 6 + 16)) @@ -4099,6 +4082,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int emittedLight = (customLightHandler != null ? this.getCustomLightLevel(customLightHandler, offX, offY, offZ, blockState.getEmittedLight()) : blockState.getEmittedLight()) & emittedMask; + if (emittedLight != 0) { + // re-propagate source ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((emittedLight & 0xFL) << (6 + 6 + 16)) @@ -4110,6 +4096,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 0) { ++ if (queueLength >= queue.length) { ++ queue = this.resizeDecreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -4154,6 +4143,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int targetLevel = Math.max(0, propagatedLightLevel - Math.max(1, opacityCached)); + if (lightLevel > targetLevel) { + // it looks like another source propagated here, so re-propagate it ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((lightLevel & 0xFL) << (6 + 6 + 16)) @@ -4164,6 +4156,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int emittedLight = (customLightHandler != null ? this.getCustomLightLevel(customLightHandler, offX, offY, offZ, blockState.getEmittedLight()) : blockState.getEmittedLight()) & emittedMask; + if (emittedLight != 0) { + // re-propagate source ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((emittedLight & 0xFL) << (6 + 6 + 16)) @@ -4175,6 +4170,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 0) { // we actually need to propagate 0 just in case we find a neighbour... ++ if (queueLength >= queue.length) { ++ queue = this.resizeDecreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -4198,6 +4196,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int targetLevel = Math.max(0, propagatedLightLevel - Math.max(1, opacity)); + if (lightLevel > targetLevel) { + // it looks like another source propagated here, so re-propagate it ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((lightLevel & 0xFL) << (6 + 6 + 16)) @@ -4208,6 +4209,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + final int emittedLight = (customLightHandler != null ? this.getCustomLightLevel(customLightHandler, offX, offY, offZ, blockState.getEmittedLight()) : blockState.getEmittedLight()) & emittedMask; + if (emittedLight != 0) { + // re-propagate source ++ if (increaseQueueLength >= increaseQueue.length) { ++ increaseQueue = this.resizeIncreaseQueue(); ++ } + increaseQueue[increaseQueueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((emittedLight & 0xFL) << (6 + 6 + 16)) @@ -4219,6 +4223,9 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f + this.postLightUpdate(offX, offY, offZ); + + if (targetLevel > 0) { // we actually need to propagate 0 just in case we find a neighbour... ++ if (queueLength >= queue.length) { ++ queue = this.resizeDecreaseQueue(); ++ } + queue[queueLength++] = + ((offX + (offZ << 6) + (offY << 12) + encodeOffset) & ((1L << (6 + 6 + 16)) - 1)) + | ((targetLevel & 0xFL) << (6 + 6 + 16)) @@ -4238,13 +4245,14 @@ index 0000000000000000000000000000000000000000..5fcb8535e5319d74520e741dea9b9d9f +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/StarLightInterface.java b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightInterface.java new file mode 100644 -index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e274318db5cd98 +index 0000000000000000000000000000000000000000..eb3662a0084d4f1f62d339ac11d2aaced092e28e --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightInterface.java -@@ -0,0 +1,465 @@ +@@ -0,0 +1,473 @@ +package com.tuinity.tuinity.chunk.light; + +import com.tuinity.tuinity.util.CoordinateUtils; ++import com.tuinity.tuinity.util.WorldUtil; +import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.shorts.ShortCollection; @@ -4262,6 +4270,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 +import java.util.Iterator; +import java.util.Set; +import java.util.function.Consumer; ++import java.util.function.IntConsumer; + +public final class StarLightInterface { + @@ -4281,11 +4290,27 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + protected final LightEngineLayerEventListener blockReader; + protected static final boolean isClientSide = false; + ++ protected final int minSection; ++ protected final int maxSection; ++ protected final int minLightSection; ++ protected final int maxLightSection; ++ + public StarLightInterface(final ILightAccess lightAccess, final boolean hasSkyLight, final boolean hasBlockLight) { + this.lightAccess = lightAccess; + this.world = lightAccess == null ? null : (WorldServer)lightAccess.getWorld(); + this.cachedSkyPropagators = hasSkyLight && lightAccess != null ? new ArrayDeque<>() : null; + this.cachedBlockPropagators = hasBlockLight && lightAccess != null ? new ArrayDeque<>() : null; ++ if (this.world == null) { ++ this.minSection = 0; ++ this.maxSection = 15; ++ this.minLightSection = -1; ++ this.maxLightSection = 16; ++ } else { ++ this.minSection = WorldUtil.getMinSection(this.world); ++ this.maxSection = WorldUtil.getMaxSection(this.world); ++ this.minLightSection = WorldUtil.getMinLightSection(this.world); ++ this.maxLightSection = WorldUtil.getMaxLightSection(this.world); ++ } + this.skyReader = !hasSkyLight ? LightEngineLayerEventListener.Void.INSTANCE : new LightEngineLayerEventListener() { + @Override + public NibbleArray a(final SectionPosition pos) { @@ -4296,15 +4321,15 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + + final int sectionY = pos.getY(); + -+ if (sectionY > 16 || sectionY < -1) { ++ if (sectionY > StarLightInterface.this.maxLightSection || sectionY < StarLightInterface.this.minLightSection) { + return null; + } + -+ if (chunk.getEmptinessMap()[IChunkAccess.getEmptinessMapIndex(0, 0)] == null) { ++ if (chunk.getEmptinessMap() == null) { + return null; + } + -+ return chunk.getSkyNibbles()[sectionY + 1].toVanillaNibble(); ++ return chunk.getSkyNibbles()[sectionY - StarLightInterface.this.minLightSection].toVanillaNibble(); + } + + @Override @@ -4320,17 +4345,17 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + + int sectionY = y >> 4; + -+ if (sectionY > 16) { ++ if (sectionY > StarLightInterface.this.maxLightSection) { + return 15; + } + -+ if (sectionY < -1) { -+ y = -16; -+ sectionY = -1; ++ if (sectionY < StarLightInterface.this.minLightSection) { ++ sectionY = StarLightInterface.this.minLightSection; ++ y = sectionY << 4; + } + + final SWMRNibbleArray[] nibbles = chunk.getSkyNibbles(); -+ final SWMRNibbleArray immediate = nibbles[sectionY + 1]; ++ final SWMRNibbleArray immediate = nibbles[sectionY - StarLightInterface.this.minLightSection]; + + if (StarLightInterface.this.isClientSide) { + if (!immediate.isNullNibbleUpdating()) { @@ -4342,16 +4367,16 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + } + } + -+ final boolean[] emptinessMap = chunk.getEmptinessMap()[IChunkAccess.getEmptinessMapIndex(0, 0)]; ++ final boolean[] emptinessMap = chunk.getEmptinessMap(); + + if (emptinessMap == null) { + return 15; + } + + // are we above this chunk's lowest empty section? -+ int lowestY = -2; -+ for (int currY = 15; currY >= 0; --currY) { -+ if (emptinessMap[currY]) { ++ int lowestY = StarLightInterface.this.minLightSection - 1; ++ for (int currY = StarLightInterface.this.maxSection; currY >= StarLightInterface.this.minSection; --currY) { ++ if (emptinessMap[currY - StarLightInterface.this.minSection]) { + continue; + } + @@ -4366,8 +4391,8 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + + // this nibble is going to depend solely on the skylight data above it + // find first non-null data above (there does exist one, as we just found it above) -+ for (int currY = sectionY + 1; currY <= 16; ++currY) { -+ final SWMRNibbleArray nibble = nibbles[currY + 1]; ++ for (int currY = sectionY + 1; currY <= StarLightInterface.this.maxLightSection; ++currY) { ++ final SWMRNibbleArray nibble = nibbles[currY - StarLightInterface.this.minLightSection]; + if (StarLightInterface.this.isClientSide) { + if (!nibble.isNullNibbleUpdating()) { + return nibble.getUpdating(x, 0, z); @@ -4392,7 +4417,12 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + @Override + public NibbleArray a(final SectionPosition pos) { + final IChunkAccess chunk = StarLightInterface.this.getAnyChunkNow(pos.getX(), pos.getZ()); -+ return chunk != null ? chunk.getBlockNibbles()[pos.getY() + 1].toVanillaNibble() : null; ++ ++ if (pos.getY() < StarLightInterface.this.minLightSection || pos.getY() > StarLightInterface.this.maxLightSection) { ++ return null; ++ } ++ ++ return chunk != null ? chunk.getBlockNibbles()[pos.getY() - StarLightInterface.this.minLightSection].toVanillaNibble() : null; + } + + @Override @@ -4401,7 +4431,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + final int cy = blockPos.getY() >> 4; + final int cz = blockPos.getZ() >> 4; + -+ if (cy < -1 || cy > 16) { ++ if (cy < StarLightInterface.this.minLightSection || cy > StarLightInterface.this.maxLightSection) { + return 0; + } + @@ -4411,7 +4441,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + return 0; + } + -+ final SWMRNibbleArray nibble = chunk.getBlockNibbles()[cy + 1]; ++ final SWMRNibbleArray nibble = chunk.getBlockNibbles()[cy - StarLightInterface.this.minLightSection]; + if (StarLightInterface.this.isClientSide) { + return nibble.getUpdating(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + } else { @@ -4470,7 +4500,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + } + + if (ret == null) { -+ return new SkyStarLightEngine(this.isClientSide); ++ return new SkyStarLightEngine(this.world); + } + return ret; + } @@ -4494,7 +4524,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + } + + if (ret == null) { -+ return new BlockStarLightEngine(this.isClientSide); ++ return new BlockStarLightEngine(this.world); + } + return ret; + } @@ -4509,7 +4539,7 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + } + + public void blockChange(BlockPosition pos) { -+ if (pos.getY() < 0 || pos.getY() > 255 || this.world == null) { // empty world ++ if (this.world == null || pos.getY() < WorldUtil.getMinBlockY(this.world) || pos.getY() > WorldUtil.getMaxBlockY(this.world)) { // empty world + return; + } + @@ -4531,9 +4561,9 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + return new ChunkChanges(); + }); + if (changes.changedSectionSet == null) { -+ changes.changedSectionSet = new Boolean[16]; ++ changes.changedSectionSet = new Boolean[this.maxSection - this.minSection + 1]; + } -+ changes.changedSectionSet[pos.getY()] = Boolean.valueOf(newEmptyValue); ++ changes.changedSectionSet[pos.getY() - this.minSection] = Boolean.valueOf(newEmptyValue); + } + } + @@ -4571,33 +4601,18 @@ index 0000000000000000000000000000000000000000..5edc4daffa24074a83d67a3ed6e27431 + } + } + -+ public void relightChunk(final int chunkX, final int chunkZ) { ++ public void relightChunks(final Set chunks, final Consumer chunkLightCallback, ++ final IntConsumer onComplete) { + final SkyStarLightEngine skyEngine = this.getSkyLightEngine(); + final BlockStarLightEngine blockEngine = this.getBlockLightEngine(); + + try { + if (skyEngine != null) { -+ skyEngine.relight(this.lightAccess, chunkX, chunkZ); ++ skyEngine.relightChunks(this.lightAccess, chunks, blockEngine == null ? chunkLightCallback : null, ++ blockEngine == null ? onComplete : null); + } + if (blockEngine != null) { -+ blockEngine.relight(this.lightAccess, chunkX, chunkZ); -+ } -+ } finally { -+ this.releaseSkyLightEngine(skyEngine); -+ this.releaseBlockLightEngine(blockEngine); -+ } -+ } -+ -+ public void relightChunks(final Set chunks, final Consumer chunkLightCallback) { -+ final SkyStarLightEngine skyEngine = this.getSkyLightEngine(); -+ final BlockStarLightEngine blockEngine = this.getBlockLightEngine(); -+ -+ try { -+ if (skyEngine != null) { -+ skyEngine.relightChunks(this.lightAccess, chunks, chunkLightCallback); -+ } -+ if (blockEngine != null) { -+ blockEngine.relightChunks(this.lightAccess, chunks, chunkLightCallback); ++ blockEngine.relightChunks(this.lightAccess, chunks, chunkLightCallback, onComplete); + } + } finally { + this.releaseSkyLightEngine(skyEngine); @@ -5331,10 +5346,10 @@ index 0000000000000000000000000000000000000000..21e50c75e0bffaa5cc5faf6aa81ae742 +} diff --git a/src/main/java/com/tuinity/tuinity/util/CoordinateUtils.java b/src/main/java/com/tuinity/tuinity/util/CoordinateUtils.java new file mode 100644 -index 0000000000000000000000000000000000000000..224c79e015fc7a87ef8fc357d56f9253576f4c67 +index 0000000000000000000000000000000000000000..81fe01c122529f1716a264263957500015476f5f --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/util/CoordinateUtils.java -@@ -0,0 +1,122 @@ +@@ -0,0 +1,128 @@ +package com.tuinity.tuinity.util; + +import net.minecraft.server.BlockPosition; @@ -5345,6 +5360,12 @@ index 0000000000000000000000000000000000000000..224c79e015fc7a87ef8fc357d56f9253 + +public final class CoordinateUtils { + ++ // dx, dz are relative to the target chunk ++ // dx, dz in [-radius, radius] ++ public static int getNeighbourMappedIndex(final int dx, final int dz, final int radius) { ++ return (dx + radius) + (2 * radius + 1)*(dz + radius); ++ } ++ + // the chunk keys are compatible with vanilla + + public static long getChunkKey(final BlockPosition pos) { @@ -5843,6 +5864,60 @@ index 0000000000000000000000000000000000000000..08ed243259f052165c6f75aed1d1d65a + } +} \ No newline at end of file +diff --git a/src/main/java/com/tuinity/tuinity/util/WorldUtil.java b/src/main/java/com/tuinity/tuinity/util/WorldUtil.java +new file mode 100644 +index 0000000000000000000000000000000000000000..141748fe4915eb46671f1d532951f14d7080818d +--- /dev/null ++++ b/src/main/java/com/tuinity/tuinity/util/WorldUtil.java +@@ -0,0 +1,48 @@ ++package com.tuinity.tuinity.util; ++ ++import net.minecraft.server.World; ++ ++public final class WorldUtil { ++ ++ // min, max are inclusive ++ // TODO update these for 1.17 ++ ++ public static int getMaxSection(final World world) { ++ return 15; ++ } ++ ++ public static int getMinSection(final World world) { ++ return 0; ++ } ++ ++ public static int getMaxLightSection(final World world) { ++ return getMaxSection(world) + 1; ++ } ++ ++ public static int getMinLightSection(final World world) { ++ return getMinSection(world) - 1; ++ } ++ ++ ++ ++ public static int getTotalSections(final World world) { ++ return getMaxSection(world) - getMinSection(world) + 1; ++ } ++ ++ public static int getTotalLightSections(final World world) { ++ return getMaxLightSection(world) - getMinLightSection(world) + 1; ++ } ++ ++ public static int getMinBlockY(final World world) { ++ return getMinSection(world) << 4; ++ } ++ ++ public static int getMaxBlockY(final World world) { ++ return (getMaxSection(world) << 4) | 15; ++ } ++ ++ private WorldUtil() { ++ throw new RuntimeException(); ++ } ++ ++} diff --git a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java new file mode 100644 index 0000000000000000000000000000000000000000..be408aebbccbda46e8aa82ef337574137cfa0096 @@ -8295,10 +8370,10 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd @Override public BlockPosition immutableCopy() { diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6ede654456 100644 +index 9c078d30afef20bd1ea5975299c5513334829b19..6ca9e373c402bf252bae6f08b88407bda48d7f0e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,182 @@ public class Chunk implements IChunkAccess { +@@ -91,6 +91,186 @@ public class Chunk implements IChunkAccess { private final int[] inventoryEntityCounts = new int[16]; // Paper end @@ -8354,7 +8429,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e + // Tuinity start - rewrite light engine + private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); + private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile boolean[][] emptinessMap = new boolean[9][]; ++ private volatile boolean[] emptinessMap; + + @Override + public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { @@ -8377,10 +8452,14 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e + } + + @Override -+ public boolean[][] getEmptinessMap() { ++ public boolean[] getEmptinessMap() { + return this.emptinessMap; + } + ++ @Override ++ public void setEmptinessMap(boolean[] emptinessMap) { ++ this.emptinessMap = emptinessMap; ++ } + // Tuinity end - rewrite light engine + + // Tuinity start - entity slices by class @@ -8481,7 +8560,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList ticklist, TickList ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer consumer) { this.sections = new ChunkSection[16]; this.e = Maps.newHashMap(); -@@ -297,6 +473,11 @@ public class Chunk implements IChunkAccess { +@@ -297,6 +477,11 @@ public class Chunk implements IChunkAccess { public Chunk(World world, ProtoChunk protochunk) { this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null); @@ -8493,7 +8572,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e Iterator iterator = protochunk.y().iterator(); while (iterator.hasNext()) { -@@ -330,7 +511,7 @@ public class Chunk implements IChunkAccess { +@@ -330,7 +515,7 @@ public class Chunk implements IChunkAccess { Entry entry = (Entry) iterator.next(); if (ChunkStatus.FULL.h().contains(entry.getKey())) { @@ -8502,7 +8581,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e } } -@@ -547,6 +728,7 @@ public class Chunk implements IChunkAccess { +@@ -547,6 +732,7 @@ public class Chunk implements IChunkAccess { @Override public void a(Entity entity) { @@ -8510,7 +8589,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e this.q = true; int i = MathHelper.floor(entity.locX() / 16.0D); int j = MathHelper.floor(entity.locZ() / 16.0D); -@@ -592,8 +774,8 @@ public class Chunk implements IChunkAccess { +@@ -592,8 +778,8 @@ public class Chunk implements IChunkAccess { entity.chunkX = this.loc.x; entity.chunkY = k; entity.chunkZ = this.loc.z; @@ -8521,7 +8600,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e // Paper start if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -616,6 +798,7 @@ public class Chunk implements IChunkAccess { +@@ -616,6 +802,7 @@ public class Chunk implements IChunkAccess { } public void a(Entity entity, int i) { @@ -8529,7 +8608,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e if (i < 0) { i = 0; } -@@ -630,7 +813,7 @@ public class Chunk implements IChunkAccess { +@@ -630,7 +817,7 @@ public class Chunk implements IChunkAccess { entity.entitySlice = null; entity.inChunk = false; } @@ -8538,7 +8617,7 @@ index 9c078d30afef20bd1ea5975299c5513334829b19..0d3fd9b9bebdecabb78f6e04aed18b6e return; } if (entity instanceof EntityItem) { -@@ -943,6 +1126,7 @@ public class Chunk implements IChunkAccess { +@@ -943,6 +1130,7 @@ public class Chunk implements IChunkAccess { } @@ -9323,7 +9402,7 @@ index 6acb5f05a05c542f8257e205ef70987be2d29194..12d9b73ccc2f4406957932397746cac7 } } finally { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d0571d6de7c6 100644 +index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..13553da7c37d2701854c8d824311dd7bc1a0a423 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -24,6 +24,14 @@ public class ChunkRegionLoader { @@ -9346,7 +9425,7 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 // Paper end + // Tuinity start - rewrite light engine -+ private static final int STARLIGHT_LIGHT_VERSION = 1; ++ private static final int STARLIGHT_LIGHT_VERSION = 2; + + private static final String UNINITIALISED_SKYLIGHT_TAG = "starlight.skylight_uninit"; + private static final String STARLIGHT_VERSION_TAG = "starlight.light_version"; @@ -9355,7 +9434,7 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 public static InProgressChunkHolder loadChunk(WorldServer worldserver, DefinedStructureManager definedstructuremanager, VillagePlace villageplace, ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound, boolean distinguish) { ArrayDeque tasksToExecuteOnMain = new ArrayDeque<>(); // Paper end -@@ -85,13 +100,15 @@ public class ChunkRegionLoader { +@@ -85,13 +100,17 @@ public class ChunkRegionLoader { ProtoChunkTickList protochunkticklist1 = new ProtoChunkTickList<>((fluidtype) -> { return fluidtype == null || fluidtype == FluidTypes.EMPTY; }, chunkcoordintpair, nbttagcompound1.getList("LiquidsToBeTicked", 9)); @@ -9367,24 +9446,26 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 boolean flag2 = worldserver.getDimensionManager().hasSkyLight(); ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); LightEngine lightengine = chunkproviderserver.getLightEngine(); -+ com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); // Tuinity - replace light impl -+ com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); // Tuinity - replace light impl ++ com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(worldserver); // Tuinity - replace light impl ++ com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(worldserver); // Tuinity - replace light impl ++ final int minSection = com.tuinity.tuinity.util.WorldUtil.getMinLightSection(worldserver); ++ final int maxSection = com.tuinity.tuinity.util.WorldUtil.getMaxLightSection(worldserver); if (flag) { tasksToExecuteOnMain.add(() -> { // Paper - delay this task since we're executing off-main -@@ -119,6 +136,7 @@ public class ChunkRegionLoader { +@@ -119,6 +138,7 @@ public class ChunkRegionLoader { if (flag) { if (nbttagcompound2.hasKeyOfType("BlockLight", 7)) { -+ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && canUseBlockLight) blockNibbles[b0 + 1] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(nbttagcompound2.getByteArray("BlockLight").clone()); // Tuinity - replace light impl ++ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && canUseBlockLight) blockNibbles[b0 - minSection] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(nbttagcompound2.getByteArray("BlockLight").clone()); // Tuinity - replace light impl // Paper start - delay this task since we're executing off-main NibbleArray blockLight = new NibbleArray(nbttagcompound2.getByteArray("BlockLight")); tasksToExecuteOnMain.add(() -> { -@@ -128,13 +146,14 @@ public class ChunkRegionLoader { +@@ -128,13 +148,14 @@ public class ChunkRegionLoader { } if (flag2 && nbttagcompound2.hasKeyOfType("SkyLight", 7)) { -+ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && canUseSkyLight) skyNibbles[b0 + 1] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(nbttagcompound2.getByteArray("SkyLight").clone()); // Tuinity - replace light impl ++ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && canUseSkyLight) skyNibbles[b0 - minSection] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(nbttagcompound2.getByteArray("SkyLight").clone()); // Tuinity - replace light impl // Paper start - delay this task since we're executing off-main NibbleArray skyLight = new NibbleArray(nbttagcompound2.getByteArray("SkyLight")); tasksToExecuteOnMain.add(() -> { @@ -9392,11 +9473,11 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 }); // Paper end - delay this task since we're executing off-main - } -+ } else if (flag2 && nbttagcompound2.getBoolean(UNINITIALISED_SKYLIGHT_TAG)) skyNibbles[b0 + 1] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(); // Tuinity - replace light impl ++ } else if (flag2 && nbttagcompound2.getBoolean(UNINITIALISED_SKYLIGHT_TAG)) skyNibbles[b0 - minSection] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(); // Tuinity - replace light impl } } -@@ -173,8 +192,12 @@ public class ChunkRegionLoader { +@@ -173,8 +194,12 @@ public class ChunkRegionLoader { object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, // Paper start - fix massive nbt memory leak due to lambda. move lambda into a container method to not leak scope. Only clone needed NBT keys. createLoadEntitiesConsumer(new SafeNBTCopy(nbttagcompound1, "TileEntities", "Entities", "ChunkBukkitValues")) // Paper - move CB Chunk PDC into here );// Paper end @@ -9409,14 +9490,20 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 protochunk.a(biomestorage); object = protochunk; -@@ -354,14 +377,14 @@ public class ChunkRegionLoader { +@@ -353,15 +378,20 @@ public class ChunkRegionLoader { + NibbleArray[] blockLight = new NibbleArray[17 - (-1)]; NibbleArray[] skyLight = new NibbleArray[17 - (-1)]; ++ // Tuinity start - rewrite light impl ++ final int minSection = com.tuinity.tuinity.util.WorldUtil.getMinLightSection(world); ++ final int maxSection = com.tuinity.tuinity.util.WorldUtil.getMaxLightSection(world); ++ // Tuinity end - rewrite light impl ++ for (int i = -1; i < 17; ++i) { - NibbleArray blockArray = lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkPos, i)); - NibbleArray skyArray = lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkPos, i)); -+ NibbleArray blockArray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasBlockLight ? null : (chunk.getBlockNibbles()[i + 1].isAllZero() ? new NibbleArray() : chunk.getBlockNibbles()[i + 1].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkPos, i)); // Tuinity - chunk might not be loaded -+ NibbleArray skyArray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasSkyLight ? null : (chunk.getSkyNibbles()[i + 1].isAllZero() ? new NibbleArray() : chunk.getSkyNibbles()[i + 1].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkPos, i)); // Tuinity - chunk might not be loaded ++ NibbleArray blockArray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasBlockLight ? null : (chunk.getBlockNibbles()[i - minSection].isAllZero() ? new NibbleArray() : chunk.getBlockNibbles()[i - minSection].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkPos, i)); // Tuinity - chunk might not be loaded ++ NibbleArray skyArray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasSkyLight ? null : (chunk.getSkyNibbles()[i - minSection].isAllZero() ? new NibbleArray() : chunk.getSkyNibbles()[i - minSection].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkPos, i)); // Tuinity - chunk might not be loaded // copy data for safety - if (blockArray != null) { @@ -9428,7 +9515,16 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 skyArray = skyArray.copy(); } -@@ -401,10 +424,10 @@ public class ChunkRegionLoader { +@@ -396,15 +426,19 @@ public class ChunkRegionLoader { + } + public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess, AsyncSaveData asyncsavedata) { + // Paper end ++ // Tuinity start - rewrite light impl ++ final int minSection = com.tuinity.tuinity.util.WorldUtil.getMinLightSection(worldserver); ++ final int maxSection = com.tuinity.tuinity.util.WorldUtil.getMaxLightSection(worldserver); ++ // Tuinity end - rewrite light impl + ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos(); + NBTTagCompound nbttagcompound = new NBTTagCompound(); NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion()); @@ -9441,18 +9537,18 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 nbttagcompound1.setLong("InhabitedTime", ichunkaccess.getInhabitedTime()); nbttagcompound1.setString("Status", ichunkaccess.getChunkStatus().d()); ChunkConverter chunkconverter = ichunkaccess.p(); -@@ -429,8 +452,8 @@ public class ChunkRegionLoader { +@@ -429,8 +463,8 @@ public class ChunkRegionLoader { NibbleArray nibblearray; // block light NibbleArray nibblearray1; // sky light if (asyncsavedata == null) { - nibblearray = lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i)); /// Paper - diff on method change (see getAsyncSaveData) - nibblearray1 = lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i)); // Paper - diff on method change (see getAsyncSaveData) -+ nibblearray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasBlockLight ? null : (ichunkaccess.getBlockNibbles()[i + 1].isAllZero() ? new NibbleArray() : ichunkaccess.getBlockNibbles()[i + 1].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i)); // Tuinity - chunk might not be loaded -+ nibblearray1 = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasSkyLight ? null : (ichunkaccess.getSkyNibbles()[i + 1].isAllZero() ? new NibbleArray() : ichunkaccess.getSkyNibbles()[i + 1].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i)); // Tuinity - chunk might not be loaded ++ nibblearray = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasBlockLight ? null : (ichunkaccess.getBlockNibbles()[i - minSection].isAllZero() ? new NibbleArray() : ichunkaccess.getBlockNibbles()[i - minSection].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i)); // Tuinity - chunk might not be loaded ++ nibblearray1 = com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? (!lightenginethreaded.hasSkyLight ? null : (ichunkaccess.getSkyNibbles()[i - minSection].isAllZero() ? new NibbleArray() : ichunkaccess.getSkyNibbles()[i - minSection].toVanillaNibble())) : lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i)); // Tuinity - chunk might not be loaded } else { nibblearray = asyncsavedata.blockLight[i + 1]; // +1 to offset the -1 starting index nibblearray1 = asyncsavedata.skyLight[i + 1]; // +1 to offset the -1 starting index -@@ -444,12 +467,12 @@ public class ChunkRegionLoader { +@@ -444,12 +478,12 @@ public class ChunkRegionLoader { } if (nibblearray != null && !nibblearray.c()) { @@ -9468,7 +9564,7 @@ index 8e7da2c5f3852920ec5fbcdd2bff4d299e6aa499..1f1f1a0cb84a07087025fd831441d057 nbttaglist.add(nbttagcompound2); } -@@ -457,7 +480,7 @@ public class ChunkRegionLoader { +@@ -457,7 +491,7 @@ public class ChunkRegionLoader { nbttagcompound1.set("Sections", nbttaglist); if (flag) { @@ -9521,15 +9617,15 @@ index f6c9bdbf52d773d7aa601125b887b347163f9328..51ea295d66312c95685b9fe4ee502a02 } diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 26b48b5ffa4ce3fbe50810dc1a8070d333a2684f..353b61aa57501fa76ce42dff5ba61bdb6a1e302e 100644 +index f0c9009fb808ca664a7c3ebaeb8cfa8e2ba7b97e..58f7e30da99afbfae39aedc2d708e144d4dfb128 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -52,6 +52,7 @@ public class DataBits { - return (int) ((long) i * j + k >> 32 >> this.i); + return (int) ((long) i * this.g_unsigned + this.h_unsigned >> 32 >> this.i); // Paper } + public final int getAndSet(final int index, final int value) { return this.a(index, value); } // Tuinity - OBFHELPER - public int a(int i, int j) { + public final int a(int i, int j) { // Paper - make final for inline //Validate.inclusiveBetween(0L, (long) (this.e - 1), (long) i); // Paper //Validate.inclusiveBetween(0L, this.d, (long) j); // Paper @@ -64,6 +65,7 @@ public class DataBits { @@ -9537,7 +9633,7 @@ index 26b48b5ffa4ce3fbe50810dc1a8070d333a2684f..353b61aa57501fa76ce42dff5ba61bdb } + public final void set(final int index, final int value) { this.b(index, value); } // Tuinity - OBFHELPER - public void b(int i, int j) { + public final void b(int i, int j) { // Paper - make final for inline //Validate.inclusiveBetween(0L, (long) (this.e - 1), (long) i); // Paper //Validate.inclusiveBetween(0L, this.d, (long) j); // Paper @@ -74,6 +76,7 @@ public class DataBits { @@ -9545,7 +9641,7 @@ index 26b48b5ffa4ce3fbe50810dc1a8070d333a2684f..353b61aa57501fa76ce42dff5ba61bdb } + public final int get(final int index) { return this.a(index); } // Tuinity - OBFHELPER - public int a(int i) { + public final int a(int i) { // Paper - make final for inline //Validate.inclusiveBetween(0L, (long) (this.e - 1), (long) i); // Paper int j = this.b(i); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -10099,7 +10195,7 @@ index c8cdce899b109a7f554fec7aaa8235df4224cd1d..1c396ec56f35d8764e3bf7b67a798439 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 7240b885d96eb2df187b6229449af1a893a4524e..72fcd7f259630cb3c194deb685a2c4498a7c7079 100644 +index 7240b885d96eb2df187b6229449af1a893a4524e..40f56858143651bb0addd0b74db7388ecbe56521 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -527,6 +527,185 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -10281,8 +10377,8 @@ index 7240b885d96eb2df187b6229449af1a893a4524e..72fcd7f259630cb3c194deb685a2c449 + + this.networkManager.enableAutomaticFlush(); + -+ System.out.println("Block: " + this.getBukkitEntity().getLocation().getBlock().getLightFromBlocks()); -+ System.out.println("Sky: " + this.getBukkitEntity().getLocation().getBlock().getLightFromSky()); ++ //System.out.println("Block: " + this.getBukkitEntity().getLocation().getBlock().getLightFromBlocks()); ++ //System.out.println("Sky: " + this.getBukkitEntity().getLocation().getBlock().getLightFromSky()); + */ // TODO remove debug + if (this.getHealth() != this.lastHealthSent || this.lastFoodSent != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastSentSaturationZero) { @@ -10413,10 +10509,10 @@ index c4a83448ed4513f6e4ab179d1d43e5bb0cb13641..5c3eb4fc7e5aec2ad8d0050673fc8f4d Vec3D vec3d1 = raytrace1.a(); VoxelShape voxelshape = raytrace1.a(iblockdata, this, blockposition); diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java -index 180b6b58dc5663158db84b6f1257591439b48c31..2e83dd9985204b41c1e6c829d76630df4434f32e 100644 +index 180b6b58dc5663158db84b6f1257591439b48c31..62a648a78481b4f3f35882c689e137e733f7f152 100644 --- a/src/main/java/net/minecraft/server/IChunkAccess.java +++ b/src/main/java/net/minecraft/server/IChunkAccess.java -@@ -24,6 +24,30 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -24,6 +24,28 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { } // Paper end @@ -10434,12 +10530,10 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..2e83dd9985204b41c1e6c829d76630df + default void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { + throw new UnsupportedOperationException(this.getClass().getName()); + } -+ // cx, cz are relative to the target chunk's map -+ public static int getEmptinessMapIndex(final int cx, final int cz) { -+ //return (cx + 1) + 3*(cz + 1); -+ return (1 + 3 * 1) + (cx) + 3*(cz); ++ public default boolean[] getEmptinessMap() { ++ throw new UnsupportedOperationException(this.getClass().getName()); + } -+ public default boolean[][] getEmptinessMap() { ++ public default void setEmptinessMap(final boolean[] emptinessMap) { + throw new UnsupportedOperationException(this.getClass().getName()); + } + // Tuinity end @@ -10447,7 +10541,7 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..2e83dd9985204b41c1e6c829d76630df IBlockData getType(final int x, final int y, final int z); // Paper @Nullable IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); -@@ -122,6 +146,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -122,6 +144,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { @Nullable NBTTagCompound j(BlockPosition blockposition); @@ -10455,7 +10549,7 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..2e83dd9985204b41c1e6c829d76630df Stream m(); TickList n(); -@@ -142,6 +167,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -142,6 +165,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { return ashortlist[i]; } @@ -10626,7 +10720,7 @@ index b98e60772bad7e06845b50fdc11e98c0ea775d3d..e0bbfe1422cbad811ecb43d7436380d8 while (objectiterator.hasNext()) { entry = (Entry) objectiterator.next(); diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java -index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e4340792312 100644 +index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..4d6663b3b4118f1b7f655c7b4a31d89a98e0d18f 100644 --- a/src/main/java/net/minecraft/server/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java @@ -2,6 +2,11 @@ package net.minecraft.server; @@ -10650,7 +10744,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 // Paper start private static final int MAX_PRIORITIES = PlayerChunkMap.GOLDEN_TICKET + 2; -@@ -156,13 +161,187 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -156,13 +161,218 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { private volatile int f = 5; private final AtomicBoolean g = new AtomicBoolean(); @@ -10678,18 +10772,49 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 + return world.getChunkProvider().getChunkAtImmediately(chunkX, chunkZ); + } + -+ public void relight(int chunkX, int chunkZ, Runnable whenComplete) { -+ this.scheduleLightWorkTask(chunkX, chunkZ, LightEngineThreaded.Update.POST_UPDATE, () -> { -+ this.theLightEngine.relightChunk(chunkX, chunkZ); -+ whenComplete.run(); -+ }); -+ } ++ protected long relightCounter; ++ ++ public int relight(java.util.Set chunks_param, ++ java.util.function.Consumer chunkLightCallback, ++ java.util.function.IntConsumer onComplete) { ++ if (!org.bukkit.Bukkit.isPrimaryThread()) { ++ throw new IllegalStateException("Must only be called on the main thread"); ++ } ++ ++ java.util.Set chunks = new java.util.LinkedHashSet<>(chunks_param); ++ // add tickets ++ java.util.Map ticketIds = new java.util.HashMap<>(); ++ int totalChunks = 0; ++ for (java.util.Iterator iterator = chunks.iterator(); iterator.hasNext();) { ++ final ChunkCoordIntPair chunkPos = iterator.next(); ++ ++ final IChunkAccess chunk = this.theLightEngine.getWorld().getChunkProvider().getChunkAtImmediately(chunkPos.x, chunkPos.z); ++ if (chunk == null || !chunk.isLit() || !chunk.getChunkStatus().isAtLeastStatus(ChunkStatus.LIGHT)) { ++ // cannot relight this chunk ++ iterator.remove(); ++ continue; ++ } ++ ++ final Long id = Long.valueOf(this.relightCounter++); ++ ++ this.theLightEngine.getWorld().getChunkProvider().addTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), id); ++ ticketIds.put(chunkPos, id); ++ ++ ++totalChunks; ++ } + -+ public void relight(java.util.Set chunks, -+ java.util.function.Consumer chunkLightCallback) { + this.getExecutor().queue(() -> { -+ this.theLightEngine.relightChunks(chunks, chunkLightCallback); ++ this.theLightEngine.relightChunks(chunks, (ChunkCoordIntPair chunkPos) -> { ++ chunkLightCallback.accept(chunkPos); ++ ((java.util.concurrent.Executor)this.theLightEngine.getWorld().getChunkProvider().serverThreadQueue).execute(() -> { ++ this.theLightEngine.getWorld().getChunkProvider().playerChunkMap.getUpdatingChunk(chunkPos.pair()).sendPacketToTrackedPlayers(new PacketPlayOutLightUpdate(chunkPos, this, true), false); ++ this.theLightEngine.getWorld().getChunkProvider().removeTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), ticketIds.get(chunkPos)); ++ }); ++ }, onComplete); + }); ++ this.queueUpdate(); ++ ++ return totalChunks; + } + + protected final Long2IntOpenHashMap holdingChunks = new Long2IntOpenHashMap(); @@ -10838,7 +10963,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 public void close() {} @Override -@@ -179,6 +358,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -179,6 +389,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { public void a(BlockPosition blockposition) { BlockPosition blockposition1 = blockposition.immutableCopy(); @@ -10854,7 +10979,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(blockposition.getX() >> 4, blockposition.getZ() >> 4, LightEngineThreaded.Update.POST_UPDATE, SystemUtils.a(() -> { super.a(blockposition1); }, () -> { -@@ -187,6 +375,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -187,6 +406,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } protected void a(ChunkCoordIntPair chunkcoordintpair) { @@ -10866,7 +10991,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -211,6 +404,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -211,6 +435,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(SectionPosition sectionposition, boolean flag) { @@ -10881,7 +11006,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(sectionposition.a(), sectionposition.c(), () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -222,6 +423,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -222,6 +454,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -10893,7 +11018,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(chunkcoordintpair.x, chunkcoordintpair.z, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { super.a(chunkcoordintpair, flag); }, () -> { -@@ -231,6 +437,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -231,6 +468,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition, @Nullable NibbleArray nibblearray, boolean flag) { @@ -10905,7 +11030,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(sectionposition.a(), sectionposition.c(), () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -240,6 +451,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -240,6 +482,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { })); } @@ -10913,7 +11038,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 private void a(int i, int j, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) { this.a(i, j, this.d.c(ChunkCoordIntPair.pair(i, j)), lightenginethreaded_update, runnable); } -@@ -252,6 +464,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -252,6 +495,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void b(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -10925,7 +11050,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -277,6 +494,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -277,6 +525,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { return; } // Paper end @@ -10933,7 +11058,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 ChunkSection[] achunksection = ichunkaccess.getSections(); for (int i = 0; i < 16; ++i) { -@@ -293,16 +511,25 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -293,16 +542,25 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { super.a(blockposition, ichunkaccess.g(blockposition)); }); } @@ -10961,7 +11086,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 // Paper start future.complete(ichunkaccess); }); -@@ -311,7 +538,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -311,7 +569,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } public void queueUpdate() { @@ -10970,7 +11095,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..8f9154942bb7f9f195abb8a218928e43 this.b.a((() -> { // Paper - decompile error this.b(); this.g.set(false); -@@ -325,17 +552,36 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -325,17 +583,36 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { private final java.util.List pre = new java.util.ArrayList<>(); private final java.util.List post = new java.util.ArrayList<>(); private void b() { @@ -11099,10 +11224,10 @@ index ff74be14512a947e81b62d53e616131ca7d7f609..e79e773f2219f9a9ae076fcbc8108b79 public static void mergeSortedSets(final java.util.function.Consumer consumer, final java.util.Comparator comparator, final java.util.SortedSet...sets) { final ObjectRBTreeSet all = new ObjectRBTreeSet<>(comparator); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 172fc9ef9c0d3444eb99f750a17d42f130d94f73..2bb4710868b4756c3446bb785c7dc1f00c9e4258 100644 +index a7cd98a7cd7fed95e37a178f732339e204650b10..34fa53eb1370682fff3dc342e33ffe7c48d1689f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -156,6 +156,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public boolean serverAutoSave = false; // Paper -@@ -754,10 +755,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -11266,7 +11391,7 @@ index 172fc9ef9c0d3444eb99f750a17d42f130d94f73..2bb4710868b4756c3446bb785c7dc1f0 return !this.canOversleep(); }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -@@ -1263,6 +1323,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -12072,7 +12197,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 private boolean h; // Paper start - Async-Anti-Xray - Set the ready flag to true -@@ -31,14 +31,16 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -31,7 +31,9 @@ public class PacketPlayOutMapChunk implements Packet { // Paper start private final java.util.List extraPackets = new java.util.ArrayList<>(); @@ -12083,15 +12208,16 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 @Override public java.util.List getExtraPackets() { - return extraPackets; - } +@@ -40,7 +42,7 @@ public class PacketPlayOutMapChunk implements Packet { // Paper end -- public PacketPlayOutMapChunk(Chunk chunk, int i) { -+ public PacketPlayOutMapChunk(Chunk chunk, int i) { final int chunkSectionBitSet = i; // Tuinity - handle oversized chunk data packets more robustly - ChunkPacketInfo chunkPacketInfo = chunk.world.chunkPacketBlockController.getChunkPacketInfo(this, chunk, i); // Paper - Anti-Xray - Add chunk packet info + // Paper start - Anti-Xray - Add chunk packet info + @Deprecated public PacketPlayOutMapChunk(Chunk chunk, int i) { this(chunk, i, true); } // Notice for updates: Please make sure this constructor isn't used anywhere +- public PacketPlayOutMapChunk(Chunk chunk, int i, boolean modifyBlocks) { ++ public PacketPlayOutMapChunk(Chunk chunk, int i, boolean modifyBlocks) { final int chunkSectionBitSet = i; // Tuinity - handle oversized chunk data packets more robustly + ChunkPacketInfo chunkPacketInfo = modifyBlocks ? chunk.world.chunkPacketBlockController.getChunkPacketInfo(this, chunk, i) : null; + // Paper end ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); - -@@ -46,27 +48,12 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -49,27 +51,12 @@ public class PacketPlayOutMapChunk implements Packet { this.b = chunkcoordintpair.z; this.h = i == 65535; this.d = new NBTTagCompound(); @@ -12125,7 +12251,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 // Paper end this.g = Lists.newArrayList(); iterator = chunk.getTileEntities().entrySet().iterator(); -@@ -79,8 +66,16 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -82,8 +69,16 @@ public class PacketPlayOutMapChunk implements Packet { int j = blockposition.getY() >> 4; if (this.f() || (i & 1 << j) != 0) { @@ -12143,7 +12269,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 PacketPlayOutTileEntityData updatePacket = tileentity.getUpdatePacket(); if (updatePacket != null) { this.extraPackets.add(updatePacket); -@@ -94,7 +89,42 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -97,7 +92,42 @@ public class PacketPlayOutMapChunk implements Packet { this.g.add(nbttagcompound); } } @@ -12178,7 +12304,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 + chunkSectionBitSetCopy ^= trailingBit; // move on to the next + + if (chunk.getSections()[sectionIndex] != null) { -+ this.extraPackets.add(new PacketPlayOutMapChunk(chunk, trailingBit)); ++ this.extraPackets.add(new PacketPlayOutMapChunk(chunk, trailingBit, modifyBlocks)); + } + } + } @@ -12186,7 +12312,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 } // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag -@@ -185,7 +215,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -188,7 +218,7 @@ public class PacketPlayOutMapChunk implements Packet { for (int l = achunksection.length; k < l; ++k) { ChunkSection chunksection = achunksection[k]; @@ -12195,7 +12321,7 @@ index 5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa..72fdbf1534b65284ac8020dcc15fe151 j |= 1 << k; chunksection.writeChunkSection(packetdataserializer, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info } -@@ -202,7 +232,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -205,7 +235,7 @@ public class PacketPlayOutMapChunk implements Packet { for (int l = achunksection.length; k < l; ++k) { ChunkSection chunksection = achunksection[k]; @@ -12496,7 +12622,7 @@ index 42b12ad5ba68bdf8f76704ddd970715770183de0..ac82f1791ce07e9a23cf97ca34974ab2 if (chunk != null) { playerchunkmap.callbackExecutor.execute(() -> { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6c399bcea03e839bf2f21e92b5d76d46b7088667..d3bf356ea768a32a5684eb851a2a0addcc67727b 100644 +index 49008cdec739b19409fdaf1b0ed806a6c0e93200..16779ffa00caf32752170700e1d88092802fa932 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -121,31 +121,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -12845,7 +12971,7 @@ index 6c399bcea03e839bf2f21e92b5d76d46b7088667..d3bf356ea768a32a5684eb851a2a0add } // Paper end - optimised tracker diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 73241af66256ef386790027fd6c7e0ca984524b4..37e9b8983fc310a04c98e27048b119439179cb5f 100644 +index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -419,7 +419,9 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -13078,17 +13204,17 @@ index 485b609bb5387b0f8a46c1201177cdc6d183ad91..614cfacb1e8ac5d68f0ce931933fac5d this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); // CraftBukkit - SPIGOT-5196 } diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 5b0cd414ca1949ab53b289f7159f18da07d21f14..42cae66f39571950929525eab592ea3feaadd587 100644 +index 5b0cd414ca1949ab53b289f7159f18da07d21f14..71c7fca4ea925fee8790c5a4042ad26584a8ceb3 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java -@@ -48,6 +48,37 @@ public class ProtoChunk implements IChunkAccess { +@@ -48,6 +48,42 @@ public class ProtoChunk implements IChunkAccess { private volatile boolean u; final World world; // Paper - Anti-Xray - Add world // Paper - private -> default + // Tuinity start - rewrite light engine + private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); + private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile boolean[][] emptinessMap = new boolean[9][]; ++ private volatile boolean[] emptinessMap; + + @Override + public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { @@ -13111,15 +13237,20 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..42cae66f39571950929525eab592ea3f + } + + @Override -+ public boolean[][] getEmptinessMap() { ++ public boolean[] getEmptinessMap() { + return this.emptinessMap; + } ++ ++ @Override ++ public void setEmptinessMap(final boolean[] emptinessMap) { ++ this.emptinessMap = emptinessMap; ++ } + // Tuinity end - rewrite light engine + // Paper start - Anti-Xray - Add world @Deprecated public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) { this(chunkcoordintpair, chunkconverter, null); } // Notice for updates: Please make sure this constructor isn't used anywhere public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, World world) { -@@ -173,20 +204,17 @@ public class ProtoChunk implements IChunkAccess { +@@ -173,20 +209,17 @@ public class ProtoChunk implements IChunkAccess { ChunkSection chunksection = this.a(j >> 4); IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata); @@ -13144,7 +13275,7 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..42cae66f39571950929525eab592ea3f HeightMap heightmap = (HeightMap) this.f.get(heightmap_type); if (heightmap == null) { -@@ -202,10 +230,9 @@ public class ProtoChunk implements IChunkAccess { +@@ -202,10 +235,9 @@ public class ProtoChunk implements IChunkAccess { HeightMap.a(this, enumset1); } @@ -13159,10 +13290,10 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..42cae66f39571950929525eab592ea3f } diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..5bc577683c73c50dc96d704b9c24ec821a9e7b4f 100644 +index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..0e528df0d9d77f39af1b5c62a29ef31e6ac3b614 100644 --- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java +++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -@@ -8,7 +8,34 @@ import javax.annotation.Nullable; +@@ -8,7 +8,39 @@ import javax.annotation.Nullable; public class ProtoChunkExtension extends ProtoChunk { @@ -13191,9 +13322,14 @@ index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..5bc577683c73c50dc96d704b9c24ec82 + } + + @Override -+ public boolean[][] getEmptinessMap() { ++ public boolean[] getEmptinessMap() { + return this.getWrappedChunk().getEmptinessMap(); + } ++ ++ @Override ++ public void setEmptinessMap(final boolean[] emptinessMap) { ++ this.getWrappedChunk().setEmptinessMap(emptinessMap); ++ } + // Tuinity end - rewrite light engine public ProtoChunkExtension(Chunk chunk) { @@ -15166,7 +15302,7 @@ index 5d9d58411f2fad9d5da703f964d269b4a7c2b205..f0fdfd6891e59891e7370a2d682b65c6 private double c; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb1afc3090 100644 +index 277c051f814d25dd7c57cdba268ea044873c88d5..4a17c1b8092968247ee9fa0ce2b5bd44baf2b18f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -94,6 +94,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -15250,7 +15386,7 @@ index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb IBlockData iblockdata = newBlock; IBlockData iblockdata1 = oldBlock; IBlockData iblockdata2 = actualBlock; -@@ -893,6 +935,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -895,6 +937,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return; // Paper end } @@ -15258,7 +15394,7 @@ index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb } // Paper start - Prevent armor stands from doing entity lookups @Override -@@ -1076,10 +1119,44 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1078,10 +1121,44 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return this.getChunkAt(i, j, ChunkStatus.FULL, false); } @@ -15304,7 +15440,7 @@ index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D); int j = MathHelper.floor((axisalignedbb.maxX + 2.0D) / 16.0D); int k = MathHelper.floor((axisalignedbb.minZ - 2.0D) / 16.0D); -@@ -1135,7 +1212,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1137,7 +1214,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper if (chunk != null) { @@ -15313,7 +15449,7 @@ index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb } } } -@@ -1158,7 +1235,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1160,7 +1237,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper if (chunk != null) { @@ -15322,7 +15458,7 @@ index 9ed21f434c5fb019b74dfe9ee0b802ccc5c07fd8..59abca0fd2330e1cdeda603d4146e4bb } } } -@@ -1166,6 +1243,106 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1168,6 +1245,106 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return list; } @@ -16407,7 +16543,7 @@ index dc7de2b59ec5ca3e5fba34dbb2aa2e6aed8f95cb..a383ba5e897101a3da1544c877148b43 public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b71316cce3bdbf3485be456f0260c6b3463cff8e..a69b38f293723a58691b2777d170f9cc146d1148 100644 +index 0314cb1270803265dc4bf4268697b09aabf2c612..8904b39db2203118fe3589133cb7e64334c20f33 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -341,6 +341,14 @@ public class CraftWorld implements World { @@ -16480,7 +16616,7 @@ index b71316cce3bdbf3485be456f0260c6b3463cff8e..a69b38f293723a58691b2777d170f9cc @Override public boolean isChunkForceLoaded(int x, int z) { return getHandle().getForceLoadedChunks().contains(ChunkCoordIntPair.pair(x, z)); -@@ -2553,7 +2579,7 @@ public class CraftWorld implements World { +@@ -2562,7 +2588,7 @@ public class CraftWorld implements World { } return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> { net.minecraft.server.Chunk chunk = (net.minecraft.server.Chunk) either.left().orElse(null); diff --git a/patches/server/0002-Rebrand.patch b/patches/server/0002-Rebrand.patch index a9c6b207e..1c46b14f3 100644 --- a/patches/server/0002-Rebrand.patch +++ b/patches/server/0002-Rebrand.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand diff --git a/pom.xml b/pom.xml -index 78c2a8bbcc0132f891c8aa545529d20aa0d9eb57..422bed88a0860f768e162a38a1c16265451f5990 100644 +index 174c0b67c1c5b41d80613128ebf2d78ee27f3cee..aafe4d0962d641866bb0f82728719c102c56fcc1 100644 --- a/pom.xml +++ b/pom.xml @@ -26,8 +26,10 @@ @@ -48,10 +48,10 @@ index 229c3b0f0c650b501f31147adaa17194af57fedd..f88cf526d272fe47b5a474c0b344b748 throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2bb4710868b4756c3446bb785c7dc1f00c9e4258..a8a90679687d680bb26b4fa7c1044f614585c867 100644 +index 34fa53eb1370682fff3dc342e33ffe7c48d1689f..1f2bcafbe5444fe0900dea6a493bac2ccc6b8b50 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1512,7 +1512,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index bc156a5edefe117ad45638d434fe4946fb50159d..041016de85360adacf4a5d0845bb1ebcc25a14b9 100644 +index 673c40d952bae6ae9e92aac9742e58ffb6a8b1bb..ce14283dd1a1fddbea17c2fbaf1c4ef9d7a7479f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -118,6 +118,11 @@ public class PaperConfig { @@ -78,7 +78,7 @@ index 9b35c8ad9efe9241fe442bc6ef2e9f62def386d8..2c4c13b30b4533f5476f1128317d477a if (this.bF) { this.bF = false; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 59abca0fd2330e1cdeda603d4146e4bb1afc3090..ca4d260e8faf852b0986c4cd8645e5135afe6156 100644 +index 4a17c1b8092968247ee9fa0ce2b5bd44baf2b18f..68dec17bbf64a60c774ab26abc326b953889aa8c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -95,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/patches/server/0009-AFK-API.patch b/patches/server/0009-AFK-API.patch index 4cd50ebac..152febe09 100644 --- a/patches/server/0009-AFK-API.patch +++ b/patches/server/0009-AFK-API.patch @@ -25,7 +25,7 @@ index 3ef463e1313b9729c86437f499930ab4cd332a6d..7880c329942ff96acd1d9c713c548410 super(EntityTypes.PLAYER, world); this.bL = ItemStack.b; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 72fcd7f259630cb3c194deb685a2c4498a7c7079..76d42805a4616da11c06b492590a9d52e979a4b7 100644 +index 40f56858143651bb0addd0b74db7388ecbe56521..82b975dd483b55461df0e110add5546a7815c650 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1904,8 +1904,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -149,7 +149,7 @@ index b5e1a860a2569d7668330827614d221b60f3fc78..5f85a1d513f4fdc21b64e1a2b6882e33 // Paper start public static final Predicate affectsSpawning = (entity) -> { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 37e9b8983fc310a04c98e27048b119439179cb5f..d42dbc3b44f8b54b05f356155727f5a8f6a3e98e 100644 +index 5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc..d1d4f4baf33e6b2224116f22a63b6d218e26635b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -250,6 +250,12 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0011-Configurable-server-mod-name.patch b/patches/server/0011-Configurable-server-mod-name.patch index 502c7db72..caf0f73b1 100644 --- a/patches/server/0011-Configurable-server-mod-name.patch +++ b/patches/server/0011-Configurable-server-mod-name.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable server mod name diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a8a90679687d680bb26b4fa7c1044f614585c867..5e0f06a254d62acd491ba56371f3391423eb64fd 100644 +index 1f2bcafbe5444fe0900dea6a493bac2ccc6b8b50..0945e9cf8a37868beb9ea13e7b889aae827b4662 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1512,7 +1512,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper diff --git a/patches/server/0018-Player-invulnerabilities.patch b/patches/server/0018-Player-invulnerabilities.patch index 485e462b5..d1191efa3 100644 --- a/patches/server/0018-Player-invulnerabilities.patch +++ b/patches/server/0018-Player-invulnerabilities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player invulnerabilities diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 76d42805a4616da11c06b492590a9d52e979a4b7..77603a4819c02d73d4b058a8a3d822ae6a4cb505 100644 +index 82b975dd483b55461df0e110add5546a7815c650..6f8bc857141b7e9a3444b81cddd13228f8cbb9a5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -150,6 +150,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -67,7 +67,7 @@ index 76d42805a4616da11c06b492590a9d52e979a4b7..77603a4819c02d73d4b058a8a3d822ae public Scoreboard getScoreboard() { return getBukkitEntity().getScoreboard().getHandle(); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d42dbc3b44f8b54b05f356155727f5a8f6a3e98e..cd562571ac6738fad39f585c1c046ee8e8c90f78 100644 +index d1d4f4baf33e6b2224116f22a63b6d218e26635b..07fcf1646a46b867ffb0e88746b4a781ef55729b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1666,6 +1666,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0021-Alternative-Keepalive-Handling.patch b/patches/server/0021-Alternative-Keepalive-Handling.patch index 4b2cdfa4b..02ab0875a 100644 --- a/patches/server/0021-Alternative-Keepalive-Handling.patch +++ b/patches/server/0021-Alternative-Keepalive-Handling.patch @@ -17,7 +17,7 @@ index 8e93f1540ba5f995489c1fbcec70d10b011cd9c3..470f92c4fb0919d052b19acff8dff533 return this.a; } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index cd562571ac6738fad39f585c1c046ee8e8c90f78..a8908a46260e90c6366eb100688f15d831be1b4f 100644 +index 07fcf1646a46b867ffb0e88746b4a781ef55729b..d74986818af4fbefdd60f865d2225d61008df7d1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -84,6 +84,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0048-Signs-allow-color-codes.patch b/patches/server/0048-Signs-allow-color-codes.patch index d446a964f..d6570d683 100644 --- a/patches/server/0048-Signs-allow-color-codes.patch +++ b/patches/server/0048-Signs-allow-color-codes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Signs allow color codes diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 77603a4819c02d73d4b058a8a3d822ae6a4cb505..da693a31f26973467b4494e79996c3f0d8a3a758 100644 +index 6f8bc857141b7e9a3444b81cddd13228f8cbb9a5..26c508258f1638fcf7d11ba87816cdf4771e9fc6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1429,6 +1429,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -17,7 +17,7 @@ index 77603a4819c02d73d4b058a8a3d822ae6a4cb505..da693a31f26973467b4494e79996c3f0 this.playerConnection.sendPacket(new PacketPlayOutOpenSignEditor(tileentitysign.getPosition())); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a8908a46260e90c6366eb100688f15d831be1b4f..9679c53c9252502dab3e69eaf5c2be0c22943959 100644 +index d74986818af4fbefdd60f865d2225d61008df7d1..1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2837,6 +2837,14 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0050-Controllable-Minecarts.patch b/patches/server/0050-Controllable-Minecarts.patch index 9ddbf951c..c6f794a2e 100644 --- a/patches/server/0050-Controllable-Minecarts.patch +++ b/patches/server/0050-Controllable-Minecarts.patch @@ -106,7 +106,7 @@ index efe5c0cecaf12ef921f6d32ff6670eff051bf323..a814cf280d1ce0d446d24da8e596f13e this.move(EnumMoveType.SELF, this.getMot()); if (!this.onGround) { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index da693a31f26973467b4494e79996c3f0d8a3a758..5bee05e6e8b52d1edea81a0d76ec9cfdb5acf704 100644 +index 26c508258f1638fcf7d11ba87816cdf4771e9fc6..452675eb071513609665ec214ddb0b01874c3a09 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1004,6 +1004,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0052-Players-should-not-cram-to-death.patch b/patches/server/0052-Players-should-not-cram-to-death.patch index bbd5e7fe6..1c099a234 100644 --- a/patches/server/0052-Players-should-not-cram-to-death.patch +++ b/patches/server/0052-Players-should-not-cram-to-death.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Players should not cram to death diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 5bee05e6e8b52d1edea81a0d76ec9cfdb5acf704..36be65f9a36ea1b35ffa882eec295e1f46021f0c 100644 +index 452675eb071513609665ec214ddb0b01874c3a09..a86e29ff086a4fe8aa4e8395ba420c0aff8f0be0 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1406,7 +1406,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0059-Configurable-TPS-Catchup.patch b/patches/server/0059-Configurable-TPS-Catchup.patch index 2fa067393..a30de7bef 100644 --- a/patches/server/0059-Configurable-TPS-Catchup.patch +++ b/patches/server/0059-Configurable-TPS-Catchup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable TPS Catchup diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fe3b76e4ed11f0183731a0dcc39a323ccee3fd2e..2d01bc9c5f95e7bd950a8c9137d1a1ab74a6cb72 100644 +index de72f058b6de539ff75858120d6d023eaae22275..1c97728959709930d280d0522ef6331fb5cb3429 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1003,7 +1003,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> 4 != chunk.getPos().x || (int) Math.floor(entity.locZ()) >> 4 != chunk.getPos().z) { -@@ -653,10 +663,20 @@ public class ChunkRegionLoader { +@@ -664,10 +674,20 @@ public class ChunkRegionLoader { NBTTagList nbttaglist = nbttagcompound.getList("Entities", 10); World world = chunk.getWorld(); diff --git a/patches/server/0071-Add-canSaveToDisk-to-Entity.patch b/patches/server/0071-Add-canSaveToDisk-to-Entity.patch index 8ddff2126..2c9d863fd 100644 --- a/patches/server/0071-Add-canSaveToDisk-to-Entity.patch +++ b/patches/server/0071-Add-canSaveToDisk-to-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add canSaveToDisk to Entity diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 423da11d4910bbe12625ec5a16edfd6e80cd3dea..77f31dc1e45b438ece691617deb17d7a5fbbc94b 100644 +index 66058a6365fe4da8980b09904142ed44e42c5aac..cda8847829a3a92869f0f12d74f54daa97c5e2a1 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -525,6 +525,7 @@ public class ChunkRegionLoader { +@@ -536,6 +536,7 @@ public class ChunkRegionLoader { while (iterator1.hasNext()) { Entity entity = (Entity) iterator1.next(); diff --git a/patches/server/0074-Add-option-for-boats-to-eject-players-on-land.patch b/patches/server/0074-Add-option-for-boats-to-eject-players-on-land.patch index e30dea450..9124bf04e 100644 --- a/patches/server/0074-Add-option-for-boats-to-eject-players-on-land.patch +++ b/patches/server/0074-Add-option-for-boats-to-eject-players-on-land.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option for boats to eject players on land diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java -index fdfdf83c28c3065fa89fba9e44b3da99f9791e0e..d53bbe31694c2d88939332691cdf145c46099e22 100644 +index da84cf98022b771bdf0c9d0b284aa7d4d59318e0..4f95976f9a852fa89cedd1fe81d2077fe5d118ee 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java -@@ -440,6 +440,7 @@ public class EntityBoat extends Entity { +@@ -441,6 +441,7 @@ public class EntityBoat extends Entity { if (f > 0.0F) { this.aw = f; diff --git a/patches/server/0078-Add-5-second-tps-average-in-tps.patch b/patches/server/0077-Add-5-second-tps-average-in-tps.patch similarity index 94% rename from patches/server/0078-Add-5-second-tps-average-in-tps.patch rename to patches/server/0077-Add-5-second-tps-average-in-tps.patch index 8c485bb8e..ed1c942d1 100644 --- a/patches/server/0078-Add-5-second-tps-average-in-tps.patch +++ b/patches/server/0077-Add-5-second-tps-average-in-tps.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add 5 second tps average in /tps diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2d01bc9c5f95e7bd950a8c9137d1a1ab74a6cb72..dd1e083289b875f1b87ae2aa6179c7babaf79ad5 100644 +index 1c97728959709930d280d0522ef6331fb5cb3429..11e76719df539d39b1ecd8303a8d54319b00f182 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -167,7 +167,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Fri, 23 Aug 2019 20:57:29 -0500 -Subject: [PATCH] Implement bamboo growth settings - - -diff --git a/src/main/java/net/minecraft/server/BlockBamboo.java b/src/main/java/net/minecraft/server/BlockBamboo.java -index f208ab50985d71996c65fcf31615052b967acc93..ce56edb7c8543f3f685301ebf62d9836ccf4197c 100644 ---- a/src/main/java/net/minecraft/server/BlockBamboo.java -+++ b/src/main/java/net/minecraft/server/BlockBamboo.java -@@ -99,7 +99,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - if (random.nextInt(Math.max(1, (int) (100.0F / worldserver.spigotConfig.bambooModifier) * 3)) == 0 && worldserver.isEmpty(blockposition.up()) && worldserver.getLightLevel(blockposition.up(), 0) >= 9) { // Spigot - int i = this.b(worldserver, blockposition) + 1; - -- if (i < 16) { -+ if (i < worldserver.purpurConfig.bambooMaxHeight) { // Purpur - this.a(iblockdata, (World) worldserver, blockposition, random, i); - } - } -@@ -130,7 +130,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - int i = this.a(iblockaccess, blockposition); - int j = this.b(iblockaccess, blockposition); - -- return i + j + 1 < 16 && (Integer) iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1; -+ return i + j + 1 < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.up(i)).get(BlockBamboo.f) != 1; // Purpur - } - - @Override -@@ -149,7 +149,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - BlockPosition blockposition1 = blockposition.up(i); - IBlockData iblockdata1 = worldserver.getType(blockposition1); - -- if (k >= 16 || (Integer) iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { -+ if (k >= worldserver.purpurConfig.bambooMaxHeight || iblockdata1.get(BlockBamboo.f) == 1 || !worldserver.isEmpty(blockposition1.up())) { // Purpur - return; - } - -@@ -190,7 +190,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - } - - int j = (Integer) iblockdata.get(BlockBamboo.d) != 1 && !iblockdata2.a(Blocks.BAMBOO) ? 0 : 1; -- int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1; -+ int k = (i < world.purpurConfig.bambooSmallHeight || random.nextFloat() >= 0.25F) && i != (world.purpurConfig.bambooMaxHeight - 1) ? 0 : 1; // Purpur - - // CraftBukkit start - if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(world, blockposition, blockposition.up(), (IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockBamboo.d, j)).set(BlockBamboo.e, blockpropertybamboosize)).set(BlockBamboo.f, k), 3)) { -@@ -205,7 +205,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - protected int a(IBlockAccess iblockaccess, BlockPosition blockposition) { - int i; - -- for (i = 0; i < 16 && iblockaccess.getType(blockposition.up(i + 1)).a(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.up(i + 1)).a(Blocks.BAMBOO); ++i) { // Purpur - ; - } - -@@ -215,7 +215,7 @@ public class BlockBamboo extends Block implements IBlockFragilePlantElement { - protected int b(IBlockAccess iblockaccess, BlockPosition blockposition) { - int i; - -- for (i = 0; i < 16 && iblockaccess.getType(blockposition.down(i + 1)).a(Blocks.BAMBOO); ++i) { -+ for (i = 0; i < ((World) iblockaccess).purpurConfig.bambooMaxHeight && iblockaccess.getType(blockposition.down(i + 1)).a(Blocks.BAMBOO); ++i) { // Purpur - ; - } - -diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index d61a96f0d9fc92780da0c698ffb4b903878a4198..b4358f89f9673170819c8995cd982952a3b915f3 100644 ---- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -166,6 +166,13 @@ public class PurpurWorldConfig { - }); - } - -+ public int bambooMaxHeight = 16; -+ public int bambooSmallHeight = 10; -+ private void bambooSettings() { -+ bambooMaxHeight = getInt("blocks.bamboo.max-height", bambooMaxHeight); -+ bambooSmallHeight = getInt("blocks.bamboo.small-height", bambooSmallHeight); -+ } -+ - public boolean dispenserApplyCursedArmor = true; - private void dispenserSettings() { - dispenserApplyCursedArmor = getBoolean("blocks.dispenser.apply-cursed-to-armor-slots", dispenserApplyCursedArmor); diff --git a/patches/server/0079-Implement-elytra-settings.patch b/patches/server/0078-Implement-elytra-settings.patch similarity index 98% rename from patches/server/0079-Implement-elytra-settings.patch rename to patches/server/0078-Implement-elytra-settings.patch index 13c86e2f5..64ddd3046 100644 --- a/patches/server/0079-Implement-elytra-settings.patch +++ b/patches/server/0078-Implement-elytra-settings.patch @@ -93,7 +93,7 @@ index 3663b701736b583db80e3119b642e47b8a0e6ff3..18f767dc574e7345d2db73e6be44f4e6 entityhuman.r(20); if (entityhuman.isOnGround()) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index b4358f89f9673170819c8995cd982952a3b915f3..db6607acc7540bbadfdf7684ac8f10baedd3ccf7 100644 +index d61a96f0d9fc92780da0c698ffb4b903878a4198..886c3b98d6bff04a93cd963a092654ef1c9729d1 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -129,6 +129,19 @@ public class PurpurWorldConfig { diff --git a/patches/server/0080-Item-entity-immunities.patch b/patches/server/0079-Item-entity-immunities.patch similarity index 98% rename from patches/server/0080-Item-entity-immunities.patch rename to patches/server/0079-Item-entity-immunities.patch index ae1ad753c..b8d9bdbe3 100644 --- a/patches/server/0080-Item-entity-immunities.patch +++ b/patches/server/0079-Item-entity-immunities.patch @@ -88,7 +88,7 @@ index 228236bce14bfdf930570b453862dcfaae9e4823..ad06bd81eded5d60f16c2d0ad1a4390f int i; int j; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index db6607acc7540bbadfdf7684ac8f10baedd3ccf7..66425f79a51587e21f83e11acb74f79a042c7850 100644 +index 886c3b98d6bff04a93cd963a092654ef1c9729d1..793c43299e71526cca01dba3badf06dca52333c6 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -101,6 +101,21 @@ public class PurpurWorldConfig { diff --git a/patches/server/0081-Add-ping-command.patch b/patches/server/0080-Add-ping-command.patch similarity index 100% rename from patches/server/0081-Add-ping-command.patch rename to patches/server/0080-Add-ping-command.patch diff --git a/patches/server/0082-Configurable-jockey-options.patch b/patches/server/0081-Configurable-jockey-options.patch similarity index 95% rename from patches/server/0082-Configurable-jockey-options.patch rename to patches/server/0081-Configurable-jockey-options.patch index f0937f101..65522901b 100644 --- a/patches/server/0082-Configurable-jockey-options.patch +++ b/patches/server/0081-Configurable-jockey-options.patch @@ -61,7 +61,7 @@ index 65bae8c9f28c23b0b5dd5d048e7fc7daf328075c..32b75f710b12efbcecec2c8d72d4d8cb public void setAngerTarget(@Nullable UUID uuid) { this.br = uuid; diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index e3606722cb1b3f6a11d34e1cdef7210280dba677..b90ea31440fe49124bd2fb003884768ce8a1e528 100644 +index 62d202ff871cf3f3deea69931fbee84131bdda8b..a43f44bcf97b30d1cea2fb5d93e6949e41ab86fd 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -93,7 +93,7 @@ index e3606722cb1b3f6a11d34e1cdef7210280dba677..b90ea31440fe49124bd2fb003884768c @Override protected void initPathfinder() { if (world.paperConfig.zombiesTargetTurtleEggs) this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Paper -@@ -439,19 +454,19 @@ public class EntityZombie extends EntityMonster { +@@ -441,19 +456,19 @@ public class EntityZombie extends EntityMonster { if (object instanceof EntityZombie.GroupDataZombie) { EntityZombie.GroupDataZombie entityzombie_groupdatazombie = (EntityZombie.GroupDataZombie) object; @@ -119,7 +119,7 @@ index e3606722cb1b3f6a11d34e1cdef7210280dba677..b90ea31440fe49124bd2fb003884768c EntityChicken entitychicken1 = (EntityChicken) EntityTypes.CHICKEN.a(this.world); entitychicken1.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F); -@@ -459,6 +474,7 @@ public class EntityZombie extends EntityMonster { +@@ -461,6 +476,7 @@ public class EntityZombie extends EntityMonster { entitychicken1.setChickenJockey(true); this.startRiding(entitychicken1); worldaccess.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit @@ -127,7 +127,7 @@ index e3606722cb1b3f6a11d34e1cdef7210280dba677..b90ea31440fe49124bd2fb003884768c } } } -@@ -561,7 +577,7 @@ public class EntityZombie extends EntityMonster { +@@ -563,7 +579,7 @@ public class EntityZombie extends EntityMonster { public static class GroupDataZombie implements GroupDataEntity { @@ -193,10 +193,10 @@ index e021c43b43839c00f81a01bfbec59c546d61ba50..505c83f3e3ad61c2d4d40c4df017e1f7 protected void initDatawatcher() { super.initDatawatcher(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 66425f79a51587e21f83e11acb74f79a042c7850..14e05b7a7cc5e89f08d166399c0f2bd2259e09a9 100644 +index 793c43299e71526cca01dba3badf06dca52333c6..b3deaaea159546509fc7cff2d843455461520dfa 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -264,6 +264,15 @@ public class PurpurWorldConfig { +@@ -257,6 +257,15 @@ public class PurpurWorldConfig { creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance); } @@ -212,7 +212,7 @@ index 66425f79a51587e21f83e11acb74f79a042c7850..14e05b7a7cc5e89f08d166399c0f2bd2 public boolean enderDragonAlwaysDropsEggBlock = false; public boolean enderDragonAlwaysDropsFullExp = false; private void enderDragonSettings() { -@@ -303,6 +312,15 @@ public class PurpurWorldConfig { +@@ -296,6 +305,15 @@ public class PurpurWorldConfig { giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth); } @@ -228,7 +228,7 @@ index 66425f79a51587e21f83e11acb74f79a042c7850..14e05b7a7cc5e89f08d166399c0f2bd2 public double illusionerMovementSpeed = 0.5D; public double illusionerFollowRange = 18.0D; public double illusionerMaxHealth = 32.0D; -@@ -378,8 +396,35 @@ public class PurpurWorldConfig { +@@ -371,8 +389,35 @@ public class PurpurWorldConfig { witherSkeletonTakesWitherDamage = getBoolean("mobs.wither_skeleton.takes-wither-damage", witherSkeletonTakesWitherDamage); } diff --git a/patches/server/0083-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch b/patches/server/0082-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch similarity index 99% rename from patches/server/0083-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch rename to patches/server/0082-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch index d1f873443..d9eb6c7a0 100644 --- a/patches/server/0083-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch +++ b/patches/server/0082-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch @@ -321,10 +321,10 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 14e05b7a7cc5e89f08d166399c0f2bd2259e09a9..dbeea1ecec72c84ba9648ea8c373d3e66dd220d6 100644 +index b3deaaea159546509fc7cff2d843455461520dfa..74aee0687cb8aa7e4b7efbf34d6374a516d873c0 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -340,6 +340,15 @@ public class PurpurWorldConfig { +@@ -333,6 +333,15 @@ public class PurpurWorldConfig { ironGolemCanSwim = getBoolean("mobs.iron_golem.can-swim", ironGolemCanSwim); } diff --git a/patches/server/0084-Add-phantom-spawning-options.patch b/patches/server/0083-Add-phantom-spawning-options.patch similarity index 98% rename from patches/server/0084-Add-phantom-spawning-options.patch rename to patches/server/0083-Add-phantom-spawning-options.patch index c83c5f631..4554e06ed 100644 --- a/patches/server/0084-Add-phantom-spawning-options.patch +++ b/patches/server/0083-Add-phantom-spawning-options.patch @@ -233,10 +233,10 @@ index 661ad8f8e67046211e001ea40d97660d7c88f8e5..ee91c33a7a2edca02caf5c71fd6429f9 return iblockdata.r(iblockaccess, blockposition) ? false : (iblockdata.isPowerSource() ? false : (!fluid.isEmpty() ? false : (iblockdata.a((Tag) TagsBlock.PREVENT_MOB_SPAWNING_INSIDE) ? false : !entitytypes.a(iblockdata)))); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ca4d260e8faf852b0986c4cd8645e5135afe6156..a8571dae8daefb557a8e3ee39c80ebc3b1b5aad9 100644 +index 68dec17bbf64a60c774ab26abc326b953889aa8c..f91d9a19b3d9870c99a03c86eb835b8ec68cc133 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1564,6 +1564,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1566,6 +1566,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return new DifficultyDamageScaler(this.getDifficulty(), this.getDayTime(), i, f); } @@ -245,10 +245,10 @@ index ca4d260e8faf852b0986c4cd8645e5135afe6156..a8571dae8daefb557a8e3ee39c80ebc3 public int c() { return this.d; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index dbeea1ecec72c84ba9648ea8c373d3e66dd220d6..813ce4cecbcf360d8c966cd183771a7cc3cd8571 100644 +index 74aee0687cb8aa7e4b7efbf34d6374a516d873c0..f60bc17cf25211bf0c9007307c54821aecc7bb96 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -343,10 +343,34 @@ public class PurpurWorldConfig { +@@ -336,10 +336,34 @@ public class PurpurWorldConfig { public double phantomAttackedByCrystalRadius = 0.0D; public float phantomAttackedByCrystalDamage = 1.0F; public double phantomOrbitCrystalRadius = 0.0D; diff --git a/patches/server/0085-Implement-bed-explosion-options.patch b/patches/server/0084-Implement-bed-explosion-options.patch similarity index 93% rename from patches/server/0085-Implement-bed-explosion-options.patch rename to patches/server/0084-Implement-bed-explosion-options.patch index d1bd11818..37a869a59 100644 --- a/patches/server/0085-Implement-bed-explosion-options.patch +++ b/patches/server/0084-Implement-bed-explosion-options.patch @@ -18,7 +18,7 @@ index 24a5c64b65f0098b1395d352cc2f99bbbbaf9c94..738535d01adf8bfd895b5057e5950422 } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 813ce4cecbcf360d8c966cd183771a7cc3cd8571..7b47c40236cdde6c939e51de67e71a35117b8260 100644 +index f60bc17cf25211bf0c9007307c54821aecc7bb96..3b8d35ef70703f47f554cbbe6637924103595f6f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -2,6 +2,7 @@ package net.pl3x.purpur; @@ -37,8 +37,8 @@ index 813ce4cecbcf360d8c966cd183771a7cc3cd8571..7b47c40236cdde6c939e51de67e71a35 import static net.pl3x.purpur.PurpurConfig.log; -@@ -201,6 +203,22 @@ public class PurpurWorldConfig { - bambooSmallHeight = getInt("blocks.bamboo.small-height", bambooSmallHeight); +@@ -194,6 +196,22 @@ public class PurpurWorldConfig { + }); } + public boolean bedExplode = true; diff --git a/patches/server/0086-Implement-respawn-anchor-explosion-options.patch b/patches/server/0085-Implement-respawn-anchor-explosion-options.patch similarity index 96% rename from patches/server/0086-Implement-respawn-anchor-explosion-options.patch rename to patches/server/0085-Implement-respawn-anchor-explosion-options.patch index 0c0cf39bd..b165e0480 100644 --- a/patches/server/0086-Implement-respawn-anchor-explosion-options.patch +++ b/patches/server/0085-Implement-respawn-anchor-explosion-options.patch @@ -30,10 +30,10 @@ index 21c5ad83a95bcd23071423c0e8336656b760fcde..521d161a3d015b641b61de21401c79ac public static boolean a(World world) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 7b47c40236cdde6c939e51de67e71a35117b8260..91d7d123be1f5ffa12710bab56788b330dc3ba37 100644 +index 3b8d35ef70703f47f554cbbe6637924103595f6f..6a8b0cb12c9465e5047a4b5e4c2ee667c9a6c12f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -240,6 +240,22 @@ public class PurpurWorldConfig { +@@ -233,6 +233,22 @@ public class PurpurWorldConfig { lavaSpeedNotNether = getInt("blocks.lava.speed.not-nether", lavaSpeedNotNether); } diff --git a/patches/server/0087-Add-allow-water-in-end-world-option.patch b/patches/server/0086-Add-allow-water-in-end-world-option.patch similarity index 97% rename from patches/server/0087-Add-allow-water-in-end-world-option.patch rename to patches/server/0086-Add-allow-water-in-end-world-option.patch index a63367cb5..22a8458fa 100644 --- a/patches/server/0087-Add-allow-water-in-end-world-option.patch +++ b/patches/server/0086-Add-allow-water-in-end-world-option.patch @@ -49,10 +49,10 @@ index 120bf8436fd82294c339add2e7bff1cda8311aea..848a185c04aa90a62e6bcc49ad68a748 return true; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a8571dae8daefb557a8e3ee39c80ebc3b1b5aad9..7a82a894bb3f737cc80f0b4b8d7a1b25ce1afc6c 100644 +index f91d9a19b3d9870c99a03c86eb835b8ec68cc133..70870b0af64ff9cac7a211cce7cc6ab2497a62ea 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1639,4 +1639,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1641,4 +1641,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final boolean isDebugWorld() { return this.debugWorld; } diff --git a/patches/server/0088-Allow-color-codes-in-books.patch b/patches/server/0087-Allow-color-codes-in-books.patch similarity index 96% rename from patches/server/0088-Allow-color-codes-in-books.patch rename to patches/server/0087-Allow-color-codes-in-books.patch index eeabf40bc..597841017 100644 --- a/patches/server/0088-Allow-color-codes-in-books.patch +++ b/patches/server/0087-Allow-color-codes-in-books.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow color codes in books diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9679c53c9252502dab3e69eaf5c2be0c22943959..781998b444a0687eab7593c2438ea060539e9f2b 100644 +index 1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11..9b05adc3a834ce1f063c3b00505faed5e4ff66ba 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1018,7 +1018,8 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0089-Entity-lifespan.patch b/patches/server/0088-Entity-lifespan.patch similarity index 96% rename from patches/server/0089-Entity-lifespan.patch rename to patches/server/0088-Entity-lifespan.patch index 6697368f4..221c8ef44 100644 --- a/patches/server/0089-Entity-lifespan.patch +++ b/patches/server/0088-Entity-lifespan.patch @@ -92,7 +92,7 @@ index 1edc13647e0897541e9009e02e1510307e5f3a8f..60797203c0b2c8c3a7caaebe635d8f19 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 781998b444a0687eab7593c2438ea060539e9f2b..0ff4e1b7ba891a2c740136a962098c9c68410ab9 100644 +index 9b05adc3a834ce1f063c3b00505faed5e4ff66ba..5db09c913d7a0c6feef4e3fa22b22235238721cb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2229,6 +2229,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -104,7 +104,7 @@ index 781998b444a0687eab7593c2438ea060539e9f2b..0ff4e1b7ba891a2c740136a962098c9c event = new PlayerInteractEntityEvent((Player) this.getPlayer(), entity.getBukkitEntity(), (packetplayinuseentity.c() == EnumHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND); } else { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 91d7d123be1f5ffa12710bab56788b330dc3ba37..2f326f88257f5a45deee872865211d15fc67fac6 100644 +index 6a8b0cb12c9465e5047a4b5e4c2ee667c9a6c12f..681400a7010444019440ffaa98de1a50e2662485 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -103,6 +103,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0090-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch b/patches/server/0089-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch similarity index 94% rename from patches/server/0090-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch rename to patches/server/0089-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch index 28ae8cb8f..ecf932f68 100644 --- a/patches/server/0090-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch +++ b/patches/server/0089-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch @@ -17,7 +17,7 @@ index be5f2147e9cded85620a57a90c7d800262fc3d6e..699afb9759083b42fd0608a3417fd3d1 } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 36be65f9a36ea1b35ffa882eec295e1f46021f0c..40d2494114348ea256883cb4e8ebd3e02b040b14 100644 +index a86e29ff086a4fe8aa4e8395ba420c0aff8f0be0..4134d9a1e649c70164a28df615bb43e81e7a64d6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -2389,4 +2389,26 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -48,7 +48,7 @@ index 36be65f9a36ea1b35ffa882eec295e1f46021f0c..40d2494114348ea256883cb4e8ebd3e0 + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2f326f88257f5a45deee872865211d15fc67fac6..73027d6eed7b93fa8b9f580235259a262d50b96d 100644 +index 681400a7010444019440ffaa98de1a50e2662485..4c878b65a271b0a014408034b0137b8d98f118ca 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -178,6 +178,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0091-Squid-EAR-immunity.patch b/patches/server/0090-Squid-EAR-immunity.patch similarity index 91% rename from patches/server/0091-Squid-EAR-immunity.patch rename to patches/server/0090-Squid-EAR-immunity.patch index 32790244f..6ae442621 100644 --- a/patches/server/0091-Squid-EAR-immunity.patch +++ b/patches/server/0090-Squid-EAR-immunity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Squid EAR immunity diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 73027d6eed7b93fa8b9f580235259a262d50b96d..de2d072b24ca5f77f118a405add7ee62a2aacc8d 100644 +index 4c878b65a271b0a014408034b0137b8d98f118ca..c66aa809024cc351d68693c899f7741516555f4e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -444,6 +444,11 @@ public class PurpurWorldConfig { +@@ -437,6 +437,11 @@ public class PurpurWorldConfig { snowGolemPutPumpkinBack = getBoolean("mobs.snow_golem.pumpkin-can-be-added-back", snowGolemPutPumpkinBack); } diff --git a/patches/server/0092-Configurable-end-spike-seed.patch b/patches/server/0091-Configurable-end-spike-seed.patch similarity index 100% rename from patches/server/0092-Configurable-end-spike-seed.patch rename to patches/server/0091-Configurable-end-spike-seed.patch diff --git a/patches/server/0093-Configurable-dungeon-seed.patch b/patches/server/0092-Configurable-dungeon-seed.patch similarity index 100% rename from patches/server/0093-Configurable-dungeon-seed.patch rename to patches/server/0092-Configurable-dungeon-seed.patch diff --git a/patches/server/0094-Phantoms-burn-in-light.patch b/patches/server/0093-Phantoms-burn-in-light.patch similarity index 97% rename from patches/server/0094-Phantoms-burn-in-light.patch rename to patches/server/0093-Phantoms-burn-in-light.patch index ae095cea8..4c0309d01 100644 --- a/patches/server/0094-Phantoms-burn-in-light.patch +++ b/patches/server/0093-Phantoms-burn-in-light.patch @@ -70,10 +70,10 @@ index 4c379916d8d7797038d2980761c49f44c010dea8..ea6b61c9b88f33d29f7266d7614c8037 public static final Item dr = a(Blocks.JACK_O_LANTERN, CreativeModeTab.b); public static final Item ds = a(Blocks.OAK_TRAPDOOR, CreativeModeTab.d); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index de2d072b24ca5f77f118a405add7ee62a2aacc8d..a3568dfbe10c01a5e6c6497e22069b0cd5a89571 100644 +index c66aa809024cc351d68693c899f7741516555f4e..3ce43e93f07cf728c9b0cf6f717d9ec7342bcb9e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -399,6 +399,9 @@ public class PurpurWorldConfig { +@@ -392,6 +392,9 @@ public class PurpurWorldConfig { public int phantomSpawnOverheadRadius = 10; public int phantomSpawnMinPerAttempt = 1; public int phantomSpawnMaxPerAttempt = -1; @@ -83,7 +83,7 @@ index de2d072b24ca5f77f118a405add7ee62a2aacc8d..a3568dfbe10c01a5e6c6497e22069b0c private void phantomSettings() { phantomAttackedByCrystalRadius = getDouble("mobs.phantom.attacked-by-crystal-range", phantomAttackedByCrystalRadius); phantomAttackedByCrystalDamage = (float) getDouble("mobs.phantom.attacked-by-crystal-damage", phantomAttackedByCrystalDamage); -@@ -415,6 +418,9 @@ public class PurpurWorldConfig { +@@ -408,6 +411,9 @@ public class PurpurWorldConfig { phantomSpawnOverheadRadius = getInt("mobs.phantom.spawn.overhead.radius", phantomSpawnOverheadRadius); phantomSpawnMinPerAttempt = getInt("mobs.phantom.spawn.per-attempt.min", phantomSpawnMinPerAttempt); phantomSpawnMaxPerAttempt = getInt("mobs.phantom.spawn.per-attempt.max", phantomSpawnMaxPerAttempt); diff --git a/patches/server/0095-Configurable-villager-breeding.patch b/patches/server/0094-Configurable-villager-breeding.patch similarity index 91% rename from patches/server/0095-Configurable-villager-breeding.patch rename to patches/server/0094-Configurable-villager-breeding.patch index 4a9bb0599..8d0972194 100644 --- a/patches/server/0095-Configurable-villager-breeding.patch +++ b/patches/server/0094-Configurable-villager-breeding.patch @@ -18,10 +18,10 @@ index 894089d665e97da31c04c82aaae344b22f83de89..5d37cb14f9cb7e3a1491a3dbcf212926 private boolean fr() { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a3568dfbe10c01a5e6c6497e22069b0cd5a89571..22a79a530a92f334a29bed0fe8186077fd57f723 100644 +index 3ce43e93f07cf728c9b0cf6f717d9ec7342bcb9e..bf56ba540159525634309cfdf40842c0ebdaa517 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -462,6 +462,7 @@ public class PurpurWorldConfig { +@@ -455,6 +455,7 @@ public class PurpurWorldConfig { public boolean villagerFollowEmeraldBlock = false; public int villagerSpawnIronGolemRadius = 0; public int villagerSpawnIronGolemLimit = 0; @@ -29,7 +29,7 @@ index a3568dfbe10c01a5e6c6497e22069b0cd5a89571..22a79a530a92f334a29bed0fe8186077 private void villagerSettings() { villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks); villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging); -@@ -470,6 +471,7 @@ public class PurpurWorldConfig { +@@ -463,6 +464,7 @@ public class PurpurWorldConfig { villagerFollowEmeraldBlock = getBoolean("mobs.villager.follow-emerald-blocks", villagerFollowEmeraldBlock); villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius); villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit); diff --git a/patches/server/0096-Redstone-deactivates-spawners.patch b/patches/server/0095-Redstone-deactivates-spawners.patch similarity index 93% rename from patches/server/0096-Redstone-deactivates-spawners.patch rename to patches/server/0095-Redstone-deactivates-spawners.patch index e72581965..be44d1c8c 100644 --- a/patches/server/0096-Redstone-deactivates-spawners.patch +++ b/patches/server/0095-Redstone-deactivates-spawners.patch @@ -26,10 +26,10 @@ index c2e830db7aa2944a477624e149a3ba66d112b68a..3b4cc9871c123cfd134783745145c407 public abstract BlockPosition b(); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 22a79a530a92f334a29bed0fe8186077fd57f723..ec84ec5297e2f16daa0d343fd3cbac6a4604c13a 100644 +index bf56ba540159525634309cfdf40842c0ebdaa517..be2ea6897e74440307561a81dd8ad4f74dd71a60 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -273,6 +273,11 @@ public class PurpurWorldConfig { +@@ -266,6 +266,11 @@ public class PurpurWorldConfig { signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit); } diff --git a/patches/server/0097-Totems-work-in-inventory.patch b/patches/server/0096-Totems-work-in-inventory.patch similarity index 96% rename from patches/server/0097-Totems-work-in-inventory.patch rename to patches/server/0096-Totems-work-in-inventory.patch index 85f51f1f3..d84c9d03c 100644 --- a/patches/server/0097-Totems-work-in-inventory.patch +++ b/patches/server/0096-Totems-work-in-inventory.patch @@ -29,7 +29,7 @@ index 699afb9759083b42fd0608a3417fd3d17ce8f560..f1e1db97d611192ff2d4b635ef81cf59 event.setCancelled(itemstack == null); this.world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ec84ec5297e2f16daa0d343fd3cbac6a4604c13a..48c8cbf95be6bea2ceec48fe33d4219eab65bc0c 100644 +index be2ea6897e74440307561a81dd8ad4f74dd71a60..9a9d56db381af4d99ebd0bfff54ce5ac04e2d768 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -183,6 +183,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0098-Fix-death-message-colors.patch b/patches/server/0097-Fix-death-message-colors.patch similarity index 95% rename from patches/server/0098-Fix-death-message-colors.patch rename to patches/server/0097-Fix-death-message-colors.patch index 8259c8129..9443c99f9 100644 --- a/patches/server/0098-Fix-death-message-colors.patch +++ b/patches/server/0097-Fix-death-message-colors.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix death message colors diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 40d2494114348ea256883cb4e8ebd3e02b040b14..d8cb09e809e382c48071d8abc3d952ca4ef64c9b 100644 +index 4134d9a1e649c70164a28df615bb43e81e7a64d6..5696bd0ce51acb45b57d84106e9b00bc041f548b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -852,7 +852,24 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0099-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch b/patches/server/0098-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch similarity index 97% rename from patches/server/0099-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch rename to patches/server/0098-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch index f25346bbc..34ca888b2 100644 --- a/patches/server/0099-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch +++ b/patches/server/0098-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Duplicate paper's vanilla scoreboard colors patch to sync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0ff4e1b7ba891a2c740136a962098c9c68410ab9..8bcf0b7dd90087c86f0b4a81b31f4942c5653dbc 100644 +index 5db09c913d7a0c6feef4e3fa22b22235238721cb..e2f97fa2b350c56c7086d89b4f66d07f3668e479 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1988,7 +1988,15 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/patches/server/0100-Populator-seed-controls.patch b/patches/server/0099-Populator-seed-controls.patch similarity index 100% rename from patches/server/0100-Populator-seed-controls.patch rename to patches/server/0099-Populator-seed-controls.patch diff --git a/patches/server/0101-Add-vindicator-johnny-spawn-chance.patch b/patches/server/0100-Add-vindicator-johnny-spawn-chance.patch similarity index 95% rename from patches/server/0101-Add-vindicator-johnny-spawn-chance.patch rename to patches/server/0100-Add-vindicator-johnny-spawn-chance.patch index fd0f10f51..7272bc663 100644 --- a/patches/server/0101-Add-vindicator-johnny-spawn-chance.patch +++ b/patches/server/0100-Add-vindicator-johnny-spawn-chance.patch @@ -22,7 +22,7 @@ index c0d26aa9dcd02c44d744b10e18609857ada95889..8f812aa9133e29d1450ab210fec68b23 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 48c8cbf95be6bea2ceec48fe33d4219eab65bc0c..a26529e932d442c9c9f4ca6a7eff5e3c5f842190 100644 +index 9a9d56db381af4d99ebd0bfff54ce5ac04e2d768..affab8e21b8643e9965959561d4f125f75b845b9 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -40,6 +40,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0102-DragonEggPlaceEvent.patch b/patches/server/0101-DragonEggPlaceEvent.patch similarity index 100% rename from patches/server/0102-DragonEggPlaceEvent.patch rename to patches/server/0101-DragonEggPlaceEvent.patch diff --git a/patches/server/0103-Add-option-to-disable-mushroom-block-updates.patch b/patches/server/0102-Add-option-to-disable-mushroom-block-updates.patch similarity index 100% rename from patches/server/0103-Add-option-to-disable-mushroom-block-updates.patch rename to patches/server/0102-Add-option-to-disable-mushroom-block-updates.patch diff --git a/patches/server/0104-Dispensers-place-anvils-option.patch b/patches/server/0103-Dispensers-place-anvils-option.patch similarity index 96% rename from patches/server/0104-Dispensers-place-anvils-option.patch rename to patches/server/0103-Dispensers-place-anvils-option.patch index 5468dab06..f656cc3f0 100644 --- a/patches/server/0104-Dispensers-place-anvils-option.patch +++ b/patches/server/0103-Dispensers-place-anvils-option.patch @@ -61,10 +61,10 @@ index 7b8a470d97ccf0fdcdb8eef9368195486e09913b..d1f9d2884d055efbe72b01f86b0bdaf1 static void a(ISourceBlock isourceblock, Entity entity, EnumDirection enumdirection) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a26529e932d442c9c9f4ca6a7eff5e3c5f842190..73969ac4480594b5c78cdb2c30fa4d49370a6a6d 100644 +index affab8e21b8643e9965959561d4f125f75b845b9..73b96f608f4e388081f4d7372a0abaed537bf006 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -240,8 +240,10 @@ public class PurpurWorldConfig { +@@ -233,8 +233,10 @@ public class PurpurWorldConfig { } public boolean dispenserApplyCursedArmor = true; diff --git a/patches/server/0105-Allow-anvil-colors.patch b/patches/server/0104-Allow-anvil-colors.patch similarity index 92% rename from patches/server/0105-Allow-anvil-colors.patch rename to patches/server/0104-Allow-anvil-colors.patch index 3c5e6fb6c..486a92cfb 100644 --- a/patches/server/0105-Allow-anvil-colors.patch +++ b/patches/server/0104-Allow-anvil-colors.patch @@ -35,7 +35,7 @@ index 4aa6b035a6a8ea39401c6566cd286de39f60e942..5e4e59e5c8478b76078fdda14e5ced76 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 73969ac4480594b5c78cdb2c30fa4d49370a6a6d..876a51801f6acdbc062de743106c5a63ed94b13c 100644 +index 73b96f608f4e388081f4d7372a0abaed537bf006..40be126a94a56d2b8a6e8101bff9c74aae563c7d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -216,6 +216,11 @@ public class PurpurWorldConfig { @@ -47,6 +47,6 @@ index 73969ac4480594b5c78cdb2c30fa4d49370a6a6d..876a51801f6acdbc062de743106c5a63 + anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors); + } + - public int bambooMaxHeight = 16; - public int bambooSmallHeight = 10; - private void bambooSettings() { + public boolean bedExplode = true; + public double bedExplosionPower = 5.0D; + public boolean bedExplosionFire = true; diff --git a/patches/server/0106-Add-no-tick-block-list.patch b/patches/server/0105-Add-no-tick-block-list.patch similarity index 97% rename from patches/server/0106-Add-no-tick-block-list.patch rename to patches/server/0105-Add-no-tick-block-list.patch index 49786f07f..b4c3a3bed 100644 --- a/patches/server/0106-Add-no-tick-block-list.patch +++ b/patches/server/0105-Add-no-tick-block-list.patch @@ -43,7 +43,7 @@ index 5db25b05565be541f07993092ba8e67c32d7cb18..44942f73c98e28821ee9d899733f44f4 this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> { return fluidtype == null || fluidtype == FluidTypes.EMPTY; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 876a51801f6acdbc062de743106c5a63ed94b13c..4b96afcbf503d91c8dc7551dd8dfe445ffc5712b 100644 +index 40be126a94a56d2b8a6e8101bff9c74aae563c7d..a9fc19ea44e2a46c1f116632e208c57e54077ad8 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -11,8 +11,10 @@ import org.bukkit.configuration.ConfigurationSection; diff --git a/patches/server/0107-Add-option-to-disable-dolphin-treasure-searching.patch b/patches/server/0106-Add-option-to-disable-dolphin-treasure-searching.patch similarity index 92% rename from patches/server/0107-Add-option-to-disable-dolphin-treasure-searching.patch rename to patches/server/0106-Add-option-to-disable-dolphin-treasure-searching.patch index 4a4c91227..e5117b82e 100644 --- a/patches/server/0107-Add-option-to-disable-dolphin-treasure-searching.patch +++ b/patches/server/0106-Add-option-to-disable-dolphin-treasure-searching.patch @@ -17,10 +17,10 @@ index 2916ee89ef7a14619703dfbe7efd5c78a2f34337..664f9693368852bfb06a7a3bd0862a10 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 4b96afcbf503d91c8dc7551dd8dfe445ffc5712b..9c7dec1b4ed0651a318f7234b8f075a923e78484 100644 +index a9fc19ea44e2a46c1f116632e208c57e54077ad8..b17b839af84c475a2141af5168ff5dd2de3c3c5d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -342,6 +342,11 @@ public class PurpurWorldConfig { +@@ -335,6 +335,11 @@ public class PurpurWorldConfig { creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance); } diff --git a/patches/server/0108-Short-enderman-height.patch b/patches/server/0107-Short-enderman-height.patch similarity index 100% rename from patches/server/0108-Short-enderman-height.patch rename to patches/server/0107-Short-enderman-height.patch diff --git a/patches/server/0109-Stop-squids-floating-on-top-of-water.patch b/patches/server/0108-Stop-squids-floating-on-top-of-water.patch similarity index 94% rename from patches/server/0109-Stop-squids-floating-on-top-of-water.patch rename to patches/server/0108-Stop-squids-floating-on-top-of-water.patch index 4bc0373c7..7dc4edfb0 100644 --- a/patches/server/0109-Stop-squids-floating-on-top-of-water.patch +++ b/patches/server/0108-Stop-squids-floating-on-top-of-water.patch @@ -43,10 +43,10 @@ index b21605a62365fe24f315f35bd840b4740fc80f0e..148e4b158734f136832e5c17bdc69634 protected void initPathfinder() { this.goalSelector.a(0, new EntitySquid.PathfinderGoalSquid(this)); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9c7dec1b4ed0651a318f7234b8f075a923e78484..5cc717c8d3829a1503fd53ae06f433a6e8f14894 100644 +index b17b839af84c475a2141af5168ff5dd2de3c3c5d..3502db47aa65fb2be8e83ce64b4eb8914cf17554 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -490,8 +490,10 @@ public class PurpurWorldConfig { +@@ -483,8 +483,10 @@ public class PurpurWorldConfig { } public boolean squidImmuneToEAR = true; diff --git a/patches/server/0110-Ridables.patch b/patches/server/0109-Ridables.patch similarity index 99% rename from patches/server/0110-Ridables.patch rename to patches/server/0109-Ridables.patch index bf8b18990..0ef24f010 100644 --- a/patches/server/0110-Ridables.patch +++ b/patches/server/0109-Ridables.patch @@ -3211,7 +3211,7 @@ index a3a428da99574c485fcf2b8c7944e0d8354146ee..cf7de0127166f6175a6246062c8664e6 this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d8cb09e809e382c48071d8abc3d952ca4ef64c9b..beb0a4b91a8abd0374ae40771009832ddf8978f7 100644 +index 5696bd0ce51acb45b57d84106e9b00bc041f548b..3c748cca91e5f83701e6ae83f76e7548dad35420 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -508,6 +508,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -3708,7 +3708,7 @@ index 7c39bec8314a3db63a90ccc9f040b82d754705e2..3f130e03bf8b235360385fd169d4886f protected SoundEffect getSoundAmbient() { return SoundEffects.ENTITY_SKELETON_AMBIENT; diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index ced89af70ca791bfe42c4e2d21604997a0cf3e0f..4d5af11734eef45821a106873b58061ea6aa7db7 100644 +index f73304240a626f3f7d9355e6e5f2963a06c4bb7d..ee4c26de15a5c304889f38f49f4584e8d4ccc5fe 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -28,12 +28,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR @@ -3773,7 +3773,7 @@ index c872be77a6cd767520d5412b38ec4ed4fa87ac2f..96cb080d940db22330598a8806726088 protected void initPathfinder() { this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityPiglinAbstract.class, true)); diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index e99fd88118a75f36cb93d02aa7c6029bcffd5f10..46026362981ce8a3a9e7d63e16230b5425a5d388 100644 +index 8a1ff579ddf2fef191bc370dc51dd2e6404d9a22..3c14ed27e5b487451846f6811f189e6fba05d32d 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -34,12 +34,45 @@ public class EntitySlime extends EntityInsentient implements IMonster { @@ -3822,7 +3822,7 @@ index e99fd88118a75f36cb93d02aa7c6029bcffd5f10..46026362981ce8a3a9e7d63e16230b54 this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> { return Math.abs(entityliving.locY() - this.locY()) <= 4.0D; })); -@@ -324,11 +357,12 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -325,11 +358,12 @@ public class EntitySlime extends EntityInsentient implements IMonster { } @Override @@ -3836,7 +3836,7 @@ index e99fd88118a75f36cb93d02aa7c6029bcffd5f10..46026362981ce8a3a9e7d63e16230b54 } @Nullable -@@ -497,10 +531,10 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -498,10 +532,10 @@ public class EntitySlime extends EntityInsentient implements IMonster { // Paper end } @@ -3849,7 +3849,7 @@ index e99fd88118a75f36cb93d02aa7c6029bcffd5f10..46026362981ce8a3a9e7d63e16230b54 private final EntitySlime k; private boolean l; -@@ -522,15 +556,27 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -523,15 +557,27 @@ public class EntitySlime extends EntityInsentient implements IMonster { @Override public void a() { @@ -3879,7 +3879,7 @@ index e99fd88118a75f36cb93d02aa7c6029bcffd5f10..46026362981ce8a3a9e7d63e16230b54 if (this.j-- <= 0) { this.j = this.k.eJ(); if (this.l) { -@@ -547,7 +593,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -548,7 +594,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.a.q(0.0F); } } else { @@ -4798,7 +4798,7 @@ index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b this.eL(); } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index b90ea31440fe49124bd2fb003884768ce8a1e528..e2f68d843c8eff2c6bcb7d2535af771a51be150e 100644 +index a43f44bcf97b30d1cea2fb5d93e6949e41ab86fd..ba9b20863c12a1ba5a55013a74a34bc2fbc37273 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -46,6 +46,16 @@ public class EntityZombie extends EntityMonster { @@ -4915,10 +4915,10 @@ index 9f5ce64a60fe7c312399ee416b11b84213dd3bee..b9f8ed355421f24306e0cc2bb976589f Entity entity1 = this.getShooter(); // Paper start - Cancel hit for vanished players diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index dd1e083289b875f1b87ae2aa6179c7babaf79ad5..2374a7ee018493795389b21848289395168db422 100644 +index 11e76719df539d39b1ecd8303a8d54319b00f182..22e84d2e08ad436c553dc7d99046adf9ee63e9f1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1411,6 +1411,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper worldserver.hasEntityMoveEvent = net.pl3x.purpur.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur @@ -4973,7 +4973,7 @@ index 0000000000000000000000000000000000000000..44929182dfd7ad847d9657c324f440cb + } +} diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8bcf0b7dd90087c86f0b4a81b31f4942c5653dbc..3b32303b9e8c9c96938758c02ed72e3fea73a638 100644 +index e2f97fa2b350c56c7086d89b4f66d07f3668e479..398f883b2e646dc8e90753270d1dece833a80739 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2246,6 +2246,8 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -5026,10 +5026,10 @@ index 5af554870bcf36e47aef43b966b141b9eda6c4d5..c59305ef7dd7847e204d4c4ed79758bf return new Vec3D(this.x * d0, this.y * d1, this.z * d2); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7a82a894bb3f737cc80f0b4b8d7a1b25ce1afc6c..bdfdb73bc1305d3fbda2e0ebe8163bf43b8aede5 100644 +index 70870b0af64ff9cac7a211cce7cc6ab2497a62ea..b91f3efb61575869d54d630263bb6a4c6499153e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1648,5 +1648,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1650,5 +1650,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean isTheEnd() { return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END; } @@ -5071,7 +5071,7 @@ index 7854fa516fcb6c00838955c2aa20d73b9181aa90..a0d1a45c4dac6e4519231aa3d02939ee public static int dungeonSeed = -1; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f277be43e 100644 +index 3502db47aa65fb2be8e83ce64b4eb8914cf17554..7ca7888d5e69c860f21ba51054ca1504e82bf216 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -42,11 +42,6 @@ public class PurpurWorldConfig { @@ -5086,7 +5086,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f private ConfigurationSection getConfigurationSection(String path) { ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path); return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path); -@@ -316,63 +311,188 @@ public class PurpurWorldConfig { +@@ -309,63 +304,188 @@ public class PurpurWorldConfig { turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts); } @@ -5275,7 +5275,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f public float giantStepHeight = 2.0F; public float giantJumpHeight = 1.0F; public double giantMovementSpeed = 0.5D; -@@ -381,6 +501,8 @@ public class PurpurWorldConfig { +@@ -374,6 +494,8 @@ public class PurpurWorldConfig { public boolean giantHaveHostileAI = false; public double giantMaxHealth = 100.0D; private void giantSettings() { @@ -5284,7 +5284,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight); giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight); giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed); -@@ -395,19 +517,44 @@ public class PurpurWorldConfig { +@@ -388,19 +510,44 @@ public class PurpurWorldConfig { giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth); } @@ -5329,7 +5329,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed); illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange); if (PurpurConfig.version < 8) { -@@ -418,11 +565,76 @@ public class PurpurWorldConfig { +@@ -411,11 +558,76 @@ public class PurpurWorldConfig { illusionerMaxHealth = getDouble("mobs.illusioner.attributes.max-health", illusionerMaxHealth); } @@ -5406,7 +5406,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f public double phantomAttackedByCrystalRadius = 0.0D; public float phantomAttackedByCrystalDamage = 1.0F; public double phantomOrbitCrystalRadius = 0.0D; -@@ -442,6 +654,11 @@ public class PurpurWorldConfig { +@@ -435,6 +647,11 @@ public class PurpurWorldConfig { public boolean phantomIgnorePlayersWithTorch = false; public boolean phantomBurnInDaylight = true; private void phantomSettings() { @@ -5418,7 +5418,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f phantomAttackedByCrystalRadius = getDouble("mobs.phantom.attacked-by-crystal-range", phantomAttackedByCrystalRadius); phantomAttackedByCrystalDamage = (float) getDouble("mobs.phantom.attacked-by-crystal-damage", phantomAttackedByCrystalDamage); phantomOrbitCrystalRadius = getDouble("mobs.phantom.orbit-crystal-radius", phantomOrbitCrystalRadius); -@@ -462,40 +679,184 @@ public class PurpurWorldConfig { +@@ -455,40 +672,184 @@ public class PurpurWorldConfig { phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch); } @@ -5603,7 +5603,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f public int villagerBrainTicks = 1; public boolean villagerUseBrainTicksOnlyWhenLagging = true; public boolean villagerCanBeLeashed = false; -@@ -505,6 +866,8 @@ public class PurpurWorldConfig { +@@ -498,6 +859,8 @@ public class PurpurWorldConfig { public int villagerSpawnIronGolemLimit = 0; public boolean villagerCanBreed = true; private void villagerSettings() { @@ -5612,7 +5612,7 @@ index 5cc717c8d3829a1503fd53ae06f433a6e8f14894..a222cd43afb5668c71e88f001e89da0f villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks); villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging); villagerCanBeLeashed = getBoolean("mobs.villager.can-be-leashed", villagerCanBeLeashed); -@@ -515,45 +878,108 @@ public class PurpurWorldConfig { +@@ -508,45 +871,108 @@ public class PurpurWorldConfig { villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed); } @@ -6383,10 +6383,10 @@ index a6d849facba1526ae2a2b7f3fb9a140d0b50289c..b56ca054b37f5887e13b481baad8132f + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3f678fde45919061dfc75030b7ce355b4dda9e3a..182e3258cdce99139c229e99cfbc54f23b7dfa77 100644 +index 4534d22aec95cf247daf7575472acd0eba91a3c9..3edc530ec688047ae037303442a16e8c5e2e72d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -506,6 +506,18 @@ public class CraftEventFactory { +@@ -498,6 +498,18 @@ public class CraftEventFactory { } craftServer.getPluginManager().callEvent(event); @@ -6405,7 +6405,7 @@ index 3f678fde45919061dfc75030b7ce355b4dda9e3a..182e3258cdce99139c229e99cfbc54f2 return event; } -@@ -906,6 +918,7 @@ public class CraftEventFactory { +@@ -898,6 +910,7 @@ public class CraftEventFactory { damageCause = DamageCause.ENTITY_EXPLOSION; } event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions); @@ -6413,7 +6413,7 @@ index 3f678fde45919061dfc75030b7ce355b4dda9e3a..182e3258cdce99139c229e99cfbc54f2 } event.setCancelled(cancelled); -@@ -990,6 +1003,7 @@ public class CraftEventFactory { +@@ -982,6 +995,7 @@ public class CraftEventFactory { if (!event.isCancelled()) { event.getEntity().setLastDamageCause(event); } @@ -6421,7 +6421,7 @@ index 3f678fde45919061dfc75030b7ce355b4dda9e3a..182e3258cdce99139c229e99cfbc54f2 return event; } -@@ -1039,6 +1053,7 @@ public class CraftEventFactory { +@@ -1031,6 +1045,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions); diff --git a/patches/server/0111-Use-configured-height-for-nether-surface-builders.patch b/patches/server/0110-Use-configured-height-for-nether-surface-builders.patch similarity index 100% rename from patches/server/0111-Use-configured-height-for-nether-surface-builders.patch rename to patches/server/0110-Use-configured-height-for-nether-surface-builders.patch diff --git a/patches/server/0112-Crying-obsidian-valid-for-portal-frames.patch b/patches/server/0111-Crying-obsidian-valid-for-portal-frames.patch similarity index 100% rename from patches/server/0112-Crying-obsidian-valid-for-portal-frames.patch rename to patches/server/0111-Crying-obsidian-valid-for-portal-frames.patch diff --git a/patches/server/0113-Entities-can-use-portals-configuration.patch b/patches/server/0112-Entities-can-use-portals-configuration.patch similarity index 96% rename from patches/server/0113-Entities-can-use-portals-configuration.patch rename to patches/server/0112-Entities-can-use-portals-configuration.patch index 6040d1156..15dddf784 100644 --- a/patches/server/0113-Entities-can-use-portals-configuration.patch +++ b/patches/server/0112-Entities-can-use-portals-configuration.patch @@ -27,7 +27,7 @@ index 0be1f47b13f617a7aaad4d6334929d9e5f943d3e..b882c049870e461472fe3252922f206c public float a(Explosion explosion, IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, float f) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a222cd43afb5668c71e88f001e89da0f277be43e..1025b5daef29da23f1a80c1c0a1ef0eeee18384e 100644 +index 7ca7888d5e69c860f21ba51054ca1504e82bf216..bda0d06dd8d0fc07a313285d714eab55815310d1 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -140,6 +140,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0114-LivingEntity-broadcastItemBreak.patch b/patches/server/0113-LivingEntity-broadcastItemBreak.patch similarity index 100% rename from patches/server/0114-LivingEntity-broadcastItemBreak.patch rename to patches/server/0113-LivingEntity-broadcastItemBreak.patch diff --git a/patches/server/0115-Customizable-wither-health-and-healing.patch b/patches/server/0114-Customizable-wither-health-and-healing.patch similarity index 96% rename from patches/server/0115-Customizable-wither-health-and-healing.patch rename to patches/server/0114-Customizable-wither-health-and-healing.patch index 357c023ec..e0633625b 100644 --- a/patches/server/0115-Customizable-wither-health-and-healing.patch +++ b/patches/server/0114-Customizable-wither-health-and-healing.patch @@ -44,10 +44,10 @@ index f68cf834aa65cc4bbb1eb9901586395d41770955..71b6fc480617f040029b2201f24d05af //this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); // Paper - Moved down diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 1025b5daef29da23f1a80c1c0a1ef0eeee18384e..0f2e0e779198765a7dfa2d4c56b8b2ff8fb08f96 100644 +index bda0d06dd8d0fc07a313285d714eab55815310d1..6c50bcc45a4208b1709290944d57793e6f47dcd4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -910,10 +910,21 @@ public class PurpurWorldConfig { +@@ -903,10 +903,21 @@ public class PurpurWorldConfig { public boolean witherRidable = false; public boolean witherRidableInWater = false; public double witherMaxY = 256D; diff --git a/patches/server/0116-Allow-toggling-special-MobSpawners-per-world.patch b/patches/server/0115-Allow-toggling-special-MobSpawners-per-world.patch similarity index 97% rename from patches/server/0116-Allow-toggling-special-MobSpawners-per-world.patch rename to patches/server/0115-Allow-toggling-special-MobSpawners-per-world.patch index 14da76cc9..d026bbd39 100644 --- a/patches/server/0116-Allow-toggling-special-MobSpawners-per-world.patch +++ b/patches/server/0115-Allow-toggling-special-MobSpawners-per-world.patch @@ -29,7 +29,7 @@ index 8d89f51182444852062d549d23c00a93e601eb38..072ec40f751b19c2a78dfcc6e439c643 if (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, iworldreader, blockposition2, EntityTypes.WANDERING_TRADER)) { blockposition1 = blockposition2; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index bdfdb73bc1305d3fbda2e0ebe8163bf43b8aede5..ab97d076c921e1fd3ba69ed4b93d43e930d54bfc 100644 +index b91f3efb61575869d54d630263bb6a4c6499153e..22a5a212b8f0a223a338a8476d9fc7fd36c19df5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -156,7 +156,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -72,7 +72,7 @@ index d5f1808b232869ed5db8161345a03bf79fd159b7..78259bbb90fbd46bfd7922b9844339ff this.worldDataServer = (WorldDataServer) iworlddataserver; worldDataServer.world = this; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 0f2e0e779198765a7dfa2d4c56b8b2ff8fb08f96..92a1fb69e58237780fe03afcd5fc2ed16657345b 100644 +index 6c50bcc45a4208b1709290944d57793e6f47dcd4..b0a0c6cc6b781130cbfd02edc6c5b511090099c0 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -7,6 +7,8 @@ import net.minecraft.server.IRegistry; diff --git a/patches/server/0117-Raid-cooldown-setting.patch b/patches/server/0116-Raid-cooldown-setting.patch similarity index 97% rename from patches/server/0117-Raid-cooldown-setting.patch rename to patches/server/0116-Raid-cooldown-setting.patch index 162c864e8..6178de8ce 100644 --- a/patches/server/0117-Raid-cooldown-setting.patch +++ b/patches/server/0116-Raid-cooldown-setting.patch @@ -52,7 +52,7 @@ index 826dcf9f7eedc3664d66170b97b2a19552a0dc60..807910c60e6cad58b91474b0477e6fc1 if (!this.raids.containsKey(raid.getId())) { this.raids.put(raid.getId(), raid); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 92a1fb69e58237780fe03afcd5fc2ed16657345b..19e43dd63cd3001b927eb5857002231073bc03a2 100644 +index b0a0c6cc6b781130cbfd02edc6c5b511090099c0..8a2724489df13cf04200b1f34b3a76e0cdd679d3 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -155,6 +155,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0118-Despawn-rate-config-options-per-projectile-type.patch b/patches/server/0117-Despawn-rate-config-options-per-projectile-type.patch similarity index 99% rename from patches/server/0118-Despawn-rate-config-options-per-projectile-type.patch rename to patches/server/0117-Despawn-rate-config-options-per-projectile-type.patch index 66dd159dd..65be246cc 100644 --- a/patches/server/0118-Despawn-rate-config-options-per-projectile-type.patch +++ b/patches/server/0117-Despawn-rate-config-options-per-projectile-type.patch @@ -300,7 +300,7 @@ index b9f8ed355421f24306e0cc2bb976589f4b72b548..58f03f1d2e2f9e4c072c727ae202a9e3 public boolean checkIfLeftOwner() { return this.h(); } // Purpur - OBFHELPER diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 19e43dd63cd3001b927eb5857002231073bc03a2..7dcc0211b0e5ab359b2cabfeee0f3f442835b5e1 100644 +index 8a2724489df13cf04200b1f34b3a76e0cdd679d3..843c57d41106d31ae81f7e926c186db48462cf52 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -147,6 +147,35 @@ public class PurpurWorldConfig { diff --git a/patches/server/0119-PaperPR-Add-hex-color-code-support-for-console-loggi.patch b/patches/server/0118-PaperPR-Add-hex-color-code-support-for-console-loggi.patch similarity index 100% rename from patches/server/0119-PaperPR-Add-hex-color-code-support-for-console-loggi.patch rename to patches/server/0118-PaperPR-Add-hex-color-code-support-for-console-loggi.patch diff --git a/patches/server/0120-Add-option-to-disable-zombie-aggressiveness-towards-.patch b/patches/server/0119-Add-option-to-disable-zombie-aggressiveness-towards-.patch similarity index 96% rename from patches/server/0120-Add-option-to-disable-zombie-aggressiveness-towards-.patch rename to patches/server/0119-Add-option-to-disable-zombie-aggressiveness-towards-.patch index c11d05ed8..a40d82169 100644 --- a/patches/server/0120-Add-option-to-disable-zombie-aggressiveness-towards-.patch +++ b/patches/server/0119-Add-option-to-disable-zombie-aggressiveness-towards-.patch @@ -45,7 +45,7 @@ index 125eab60f2b4657e52a71eddf7586c574945252e..638efc67d66001ee085957d4698f51a7 this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bo)); } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index e2f68d843c8eff2c6bcb7d2535af771a51be150e..3ad8bd0847aacabf90e83c00cd7c1a8f51aaa2e4 100644 +index ba9b20863c12a1ba5a55013a74a34bc2fbc37273..1c1816f6f08c2b02aba6db2e78863fabe83674d9 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -85,7 +85,18 @@ public class EntityZombie extends EntityMonster { @@ -69,10 +69,10 @@ index e2f68d843c8eff2c6bcb7d2535af771a51be150e..3ad8bd0847aacabf90e83c00cd7c1a8f this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bo)); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 7dcc0211b0e5ab359b2cabfeee0f3f442835b5e1..f04e2e562fb07ca0f1b4ac4e25fdb050554b5431 100644 +index 843c57d41106d31ae81f7e926c186db48462cf52..c6a09b44b5f7289d81a2fd82f91135a8c2932e1f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1012,12 +1012,14 @@ public class PurpurWorldConfig { +@@ -1005,12 +1005,14 @@ public class PurpurWorldConfig { public boolean zombieJockeyOnlyBaby = true; public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; diff --git a/patches/server/0121-Persistent-TileEntity-Lore-and-DisplayName.patch b/patches/server/0120-Persistent-TileEntity-Lore-and-DisplayName.patch similarity index 99% rename from patches/server/0121-Persistent-TileEntity-Lore-and-DisplayName.patch rename to patches/server/0120-Persistent-TileEntity-Lore-and-DisplayName.patch index bd79fa261..587f7d78f 100644 --- a/patches/server/0121-Persistent-TileEntity-Lore-and-DisplayName.patch +++ b/patches/server/0120-Persistent-TileEntity-Lore-and-DisplayName.patch @@ -165,7 +165,7 @@ index 58d958a88ac5af5b889d719d9f1ea90ce45cf184..8e8749095427b44e04582593114cae8c + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f04e2e562fb07ca0f1b4ac4e25fdb050554b5431..4d97a232351a2a70f8992ff1d8d93b1fb976029a 100644 +index c6a09b44b5f7289d81a2fd82f91135a8c2932e1f..9f26c73dc6685ede1681a6b2ede8c35ccb2580f4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -182,6 +182,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0122-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch b/patches/server/0121-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch similarity index 100% rename from patches/server/0122-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch rename to patches/server/0121-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch diff --git a/patches/server/0123-Flying-squids-Oh-my.patch b/patches/server/0122-Flying-squids-Oh-my.patch similarity index 94% rename from patches/server/0123-Flying-squids-Oh-my.patch rename to patches/server/0122-Flying-squids-Oh-my.patch index 637ce135e..25e6eeefe 100644 --- a/patches/server/0123-Flying-squids-Oh-my.patch +++ b/patches/server/0122-Flying-squids-Oh-my.patch @@ -38,10 +38,10 @@ index 70b952f10a2af547f58069977ee135469d02f84d..cee226501690e1c00983a01ac82bc738 float f1 = MathHelper.cos(f) * 0.2F; float f2 = -0.1F + this.b.getRandom().nextFloat() * 0.2F; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 4d97a232351a2a70f8992ff1d8d93b1fb976029a..70e8092aff0ffb0b37c969cde0572069fd50112a 100644 +index 9f26c73dc6685ede1681a6b2ede8c35ccb2580f4..de6b4d078c1b41300bf570d7b6fb0b02e979049c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -868,10 +868,12 @@ public class PurpurWorldConfig { +@@ -861,10 +861,12 @@ public class PurpurWorldConfig { public boolean squidRidable = false; public boolean squidImmuneToEAR = true; public double squidOffsetWaterCheck = 0.0D; diff --git a/patches/server/0124-Infinity-bow-settings.patch b/patches/server/0123-Infinity-bow-settings.patch similarity index 96% rename from patches/server/0124-Infinity-bow-settings.patch rename to patches/server/0123-Infinity-bow-settings.patch index 9d51d3eb1..6afd3d687 100644 --- a/patches/server/0124-Infinity-bow-settings.patch +++ b/patches/server/0123-Infinity-bow-settings.patch @@ -26,7 +26,7 @@ index dd6a93dc78a4589f2c65d1738c432def1285f3e2..8241f3dafa5852bed7a3967e7260b36f entityhuman.b(StatisticList.ITEM_USED.b(this)); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 70e8092aff0ffb0b37c969cde0572069fd50112a..5b007f26d91c04681bb5b57494c22fb5ba072405 100644 +index de6b4d078c1b41300bf570d7b6fb0b02e979049c..aa648cc1e1d05d38ce81d201e31541c49e9a05bb 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -147,6 +147,15 @@ public class PurpurWorldConfig { diff --git a/patches/server/0125-Stonecutter-damage.patch b/patches/server/0124-Stonecutter-damage.patch similarity index 95% rename from patches/server/0125-Stonecutter-damage.patch rename to patches/server/0124-Stonecutter-damage.patch index 1c6efce78..00f27f7bc 100644 --- a/patches/server/0125-Stonecutter-damage.patch +++ b/patches/server/0124-Stonecutter-damage.patch @@ -39,10 +39,10 @@ index 33804e68931e8b4145b896eedeab79bde78779f2..fabadcd7a21b0e4ad0e2eeadcd8926df } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5b007f26d91c04681bb5b57494c22fb5ba072405..403a503bca872c76c760c89143255228f54654dd 100644 +index aa648cc1e1d05d38ce81d201e31541c49e9a05bb..e853f0e33313cbb7a8f72affebf82476f9eb7f5a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -372,6 +372,11 @@ public class PurpurWorldConfig { +@@ -365,6 +365,11 @@ public class PurpurWorldConfig { spawnerDeactivateByRedstone = getBoolean("blocks.spawner.deactivate-by-redstone", spawnerDeactivateByRedstone); } diff --git a/patches/server/0126-Configurable-daylight-cycle.patch b/patches/server/0125-Configurable-daylight-cycle.patch similarity index 92% rename from patches/server/0126-Configurable-daylight-cycle.patch rename to patches/server/0125-Configurable-daylight-cycle.patch index 6f7e5d8da..ccc6f8e0c 100644 --- a/patches/server/0126-Configurable-daylight-cycle.patch +++ b/patches/server/0125-Configurable-daylight-cycle.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Configurable daylight cycle diff --git a/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java b/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java -index 88c3d7efaf467c1c1487f589c2cdbfb6aba734ec..fed1ce95038ead72a663f5a562dd4628fa51e5f5 100644 +index 1b9b43ee696575d986c25cafec07d863acb951a7..e837db171545ceacbc84a2b360cf0d95347145d0 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutUpdateTime.java @@ -5,7 +5,7 @@ import java.io.IOException; public class PacketPlayOutUpdateTime implements Packet { - private long a; + private long a; private final void setWorldAge(final long age) { this.a = age; } private final long getWorldAge() { return this.a; } // Paper - OBFHELPER - private long b; + private long b; public void setPlayerTime(long time) { this.b = time; } // Purpur @@ -74,7 +74,7 @@ index 78259bbb90fbd46bfd7922b9844339ff0a4c0342..98d7686b15bbd5f75676e4391a241d59 public void doMobSpawning(boolean flag, boolean flag1) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 403a503bca872c76c760c89143255228f54654dd..2136325349c1073b2103da9c6481bd87b6085833 100644 +index e853f0e33313cbb7a8f72affebf82476f9eb7f5a..bf403f3d02fe63df4e17ec461cc818861cc956a3 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -116,6 +116,13 @@ public class PurpurWorldConfig { diff --git a/patches/server/0127-Allow-infinite-and-mending-enchantments-together.patch b/patches/server/0126-Allow-infinite-and-mending-enchantments-together.patch similarity index 100% rename from patches/server/0127-Allow-infinite-and-mending-enchantments-together.patch rename to patches/server/0126-Allow-infinite-and-mending-enchantments-together.patch diff --git a/patches/server/0128-Infinite-fuel-furnace.patch b/patches/server/0127-Infinite-fuel-furnace.patch similarity index 88% rename from patches/server/0128-Infinite-fuel-furnace.patch rename to patches/server/0127-Infinite-fuel-furnace.patch index 7686adf1c..2be0e3e44 100644 --- a/patches/server/0128-Infinite-fuel-furnace.patch +++ b/patches/server/0127-Infinite-fuel-furnace.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Infinite fuel furnace diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..1a47f0ae48acca8badc418838bb767bb6fbddbcb 100644 +index e75e676d196d9f5a3409ec50645fab611b0afdad..76ea1d003b43d822e2b85eec3b8740155efd531a 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -266,6 +266,22 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -278,6 +278,22 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I if (!this.world.isClientSide) { ItemStack itemstack = (ItemStack) this.items.get(1); @@ -31,7 +31,7 @@ index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..1a47f0ae48acca8badc418838bb767bb if (!this.isBurning() && (itemstack.isEmpty() || ((ItemStack) this.items.get(0)).isEmpty())) { if (!this.isBurning() && this.cookTime > 0) { this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); -@@ -319,6 +335,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -331,6 +347,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I flag1 = true; this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, this.isBurning()), 3); } @@ -41,10 +41,10 @@ index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..1a47f0ae48acca8badc418838bb767bb if (flag1) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2136325349c1073b2103da9c6481bd87b6085833..1dea0f8c04bb730e8d0643718845824047e6caf9 100644 +index bf403f3d02fe63df4e17ec461cc818861cc956a3..07519a988c61b23904f5c70becbc6c525456c39f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -340,6 +340,11 @@ public class PurpurWorldConfig { +@@ -333,6 +333,11 @@ public class PurpurWorldConfig { farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow); } diff --git a/patches/server/0129-Arrows-should-not-reset-despawn-counter.patch b/patches/server/0128-Arrows-should-not-reset-despawn-counter.patch similarity index 100% rename from patches/server/0129-Arrows-should-not-reset-despawn-counter.patch rename to patches/server/0128-Arrows-should-not-reset-despawn-counter.patch diff --git a/patches/server/0130-Add-tablist-suffix-option-for-afk.patch b/patches/server/0129-Add-tablist-suffix-option-for-afk.patch similarity index 96% rename from patches/server/0130-Add-tablist-suffix-option-for-afk.patch rename to patches/server/0129-Add-tablist-suffix-option-for-afk.patch index 1058bf9da..e55b051a2 100644 --- a/patches/server/0130-Add-tablist-suffix-option-for-afk.patch +++ b/patches/server/0129-Add-tablist-suffix-option-for-afk.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add tablist suffix option for afk diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index beb0a4b91a8abd0374ae40771009832ddf8978f7..3906805c5d6b9203e1ad160207154493660c8188 100644 +index 3c748cca91e5f83701e6ae83f76e7548dad35420..d677b4477a871790377348a112fa267181a70cda 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1972,7 +1972,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0131-Ability-to-re-add-farmland-mechanics-from-Alpha.patch b/patches/server/0130-Ability-to-re-add-farmland-mechanics-from-Alpha.patch similarity index 92% rename from patches/server/0131-Ability-to-re-add-farmland-mechanics-from-Alpha.patch rename to patches/server/0130-Ability-to-re-add-farmland-mechanics-from-Alpha.patch index 350c29b74..8576a2ab5 100644 --- a/patches/server/0131-Ability-to-re-add-farmland-mechanics-from-Alpha.patch +++ b/patches/server/0130-Ability-to-re-add-farmland-mechanics-from-Alpha.patch @@ -24,10 +24,10 @@ index 8dd48669c29dd51ed4d535dad0b0319f4bb2250c..099e0d3df219408ebe2a741a02e53eb9 return; } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 1dea0f8c04bb730e8d0643718845824047e6caf9..90368559d64615bb9df3c5d8c4ec23289df09ddd 100644 +index 07519a988c61b23904f5c70becbc6c525456c39f..bdbf949e3cbef495bcbfb7d8b97a88107b7d110f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -336,8 +336,10 @@ public class PurpurWorldConfig { +@@ -329,8 +329,10 @@ public class PurpurWorldConfig { } public boolean farmlandGetsMoistFromBelow = false; diff --git a/patches/server/0132-Add-adjustable-breeding-cooldown-to-config.patch b/patches/server/0131-Add-adjustable-breeding-cooldown-to-config.patch similarity index 97% rename from patches/server/0132-Add-adjustable-breeding-cooldown-to-config.patch rename to patches/server/0131-Add-adjustable-breeding-cooldown-to-config.patch index b0412b464..48d2287bd 100644 --- a/patches/server/0132-Add-adjustable-breeding-cooldown-to-config.patch +++ b/patches/server/0131-Add-adjustable-breeding-cooldown-to-config.patch @@ -33,7 +33,7 @@ index bba343542e7e6fa83ec802d97b4c139bb210ab28..d9f9e2235d091e14e5d34bb9a3273e7f int experience = this.getRandom().nextInt(7) + 1; org.bukkit.event.entity.EntityBreedEvent entityBreedEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(entityageable, this, entityanimal, entityplayer, this.breedItem, experience); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ab97d076c921e1fd3ba69ed4b93d43e930d54bfc..b4ba9b56a9964cefcb24044890855697ce726a08 100644 +index 22a5a212b8f0a223a338a8476d9fc7fd36c19df5..7021875fd8f205049748fe96b945de8339f3ec58 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -104,6 +104,48 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -94,7 +94,7 @@ index ab97d076c921e1fd3ba69ed4b93d43e930d54bfc..b4ba9b56a9964cefcb24044890855697 this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 90368559d64615bb9df3c5d8c4ec23289df09ddd..a108545c74c9cc7b280eb33637cbe869de72a0f5 100644 +index bdbf949e3cbef495bcbfb7d8b97a88107b7d110f..309d15804eb7e5087805724c401461375b4745cc 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -202,6 +202,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0133-Make-animal-breeding-times-configurable.patch b/patches/server/0132-Make-animal-breeding-times-configurable.patch similarity index 96% rename from patches/server/0133-Make-animal-breeding-times-configurable.patch rename to patches/server/0132-Make-animal-breeding-times-configurable.patch index 7df041124..583d0a407 100644 --- a/patches/server/0133-Make-animal-breeding-times-configurable.patch +++ b/patches/server/0132-Make-animal-breeding-times-configurable.patch @@ -398,10 +398,10 @@ index 9ae7168595dd66860e09ef87f946b18b010e54b1..6c25f667eecdf345289a0dbf885c9d71 @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe2f56f00c 100644 +index 309d15804eb7e5087805724c401461375b4745cc..ef0c2320780c623df4dd638c9272110a2fb2e530 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -423,10 +423,12 @@ public class PurpurWorldConfig { +@@ -416,10 +416,12 @@ public class PurpurWorldConfig { public boolean beeRidable = false; public boolean beeRidableInWater = false; public double beeMaxY = 256D; @@ -414,7 +414,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean blazeRidable = false; -@@ -443,12 +445,14 @@ public class PurpurWorldConfig { +@@ -436,12 +438,14 @@ public class PurpurWorldConfig { public int catSpawnDelay = 1200; public int catSpawnSwampHutScanRange = 16; public int catSpawnVillageScanRange = 48; @@ -429,7 +429,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean caveSpiderRidable = false; -@@ -461,10 +465,12 @@ public class PurpurWorldConfig { +@@ -454,10 +458,12 @@ public class PurpurWorldConfig { public boolean chickenRidable = false; public boolean chickenRidableInWater = false; public boolean chickenRetaliate = false; @@ -442,7 +442,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean codRidable = false; -@@ -475,10 +481,12 @@ public class PurpurWorldConfig { +@@ -468,10 +474,12 @@ public class PurpurWorldConfig { public boolean cowRidable = false; public boolean cowRidableInWater = false; public int cowFeedMushrooms = 0; @@ -455,7 +455,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean creeperRidable = false; -@@ -506,8 +514,10 @@ public class PurpurWorldConfig { +@@ -499,8 +507,10 @@ public class PurpurWorldConfig { } public boolean donkeyRidableInWater = false; @@ -466,7 +466,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean drownedRidable = false; -@@ -567,10 +577,12 @@ public class PurpurWorldConfig { +@@ -560,10 +570,12 @@ public class PurpurWorldConfig { public boolean foxRidable = false; public boolean foxRidableInWater = false; public boolean foxTypeChangesWithTulips = false; @@ -479,7 +479,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean ghastRidable = false; -@@ -615,14 +627,18 @@ public class PurpurWorldConfig { +@@ -608,14 +620,18 @@ public class PurpurWorldConfig { public boolean hoglinRidable = false; public boolean hoglinRidableInWater = false; @@ -498,7 +498,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean huskRidable = false; -@@ -667,9 +683,11 @@ public class PurpurWorldConfig { +@@ -660,9 +676,11 @@ public class PurpurWorldConfig { public boolean llamaRidable = false; public boolean llamaRidableInWater = false; @@ -510,7 +510,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean llamaTraderRidable = false; -@@ -688,28 +706,36 @@ public class PurpurWorldConfig { +@@ -681,28 +699,36 @@ public class PurpurWorldConfig { public boolean mooshroomRidable = false; public boolean mooshroomRidableInWater = false; @@ -547,7 +547,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean parrotRidable = false; -@@ -773,10 +799,12 @@ public class PurpurWorldConfig { +@@ -766,10 +792,12 @@ public class PurpurWorldConfig { public boolean pigRidable = false; public boolean pigRidableInWater = false; public boolean pigGiveSaddleBack = false; @@ -560,7 +560,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean piglinRidable = false; -@@ -804,12 +832,14 @@ public class PurpurWorldConfig { +@@ -797,12 +825,14 @@ public class PurpurWorldConfig { public boolean polarBearRidableInWater = false; public String polarBearBreedableItemString = ""; public Item polarBearBreedableItem = null; @@ -575,7 +575,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean pufferfishRidable = false; -@@ -821,11 +851,13 @@ public class PurpurWorldConfig { +@@ -814,11 +844,13 @@ public class PurpurWorldConfig { public boolean rabbitRidableInWater = false; public double rabbitNaturalToast = 0.0D; public double rabbitNaturalKiller = 0.0D; @@ -589,7 +589,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean ravagerRidable = false; -@@ -842,9 +874,11 @@ public class PurpurWorldConfig { +@@ -835,9 +867,11 @@ public class PurpurWorldConfig { public boolean sheepRidable = false; public boolean sheepRidableInWater = false; @@ -601,7 +601,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean shulkerRidable = false; -@@ -922,9 +956,11 @@ public class PurpurWorldConfig { +@@ -915,9 +949,11 @@ public class PurpurWorldConfig { public boolean striderRidable = false; public boolean striderRidableInWater = false; @@ -613,7 +613,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean tropicalFishRidable = false; -@@ -934,9 +970,11 @@ public class PurpurWorldConfig { +@@ -927,9 +963,11 @@ public class PurpurWorldConfig { public boolean turtleRidable = false; public boolean turtleRidableInWater = false; @@ -625,7 +625,7 @@ index a108545c74c9cc7b280eb33637cbe869de72a0f5..992a0babbed1eee0c0d566612b54adfe } public boolean vexRidable = false; -@@ -1029,9 +1067,11 @@ public class PurpurWorldConfig { +@@ -1022,9 +1060,11 @@ public class PurpurWorldConfig { public boolean wolfRidable = false; public boolean wolfRidableInWater = false; diff --git a/patches/server/0134-Apply-display-names-from-item-forms-of-entities-to-e.patch b/patches/server/0133-Apply-display-names-from-item-forms-of-entities-to-e.patch similarity index 96% rename from patches/server/0134-Apply-display-names-from-item-forms-of-entities-to-e.patch rename to patches/server/0133-Apply-display-names-from-item-forms-of-entities-to-e.patch index 9b8c595ae..5db2dd5ab 100644 --- a/patches/server/0134-Apply-display-names-from-item-forms-of-entities-to-e.patch +++ b/patches/server/0133-Apply-display-names-from-item-forms-of-entities-to-e.patch @@ -25,7 +25,7 @@ index faa221038df6bed02a2433855ed7c7e0f89c6024..6efe59e0385e144c59804e9e5e18e691 } diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java -index d53bbe31694c2d88939332691cdf145c46099e22..bc558c54c9e74e2158a5835173e6068cfaeffcc0 100644 +index 4f95976f9a852fa89cedd1fe81d2077fe5d118ee..0254a9e971b2dd93436a38815bfd1dcca9a2ec67 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -155,7 +155,13 @@ public class EntityBoat extends Entity { @@ -34,7 +34,7 @@ index d53bbe31694c2d88939332691cdf145c46099e22..bc558c54c9e74e2158a5835173e6068c if (!flag && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { - this.a((IMaterial) this.g()); + // Purpur start -+ final ItemStack boat = new ItemStack(this.getMaterialForType()); ++ final ItemStack boat = new ItemStack(this.getBoatItem()); + if (this.world.purpurConfig.persistentDroppableEntityDisplayNames && this.hasCustomName()) { + boat.setName(this.getCustomName()); + } @@ -43,14 +43,6 @@ index d53bbe31694c2d88939332691cdf145c46099e22..bc558c54c9e74e2158a5835173e6068c } this.die(); -@@ -216,6 +222,7 @@ public class EntityBoat extends Entity { - - } - -+ public Item getMaterialForType() { return this.g(); } // Purpur - OBFHELPER - public Item g() { - switch (this.getType()) { - case OAK: diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index 4b524c2165e95a4d3d78b84b7b15416a4ea7d622..d1ed9856d3362e1bed37d60c268b7e91c404d25d 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java @@ -196,7 +188,7 @@ index 623bcb93cbdf0f67ee999104936f9d60c5228037..eb115a9c2aac9abe28d36f6284ca84f6 NBTTagCompound nbttagcompound = this.a("display"); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 992a0babbed1eee0c0d566612b54adfe2f56f00c..af3f910e639a17dbcade8609a3c8c42b0d138cbb 100644 +index ef0c2320780c623df4dd638c9272110a2fb2e530..458aa1882da2015928c334e0f40b14ee36ba667d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -83,8 +83,10 @@ public class PurpurWorldConfig { diff --git a/patches/server/0135-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch b/patches/server/0134-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch similarity index 95% rename from patches/server/0135-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch rename to patches/server/0134-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch index 9b9265a15..eb2daa954 100644 --- a/patches/server/0135-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch +++ b/patches/server/0134-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch @@ -21,7 +21,7 @@ index 01163ce38602f9345f00ee0535b4e73be7c6d735..a7efce97318fcf95d98f33ad4ac2da69 ((EntityInsentient) entityliving).setPersistent(); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index af3f910e639a17dbcade8609a3c8c42b0d138cbb..a77debc7a8923693733d748ce9abd3ae2d057fb9 100644 +index 458aa1882da2015928c334e0f40b14ee36ba667d..d4e876fb5dc5f405d5a06982589bf8b4e05b2394 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -84,9 +84,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0136-Add-twisting-and-weeping-vines-growth-rates.patch b/patches/server/0135-Add-twisting-and-weeping-vines-growth-rates.patch similarity index 96% rename from patches/server/0136-Add-twisting-and-weeping-vines-growth-rates.patch rename to patches/server/0135-Add-twisting-and-weeping-vines-growth-rates.patch index aa73113a9..1e15b10cb 100644 --- a/patches/server/0136-Add-twisting-and-weeping-vines-growth-rates.patch +++ b/patches/server/0135-Add-twisting-and-weeping-vines-growth-rates.patch @@ -67,10 +67,10 @@ index 23dca1940375d243531fc4a891f04e937ae2f48f..94ffadb91fec65a721cf0c8fa98bad70 + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a77debc7a8923693733d748ce9abd3ae2d057fb9..a7eb31a3ed80ebe6bfc7d4187734d9bcbe9b537e 100644 +index d4e876fb5dc5f405d5a06982589bf8b4e05b2394..cf6fa370ce968a882311f1403556cea618c7c7fe 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -408,6 +408,16 @@ public class PurpurWorldConfig { +@@ -401,6 +401,16 @@ public class PurpurWorldConfig { turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts); } diff --git a/patches/server/0137-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch b/patches/server/0136-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch similarity index 96% rename from patches/server/0137-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch rename to patches/server/0136-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch index 3743eaf4e..1c3c2ec1e 100644 --- a/patches/server/0137-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch +++ b/patches/server/0136-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch @@ -89,10 +89,10 @@ index 94ffadb91fec65a721cf0c8fa98bad708a2ca269..067df63ab27ecb9fe0a0d012b16efbd5 // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a7eb31a3ed80ebe6bfc7d4187734d9bcbe9b537e..9b91ae1186a057722cc84173a43e9d1138c8a8ca 100644 +index cf6fa370ce968a882311f1403556cea618c7c7fe..91ba7f0b3ddb2846119e4b74ba501f6b40938702 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -355,6 +355,11 @@ public class PurpurWorldConfig { +@@ -348,6 +348,11 @@ public class PurpurWorldConfig { furnaceInfiniteFuel = getBoolean("blocks.furnace.infinite-fuel", furnaceInfiniteFuel); } @@ -104,7 +104,7 @@ index a7eb31a3ed80ebe6bfc7d4187734d9bcbe9b537e..9b91ae1186a057722cc84173a43e9d11 public boolean lavaInfinite = false; public int lavaInfiniteRequiredSources = 2; public int lavaSpeedNether = 10; -@@ -409,13 +414,17 @@ public class PurpurWorldConfig { +@@ -402,13 +407,17 @@ public class PurpurWorldConfig { } public double twistingVinesGrowthModifier = 0.10D; diff --git a/patches/server/0138-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch b/patches/server/0137-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch similarity index 93% rename from patches/server/0138-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch rename to patches/server/0137-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch index b4605f1ae..290afad73 100644 --- a/patches/server/0138-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch +++ b/patches/server/0137-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch @@ -21,10 +21,10 @@ index 995849212c25568d3aa28ada78babf8b8e669960..acb2b3ed04ea0bf19335415310ce22cd static class PathfinderGoalEndermanPickupBlock extends PathfinderGoal { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9b91ae1186a057722cc84173a43e9d1138c8a8ca..d14a4955e5e2fc805b8fb6b46c9750ccc9955df0 100644 +index 91ba7f0b3ddb2846119e4b74ba501f6b40938702..5df5f771dfcdd01386600531defa4ab1b612160b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -579,10 +579,12 @@ public class PurpurWorldConfig { +@@ -572,10 +572,12 @@ public class PurpurWorldConfig { public boolean endermanRidable = false; public boolean endermanRidableInWater = false; public boolean endermanAllowGriefing = true; diff --git a/patches/server/0139-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch b/patches/server/0138-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch similarity index 94% rename from patches/server/0139-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch rename to patches/server/0138-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch index 346ebfe4e..ad2a614a4 100644 --- a/patches/server/0139-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch +++ b/patches/server/0138-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch @@ -33,10 +33,10 @@ index 9963cef9298eb6d3e2ee6a24d9b1998e765123ac..a72ce4ea5a45fce35a47fd5f9c21b950 if (flag5) { if (i > 0) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 182e3258cdce99139c229e99cfbc54f23b7dfa77..eec1e49f615f8491b28b6a921c192ffae803b478 100644 +index 3edc530ec688047ae037303442a16e8c5e2e72d4..0d9c4d2a427a3484db1f87476be43c03dd36621d 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1052,7 +1052,7 @@ public class CraftEventFactory { +@@ -1044,7 +1044,7 @@ public class CraftEventFactory { private static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, Map modifiers, Map> modifierFunctions, boolean cancelled) { EntityDamageEvent event; if (damager != null) { diff --git a/patches/server/0140-Add-configurable-snowball-damage.patch b/patches/server/0139-Add-configurable-snowball-damage.patch similarity index 95% rename from patches/server/0140-Add-configurable-snowball-damage.patch rename to patches/server/0139-Add-configurable-snowball-damage.patch index 97cad2bae..00cd9891a 100644 --- a/patches/server/0140-Add-configurable-snowball-damage.patch +++ b/patches/server/0139-Add-configurable-snowball-damage.patch @@ -18,7 +18,7 @@ index 34a5f481e6ed1357861dca15fb4013ec8484a292..d7bab4446a5a8eef98c10b1f6eb89de9 entity.damageEntity(DamageSource.projectile(this, this.getShooter()), (float) i); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index d14a4955e5e2fc805b8fb6b46c9750ccc9955df0..effcabfd6b4cfb0ff2bdf058b60923f2162d9ce4 100644 +index 5df5f771dfcdd01386600531defa4ab1b612160b..478184f94b146419f9a3107b4f8fd3b08e914588 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -196,6 +196,11 @@ public class PurpurWorldConfig { diff --git a/patches/server/0141-Zombie-break-door-minimum-difficulty-option.patch b/patches/server/0140-Zombie-break-door-minimum-difficulty-option.patch similarity index 94% rename from patches/server/0141-Zombie-break-door-minimum-difficulty-option.patch rename to patches/server/0140-Zombie-break-door-minimum-difficulty-option.patch index b1ec7d803..d6e9c5ae4 100644 --- a/patches/server/0141-Zombie-break-door-minimum-difficulty-option.patch +++ b/patches/server/0140-Zombie-break-door-minimum-difficulty-option.patch @@ -40,7 +40,7 @@ index 7488a12926c5ee4adc3bc1fa3973988350381544..23870a271b759a953a095df835e08ea2 + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index effcabfd6b4cfb0ff2bdf058b60923f2162d9ce4..ee7b5efcfc0e185f0dfec50054ff53ee46d48d59 100644 +index 478184f94b146419f9a3107b4f8fd3b08e914588..e6ca3585b8b34311ae2596b610e85953f1cf2a13 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -2,6 +2,7 @@ package net.pl3x.purpur; @@ -51,7 +51,7 @@ index effcabfd6b4cfb0ff2bdf058b60923f2162d9ce4..ee7b5efcfc0e185f0dfec50054ff53ee import net.minecraft.server.Explosion; import net.minecraft.server.IRegistry; import net.minecraft.server.Item; -@@ -1119,6 +1120,7 @@ public class PurpurWorldConfig { +@@ -1112,6 +1113,7 @@ public class PurpurWorldConfig { public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; public boolean zombieAggressiveTowardsVillagerWhenLagging = true; @@ -59,7 +59,7 @@ index effcabfd6b4cfb0ff2bdf058b60923f2162d9ce4..ee7b5efcfc0e185f0dfec50054ff53ee private void zombieSettings() { zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable); zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater); -@@ -1126,6 +1128,11 @@ public class PurpurWorldConfig { +@@ -1119,6 +1121,11 @@ public class PurpurWorldConfig { zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance); zombieJockeyTryExistingChickens = getBoolean("mobs.zombie.jockey.try-existing-chickens", zombieJockeyTryExistingChickens); zombieAggressiveTowardsVillagerWhenLagging = getBoolean("mobs.zombie.aggressive-towards-villager-when-lagging", zombieAggressiveTowardsVillagerWhenLagging); diff --git a/patches/server/0142-Add-demo-command.patch b/patches/server/0141-Add-demo-command.patch similarity index 100% rename from patches/server/0142-Add-demo-command.patch rename to patches/server/0141-Add-demo-command.patch diff --git a/patches/server/0143-Left-handed-API.patch b/patches/server/0142-Left-handed-API.patch similarity index 100% rename from patches/server/0143-Left-handed-API.patch rename to patches/server/0142-Left-handed-API.patch diff --git a/patches/server/0144-Origami-Fix-ProtocolLib-issues-on-Java-15.patch b/patches/server/0143-Origami-Fix-ProtocolLib-issues-on-Java-15.patch similarity index 100% rename from patches/server/0144-Origami-Fix-ProtocolLib-issues-on-Java-15.patch rename to patches/server/0143-Origami-Fix-ProtocolLib-issues-on-Java-15.patch diff --git a/patches/server/0145-Changeable-Mob-Left-Handed-Chance.patch b/patches/server/0144-Changeable-Mob-Left-Handed-Chance.patch similarity index 95% rename from patches/server/0145-Changeable-Mob-Left-Handed-Chance.patch rename to patches/server/0144-Changeable-Mob-Left-Handed-Chance.patch index 6536368d6..c64c4176b 100644 --- a/patches/server/0145-Changeable-Mob-Left-Handed-Chance.patch +++ b/patches/server/0144-Changeable-Mob-Left-Handed-Chance.patch @@ -18,7 +18,7 @@ index d1ed9856d3362e1bed37d60c268b7e91c404d25d..d7ceb4ff6aa424d620817ddcc9201fc0 } else { this.setLeftHanded(false); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ee7b5efcfc0e185f0dfec50054ff53ee46d48d59..090a8c681c4288bff1efef1f782d2bf36abaef77 100644 +index e6ca3585b8b34311ae2596b610e85953f1cf2a13..b426fffac370530ee8ae5c0134fc24bdfb9dcf39 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -129,8 +129,10 @@ public class PurpurWorldConfig { diff --git a/patches/server/0146-Add-boat-fall-damage-config.patch b/patches/server/0145-Add-boat-fall-damage-config.patch similarity index 94% rename from patches/server/0146-Add-boat-fall-damage-config.patch rename to patches/server/0145-Add-boat-fall-damage-config.patch index f75ca3b7b..d5ab56bf1 100644 --- a/patches/server/0146-Add-boat-fall-damage-config.patch +++ b/patches/server/0145-Add-boat-fall-damage-config.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add boat fall damage config diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3906805c5d6b9203e1ad160207154493660c8188..50cd947d0e47e7897a071fdf8ff6e5834e137d58 100644 +index d677b4477a871790377348a112fa267181a70cda..157300c0320a136d36994d463a69a5b0fe022683 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1030,7 +1030,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -27,7 +27,7 @@ index 3906805c5d6b9203e1ad160207154493660c8188..50cd947d0e47e7897a071fdf8ff6e583 if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 090a8c681c4288bff1efef1f782d2bf36abaef77..1e5dc4366ccc85002e9b0ea0cfbcde46d39017d2 100644 +index b426fffac370530ee8ae5c0134fc24bdfb9dcf39..472db0b81c6b072941a64d2e2f0cf2aebd3408b7 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -206,6 +206,7 @@ public class PurpurWorldConfig { diff --git a/patches/server/0147-Config-migration-disable-saving-projectiles-to-disk-.patch b/patches/server/0146-Config-migration-disable-saving-projectiles-to-disk-.patch similarity index 97% rename from patches/server/0147-Config-migration-disable-saving-projectiles-to-disk-.patch rename to patches/server/0146-Config-migration-disable-saving-projectiles-to-disk-.patch index 2e0c076a6..3b60fc43e 100644 --- a/patches/server/0147-Config-migration-disable-saving-projectiles-to-disk-.patch +++ b/patches/server/0146-Config-migration-disable-saving-projectiles-to-disk-.patch @@ -36,7 +36,7 @@ index 4709fe0db33d64406c3c52991626a377f0a8cf93..0c1f22249061f600fce2d4d627f0683f public static String afkBroadcastBack = "§e§o%s is no longer AFK"; public static String afkTabListPrefix = "[AFK] "; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 1e5dc4366ccc85002e9b0ea0cfbcde46d39017d2..d2c07bd07406f324a79b0543101cb2d391fa8dec 100644 +index 472db0b81c6b072941a64d2e2f0cf2aebd3408b7..12a4a4b2874212a192ed05498a0238e3615cd548 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1,5 +1,6 @@ diff --git a/patches/server/0148-Snow-Golem-rate-of-fire-config.patch b/patches/server/0147-Snow-Golem-rate-of-fire-config.patch similarity index 95% rename from patches/server/0148-Snow-Golem-rate-of-fire-config.patch rename to patches/server/0147-Snow-Golem-rate-of-fire-config.patch index 5b365aa81..cbc0fcdc3 100644 --- a/patches/server/0148-Snow-Golem-rate-of-fire-config.patch +++ b/patches/server/0147-Snow-Golem-rate-of-fire-config.patch @@ -23,10 +23,10 @@ index e980da14cf4f34c87a88ffd2b908223808404966..e5b3d298f52006f39a36cfdd95097e7b this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); this.goalSelector.a(4, new PathfinderGoalRandomLookaround(this)); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index d2c07bd07406f324a79b0543101cb2d391fa8dec..7f40f118723e04491d48227304fb7b1758ed7d0e 100644 +index 12a4a4b2874212a192ed05498a0238e3615cd548..823e72736110e3ef13aa763a1a94ce759a6d5f76 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -970,12 +970,20 @@ public class PurpurWorldConfig { +@@ -963,12 +963,20 @@ public class PurpurWorldConfig { public boolean snowGolemLeaveTrailWhenRidden = false; public boolean snowGolemDropsPumpkin = false; public boolean snowGolemPutPumpkinBack = false; diff --git a/patches/server/0149-PaperPR-Config-option-for-Piglins-guarding-chests.patch b/patches/server/0148-PaperPR-Config-option-for-Piglins-guarding-chests.patch similarity index 91% rename from patches/server/0149-PaperPR-Config-option-for-Piglins-guarding-chests.patch rename to patches/server/0148-PaperPR-Config-option-for-Piglins-guarding-chests.patch index a9fad2c90..890a706c2 100644 --- a/patches/server/0149-PaperPR-Config-option-for-Piglins-guarding-chests.patch +++ b/patches/server/0148-PaperPR-Config-option-for-Piglins-guarding-chests.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PaperPR - Config option for Piglins guarding chests diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2452f54d96cab2d93140c64e25d9b799cbc94caa..3ff2fa66b940acbe8e72fb03bf7a86398ab69613 100644 +index 0bca517b4948cd55bfbf3ba4d5c1b3cd895cc086..b21da8af71fa6af82156aa83d983e99c6ac6502a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -669,6 +669,11 @@ public class PaperWorldConfig { +@@ -686,6 +686,11 @@ public class PaperWorldConfig { zombiesTargetTurtleEggs = getBoolean("zombies-target-turtle-eggs", zombiesTargetTurtleEggs); } diff --git a/patches/server/0150-EMC-Configurable-disable-give-dropping.patch b/patches/server/0149-EMC-Configurable-disable-give-dropping.patch similarity index 100% rename from patches/server/0150-EMC-Configurable-disable-give-dropping.patch rename to patches/server/0149-EMC-Configurable-disable-give-dropping.patch diff --git a/patches/server/0151-Config-migration-climbing-should-not-bypass-cramming.patch b/patches/server/0150-Config-migration-climbing-should-not-bypass-cramming.patch similarity index 96% rename from patches/server/0151-Config-migration-climbing-should-not-bypass-cramming.patch rename to patches/server/0150-Config-migration-climbing-should-not-bypass-cramming.patch index 9f3260f66..768dca49e 100644 --- a/patches/server/0151-Config-migration-climbing-should-not-bypass-cramming.patch +++ b/patches/server/0150-Config-migration-climbing-should-not-bypass-cramming.patch @@ -28,7 +28,7 @@ index 4ea4abc4f03123fa4be7e19b777d4afa0d2002ae..dbda80c9a57dc7a1882a00020b407dd6 public static String afkBroadcastBack = "§e§o%s is no longer AFK"; public static String afkTabListPrefix = "[AFK] "; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 7f40f118723e04491d48227304fb7b1758ed7d0e..f57d0e48fbf8ff54f1a033ccb2302c29038c3a09 100644 +index 823e72736110e3ef13aa763a1a94ce759a6d5f76..1c9aaf92e8c2f23f1d65f42fb044a2183b99e214 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -96,6 +96,17 @@ public class PurpurWorldConfig { diff --git a/patches/server/0152-Lobotomize-stuck-villagers.patch b/patches/server/0151-Lobotomize-stuck-villagers.patch similarity index 96% rename from patches/server/0152-Lobotomize-stuck-villagers.patch rename to patches/server/0151-Lobotomize-stuck-villagers.patch index 4b0bfa02d..b65db21d0 100644 --- a/patches/server/0152-Lobotomize-stuck-villagers.patch +++ b/patches/server/0151-Lobotomize-stuck-villagers.patch @@ -88,10 +88,10 @@ index b92ca4a6de01f3f86367fb8dfe3591b08a3e9218..1208464fba96daf276c9cc0c1c9b18db // Paper start - add target parameter return this.a(blockposition, null, i); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f57d0e48fbf8ff54f1a033ccb2302c29038c3a09..71ce16f714ed903ae7a466f815d59dcb1757ea86 100644 +index 1c9aaf92e8c2f23f1d65f42fb044a2183b99e214..99e4cce00d644dd7bb2183058847380c2046889c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1064,6 +1064,8 @@ public class PurpurWorldConfig { +@@ -1057,6 +1057,8 @@ public class PurpurWorldConfig { public int villagerSpawnIronGolemRadius = 0; public int villagerSpawnIronGolemLimit = 0; public boolean villagerCanBreed = true; @@ -100,7 +100,7 @@ index f57d0e48fbf8ff54f1a033ccb2302c29038c3a09..71ce16f714ed903ae7a466f815d59dcb private void villagerSettings() { villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable); villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater); -@@ -1075,6 +1077,13 @@ public class PurpurWorldConfig { +@@ -1068,6 +1070,13 @@ public class PurpurWorldConfig { villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius); villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit); villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed); diff --git a/patches/server/0153-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch b/patches/server/0152-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch similarity index 98% rename from patches/server/0153-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch rename to patches/server/0152-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch index 82cf15f8e..3909528f2 100644 --- a/patches/server/0153-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch +++ b/patches/server/0152-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch @@ -234,10 +234,10 @@ index 3c60da7ac6faebe9d964e893974e42613c59b4c1..6493f220a0cf627e82e5f3f3c85e9934 public static final VillagerProfession FISHERMAN = a("fisherman", VillagePlaceType.i, SoundEffects.ENTITY_VILLAGER_WORK_FISHERMAN); public static final VillagerProfession FLETCHER = a("fletcher", VillagePlaceType.j, SoundEffects.ENTITY_VILLAGER_WORK_FLETCHER); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 71ce16f714ed903ae7a466f815d59dcb1757ea86..591d2eabb922d4ecda0acaf00e7dc82a00501d1b 100644 +index 99e4cce00d644dd7bb2183058847380c2046889c..6ae81e9e118632a0f3fa77870bbe1ec65aa406eb 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1066,6 +1066,8 @@ public class PurpurWorldConfig { +@@ -1059,6 +1059,8 @@ public class PurpurWorldConfig { public boolean villagerCanBreed = true; public boolean villagerLobotomizeEnabled = false; public int villagerLobotomizeCheck = 60; @@ -246,7 +246,7 @@ index 71ce16f714ed903ae7a466f815d59dcb1757ea86..591d2eabb922d4ecda0acaf00e7dc82a private void villagerSettings() { villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable); villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater); -@@ -1084,6 +1086,8 @@ public class PurpurWorldConfig { +@@ -1077,6 +1079,8 @@ public class PurpurWorldConfig { } villagerLobotomizeEnabled = getBoolean("mobs.villager.lobotomize.enabled", villagerLobotomizeEnabled); villagerLobotomizeCheck = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheck); diff --git a/patches/server/0154-Toggle-for-Zombified-Piglin-death-always-counting-as.patch b/patches/server/0153-Toggle-for-Zombified-Piglin-death-always-counting-as.patch similarity index 95% rename from patches/server/0154-Toggle-for-Zombified-Piglin-death-always-counting-as.patch rename to patches/server/0153-Toggle-for-Zombified-Piglin-death-always-counting-as.patch index 0fc8901bc..aa0c642e8 100644 --- a/patches/server/0154-Toggle-for-Zombified-Piglin-death-always-counting-as.patch +++ b/patches/server/0153-Toggle-for-Zombified-Piglin-death-always-counting-as.patch @@ -35,10 +35,10 @@ index 3327dbbf87d8f43cbc7cd728df2f4c6a33dae40d..57f3358b8dfd53f5b1d2e976d64b809f } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 591d2eabb922d4ecda0acaf00e7dc82a00501d1b..ed39dad5707add6392042073998e8ce08a887d1e 100644 +index 6ae81e9e118632a0f3fa77870bbe1ec65aa406eb..fcb7042d55a8942ec9f2aa77f0a67591c179be12 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1197,12 +1197,14 @@ public class PurpurWorldConfig { +@@ -1190,12 +1190,14 @@ public class PurpurWorldConfig { public boolean zombifiedPiglinJockeyOnlyBaby = true; public double zombifiedPiglinJockeyChance = 0.05D; public boolean zombifiedPiglinJockeyTryExistingChickens = true; diff --git a/patches/server/0155-Spread-out-and-optimise-player-list-ticks.patch b/patches/server/0154-Spread-out-and-optimise-player-list-ticks.patch similarity index 100% rename from patches/server/0155-Spread-out-and-optimise-player-list-ticks.patch rename to patches/server/0154-Spread-out-and-optimise-player-list-ticks.patch diff --git a/patches/server/0156-Configurable-chance-for-wolves-to-spawn-rabid.patch b/patches/server/0155-Configurable-chance-for-wolves-to-spawn-rabid.patch similarity index 98% rename from patches/server/0156-Configurable-chance-for-wolves-to-spawn-rabid.patch rename to patches/server/0155-Configurable-chance-for-wolves-to-spawn-rabid.patch index 9ab12e246..71c71dacd 100644 --- a/patches/server/0156-Configurable-chance-for-wolves-to-spawn-rabid.patch +++ b/patches/server/0155-Configurable-chance-for-wolves-to-spawn-rabid.patch @@ -201,10 +201,10 @@ index 9a4819815c7a4bf2fd4a92c4169ace35f2261704..da29898574d30d5fecc5a44ad7b36556 public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class oclass, Predicate predicate, float f, double d0, double d1, Predicate predicate1) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ed39dad5707add6392042073998e8ce08a887d1e..fb936cfac0155f800036685ba7cc3615b1474a44 100644 +index fcb7042d55a8942ec9f2aa77f0a67591c179be12..79bbe93e37d9bbdc531f92d94f43277c247111c1 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1148,10 +1148,14 @@ public class PurpurWorldConfig { +@@ -1141,10 +1141,14 @@ public class PurpurWorldConfig { public boolean wolfRidable = false; public boolean wolfRidableInWater = false; diff --git a/patches/server/0157-Configurable-default-wolf-collar-color.patch b/patches/server/0156-Configurable-default-wolf-collar-color.patch similarity index 94% rename from patches/server/0157-Configurable-default-wolf-collar-color.patch rename to patches/server/0156-Configurable-default-wolf-collar-color.patch index 485c5f525..cc56b4467 100644 --- a/patches/server/0157-Configurable-default-wolf-collar-color.patch +++ b/patches/server/0156-Configurable-default-wolf-collar-color.patch @@ -24,7 +24,7 @@ index 5fe2e9f4bfbdc08690eacd6196e59529dc7953e8..fd62dc51258876275adbe02f750fd881 @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index fb936cfac0155f800036685ba7cc3615b1474a44..513aa507aaea6fac108dbf1dc3c3d51259b16df6 100644 +index 79bbe93e37d9bbdc531f92d94f43277c247111c1..d3235065b847993f38e0e4e781269d28313e23ba 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -3,6 +3,7 @@ package net.pl3x.purpur; @@ -35,7 +35,7 @@ index fb936cfac0155f800036685ba7cc3615b1474a44..513aa507aaea6fac108dbf1dc3c3d512 import net.minecraft.server.EnumDifficulty; import net.minecraft.server.Explosion; import net.minecraft.server.IRegistry; -@@ -1148,12 +1149,18 @@ public class PurpurWorldConfig { +@@ -1141,12 +1142,18 @@ public class PurpurWorldConfig { public boolean wolfRidable = false; public boolean wolfRidableInWater = false; diff --git a/patches/server/0158-Configurable-entity-base-attributes.patch b/patches/server/0157-Configurable-entity-base-attributes.patch similarity index 98% rename from patches/server/0158-Configurable-entity-base-attributes.patch rename to patches/server/0157-Configurable-entity-base-attributes.patch index 388907aaa..7940cb2d3 100644 --- a/patches/server/0158-Configurable-entity-base-attributes.patch +++ b/patches/server/0157-Configurable-entity-base-attributes.patch @@ -982,7 +982,7 @@ index 96cb080d940db22330598a8806726088b79a53c1..ee7805dccac9c4dcdf4fa83ab8041953 @Override diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 46026362981ce8a3a9e7d63e16230b5425a5d388..5b4d5fd59760e24c8ed59086b4c6c3153a86967c 100644 +index 3c14ed27e5b487451846f6811f189e6fba05d32d..36b384fd8fc29b270bb8c0ccc66ffad15183cf94 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -10,6 +10,7 @@ import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent; @@ -1245,7 +1245,7 @@ index d92fe8013fb3b43cb7eabdf1c624291b7e881889..bcc4aa1d3f09e43016d0009cd04dd6b7 @Override diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 3ad8bd0847aacabf90e83c00cd7c1a8f51aaa2e4..d73e463ca045e7c8755eb5cb257e7245d3521d0e 100644 +index 1c1816f6f08c2b02aba6db2e78863fabe83674d9..ea5a568509d5c44c3f15d8e813a554957784016b 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -67,6 +67,15 @@ public class EntityZombie extends EntityMonster { @@ -1264,7 +1264,7 @@ index 3ad8bd0847aacabf90e83c00cd7c1a8f51aaa2e4..d73e463ca045e7c8755eb5cb257e7245 // Purpur end @Override -@@ -544,7 +553,7 @@ public class EntityZombie extends EntityMonster { +@@ -546,7 +555,7 @@ public class EntityZombie extends EntityMonster { } protected void eV() { @@ -1314,10 +1314,10 @@ index 0c47477b416980d2e932321730525bf5a8feda4f..dc850677c29c16805f28af00b2a63363 @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df3bfffea0 100644 +index d3235065b847993f38e0e4e781269d28313e23ba..279b9677d724f1dbbdb7efe665c4ebc00d585270 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -473,30 +473,58 @@ public class PurpurWorldConfig { +@@ -466,30 +466,58 @@ public class PurpurWorldConfig { public boolean batRidable = false; public boolean batRidableInWater = false; public double batMaxY = 256D; @@ -1376,7 +1376,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean catRidable = false; -@@ -505,6 +533,7 @@ public class PurpurWorldConfig { +@@ -498,6 +526,7 @@ public class PurpurWorldConfig { public int catSpawnSwampHutScanRange = 16; public int catSpawnVillageScanRange = 48; public int catBreedingTicks = 6000; @@ -1384,7 +1384,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void catSettings() { catRidable = getBoolean("mobs.cat.ridable", catRidable); catRidableInWater = getBoolean("mobs.cat.ridable-in-water", catRidableInWater); -@@ -512,51 +541,92 @@ public class PurpurWorldConfig { +@@ -505,51 +534,92 @@ public class PurpurWorldConfig { catSpawnSwampHutScanRange = getInt("mobs.cat.scan-range-for-other-cats.swamp-hut", catSpawnSwampHutScanRange); catSpawnVillageScanRange = getInt("mobs.cat.scan-range-for-other-cats.village", catSpawnVillageScanRange); catBreedingTicks = getInt("mobs.cat.breeding-delay-ticks", catBreedingTicks); @@ -1477,7 +1477,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean dolphinRidable = false; -@@ -564,19 +634,45 @@ public class PurpurWorldConfig { +@@ -557,19 +627,45 @@ public class PurpurWorldConfig { public float dolphinSpitSpeed = 1.0F; public float dolphinSpitDamage = 2.0F; public boolean dolphinDisableTreasureSearching = false; @@ -1523,7 +1523,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean drownedRidable = false; -@@ -584,17 +680,33 @@ public class PurpurWorldConfig { +@@ -577,17 +673,33 @@ public class PurpurWorldConfig { public boolean drownedJockeyOnlyBaby = true; public double drownedJockeyChance = 0.05D; public boolean drownedJockeyTryExistingChickens = true; @@ -1557,7 +1557,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean enderDragonRidable = false; -@@ -602,57 +714,103 @@ public class PurpurWorldConfig { +@@ -595,57 +707,103 @@ public class PurpurWorldConfig { public double enderDragonMaxY = 256D; public boolean enderDragonAlwaysDropsEggBlock = false; public boolean enderDragonAlwaysDropsFullExp = false; @@ -1661,7 +1661,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean giantRidable = false; -@@ -675,31 +833,68 @@ public class PurpurWorldConfig { +@@ -668,31 +826,68 @@ public class PurpurWorldConfig { giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI); if (PurpurConfig.version < 8) { double oldValue = getDouble("mobs.giant.max-health", giantMaxHealth); @@ -1732,7 +1732,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean huskRidable = false; -@@ -707,12 +902,21 @@ public class PurpurWorldConfig { +@@ -700,12 +895,21 @@ public class PurpurWorldConfig { public boolean huskJockeyOnlyBaby = true; public double huskJockeyChance = 0.05D; public boolean huskJockeyTryExistingChickens = true; @@ -1754,7 +1754,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean illusionerRidable = false; -@@ -727,85 +931,188 @@ public class PurpurWorldConfig { +@@ -720,85 +924,188 @@ public class PurpurWorldConfig { illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange); if (PurpurConfig.version < 8) { double oldValue = getDouble("mobs.illusioner.max-health", illusionerMaxHealth); @@ -1945,7 +1945,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean phantomRidable = false; -@@ -831,6 +1138,7 @@ public class PurpurWorldConfig { +@@ -824,6 +1131,7 @@ public class PurpurWorldConfig { public int phantomBurnInLight = 0; public boolean phantomIgnorePlayersWithTorch = false; public boolean phantomBurnInDaylight = true; @@ -1953,7 +1953,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void phantomSettings() { phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable); phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater); -@@ -855,38 +1163,72 @@ public class PurpurWorldConfig { +@@ -848,38 +1156,72 @@ public class PurpurWorldConfig { phantomBurnInLight = getInt("mobs.phantom.burn-in-light", phantomBurnInLight); phantomBurnInDaylight = getBoolean("mobs.phantom.burn-in-daylight", phantomBurnInDaylight); phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch); @@ -2026,7 +2026,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean polarBearRidable = false; -@@ -894,6 +1236,7 @@ public class PurpurWorldConfig { +@@ -887,6 +1229,7 @@ public class PurpurWorldConfig { public String polarBearBreedableItemString = ""; public Item polarBearBreedableItem = null; public int polarBearBreedingTicks = 6000; @@ -2034,7 +2034,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void polarBearSettings() { polarBearRidable = getBoolean("mobs.polar_bear.ridable", polarBearRidable); polarBearRidableInWater = getBoolean("mobs.polar_bear.ridable-in-water", polarBearRidableInWater); -@@ -901,11 +1244,24 @@ public class PurpurWorldConfig { +@@ -894,11 +1237,24 @@ public class PurpurWorldConfig { Item item = IRegistry.ITEM.get(new MinecraftKey(polarBearBreedableItemString)); if (item != Items.AIR) polarBearBreedableItem = item; polarBearBreedingTicks = getInt("mobs.polar_bear.breeding-delay-ticks", polarBearBreedingTicks); @@ -2059,7 +2059,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean rabbitRidable = false; -@@ -913,68 +1269,142 @@ public class PurpurWorldConfig { +@@ -906,68 +1262,142 @@ public class PurpurWorldConfig { public double rabbitNaturalToast = 0.0D; public double rabbitNaturalKiller = 0.0D; public int rabbitBreedingTicks = 6000; @@ -2202,7 +2202,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean snowGolemRidable = false; -@@ -986,6 +1416,7 @@ public class PurpurWorldConfig { +@@ -979,6 +1409,7 @@ public class PurpurWorldConfig { public int snowGolemSnowBallMax = 20; public float snowGolemSnowBallModifier = 10.0F; public double snowGolemAttackDistance = 1.25D; @@ -2210,7 +2210,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void snowGolemSettings() { snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable); snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater); -@@ -996,63 +1427,118 @@ public class PurpurWorldConfig { +@@ -989,63 +1420,118 @@ public class PurpurWorldConfig { snowGolemSnowBallMax = getInt("mobs.snow_golem.max-shoot-interval-ticks", snowGolemSnowBallMax); snowGolemSnowBallModifier = (float) getDouble("mobs.snow_golem.snow-ball-modifier", snowGolemSnowBallModifier); snowGolemAttackDistance = getDouble("mobs.snow_golem.attack-distance", snowGolemAttackDistance); @@ -2329,7 +2329,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean villagerRidable = false; -@@ -1069,6 +1555,7 @@ public class PurpurWorldConfig { +@@ -1062,6 +1548,7 @@ public class PurpurWorldConfig { public int villagerLobotomizeCheck = 60; public boolean villagerClericsFarmWarts = false; public boolean villagerClericFarmersThrowWarts = true; @@ -2337,7 +2337,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void villagerSettings() { villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable); villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater); -@@ -1089,33 +1576,60 @@ public class PurpurWorldConfig { +@@ -1082,33 +1569,60 @@ public class PurpurWorldConfig { villagerLobotomizeCheck = getInt("mobs.villager.lobotomize.check-interval", villagerLobotomizeCheck); villagerClericsFarmWarts = getBoolean("mobs.villager.clerics-farm-warts", villagerClericsFarmWarts); villagerClericFarmersThrowWarts = getBoolean("mobs.villager.cleric-wart-farmers-throw-warts-at-villagers", villagerClericFarmersThrowWarts); @@ -2398,7 +2398,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean witherRidable = false; -@@ -1132,19 +1646,30 @@ public class PurpurWorldConfig { +@@ -1125,19 +1639,30 @@ public class PurpurWorldConfig { witherHealthRegenDelay = getInt("mobs.wither.health-regen-delay", witherHealthRegenDelay); if (PurpurConfig.version < 8) { double oldValue = getDouble("mobs.wither.max-health", witherMaxHealth); @@ -2431,7 +2431,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean wolfRidable = false; -@@ -1153,6 +1678,7 @@ public class PurpurWorldConfig { +@@ -1146,6 +1671,7 @@ public class PurpurWorldConfig { public boolean wolfMilkCuresRabies = true; public double wolfNaturalRabid = 0.0D; public int wolfBreedingTicks = 6000; @@ -2439,7 +2439,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void wolfSettings() { wolfRidable = getBoolean("mobs.wolf.ridable", wolfRidable); wolfRidableInWater = getBoolean("mobs.wolf.ridable-in-water", wolfRidableInWater); -@@ -1164,13 +1690,26 @@ public class PurpurWorldConfig { +@@ -1157,13 +1683,26 @@ public class PurpurWorldConfig { wolfMilkCuresRabies = getBoolean("mobs.wolf.milk-cures-rabid-wolves", wolfMilkCuresRabies); wolfNaturalRabid = getDouble("mobs.wolf.spawn-rabid-chance", wolfNaturalRabid); wolfBreedingTicks = getInt("mobs.wolf.breeding-delay-ticks", wolfBreedingTicks); @@ -2466,7 +2466,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean zombieRidable = false; -@@ -1180,6 +1719,8 @@ public class PurpurWorldConfig { +@@ -1173,6 +1712,8 @@ public class PurpurWorldConfig { public boolean zombieJockeyTryExistingChickens = true; public boolean zombieAggressiveTowardsVillagerWhenLagging = true; public EnumDifficulty zombieBreakDoorMinDifficulty = EnumDifficulty.HARD; @@ -2475,7 +2475,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void zombieSettings() { zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable); zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater); -@@ -1192,15 +1733,40 @@ public class PurpurWorldConfig { +@@ -1185,15 +1726,40 @@ public class PurpurWorldConfig { } catch (IllegalArgumentException ignore) { zombieBreakDoorMinDifficulty = EnumDifficulty.HARD; } @@ -2516,7 +2516,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean zombifiedPiglinRidable = false; -@@ -1209,6 +1775,8 @@ public class PurpurWorldConfig { +@@ -1202,6 +1768,8 @@ public class PurpurWorldConfig { public double zombifiedPiglinJockeyChance = 0.05D; public boolean zombifiedPiglinJockeyTryExistingChickens = true; public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = true; @@ -2525,7 +2525,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df private void zombifiedPiglinSettings() { zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable); zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater); -@@ -1216,6 +1784,13 @@ public class PurpurWorldConfig { +@@ -1209,6 +1777,13 @@ public class PurpurWorldConfig { zombifiedPiglinJockeyChance = getDouble("mobs.zombified_piglin.jockey.chance", zombifiedPiglinJockeyChance); zombifiedPiglinJockeyTryExistingChickens = getBoolean("mobs.zombified_piglin.jockey.try-existing-chickens", zombifiedPiglinJockeyTryExistingChickens); zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry); @@ -2539,7 +2539,7 @@ index 513aa507aaea6fac108dbf1dc3c3d51259b16df6..7c95423062e473d09b80ac65e15431df } public boolean zombieVillagerRidable = false; -@@ -1223,11 +1798,20 @@ public class PurpurWorldConfig { +@@ -1216,11 +1791,20 @@ public class PurpurWorldConfig { public boolean zombieVillagerJockeyOnlyBaby = true; public double zombieVillagerJockeyChance = 0.05D; public boolean zombieVillagerJockeyTryExistingChickens = true; diff --git a/patches/server/0159-Phantom-flames-on-swoop.patch b/patches/server/0158-Phantom-flames-on-swoop.patch similarity index 91% rename from patches/server/0159-Phantom-flames-on-swoop.patch rename to patches/server/0158-Phantom-flames-on-swoop.patch index dcca48032..99a113744 100644 --- a/patches/server/0159-Phantom-flames-on-swoop.patch +++ b/patches/server/0158-Phantom-flames-on-swoop.patch @@ -17,10 +17,10 @@ index 25345d8d585735af407787f2c26fe92674721239..087a91fedc49aaf6e74b81b90494849c @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 7c95423062e473d09b80ac65e15431df3bfffea0..3a356ef00a973168fb80b674596089c98f074167 100644 +index 279b9677d724f1dbbdb7efe665c4ebc00d585270..0beaa5971f7e45b5ee51f22a62f10eb1bc78957a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1138,6 +1138,7 @@ public class PurpurWorldConfig { +@@ -1131,6 +1131,7 @@ public class PurpurWorldConfig { public int phantomBurnInLight = 0; public boolean phantomIgnorePlayersWithTorch = false; public boolean phantomBurnInDaylight = true; @@ -28,7 +28,7 @@ index 7c95423062e473d09b80ac65e15431df3bfffea0..3a356ef00a973168fb80b674596089c9 public double phantomMaxHealth = 20.0D; private void phantomSettings() { phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable); -@@ -1163,6 +1164,7 @@ public class PurpurWorldConfig { +@@ -1156,6 +1157,7 @@ public class PurpurWorldConfig { phantomBurnInLight = getInt("mobs.phantom.burn-in-light", phantomBurnInLight); phantomBurnInDaylight = getBoolean("mobs.phantom.burn-in-daylight", phantomBurnInDaylight); phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch); diff --git a/patches/server/0160-Option-for-chests-to-open-even-with-a-solid-block-on.patch b/patches/server/0159-Option-for-chests-to-open-even-with-a-solid-block-on.patch similarity index 91% rename from patches/server/0160-Option-for-chests-to-open-even-with-a-solid-block-on.patch rename to patches/server/0159-Option-for-chests-to-open-even-with-a-solid-block-on.patch index 82567ca2d..09732f662 100644 --- a/patches/server/0160-Option-for-chests-to-open-even-with-a-solid-block-on.patch +++ b/patches/server/0159-Option-for-chests-to-open-even-with-a-solid-block-on.patch @@ -17,10 +17,10 @@ index 9e5e6de52efabe9126f6c47acb35fa1dc461ff4f..487b281cf53d3482853d56ee1e90a329 return iblockaccess.getType(blockposition1).isOccluding(iblockaccess, blockposition1); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 3a356ef00a973168fb80b674596089c98f074167..027419b939311aefbf12bfa109306a190ccb699c 100644 +index 0beaa5971f7e45b5ee51f22a62f10eb1bc78957a..c8b0fc1353b56d696d72e5ca1203f5f9b690cf3e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -370,6 +370,11 @@ public class PurpurWorldConfig { +@@ -363,6 +363,11 @@ public class PurpurWorldConfig { } } diff --git a/patches/server/0161-Implement-TPSBar.patch b/patches/server/0160-Implement-TPSBar.patch similarity index 97% rename from patches/server/0161-Implement-TPSBar.patch rename to patches/server/0160-Implement-TPSBar.patch index fb3ec0553..5fbf5857e 100644 --- a/patches/server/0161-Implement-TPSBar.patch +++ b/patches/server/0160-Implement-TPSBar.patch @@ -17,10 +17,10 @@ index ccd0be059f4d7b95d4ec58c0d4fc744a94fec3fd..e31f13b80aef9b410c508030c0d965ec if (commanddispatcher_servertype.d) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2374a7ee018493795389b21848289395168db422..d33047a57f232ea2260289d86836264f91a52d86 100644 +index 22e84d2e08ad436c553dc7d99046adf9ee63e9f1..9399b3c1571dfbbc58476e3d92599f589fa0094a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -473,6 +473,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant