From 111636ecc3359aee4ece2ca2a4c0dc6068a65217 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 22 Mar 2021 16:12:24 -0400 Subject: [PATCH] Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 0641de2d4 [CI-SKIP] Change some fields to textara (#5405) 98a34ea47 [CI-SKIP] ๐Ÿš€ Upgrade to new form-based templates (#5278) bca97a8f7 replace spaces in world key (touches #5397) de94f6485 Refactor chat message composition (#5396) e27f334bb [CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389) ae15e85da Updated Upstream (CraftBukkit) 26fe0ac5a Only set despawnTimer for Wandering Traders spawned by MobSpawnerTrader (#5391) b748eb7b8 Fix VanillaMobGoalTest#testBukkitMap (#5390) 18dbbb578 [Auto] Updated Upstream (CraftBukkit) fac9cc5d5 [CI-SKIP] Ignore .gitignore 087aa70e7 Deprecate ItemStack#setLore(List) and ItemStack#getLore, add Component based alternatives 9889c651c apply fixup c310f0a61 Updated Upstream (Bukkit/CraftBukkit) f17560ab0 wtf is this t file -jmp 347f3a9b8 fix compile 700e9e6a5 rebase cf4dc464a Revert de5f4e469...c270abe96 6870db613 script & POM fix 743c6533c Replace ** with * (BSD/macOS) 376d7b097 Don't remove the .java fcb3fd42a Fix macOS/BSD support 8cfc05249 Link correctly ba1031ca7 Rename work dir c8d844ab7 Actually fix preloading this time e62aa5e3e Fix class preloading 1c03cf898 It's mojang math, not minecraft math 1034873df Apply fixups 39b125771 Use revision file 956150da7 Welcome to 1.16.5-R0.2 ccb217c01 Change cache keys 0d217001c more work f6d820f07 It compiles 0f78e9525 More work 1718f61bf Updated Upstream (CraftBukkit/Spigot) b28d46114 Update scripts for NMS repackaging d4532f7e7 bug #5373 - fix AsyncChatEvent not being posted when processing a legacy APCE continuation 522ae1c51 Replace all block states of a specified block (#5055) 1cda67118 [Auto] Updated Upstream (CraftBukkit) 8c74d3126 Updated Upstream (Bukkit) (#5359) fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective Tuinity Changes: 9bdcb9b Delete work dir when running jar 6351d7c Updated Upstream (Paper) 932c199 Generate mc-dev correctly bf3e737 Make packet limiter work from IDE 1686f38 Fix packet limiter config f40f7b4 Update README.md styling (#264) da1c3ac GH Actions Changes (#213) 5f325ec Updated Upstream (Paper) 0f83fe4 Updated Upstream (Paper) 44e8e5d Do not load extra radius of chunks when loading a single chunk 31f9cae Revert custom table implementation for blockstate states 9ac33d1 Be aware of entity teleports when chunk checking entities 18c7f3f Always set impulse for projectiles to true, even if hit event failed Airplane Changes: f94d399 Merge pull request #18 from notOM3GA/upstream/nms-repackage 0fc6226 Force build for Flare update 08439d6 Updated Upstream (Tuinity) 0f80443 Updated Upstream (Tuinity) 2f6cbdc More debug for plugins not shutting down tasks 12e1b61 Updated Upstream (Tuinity) fc778d3 Update README.md db6b0eb Merge pull request #16 from DeadSteve51/patch-2 b23bee3 Remove debug 8157e98 Config style, flare style, disable tracker by def 98d0b58 Updates to README Purpur Changes: 75b07a0 Fix stack overflow on armorstand movement f754a7b Sneak to bulk process composter 1362f49 Updated Upstream (Paper, Tuinity, & Airplane) 5bf8615 [ci-skip] Conflict on change for adventure deprecations 114b37b Add purpur.yml to Flare (#204) c6dce38 forgot the crops c004236 Configurable ravager griefable blocks list 766246a [ci-skip] remove duplicate patch ac93477 Config to make Creepers explode on death (#201) 297181e Updated Upstream (Paper, Tuinity, & Airplane) 45b9a18 Config to disable Llama caravans (#203) a99a83b Allow fully disabling farmland trampling 3aa4f68 Tick fluids config 0e34d59 Add missing imports :/ 3dd9f46 Updated Upstream (Paper, Tuinity, & Airplane) Empirecraft Changes: 1b579407 Improve importmcdev script and fix first server patch f597a82e Update generatesources script 218f5298 Fix patches - imported files 847cf558 Updated Paper d51410c3 Updated Paper fb3301fd Fix bow entity ai speed/distance dbde1dc4 Add isJoined boolean to fake players a23317f7 Update Fake Player API - misc changes a970b77f Updated Paper --- PATCHES.md | 75 +- Paper | 2 +- .../src/main/kotlin/ConfigureSubprojects.kt | 22 +- buildSrc/src/main/kotlin/InitTasks.kt | 1 + .../src/main/kotlin/ToothpickExtension.kt | 5 +- buildSrc/src/main/kotlin/Util.kt | 20 +- .../kotlin/relocation/ToothpickRelocator.kt | 58 + buildSrc/src/main/kotlin/task/ImportMCDev.kt | 64 +- buildSrc/src/main/kotlin/task/RepackageNMS.kt | 108 + ...difiedLog4j2PluginsCacheFileTransformer.kt | 122 +- .../server/0001-Airplane-MC-Dev-Fixes.patch | 83 +- .../0002-Airplane-Branding-Changes.patch | 112 + ...atch => 0003-Airplane-Configuration.patch} | 19 +- ...treams.patch => 0004-Remove-streams.patch} | 18 +- ...ing-for-EntityLiving-hasLineOfSight.patch} | 117 +- ...elessRecipes-comparison-for-Vanilla.patch} | 14 +- ...odifiableMap-instead-of-making-copy.patch} | 10 +- ...priority-of-checks-in-chunk-ticking.patch} | 10 +- ...009-Reduce-projectile-chunk-loading.patch} | 19 +- ...imize-random-calls-in-chunk-ticking.patch} | 98 +- ...-get-entity-equipment-if-not-needed.patch} | 10 +- ...ch => 0012-Dynamic-activation-range.patch} | 191 +- ...cs-improve-perf-of-StructureManager.patch} | 36 +- ...y.patch => 0014-Cache-palette-array.patch} | 84 +- ...> 0015-Reduce-chunk-loading-lookups.patch} | 43 +- ...kip-POI-finding-if-stuck-in-vehicle.patch} | 20 +- ...ler.patch => 0017-Airplane-Profiler.patch} | 118 +- ... 0018-Multithreaded-entity-tracking.patch} | 134 +- ...kip-copying-unloading-tile-entities.patch} | 12 +- ...ty-chunk-ticking-checks-from-3-to-1.patch} | 16 +- ...e-iterators-from-inventory-contains.patch} | 12 +- ...0022-Cache-entityhuman-display-name.patch} | 12 +- ...urn-optimization-for-target-finding.patch} | 10 +- ...-for-plugins-not-shutting-down-tasks.patch | 22 + .../server/0001-Disable-the-Snooper.patch | 6 +- ...le-I-O-operation-on-load-player-file.patch | 12 +- ...aps-the-predicate-order-of-collision.patch | 10 +- ...otable-Refresh-for-non-player-intera.patch | 10 +- ...it.createInventory-with-type-LECTERN.patch | 42 +- .../0003-dont-load-chunks-for-physics.patch | 38 +- .../server/0001-Origami-Server-Config.patch | 30 +- ...Optimize-inventory-API-item-handling.patch | 10 +- ...chunk-with-seed-based-feature-search.patch | 12 +- ...-some-streams-and-object-allocations.patch | 12 +- .../server/0005-Hopper-Optimizations.patch | 94 +- ...dd-option-to-disable-observer-clocks.patch | 10 +- .../0007-Add-timings-for-Behavior.patch | 16 +- ...tities-when-damage-event-is-cancelle.patch | 12 +- ...x-exp-drop-of-zombie-pigmen-MC-56653.patch | 10 +- .../0017-ItemStack-convenience-methods.patch | 4 +- ...oc-warnings-missing-param-and-return.patch | 46 +- ...on-change-for-adventure-deprecations.patch | 867 +++ .../Purpur/patches/server/0001-Rebrand.patch | 46 +- .../server/0002-Purpur-config-files.patch | 51 +- .../0004-Barrels-and-enderchests-6-rows.patch | 110 +- .../patches/server/0005-Advancement-API.patch | 51 +- .../patches/server/0006-Llama-API.patch | 78 +- .../Purpur/patches/server/0007-AFK-API.patch | 244 +- .../server/0008-Bring-back-server-name.patch | 14 +- .../0009-Configurable-server-mod-name.patch | 10 +- .../0010-LivingEntity-safeFallDistance.patch | 72 +- .../server/0011-Lagging-threshold.patch | 12 +- .../0012-ItemFactory-getMonsterEgg.patch | 20 +- ...013-PlayerSetSpawnerTypeWithEggEvent.patch | 30 +- .../0014-EMC-MonsterEggSpawnEvent.patch | 27 +- .../0015-Player-invulnerabilities.patch | 42 +- .../patches/server/0016-Anvil-API.patch | 38 +- ...17-Configurable-villager-brain-ticks.patch | 20 +- .../0018-Alternative-Keepalive-Handling.patch | 26 +- .../server/0019-Silk-touch-spawners.patch | 156 +- ...772-Fix-Add-turtle-egg-block-options.patch | 28 +- ...x-vanilla-command-permission-handler.patch | 4 +- ...-settings-suppressing-pointless-logs.patch | 8 +- .../0023-Disable-outdated-build-check.patch | 4 +- .../server/0024-Giants-AI-settings.patch | 157 +- .../server/0025-Illusioners-AI-settings.patch | 12 +- .../0026-Zombie-horse-naturally-spawn.patch | 20 +- ...0027-Charged-creeper-naturally-spawn.patch | 37 +- ...bit-naturally-spawn-toast-and-killer.patch | 14 +- ...ver-showing-in-ping-before-server-fu.patch | 10 +- .../server/0030-Make-Iron-Golems-Swim.patch | 20 +- ...031-Dont-send-useless-entity-packets.patch | 56 +- .../server/0032-Tulips-change-fox-type.patch | 37 +- .../server/0033-Breedable-Polar-Bears.patch | 40 +- .../server/0034-Chickens-can-retaliate.patch | 27 +- ...option-to-set-armorstand-step-height.patch | 12 +- .../server/0036-Cat-spawning-options.patch | 94 +- ...on-black-cats-spawning-in-swamp-huts.patch | 10 +- .../server/0038-Cows-eat-mushrooms.patch | 66 +- ...cow-rotation-when-shearing-mooshroom.patch | 10 +- .../server/0040-Pigs-give-saddle-back.patch | 12 +- ...41-Snowman-drop-and-put-back-pumpkin.patch | 14 +- ...42-Ender-dragon-always-drop-full-exp.patch | 12 +- .../0043-Signs-editable-on-right-click.patch | 30 +- .../server/0044-Signs-allow-color-codes.patch | 42 +- ...moisten-from-water-directly-under-it.patch | 12 +- .../server/0046-Controllable-Minecarts.patch | 122 +- ...able-loot-drops-on-death-by-cramming.patch | 12 +- ...048-Players-should-not-cram-to-death.patch | 10 +- ...ption-to-toggle-milk-curing-bad-omen.patch | 21 +- ...hould-check-if-entity-can-use-portal.patch | 10 +- ...0051-Fix-the-dead-lagging-the-server.patch | 20 +- ...-Skip-events-if-there-s-no-listeners.patch | 12 +- .../0053-Add-permission-for-F3-N-debug.patch | 10 +- ...-skeleton-takes-wither-damage-option.patch | 12 +- .../0055-Configurable-TPS-Catchup.patch | 6 +- ...low-loyalty-on-tridents-to-work-in-t.patch | 12 +- ...derman-and-creeper-griefing-controls.patch | 26 +- ...up-loot-bypass-mob-griefing-gamerule.patch | 12 +- ...ing-can-bypass-mob-griefing-gamerule.patch | 12 +- ...0060-Villagers-follow-emerald-blocks.patch | 62 +- .../0061-Allow-leashing-villagers.patch | 40 +- ...urable-search-radius-for-villagers-t.patch | 12 +- .../server/0063-Implement-infinite-lava.patch | 24 +- ...64-Make-lava-flow-speed-configurable.patch | 12 +- ...Add-player-death-exp-control-options.patch | 14 +- .../0066-Add-canSaveToDisk-to-Entity.patch | 34 +- ...0067-Configurable-void-damage-height.patch | 12 +- ...ispenser-curse-of-binding-protection.patch | 32 +- ...n-for-boats-to-eject-players-on-land.patch | 12 +- .../0070-Add-obfhelpers-for-plugin-use.patch | 10 +- ...g-mends-most-damages-equipment-first.patch | 86 +- ...0072-Add-5-second-tps-average-in-tps.patch | 12 +- .../0073-Implement-elytra-settings.patch | 52 +- .../server/0074-Item-entity-immunities.patch | 113 +- .../server/0075-Add-ping-command.patch | 70 +- .../0076-Configurable-jockey-options.patch | 60 +- ...ed-to-crystals-and-crystals-shoot-ph.patch | 85 +- .../0078-Add-phantom-spawning-options.patch | 115 +- ...0079-Implement-bed-explosion-options.patch | 26 +- ...ent-respawn-anchor-explosion-options.patch | 14 +- ...-Add-allow-water-in-end-world-option.patch | 78 +- .../0082-Allow-color-codes-in-books.patch | 14 +- .../patches/server/0083-Entity-lifespan.patch | 46 +- ...leport-to-spawn-if-outside-world-bor.patch | 44 +- .../server/0085-Squid-EAR-immunity.patch | 16 +- .../0086-Configurable-end-spike-seed.patch | 16 +- .../0087-Configurable-dungeon-seed.patch | 14 +- .../server/0088-Phantoms-burn-in-light.patch | 46 +- .../0089-Configurable-villager-breeding.patch | 12 +- .../0090-Redstone-deactivates-spawners.patch | 14 +- .../0091-Totems-work-in-inventory.patch | 12 +- .../server/0092-Populator-seed-controls.patch | 28 +- ...3-Add-vindicator-johnny-spawn-chance.patch | 20 +- ...on-to-disable-mushroom-block-updates.patch | 14 +- .../0095-Dispensers-place-anvils-option.patch | 34 +- .../server/0096-Allow-anvil-colors.patch | 14 +- .../server/0097-Add-no-tick-block-list.patch | 46 +- ...o-disable-dolphin-treasure-searching.patch | 12 +- .../server/0099-Short-enderman-height.patch | 48 +- ...Stop-squids-floating-on-top-of-water.patch | 30 +- .../Purpur/patches/server/0101-Ridables.patch | 6652 +++++++++-------- ...d-height-for-nether-surface-builders.patch | 10 +- ...ing-obsidian-valid-for-portal-frames.patch | 36 +- ...tities-can-use-portals-configuration.patch | 14 +- ...0105-LivingEntity-broadcastItemBreak.patch | 4 +- ...stomizable-wither-health-and-healing.patch | 16 +- ...ggling-special-MobSpawners-per-world.patch | 136 +- .../server/0108-Raid-cooldown-setting.patch | 16 +- ...e-config-options-per-projectile-type.patch | 156 +- ...sable-zombie-aggressiveness-towards-.patch | 26 +- ...tent-TileEntity-Lore-and-DisplayName.patch | 135 +- ...e-to-recipe-s-ExactChoice-ingredient.patch | 16 +- .../server/0113-Flying-squids-Oh-my.patch | 16 +- .../server/0114-Infinity-bow-settings.patch | 14 +- .../server/0115-Stonecutter-damage.patch | 32 +- .../0116-Configurable-daylight-cycle.patch | 36 +- ...te-and-mending-enchantments-together.patch | 14 +- .../server/0118-Infinite-fuel-furnace.patch | 30 +- ...ows-should-not-reset-despawn-counter.patch | 10 +- ...20-Add-tablist-suffix-option-for-afk.patch | 14 +- ...re-add-farmland-mechanics-from-Alpha.patch | 12 +- ...justable-breeding-cooldown-to-config.patch | 48 +- ...e-entity-breeding-times-configurable.patch | 464 +- ...mes-from-item-forms-of-entities-to-e.patch | 112 +- ...-when-using-a-Name-Tag-on-an-Armor-S.patch | 20 +- ...sting-and-weeping-vines-growth-rates.patch | 66 +- ...-twisting-vines-configurable-max-gro.patch | 46 +- ...llowing-Endermen-to-despawn-even-whi.patch | 12 +- ...-check-to-EntityDamagedByEntityEvent.patch | 18 +- ...130-Add-configurable-snowball-damage.patch | 12 +- ...break-door-minimum-difficulty-option.patch | 38 +- .../server/0132-Add-demo-command.patch | 38 +- .../patches/server/0133-Left-handed-API.patch | 2 +- ...mi-Fix-ProtocolLib-issues-on-Java-15.patch | 18 +- ...35-Changeable-Mob-Left-Handed-Chance.patch | 12 +- .../0136-Add-boat-fall-damage-config.patch | 20 +- ...-disable-saving-projectiles-to-disk-.patch | 16 +- .../0138-Snow-Golem-rate-of-fire-config.patch | 12 +- ...g-option-for-Piglins-guarding-chests.patch | 12 +- ...C-Configurable-disable-give-dropping.patch | 14 +- ...-climbing-should-not-bypass-cramming.patch | 6 +- .../0142-Lobotomize-stuck-villagers.patch | 65 +- ...Villager-Clerics-to-farm-Nether-Wart.patch | 196 +- ...fied-Piglin-death-always-counting-as.patch | 14 +- ...d-out-and-optimise-player-list-ticks.patch | 16 +- ...ble-chance-for-wolves-to-spawn-rabid.patch | 135 +- ...nfigurable-default-wolf-collar-color.patch | 24 +- ...-Configurable-entity-base-attributes.patch | 1492 ++-- .../server/0149-Phantom-flames-on-swoop.patch | 12 +- ...s-to-open-even-with-a-solid-block-on.patch | 12 +- .../server/0151-Implement-TPSBar.patch | 34 +- .../0152-Striders-give-saddle-back.patch | 12 +- .../server/0153-PlayerBookTooLargeEvent.patch | 14 +- ...therite-armor-grants-fire-resistance.patch | 12 +- ...0155-Fix-rotating-UP-DOWN-CW-and-CCW.patch | 12 +- ...iefing-bypass-to-everything-affected.patch | 552 +- ...allow-Note-Block-sounds-when-blocked.patch | 12 +- ...0158-Add-EntityTeleportHinderedEvent.patch | 66 +- .../0159-Add-StructureGenerateEvent.patch | 30 +- .../0160-Farmland-trampling-changes.patch | 50 +- ...1-Movement-options-for-armor-stands.patch} | 40 +- .../server/0162-Fix-stuck-in-portals.patch | 36 +- ...yerEditBookEvent-not-saving-new-book.patch | 10 +- ...-to-use-infinity-bows-without-arrows.patch | 12 +- ...oggle-for-water-sensitive-mob-damage.patch | 110 +- ...66-Config-to-always-tame-in-Creative.patch | 90 +- .../0167-End-crystal-explosion-options.patch | 16 +- ...-Add-unsafe-Entity-serialization-API.patch | 26 +- ...0169-Add-ghast-allow-griefing-option.patch | 28 +- ...ither-Ender-Dragon-can-ride-vehicles.patch | 40 +- .../server/0171-Dont-run-with-scissors.patch | 14 +- .../patches/server/0172-One-Punch-Man.patch | 22 +- ...0173-Add-config-for-snow-on-blue-ice.patch | 12 +- ...er-Pearl-cooldown-damage-and-Endermi.patch | 28 +- ...-to-ignore-nearby-mobs-when-sleeping.patch | 12 +- ...Enderman-to-aggro-spawned-Endermites.patch | 16 +- ...-Dragon-Head-wearers-and-stare-aggro.patch | 24 +- .../server/0178-Tick-fluids-config.patch | 53 + ...179-Config-to-disable-Llama-caravans.patch | 53 + ...ig-to-make-Creepers-explode-on-death.patch | 77 + ...urable-ravager-griefable-blocks-list.patch | 68 + ...0182-Sneak-to-bulk-process-composter.patch | 61 + .../api/0001-Tuinity-POM-Changes.patch | 2 +- .../server/0001-Tuinity-POM-Changes.patch | 4 +- .../patches/server/0002-Brand-changes.patch | 14 +- .../patches/server/0003-MC-Dev-fixes.patch | 12 +- .../patches/server/0004-Util-patch.patch | 482 +- .../server/0005-Tuinity-Server-Config.patch | 52 +- ...7-Multi-Threaded-ticking-CraftBukkit.patch | 2 +- .../server/0008-Add-soft-async-catcher.patch | 116 +- .../server/0009-Delay-chunk-unloads.patch | 40 +- ...culate-regionfile-header-if-it-is-co.patch | 185 +- .../0011-Lag-compensate-block-breaking.patch | 28 +- .../server/0013-Per-World-Spawn-Limits.patch | 4 +- ...l-more-information-in-watchdog-dumps.patch | 264 +- .../0015-Execute-chunk-tasks-mid-tick.patch | 230 +- ...-use-NORMAL-priority-rather-than-LOW.patch | 26 +- ...trolled-flushing-for-network-manager.patch | 28 +- ...ush-calls-for-entity-tracker-packets.patch | 16 +- .../server/0019-Time-scoreboard-search.patch | 6 +- ...0-Make-CallbackExecutor-strict-again.patch | 20 +- ...imise-entity-hard-collision-checking.patch | 296 +- ...oversized-chunk-data-packet-handling.patch | 24 +- ...e-iterator-allocation-from-chunk-gen.patch | 24 +- ...g-map-entry-creation-in-light-engine.patch | 14 +- ...single-and-multi-AABB-VoxelShapes-an.patch | 1420 ++-- ...llocation-rate-from-crammed-entities.patch | 12 +- .../0027-Optimise-chunk-tick-iteration.patch | 20 +- ...ticking-chunk-map-for-entity-tracker.patch | 10 +- ...event-moving-into-unloaded-chunk-che.patch | 12 +- ...-to-not-load-chunks-when-crossing-wo.patch | 52 +- ...t-Async-retaining-chunks-for-long-pe.patch | 8 +- ...ework-PlayerChunk-main-thread-checks.patch | 30 +- ...o-be-removed-from-a-world-while-tick.patch | 38 +- ...alls-removing-tickets-for-sync-loads.patch | 24 +- ...on-checking-in-player-move-packet-ha.patch | 24 +- ...ally-inline-methods-in-BlockPosition.patch | 28 +- ...locking-from-state-access-in-UserCac.patch | 24 +- .../0038-Distance-manager-tick-timings.patch | 16 +- ...ix-swamp-hut-cat-generation-deadlock.patch | 22 +- ...heck-flag-dirty-calls-in-PlayerChunk.patch | 12 +- ...ket-level-changes-while-unloading-pl.patch | 26 +- ...d-getChunkAt-has-inlined-logic-for-l.patch | 12 +- .../0045-Add-packet-limiter-config.patch | 48 +- .../0046-Optimise-closest-entity-lookup.patch | 366 +- .../0047-Optimise-nearby-player-lookups.patch | 752 +- .../0048-Remove-streams-for-villager-AI.patch | 214 +- ...t-lookup-fluid-state-when-raytracing.patch | 10 +- .../0050-Reduce-pathfinder-branches.patch | 42 +- ...tives-for-encryption-and-compression.patch | 82 +- ...52-Optimise-non-flush-packet-sending.patch | 14 +- ...ayerchunkmap-instance-in-light-threa.patch | 10 +- ...ot-load-chunks-during-a-crash-report.patch | 6 +- ...ove-abnormal-server-shutdown-process.patch | 30 +- ...py-passenger-list-in-enderTeleportTo.patch | 10 +- .../patches/server/0057-Revert-MC-4-fix.patch | 10 +- ...eue-overfill-when-no-players-are-onl.patch | 20 +- ...tructureLocateEvent-to-change-worlds.patch | 10 +- ...cancellation-of-projectile-hit-event.patch | 86 +- .../0061-Rewrite-the-light-engine.patch | 1400 ++-- .../0062-Optimise-WorldServer-notify.patch | 124 +- .../0063-Actually-unload-POI-data.patch | 210 +- ...-packets-for-hard-colliding-entities.patch | 14 +- ...chunks-refusing-to-unload-at-low-TPS.patch | 10 +- ...0066-Fix-incorrect-isRealPlayer-init.patch | 12 +- ...67-Do-not-run-raytrace-logic-for-AIR.patch | 10 +- ...cker-use-highest-range-of-passengers.patch | 53 +- ...-server-to-unload-chunks-at-request-.patch | 10 +- ...-logic-for-inventories-on-chunk-unlo.patch | 63 +- ...71-Fix-NPE-in-pickup-logic-for-arrow.patch | 10 +- ...kup-lambda-allocation-from-counting-.patch | 26 +- ...3-Optimise-snow-ice-in-chunk-ticking.patch | 114 +- ...primise-map-impl-for-tracked-players.patch | 16 +- ...able-for-maintaing-changed-block-set.patch | 12 +- ...6-Replace-player-chunk-loader-system.patch | 668 +- .../0077-Optimise-general-POI-access.patch | 180 +- ...ty-teleports-when-chunk-checking-ent.patch | 50 + patches/api/0001-Modify-POM.patch | 6 +- .../0002-Yatopia-Config-Redirect-Config.patch | 2 +- .../api/0003-Add-GameProfileLookupEvent.patch | 8 +- patches/api/0004-Add-last-tick-time-API.patch | 4 +- ...005-Add-NBT-API-as-a-first-class-lib.patch | 14 +- patches/server/0001-Modify-POM.patch | 7 +- patches/server/0002-Brandings.patch | 28 +- patches/server/0003-Utilities.patch | 2 +- .../0004-Add-GameProfileLookupEvent.patch | 12 +- .../server/0005-Add-last-tick-time-API.patch | 10 +- .../server/0006-Yatopia-configuration.patch | 68 +- ...7-Per-entity-type-collision-settings.patch | 22 +- ...llow-to-change-the-piston-push-limit.patch | 14 +- ...009-Add-NBT-API-as-a-first-class-lib.patch | 8 +- .../server/0010-Modify-default-configs.patch | 2 +- .../server/0011-lithium-MixinDirection.patch | 14 +- patches/server/0012-lithium-MixinBox.patch | 10 +- patches/server/0013-lithium-enum_values.patch | 118 +- .../0014-lithium-MixinGoalSelector.patch | 14 +- .../server/0016-Item-stuck-sleep-config.patch | 10 +- .../0017-Option-for-simpler-Villagers.patch | 68 +- ...ize-furnance-fuel-and-recipe-lookups.patch | 12 +- ...0019-Optimize-TileEntity-load-unload.patch | 10 +- patches/server/0020-Global-Eula-file.patch | 8 +- patches/server/0021-Redirect-Configs.patch | 14 +- .../0022-lithium-DataTrackerMixin.patch | 14 +- .../0023-Fix-lead-fall-dmg-config.patch | 10 +- ...ze-some-stuff-in-WorldServer-ticking.patch | 18 +- .../0025-Optimize-BehaviorController.patch | 20 +- .../0026-Add-timings-for-Pathfinder.patch | 20 +- ...ghly-optimize-VillagePlace-filtering.patch | 186 +- .../0028-Nuke-streams-off-BlockPosition.patch | 34 +- ...029-Nuke-streams-off-SectionPosition.patch | 22 +- ...op-wasting-resources-on-JsonList-get.patch | 24 +- ...-Fix-LightEngineThreaded-memory-leak.patch | 20 +- .../0032-Shutdown-Bootstrap-thread-pool.patch | 36 +- patches/server/0033-Optimize-Villagers.patch | 40 +- ...st-command-for-multiple-additions-re.patch | 118 +- .../server/0035-PlayerAttackEntityEvent.patch | 10 +- ...6-Ensure-pools-create-daemon-threads.patch | 38 +- ...undsException-when-sending-too-many-.patch | 12 +- patches/server/0039-Add-nspt-command.patch | 12 +- .../0040-Configurable-flight-checks.patch | 12 +- ...ze-recipe-lookups-in-CraftingManager.patch | 46 +- .../0042-Optimize-advancement-loading.patch | 22 +- ...0043-lithium-PerlinNoiseSamplerMixin.patch | 23 +- ...-lithium-VoronoiBiomeAccessTypeMixin.patch | 14 +- ...045-lithium-NoiseChunkGeneratorMixin.patch | 20 +- .../0046-lithium-reduce-allocations.patch | 14 +- .../0047-Smarter-statistics-ticking.patch | 10 +- ...0048-Configurable-criterion-triggers.patch | 12 +- .../0049-Configurable-BlockPhysicsEvent.patch | 4 +- .../server/0050-Custom-Locale-Support.patch | 12 +- .../0051-Configurable-movement-checks.patch | 16 +- ...2-Configurable-enchanting-table-tick.patch | 20 +- .../0053-Optimised-hallowen-checker.patch | 54 +- .../0054-Smol-entity-optimisations.patch | 12 +- ...dd-config-for-logging-login-location.patch | 10 +- ...056-Preload-ProtocolLib-EnumWrappers.patch | 4 +- ...57-lithium-cache-chunk-gen-sea-level.patch | 14 +- patches/server/0058-New-nbt-cache.patch | 24 +- .../0059-Suspected-plugins-report.patch | 148 +- upstream/Airplane | 2 +- upstream/Empirecraft | 2 +- upstream/Purpur | 2 +- upstream/Tuinity | 2 +- upstreamCommits/Airplane | 2 +- upstreamCommits/Empirecraft | 2 +- upstreamCommits/Purpur | 2 +- upstreamCommits/Tuinity | 2 +- upstreamConfig/0002-Airplane.properties | 4 + upstreamConfig/0003-Airplane.properties | 4 - ...rpur.properties => 0003-Purpur.properties} | 0 381 files changed, 15791 insertions(+), 12728 deletions(-) create mode 100644 buildSrc/src/main/kotlin/relocation/ToothpickRelocator.kt create mode 100644 buildSrc/src/main/kotlin/task/RepackageNMS.kt create mode 100644 patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch rename patches/Airplane/patches/server/{0002-Airplane-Configuration.patch => 0003-Airplane-Configuration.patch} (95%) rename patches/Airplane/patches/server/{0003-Remove-streams.patch => 0004-Remove-streams.patch} (73%) rename patches/Airplane/patches/server/{0004-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch => 0005-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch} (71%) rename patches/Airplane/patches/server/{0005-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch => 0006-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch} (85%) rename patches/Airplane/patches/server/{0006-Use-unmodifiableMap-instead-of-making-copy.patch => 0007-Use-unmodifiableMap-instead-of-making-copy.patch} (73%) rename patches/Airplane/patches/server/{0007-Swap-priority-of-checks-in-chunk-ticking.patch => 0008-Swap-priority-of-checks-in-chunk-ticking.patch} (80%) rename patches/Airplane/patches/server/{0008-Reduce-projectile-chunk-loading.patch => 0009-Reduce-projectile-chunk-loading.patch} (69%) rename patches/Airplane/patches/server/{0009-Optimize-random-calls-in-chunk-ticking.patch => 0010-Optimize-random-calls-in-chunk-ticking.patch} (78%) rename patches/Airplane/patches/server/{0010-Don-t-get-entity-equipment-if-not-needed.patch => 0011-Don-t-get-entity-equipment-if-not-needed.patch} (82%) rename patches/Airplane/patches/server/{0011-Dynamic-activation-range.patch => 0012-Dynamic-activation-range.patch} (70%) rename patches/Airplane/patches/server/{0012-Reduce-allocs-improve-perf-of-StructureManager.patch => 0013-Reduce-allocs-improve-perf-of-StructureManager.patch} (73%) rename patches/Airplane/patches/server/{0013-Cache-palette-array.patch => 0014-Cache-palette-array.patch} (59%) rename patches/Airplane/patches/server/{0014-Reduce-chunk-loading-lookups.patch => 0015-Reduce-chunk-loading-lookups.patch} (57%) rename patches/Airplane/patches/server/{0015-Skip-POI-finding-if-stuck-in-vehicle.patch => 0016-Skip-POI-finding-if-stuck-in-vehicle.patch} (59%) rename patches/Airplane/patches/server/{0016-Airplane-Profiler.patch => 0017-Airplane-Profiler.patch} (85%) rename patches/Airplane/patches/server/{0017-Multithreaded-entity-tracking.patch => 0018-Multithreaded-entity-tracking.patch} (84%) rename patches/Airplane/patches/server/{0018-Skip-copying-unloading-tile-entities.patch => 0019-Skip-copying-unloading-tile-entities.patch} (78%) rename patches/Airplane/patches/server/{0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch => 0020-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch} (80%) rename patches/Airplane/patches/server/{0020-Remove-iterators-from-inventory-contains.patch => 0021-Remove-iterators-from-inventory-contains.patch} (67%) rename patches/Airplane/patches/server/{0021-Cache-entityhuman-display-name.patch => 0022-Cache-entityhuman-display-name.patch} (69%) rename patches/Airplane/patches/server/{0022-Early-return-optimization-for-target-finding.patch => 0023-Early-return-optimization-for-target-finding.patch} (71%) create mode 100644 patches/Airplane/patches/server/0024-More-debug-for-plugins-not-shutting-down-tasks.patch create mode 100644 patches/Purpur/patches/api/0037-Conflict-on-change-for-adventure-deprecations.patch rename patches/Purpur/patches/server/{0161-Movement-options-for-armour-stands.patch => 0161-Movement-options-for-armor-stands.patch} (66%) create mode 100644 patches/Purpur/patches/server/0178-Tick-fluids-config.patch create mode 100644 patches/Purpur/patches/server/0179-Config-to-disable-Llama-caravans.patch create mode 100644 patches/Purpur/patches/server/0180-Config-to-make-Creepers-explode-on-death.patch create mode 100644 patches/Purpur/patches/server/0181-Configurable-ravager-griefable-blocks-list.patch create mode 100644 patches/Purpur/patches/server/0182-Sneak-to-bulk-process-composter.patch create mode 100644 patches/Tuinity/patches/server/0078-Be-aware-of-entity-teleports-when-chunk-checking-ent.patch create mode 100644 upstreamConfig/0002-Airplane.properties delete mode 100644 upstreamConfig/0003-Airplane.properties rename upstreamConfig/{0002-Purpur.properties => 0003-Purpur.properties} (100%) diff --git a/PATCHES.md b/PATCHES.md index 9201aa6f..0413aeff 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -8,22 +8,22 @@ # Patches | Side | Patch | Author | CoAuthors | | ----- | ------------- |:-------------:| -----:| -| api | AFK API | William Blake Galbreath | | | server | AFK API | William Blake Galbreath | | +| api | AFK API | William Blake Galbreath | | | server | Ability to re-add farmland mechanics from Alpha | Yive | | | server | Actually unload POI data | Spottedleaf | | | server | Add /ping command | William Blake Galbreath | | | server | Add 5 second tps average in /tps | William Blake Galbreath | | | api | Add ChatColor.getById | Aikar | | -| api | Add EntityTeleportHinderedEvent | Mariell Hoversholm | | | server | Add EntityTeleportHinderedEvent | Mariell Hoversholm | | -| api | Add GameProfileLookupEvent | tr7zw | | +| api | Add EntityTeleportHinderedEvent | Mariell Hoversholm | | | server | Add GameProfileLookupEvent | tr7zw | | +| api | Add GameProfileLookupEvent | tr7zw | | | server | Add IntelliJ IDEA runnable | Zoe | | -| api | Add NBT API as a first-class lib | tr7zw | | | server | Add NBT API as a first-class lib | tr7zw | | -| api | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm | +| api | Add NBT API as a first-class lib | tr7zw | | | server | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm | +| api | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm | | server | Add Velocity natives for encryption and compression | Andrew Steinborn | | | server | Add adjustable breeding cooldown to config | montlikadani | | | server | Add allow water in end world option | William Blake Galbreath | | @@ -32,13 +32,13 @@ # Patches | server | Add config for allowing Endermen to despawn even while | jmp | | | server | Add config for snow on blue ice | BillyGalbreath | | | server | Add configurable snowball damage | BillyGalbreath | | -| api | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | | | server | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | | +| api | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | | | server | Add demo command | BillyGalbreath | | | server | Add enderman and creeper griefing controls | William Blake Galbreath | | | server | Add ghast allow-griefing option | BillyGalbreath | | -| api | Add last tick time API | Ivan Pekov | tr7zw | | server | Add last tick time API | Ivan Pekov | tr7zw | +| api | Add last tick time API | Ivan Pekov | tr7zw | | server | Add mobGriefing bypass to everything affected | Encode42 | | | server | Add no-tick block list | William Blake Galbreath | | | server | Add nspt command | Ivan Pekov | | @@ -48,27 +48,28 @@ # Patches | server | Add option to disable dolphin treasure searching | William Blake Galbreath | | | server | Add option to disable mushroom block updates | William Blake Galbreath | | | server | Add option to disable observer clocks | Phoenix616 | | -| api | Add option to disable zombie aggressiveness towards villagers | nitricspace | | | server | Add option to disable zombie aggressiveness towards villagers | nitricspace | | +| api | Add option to disable zombie aggressiveness towards villagers | nitricspace | | | server | Add option to set armorstand step height | William Blake Galbreath | | | server | Add option to teleport to spawn if outside world border | William Blake Galbreath | | | server | Add packet limiter config | Spottedleaf | | | server | Add permission for F3+N debug | William Blake Galbreath | | | server | Add phantom spawning options | William Blake Galbreath | | | server | Add player death exp control options | William Blake Galbreath | | -| api | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | | | server | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | | +| api | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | | | server | Add soft async catcher | Spottedleaf | | | server | Add tablist suffix option for afk | montlikadani | | | server | Add timings for Behavior | Phoenix616 | | | server | Add timings for Pathfinder | MrIvanPlays | | | server | Add twisting and weeping vines growth rates | BillyGalbreath | | -| api | Add unsafe Entity serialization API | Mariell Hoversholm | | | server | Add unsafe Entity serialization API | Mariell Hoversholm | | +| api | Add unsafe Entity serialization API | Mariell Hoversholm | | | server | Add vindicator johnny spawn chance | William Blake Galbreath | | | server | Add wither skeleton takes wither damage option | William Blake Galbreath | | -| api | Advancement API | William Blake Galbreath | | | server | Advancement API | William Blake Galbreath | | +| api | Advancement API | William Blake Galbreath | | +| server | Airplane Branding Changes | Paul Sauve | | | server | Airplane Configuration | Paul Sauve | | | server | Airplane MC Dev Fixes | Paul Sauve | | | server | Airplane Profiler | Paul Sauve | | @@ -84,18 +85,19 @@ # Patches | server | Allow toggling special MobSpawners per world | jmp | | | api | Alphabetize in-game /plugins list | BillyGalbreath | | | server | Alternative Keepalive Handling | William Blake Galbreath | | -| api | Anvil API | William Blake Galbreath | | | server | Anvil API | William Blake Galbreath | | +| api | Anvil API | William Blake Galbreath | | | server | Apply display names from item forms of entities to entities | jmp | | | server | Arrows should not reset despawn counter | William Blake Galbreath | | | server | Attempt to recalculate regionfile header if it is corrupt | Spottedleaf | | | server | Avoid double I/O operation on load player file | ใ„—ใ„ ห‹ ใ„‘ใ„งหŠ | | | server | Barrels and enderchests 6 rows | William Blake Galbreath | | +| server | Be aware of entity teleports when chunk checking entities | Spottedleaf | | | server | Brand changes | Spottedleaf | | | server | Brandings | YatopiaMC | | | server | Breedable Polar Bears | William Blake Galbreath | | -| api | Bring back server name | William Blake Galbreath | | | server | Bring back server name | William Blake Galbreath | | +| api | Bring back server name | William Blake Galbreath | | | server | Cache entityhuman display name | Paul Sauve | | | server | Cache palette array | Paul Sauve | | | server | Cat spawning options | William Blake Galbreath | | @@ -109,8 +111,10 @@ # Patches | server | Config migration: disable saving projectiles to disk -> | jmp | | | server | Config to allow Note Block sounds when blocked | Encode42 | | | server | Config to always tame in Creative | Encode42 | | +| server | Config to disable Llama caravans | Encode42 | | | server | Config to ignore Dragon Head wearers and stare aggro | Encode42 | | | server | Config to ignore nearby mobs when sleeping | Encode42 | | +| server | Config to make Creepers explode on death | Encode42 | | | server | Config to use infinity bows without arrows | Encode42 | | | server | Configs for if Wither/Ender Dragon can ride vehicles | jmp | | | server | Configurable BlockPhysicsEvent | Mykyta Komarnytskyy | | @@ -128,10 +132,12 @@ # Patches | server | Configurable jockey options | William Blake Galbreath | | | server | Configurable movement checks | l_MrBoom_l | | | api | Configurable permission message upgrades | William Blake Galbreath | | +| server | Configurable ravager griefable blocks list | BillyGalbreath | | | server | Configurable server mod name | William Blake Galbreath | | | server | Configurable villager brain ticks | William Blake Galbreath | | | server | Configurable villager breeding | draycia | | | server | Configurable void damage height | William Blake Galbreath | | +| api | Conflict on change for adventure deprecations | BillyGalbreath | | | server | Consolidate flush calls for entity tracker packets | Spottedleaf | | | server | Controllable Minecarts | William Blake Galbreath | | | server | Copy passenger list in enderTeleportTo | Spottedleaf | | @@ -166,8 +172,8 @@ # Patches | server | Dont send useless entity packets | William Blake Galbreath | | | server | Dynamic activation range | Paul Sauve | | | server | EMC - Configurable disable give dropping | Aikar | | -| api | EMC - MonsterEggSpawnEvent | Aikar | | | server | EMC - MonsterEggSpawnEvent | Aikar | | +| api | EMC - MonsterEggSpawnEvent | Aikar | | | server | Early return optimization for target finding | Paul Sauve | | | server | End crystal explosion options | Ben Kerllenevich | | | server | End gateway should check if entity can use portal | William Blake Galbreath | | @@ -198,8 +204,8 @@ # Patches | server | Fix the dead lagging the server | William Blake Galbreath | | | server | Fix vanilla command permission handler | William Blake Galbreath | | | server | Flying squids! Oh my! | William Blake Galbreath | | -| api | Full netherite armor grants fire resistance | BillyGalbreath | | | server | Full netherite armor grants fire resistance | BillyGalbreath | | +| api | Full netherite armor grants fire resistance | BillyGalbreath | | | server | Giants AI settings | William Blake Galbreath | | | server | Global Eula file | tr7zw | | | server | Heavily optimize furnance fuel and recipe lookups | tr7zw | Mykyta Komarn | @@ -220,24 +226,24 @@ # Patches | server | Improved oversized chunk data packet handling | Spottedleaf | | | server | Infinite fuel furnace | William Blake Galbreath | | | server | Infinity bow settings | William Blake Galbreath | | -| api | Item entity immunities | William Blake Galbreath | | | server | Item entity immunities | William Blake Galbreath | | +| api | Item entity immunities | William Blake Galbreath | | | server | Item stuck sleep config | tr7zw | | -| api | ItemFactory#getMonsterEgg | William Blake Galbreath | | | server | ItemFactory#getMonsterEgg | William Blake Galbreath | | +| api | ItemFactory#getMonsterEgg | William Blake Galbreath | | | api | ItemStack convenience methods | William Blake Galbreath | | | server | Kelp weeping and twisting vines configurable max growth age | BillyGalbreath | | | server | Lag compensate block breaking | Spottedleaf | | -| api | Lagging threshold | William Blake Galbreath | | | server | Lagging threshold | William Blake Galbreath | | -| api | Left handed API | BillyGalbreath | | +| api | Lagging threshold | William Blake Galbreath | | | server | Left handed API | BillyGalbreath | | -| api | LivingEntity safeFallDistance | William Blake Galbreath | | +| api | Left handed API | BillyGalbreath | | | server | LivingEntity safeFallDistance | William Blake Galbreath | | -| api | LivingEntity#broadcastItemBreak | William Blake Galbreath | | +| api | LivingEntity safeFallDistance | William Blake Galbreath | | | server | LivingEntity#broadcastItemBreak | William Blake Galbreath | | -| api | Llama API | William Blake Galbreath | | +| api | LivingEntity#broadcastItemBreak | William Blake Galbreath | | | server | Llama API | William Blake Galbreath | | +| api | Llama API | William Blake Galbreath | | | server | Lobotomize stuck villagers | BillyGalbreath | | | server | Logger settings (suppressing pointless logs) | William Blake Galbreath | | | server | MC-147659 - Fix non black cats spawning in swamp huts | William Blake Galbreath | | @@ -251,10 +257,11 @@ # Patches | server | Make sure inlined getChunkAt has inlined logic for loaded | Spottedleaf | | | server | Manually inline methods in BlockPosition | Spottedleaf | | | server | Mending mends most damages equipment first | William Blake Galbreath | | -| api | Modify POM | YatopiaMC | | | server | Modify POM | YatopiaMC | | +| api | Modify POM | YatopiaMC | | | server | Modify default configs | tr7zw | | -| server | Movement options for armour stands | Mariell Hoversholm | | +| server | More debug for plugins not shutting down tasks | Paul Sauve | | +| server | Movement options for armor stands | Mariell Hoversholm | | | server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | | | server | Multi-Threaded ticking CraftBukkit | Spottedleaf | | | server | Multithreaded entity tracking | Paul Sauve | | @@ -295,18 +302,18 @@ # Patches | api | Per player viewdistances | Spottedleaf | | | server | Persistent TileEntity Lore and DisplayName | jmp | | | server | Phantom flames on swoop | BillyGalbreath | | -| api | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | | | server | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | | +| api | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | | | server | Phantoms burn in light | draycia | | | server | Pigs give saddle back | William Blake Galbreath | | -| api | Player invulnerabilities | William Blake Galbreath | | | server | Player invulnerabilities | William Blake Galbreath | | -| api | PlayerAttackEntityEvent | Ivan Pekov | | +| api | Player invulnerabilities | William Blake Galbreath | | | server | PlayerAttackEntityEvent | Ivan Pekov | | -| api | PlayerBookTooLargeEvent | BillyGalbreath | | +| api | PlayerAttackEntityEvent | Ivan Pekov | | | server | PlayerBookTooLargeEvent | BillyGalbreath | | -| api | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | | +| api | PlayerBookTooLargeEvent | BillyGalbreath | | | server | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | | +| api | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | | | server | Players should not cram to death | William Blake Galbreath | | | server | Populator seed controls | Spottedleaf | | | server | Preload ProtocolLib EnumWrappers | ishland | | @@ -314,8 +321,8 @@ # Patches | server | Prevent long map entry creation in light engine | Spottedleaf | | | server | Prevent unload() calls removing tickets for sync loads | Spottedleaf | | | server | Properly handle cancellation of projectile hit event | Spottedleaf | | -| api | Purpur config files | William Blake Galbreath | | | server | Purpur config files | William Blake Galbreath | | +| api | Purpur config files | William Blake Galbreath | | | server | Rabbit naturally spawn toast and killer | William Blake Galbreath | | | api | Rabid Wolf API | Encode42 | | | server | Raid cooldown setting | jmp | | @@ -340,8 +347,8 @@ # Patches | server | Revert getChunkAt(Async) retaining chunks for long periods of | Spottedleaf | | | server | Rework PlayerChunk main thread checks | Spottedleaf | | | server | Rewrite the light engine | Spottedleaf | | -| api | Ridables | William Blake Galbreath | | | server | Ridables | William Blake Galbreath | | +| api | Ridables | William Blake Galbreath | | | server | Send full pos packets for hard colliding entities | Spottedleaf | | | server | Separate lookup locking from state access in UserCache | Spottedleaf | | | server | Set name visible when using a Name Tag on an Armor Stand | jmp | | @@ -356,6 +363,7 @@ # Patches | server | Skip events if there's no listeners | William Blake Galbreath | | | server | Smarter statistics ticking | Mykyta Komarnytskyy | | | server | Smol entity optimisations | Ivan Pekov | | +| server | Sneak to bulk process composter | BillyGalbreath | | | server | Snow Golem rate of fire config | Simon Gardling | | | server | Snowman drop and put back pumpkin | William Blake Galbreath | | | api | Spigot - Improve output of plugins command | Parker Hawke | | @@ -366,17 +374,18 @@ # Patches | server | Stop wasting resources on JsonList#get | Ivan Pekov | | | server | Striders give saddle back | Ben Kerllenevich | | | server | Strip raytracing for EntityLiving#hasLineOfSight | Paul Sauve | | -| api | Suspected plugins report | ishland | | | server | Suspected plugins report | ishland | | +| api | Suspected plugins report | ishland | | | server | Swap priority of checks in chunk ticking | Paul Sauve | | | server | Swaps the predicate order of collision | ใ„—ใ„ ห‹ ใ„‘ใ„งหŠ | | +| server | Tick fluids config | BillyGalbreath | | | server | Time scoreboard search | Spottedleaf | | | server | Timings stuff | William Blake Galbreath | | | server | Toggle for Zombified Piglin death always counting as player | jmp | | | server | Toggle for water sensitive mob damage | YouHaveTrouble | | | server | Totems work in inventory | draycia | | -| api | Tuinity POM Changes | Spottedleaf | | | server | Tuinity POM Changes | Spottedleaf | | +| api | Tuinity POM Changes | Spottedleaf | | | server | Tuinity Server Config | Spottedleaf | | | api | Tuinity config | Spottedleaf | | | server | Tulips change fox type | William Blake Galbreath | | diff --git a/Paper b/Paper index 39c487b3..0641de2d 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit 39c487b37d51944997aa2eea8ce62e3f5bc07d52 +Subproject commit 0641de2d4f4a2802980140e4980c1d7eaf141a66 diff --git a/buildSrc/src/main/kotlin/ConfigureSubprojects.kt b/buildSrc/src/main/kotlin/ConfigureSubprojects.kt index ef665a60..ed02bf92 100644 --- a/buildSrc/src/main/kotlin/ConfigureSubprojects.kt +++ b/buildSrc/src/main/kotlin/ConfigureSubprojects.kt @@ -1,7 +1,8 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar // import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer -import xyz.jpenilla.toothpick.transformer.ModifiedLog4j2PluginsCacheFileTransformer +import transformer.ModifiedLog4j2PluginsCacheFileTransformer +import relocation.ToothpickRelocator import kotlinx.dom.elements import kotlinx.dom.parseXml import kotlinx.dom.search @@ -148,8 +149,7 @@ private fun Project.configureServerProject() { destination = project.buildDir.resolve("tmp/pom.xml") } - @Suppress("UNUSED_VARIABLE") - val test by tasks.getting(Test::class) { + tasks.withType { // didn't bother to look into why these fail. paper excludes them in paperweight as well though exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") } @@ -158,7 +158,6 @@ private fun Project.configureServerProject() { archiveClassifier.set("") // ShadowJar is the main server artifact dependsOn(generatePomFileForMavenJavaPublication) transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java) - //transform(Log4j2PluginsCacheFileTransformer::class.java) mergeServiceFiles() manifest { attributes( @@ -182,7 +181,6 @@ private fun Project.configureServerProject() { relocate("org.bukkit.craftbukkit", "org.bukkit.craftbukkit.v${toothpick.nmsPackage}") { exclude("org.bukkit.craftbukkit.Main*") } - relocate("net.minecraft.server", "net.minecraft.server.v${toothpick.nmsPackage}") relocationSet.add(PatchesMetadata.Relocation("", "net.minecraft.server.v${toothpick.nmsPackage}", false)) // Make sure we relocate deps the same as Paper et al. @@ -202,9 +200,17 @@ private fun Project.configureServerProject() { .elements("relocation").forEach { relocation -> val pattern = relocation.search("pattern").first().textContent val shadedPattern = relocation.search("shadedPattern").first().textContent - if (pattern != "org.bukkit.craftbukkit" && pattern != "net.minecraft.server") { // We handle these ourselves above - logger.debug("Imported relocation to server project shadowJar from ${pomFile.absolutePath}: $pattern to $shadedPattern") - relocate(pattern, shadedPattern) + val rawString = relocation.search("rawString").firstOrNull()?.textContent?.toBoolean() ?: false + if (pattern != "org.bukkit.craftbukkit") { // We handle cb ourselves + val excludes = if (rawString) listOf("net/minecraft/data/Main*") else emptyList() + relocate( + ToothpickRelocator( + pattern, + shadedPattern.replace("\${minecraft_version}", toothpick.nmsPackage), + rawString, + excludes = excludes + ) + ) relocationSet.add(PatchesMetadata.Relocation(pattern, shadedPattern, true)) } } diff --git a/buildSrc/src/main/kotlin/InitTasks.kt b/buildSrc/src/main/kotlin/InitTasks.kt index e0ebe3db..ac6074e6 100644 --- a/buildSrc/src/main/kotlin/InitTasks.kt +++ b/buildSrc/src/main/kotlin/InitTasks.kt @@ -70,4 +70,5 @@ internal fun Project.initToothpickTasks() { val upstreamCommit = createUpstreamCommitTask() + val repackageNMS = createRepackageNMSTask() } diff --git a/buildSrc/src/main/kotlin/ToothpickExtension.kt b/buildSrc/src/main/kotlin/ToothpickExtension.kt index d1c0c9e2..87ab20d3 100644 --- a/buildSrc/src/main/kotlin/ToothpickExtension.kt +++ b/buildSrc/src/main/kotlin/ToothpickExtension.kt @@ -67,9 +67,12 @@ open class ToothpickExtension(objects: ObjectFactory) { } } - val paperWorkDir: File + val paperDecompDir: File get() = paperDir.resolve("work/Minecraft/${minecraftVersion}") + val paperWorkDir: File + get() = paperDir.resolve("work") + fun getUpstreams(rootProjectDir: File): MutableList? { val configDir = rootProjectDir.resolve("$rootProjectDir/upstreamConfig") val upstreams = configDir.listFiles() diff --git a/buildSrc/src/main/kotlin/Util.kt b/buildSrc/src/main/kotlin/Util.kt index 77ac15cd..bfc2b1fe 100644 --- a/buildSrc/src/main/kotlin/Util.kt +++ b/buildSrc/src/main/kotlin/Util.kt @@ -8,13 +8,15 @@ data class CmdResult(val exitCode: Int, val output: String?) fun Project.cmd( vararg args: String, dir: File = rootProject.projectDir, - printOut: Boolean = false + printOut: Boolean = false, + environment: Map = emptyMap() ): CmdResult { - val process = ProcessBuilder() - .command(*args) - .redirectErrorStream(true) - .directory(dir) - .start() + val process = ProcessBuilder().apply { + command(*args) + redirectErrorStream(true) + directory(dir) + environment().putAll(environment) + }.start() val output = process.inputStream.bufferedReader().use { reader -> reader.lines().asSequence() .onEach { @@ -46,14 +48,16 @@ fun ensureSuccess( fun Project.gitCmd( vararg args: String, dir: File = rootProject.projectDir, - printOut: Boolean = false + printOut: Boolean = false, + environment: Map = emptyMap() ): CmdResult = cmd("git", *args, dir = dir, printOut = printOut) fun Project.bashCmd( vararg args: String, dir: File = rootProject.projectDir, - printOut: Boolean = false + printOut: Boolean = false, + environment: Map = emptyMap() ): CmdResult = cmd("bash", "-c", *args, dir = dir, printOut = printOut) diff --git a/buildSrc/src/main/kotlin/relocation/ToothpickRelocator.kt b/buildSrc/src/main/kotlin/relocation/ToothpickRelocator.kt new file mode 100644 index 00000000..5e1877cc --- /dev/null +++ b/buildSrc/src/main/kotlin/relocation/ToothpickRelocator.kt @@ -0,0 +1,58 @@ +/* + * This file is part of Toothpick, licensed under the MIT License. + * + * Copyright (c) 2020-2021 Jason Penilla & Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package relocation + +import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator +import com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator +import java.lang.reflect.Method +import java.util.regex.Pattern + +internal class ToothpickRelocator( + pattern: String, + shadedPattern: String, + rawString: Boolean = false, + includes: List = emptyList(), + excludes: List = emptyList(), + private val simpleRelocator: SimpleRelocator = SimpleRelocator(pattern, shadedPattern, includes, excludes, rawString) +) : Relocator by simpleRelocator { + override fun canRelocatePath(path: String): Boolean { + // Respect includes/excludes for rawString too + if (simpleRelocator.rawString) { + return isIncludedMethod(simpleRelocator, path) as Boolean + && !(isExcludedMethod(simpleRelocator, path) as Boolean) + && Pattern.compile(simpleRelocator.pathPattern).matcher(path).find() + } + return simpleRelocator.canRelocatePath(path) + } + + companion object { + private val isExcludedMethod: Method = SimpleRelocator::class.java.getDeclaredMethod("isExcluded", String::class.java) + private val isIncludedMethod: Method = SimpleRelocator::class.java.getDeclaredMethod("isIncluded", String::class.java) + + init { + isExcludedMethod.isAccessible = true + isIncludedMethod.isAccessible = true + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/task/ImportMCDev.kt b/buildSrc/src/main/kotlin/task/ImportMCDev.kt index 3f4a1a59..139423b0 100644 --- a/buildSrc/src/main/kotlin/task/ImportMCDev.kt +++ b/buildSrc/src/main/kotlin/task/ImportMCDev.kt @@ -11,6 +11,8 @@ import org.gradle.api.Task import toothpick import upstreams import java.io.File +import java.nio.file.Files +import kotlin.streams.toList internal fun Project.createImportMCDevTask( receiver: Task.() -> Unit = {} @@ -20,42 +22,62 @@ internal fun Project.createImportMCDevTask( val upstreamServer = toothpick.serverProject.baseDir val importLog = arrayListOf("Extra mc-dev imports") + fun isDuplicateImport(target: File, className: String): Boolean { + if (!target.exists()) return false + val message = "Skipped import for $className, a class with that name already exists in the source tree. Is there an extra entry in mcdevimports.json?" + project.gradle.taskGraph.allTasks.last().doLast { + logger.warn(message) + } + logger.warn(message) + return true + } + fun importNMS(className: String) { - logger.lifecycle("Importing n.m.s.$className") - importLog.add("Imported n.m.s.$className") - val source = toothpick.paperWorkDir.resolve("spigot/net/minecraft/server/$className.java") + logger.lifecycle("Importing $className") + val classPath = "${className.replace(".", "/")}.java" + val source = toothpick.paperDecompDir.resolve("spigot/$classPath") + importLog.add("Importing $className") if (!source.exists()) error("Missing NMS: $className") - val target = upstreamServer.resolve("src/main/java/net/minecraft/server/$className.java") + val target = upstreamServer.resolve("src/main/java/$classPath") + if (isDuplicateImport(target, className)) return + target.parentFile.mkdirs() source.copyTo(target) } fun importLibrary(import: LibraryImport) { val (group, lib, prefix, file) = import - logger.lifecycle("Importing $group.$lib $prefix/$file") - importLog.add("Imported $group.$lib $prefix/$file") - val source = toothpick.paperWorkDir.resolve("libraries/$group/$lib/$prefix/$file.java") + val className = "${prefix.replace("/", ".")}.$file" + importLog.add("Imported $className from $group.$lib") + logger.lifecycle("Importing $className from $group.$lib") + val source = toothpick.paperDecompDir.resolve("libraries/$group/$lib/$prefix/$file.java") if (!source.exists()) error("Missing Base: $lib $prefix/$file") val targetDir = upstreamServer.resolve("src/main/java/$prefix") val target = targetDir.resolve("$file.java") + if (isDuplicateImport(target, className)) return targetDir.mkdirs() source.copyTo(target) } + fun findNeededImports(patches: List): Set = patches.asSequence() + .flatMap { it.readLines().asSequence() } + .filter { line -> + line.startsWith("+++ b/src/main/java/net/minecraft/") + || line.startsWith("+++ b/src/main/java/com/mojang/math/") + } + .distinct() + .map { it.substringAfter("+++ b/src/main/java/") } + .filter { !upstreamServer.resolve("src/main/java/$it").exists() } + .filter { + val sourceFile = toothpick.paperDecompDir.resolve("spigot/$it") + val exists = sourceFile.exists() + if (!sourceFile.exists()) logger.lifecycle("$it is either missing, or is a new file added through a patch") + exists + } + .map { it.replace("/", ".").substringBefore(".java") } + .toSet() + fun getAndApplyNMS(patchesDir: File) { - (patchesDir.listFiles() ?: return).asSequence() - .flatMap { it.readLines().asSequence() } - .filter { it.startsWith("+++ b/src/main/java/net/minecraft/server/") } - .distinct() - .map { it.substringAfter("/server/").substringBefore(".java") } - .filter { !upstreamServer.resolve("src/main/java/net/minecraft/server/$it.java").exists() } - .map { toothpick.paperWorkDir.resolve("spigot/net/minecraft/server/$it.java") } - .filter { - val exists = it.exists() - if (!it.exists()) logger.lifecycle("NMS ${it.nameWithoutExtension} is either missing, or is a new file added through a patch") - exists - } - .map { it.nameWithoutExtension } - .forEach(::importNMS) + findNeededImports(patchesDir.listFiles().toList()).toList().forEach(::importNMS) } doLast { diff --git a/buildSrc/src/main/kotlin/task/RepackageNMS.kt b/buildSrc/src/main/kotlin/task/RepackageNMS.kt new file mode 100644 index 00000000..0206beeb --- /dev/null +++ b/buildSrc/src/main/kotlin/task/RepackageNMS.kt @@ -0,0 +1,108 @@ +/* + * This file is part of Toothpick, licensed under the MIT License. + * + * Copyright (c) 2020-2021 Jason Penilla & Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package task + +import org.gradle.api.tasks.TaskAction +import java.io.File +import org.gradle.api.Project +import org.gradle.api.Task +import taskGroup +import upstreams +import gitCmd +import toothpick +import java.nio.file.Paths +import java.util.concurrent.ConcurrentHashMap +import ensureSuccess +import java.net.URL + +@Suppress("UNUSED_VARIABLE") +internal fun Project.createRepackageNMSTask( + receiver: Task.() -> Unit = {} +): Task = tasks.create("repackageNMS") { + receiver(this) + group = taskGroup + class Mapping(fullyQualifiedClassName: String) { + val className = fullyQualifiedClassName.substringAfterLast(".") + val oldFQName = "net.minecraft.server.$className" + val oldJavaFileName = "net/minecraft/server/$className.java" + val newFQName = fullyQualifiedClassName + val newJavaFileName = "${fullyQualifiedClassName.replace(".", "/")}.java" + } + + class Remapper(private val mappings: Set) { + fun remapFile(file: File): String = + file.readLines().joinToString("\n") { remapLine(it) } + "\n" + + private fun remapLine(line: String): String { + if ( + line.startsWith("diff --git ") + || line.startsWith("+++ ") + || line.startsWith("--- ") + ) { + var text = line + mappings.forEach { text = text.replace(it.oldJavaFileName, it.newJavaFileName) } + return text + } + if (line.startsWith("+")) { + var text = line + mappings.forEach { text = text.replace(it.oldFQName, it.newFQName) } + return text + } + return line + } + } + doLast { + logger.lifecycle("Downloading class mappings from spigot...") + val mappingsFileText = URL("https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/raw/mappings/bukkit-1.16.5-cl.csrg?at=80d35549ec67b87a0cdf0d897abbe826ba34ac27").readText() + logger.lifecycle("Done downloading class mappings.") + + logger.lifecycle(">>> Preparing patches for NMS repackage") + val mappings = mappingsFileText + .split("\n") + .asSequence() + .filter { !it.startsWith("#") && !it.contains("$") && it.trim().isNotEmpty() } + .map { it.split(" ")[1].replace("/", ".") } + .map { Mapping(it) } + .filter { it.newFQName != it.oldFQName } + .toSet() + val remapper = Remapper(mappings) + + toothpick.subprojects.values + .map { it.patchesDir } + .forEach { patchesDir -> + val repackagedPatchesDir = + patchesDir.parentFile.resolve("${patchesDir.name}_repackaged-${System.currentTimeMillis()}") + repackagedPatchesDir.mkdir() + val patchFiles = patchesDir.listFiles()?.toList() ?: error("Could not list patch files") + patchFiles.parallelStream().forEach { patch -> + logger.lifecycle("Processing ${patchesDir.name}/${patch.name}...") + val newPatch = repackagedPatchesDir.resolve(patch.name) + newPatch.writeText(remapper.remapFile(patch)) + } + } + + logger.lifecycle(">>> Done preparing patches") + } +} + diff --git a/buildSrc/src/main/kotlin/transformer/ModifiedLog4j2PluginsCacheFileTransformer.kt b/buildSrc/src/main/kotlin/transformer/ModifiedLog4j2PluginsCacheFileTransformer.kt index 7225f57d..a442b35c 100644 --- a/buildSrc/src/main/kotlin/transformer/ModifiedLog4j2PluginsCacheFileTransformer.kt +++ b/buildSrc/src/main/kotlin/transformer/ModifiedLog4j2PluginsCacheFileTransformer.kt @@ -1,107 +1,39 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License") you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * This file is part of Toothpick, licensed under the MIT License. * - * http://www.apache.org/licenses/LICENSE-2.0 + * Copyright (c) 2020-2021 Jason Penilla & Contributors * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ -package xyz.jpenilla.toothpick.transformer +package transformer -import com.github.jengelman.gradle.plugins.shadow.ShadowStats -import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext -import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer -import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext import org.gradle.api.file.FileTreeElement -import shadow.org.apache.commons.io.IOUtils -import shadow.org.apache.commons.io.output.CloseShieldOutputStream -import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginCache import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE -import shadow.org.apache.tools.zip.ZipEntry -import shadow.org.apache.tools.zip.ZipOutputStream -import java.io.File -import java.io.FileOutputStream -import java.net.URL -import java.util.Collections -import java.util.Enumeration - -/** - * This class is a modified version of [com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer], - * used in order to fix the issues when 'element.name' for our Log4jPlugins.dat is just 'Log4jPlugins.dat' instead of [PLUGIN_CACHE_FILE]. - * - * Besides converting to Kotlin, the only modified part of the class is [canTransformResource]. - */ -internal class ModifiedLog4j2PluginsCacheFileTransformer : Transformer { - private val temporaryFiles: ArrayList = ArrayList() - private val relocators: ArrayList = ArrayList() - private lateinit var stats: ShadowStats +internal class ModifiedLog4j2PluginsCacheFileTransformer : Transformer by Log4j2PluginsCacheFileTransformer() { + /** + * For some reason we have a file with name matching simply 'Log4j2Plugins.dat' and not PLUGIN_CACHE_FILE. + * That file also needs to be merged. + */ override fun canTransformResource(element: FileTreeElement): Boolean { return PLUGIN_CACHE_FILE == element.name || element.name == "Log4j2Plugins.dat" } - - override fun transform(context: TransformerContext) { - val inputStream = context.`is` - val temporaryFile = File.createTempFile("Log4j2Plugins", ".dat") - temporaryFile.deleteOnExit() - this.temporaryFiles.add(temporaryFile) - FileOutputStream(temporaryFile).use { IOUtils.copy(inputStream, it) } - val relocators = context.relocators - if (relocators != null) { - this.relocators.addAll(relocators) - } - this.stats = context.stats - } - - override fun hasTransformedResource(): Boolean { - val hasTransformedMultipleFiles = temporaryFiles.size > 1 - val hasAtLeastOneFileAndRelocator = temporaryFiles.isNotEmpty() && relocators.isNotEmpty() - return hasTransformedMultipleFiles || hasAtLeastOneFileAndRelocator - } - - override fun modifyOutputStream(zipOutputStream: ZipOutputStream, preserveFileTimestamps: Boolean) { - val pluginCache = PluginCache() - pluginCache.loadCacheFiles(urlEnumeration()) - relocatePlugins(pluginCache) - val entry = ZipEntry(PLUGIN_CACHE_FILE) - entry.time = TransformerContext.getEntryTimestamp(preserveFileTimestamps, entry.time) - zipOutputStream.putNextEntry(entry) - pluginCache.writeCache(CloseShieldOutputStream(zipOutputStream)) - this.temporaryFiles.clear() - } - - private fun urlEnumeration(): Enumeration { - return Collections.enumeration( - this.temporaryFiles.map { it.toURI().toURL() }.toList() - ) - } - - private fun relocatePlugins(pluginCache: PluginCache) { - for (currentMap in pluginCache.allCategories.values) { - currentMap.values.forEach { currentPluginEntry -> - val className = currentPluginEntry.className - val relocateClassContext = RelocateClassContext(className, stats) - for (currentRelocator in relocators) { - // If we have a relocator that can relocate our current entry... - if (currentRelocator.canRelocateClass(className)) { - // Then we perform that relocation and update the plugin entry to reflect the new value. - val relocatedClassName = currentRelocator.relocateClass(relocateClassContext) - currentPluginEntry.className = relocatedClassName - return@forEach - } - } - } - } - } -} \ No newline at end of file +} diff --git a/patches/Airplane/patches/server/0001-Airplane-MC-Dev-Fixes.patch b/patches/Airplane/patches/server/0001-Airplane-MC-Dev-Fixes.patch index 6b2d9f27..4490e09f 100644 --- a/patches/Airplane/patches/server/0001-Airplane-MC-Dev-Fixes.patch +++ b/patches/Airplane/patches/server/0001-Airplane-MC-Dev-Fixes.patch @@ -19,11 +19,80 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/LootTableInfo.java b/src/main/java/net/minecraft/server/LootTableInfo.java -index addeb268d4d487e18ddaadebf96f078fd079246f..cbd034127de8a30b82b27c367bdd9270b43b98b0 100644 ---- a/src/main/java/net/minecraft/server/LootTableInfo.java -+++ b/src/main/java/net/minecraft/server/LootTableInfo.java -@@ -53,7 +53,7 @@ public class LootTableInfo { +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +index 375409f4b72edc7990da90460b30486fb2980fb6..ab692de8a5b1411e37251fb545e6f579a9929f91 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +@@ -54,7 +54,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + public int conversionTicks = 0; + public boolean cannotBeHunted = false; + protected static final ImmutableList>> bo = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m); +- protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); ++ protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); // Airplane - decompile error + + public EntityHoglin(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -118,13 +118,13 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + public BehaviorController getBehaviorController() { +- return super.getBehaviorController(); ++ return (BehaviorController) super.getBehaviorController(); // Airplane - decompile error + } + + @Override + protected void mobTick() { + this.world.getMethodProfiler().enter("hoglinBrain"); +- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); ++ this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error + this.world.getMethodProfiler().exit(); + HoglinAI.a(this); + if (this.isConverting()) { +@@ -300,7 +300,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null); ++ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Airplane - decompile error + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +index f2f65dc0612cc232009ea7ff12f5c1ba4e6b15ea..d100b39c420e2326e869aa4059fc800d4c2fc0e4 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +@@ -188,7 +188,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + + @Override + public BehaviorController getBehaviorController() { +- return super.getBehaviorController(); ++ return (BehaviorController) super.getBehaviorController(); // Airplane - compile error + } + + @Override +@@ -247,7 +247,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + @Override + protected void mobTick() { + this.world.getMethodProfiler().enter("piglinBrain"); +- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); ++ this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // Airplane - compile error + this.world.getMethodProfiler().exit(); + PiglinAI.b(this); + super.mobTick(); +@@ -386,7 +386,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse((Object) null); ++ return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // Airplane - compile error + } + + @Override +diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java +index 95d0c9f22d79194ca83ca6f6a8e6d91180a3c8da..5c712af849abf1e5f58a7760b19c543474559f77 100644 +--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java ++++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java +@@ -62,7 +62,7 @@ public class LootTableInfo { @Nullable public T getContextParameter(LootContextParameter lootcontextparameter) { @@ -32,7 +101,7 @@ index addeb268d4d487e18ddaadebf96f078fd079246f..cbd034127de8a30b82b27c367bdd9270 } public boolean a(LootTable loottable) { -@@ -207,7 +207,7 @@ public class LootTableInfo { +@@ -216,7 +216,7 @@ public class LootTableInfo { } public T a(LootContextParameter lootcontextparameter) { @@ -41,7 +110,7 @@ index addeb268d4d487e18ddaadebf96f078fd079246f..cbd034127de8a30b82b27c367bdd9270 if (t0 == null) { throw new IllegalArgumentException("No parameter " + lootcontextparameter); -@@ -218,7 +218,7 @@ public class LootTableInfo { +@@ -227,7 +227,7 @@ public class LootTableInfo { @Nullable public T b(LootContextParameter lootcontextparameter) { diff --git a/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch b/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch new file mode 100644 index 00000000..2344798b --- /dev/null +++ b/patches/Airplane/patches/server/0002-Airplane-Branding-Changes.patch @@ -0,0 +1,112 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paul Sauve +Date: Wed, 3 Feb 2021 21:36:16 -0600 +Subject: [PATCH] Airplane Branding Changes + +Airplane +Copyright (C) 2020 Technove LLC + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +diff --git a/pom.xml b/pom.xml +index dad9981b1cd1ca8b27a45972188fd2b92f5146e7..a3a3b17f3b30b55bb50905353e77723091bb5c1f 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -27,8 +27,8 @@ + + + +- com.tuinity +- tuinity-api ++ gg.airplane ++ airplane-api + ${project.version} + compile + +diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java +index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..b480bd3044370b8eb733166f0c4b737344475993 100644 +--- a/src/main/java/com/destroystokyo/paper/Metrics.java ++++ b/src/main/java/com/destroystokyo/paper/Metrics.java +@@ -593,7 +593,7 @@ public class Metrics { + boolean logFailedRequests = config.getBoolean("logFailedRequests", false); + // Only start Metrics, if it's enabled in the config + if (config.getBoolean("enabled", true)) { +- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page ++ Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane + + metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { + String minecraftVersion = Bukkit.getVersion(); +@@ -603,7 +603,7 @@ public class Metrics { + + metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); + metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline")); +- metrics.addCustomChart(new Metrics.SimplePie("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page ++ metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane + + metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { + Map> map = new HashMap<>(); +diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +index 7063f1da3654b382e26b0093ad5d0ff04a2b38c2..b9c5479e5561f8fe68ea8f94fbf4e64de8a53bf9 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java ++++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -28,8 +28,8 @@ public class PaperVersionFetcher implements VersionFetcher { + @Nonnull + @Override + public Component getVersionMessage(@Nonnull String serverVersion) { +- String[] parts = serverVersion.substring("git-Tuinity-".length()).split("[-\\s]"); // Tuinity +- final Component updateMessage = getUpdateStatusMessage("Spottedleaf/Tuinity", GITHUB_BRANCH_NAME, parts[0]); // Tuinity ++ String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Tuinity ++ final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Tuinity + final Component history = getHistory(); + + return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index e757cb5c2d50cb3a4dbe50d4726db09ab845fcbb..7cbbc1b1161f26f22a7f7832395af0d4a781cb1a 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1636,7 +1636,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Airplane"; // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! + } + + public CrashReport b(CrashReport crashreport) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index fd3333fef4112e6469ccd316ba2c82926c04e5db..b5ffc5f5cf04892d30092625533643c99047c16b 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper + import javax.annotation.Nonnull; // Paper + + public final class CraftServer implements Server { +- private final String serverName = "Tuinity"; // Paper // Tuinity ++ private final String serverName = "Airplane"; // Paper // Tuinity // Airplane + private final String serverVersion; + private final String bukkitVersion = Versioning.getBukkitVersion(); + private final Logger logger = Logger.getLogger("Minecraft"); +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +index 001b1e5197eaa51bfff9031aa6c69876c9a47960..1788d79ea489e446d3d9f541693d4ba3dfc26015 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +@@ -11,7 +11,7 @@ public final class Versioning { + public static String getBukkitVersion() { + String result = "Unknown-Version"; + +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane + Properties properties = new Properties(); + + if (stream != null) { diff --git a/patches/Airplane/patches/server/0002-Airplane-Configuration.patch b/patches/Airplane/patches/server/0003-Airplane-Configuration.patch similarity index 95% rename from patches/Airplane/patches/server/0002-Airplane-Configuration.patch rename to patches/Airplane/patches/server/0003-Airplane-Configuration.patch index 9e4f75aa..0b1ca9ce 100644 --- a/patches/Airplane/patches/server/0002-Airplane-Configuration.patch +++ b/patches/Airplane/patches/server/0003-Airplane-Configuration.patch @@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b +} diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..4feb9686f45ce4ae9f474447496b8e0f6fcb7e31 +index 0000000000000000000000000000000000000000..fbb9544027a48941bd0938d8f607e8c7ff9443a1 --- /dev/null +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -0,0 +1,46 @@ +@@ -0,0 +1,47 @@ +package gg.airplane; + +import gg.airplane.manual.ManualParser; @@ -113,8 +113,9 @@ index 0000000000000000000000000000000000000000..4feb9686f45ce4ae9f474447496b8e0f + + manual.get("info.version", "1.0"); + manual.setComment("info", -+ " Airplane Configuration", -+ " Please see https://airplane.gg/config for help."); ++ "Airplane Configuration", ++ "Read https://blog.airplane.gg/ to find out more about Airplane", ++ "Join our Discord to receive support & optimization help: https://discord.gg/3gtc45q"); + + for (Method method : AirplaneConfig.class.getDeclaredMethods()) { + if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers())) { @@ -367,11 +368,11 @@ index 0000000000000000000000000000000000000000..ace29adb0f140d99a8d85ac824654bed + } + +} -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index e3721b53db68171665ba05201155d088ae3cb89f..b8a45c80b6691214e513286262f31b7b5b1dd5eb 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -185,6 +185,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +index d902efdb8f2d42ea4c3933f7fa76ebe135ee09db..24a46ad36613faa5f5a1a12b70f7af886e1608ae 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -215,6 +215,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now // Paper end com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config diff --git a/patches/Airplane/patches/server/0003-Remove-streams.patch b/patches/Airplane/patches/server/0004-Remove-streams.patch similarity index 73% rename from patches/Airplane/patches/server/0003-Remove-streams.patch rename to patches/Airplane/patches/server/0004-Remove-streams.patch index c6d5d82b..ff85a10b 100644 --- a/patches/Airplane/patches/server/0003-Remove-streams.patch +++ b/patches/Airplane/patches/server/0004-Remove-streams.patch @@ -19,11 +19,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/BehaviorBetterJob.java b/src/main/java/net/minecraft/server/BehaviorBetterJob.java -index 19f8cf4384ff7a1515ad33a5f573ea0061bab93d..e6507a9bef705e1496497ad6b58a546348a0779e 100644 ---- a/src/main/java/net/minecraft/server/BehaviorBetterJob.java -+++ b/src/main/java/net/minecraft/server/BehaviorBetterJob.java -@@ -14,11 +14,31 @@ public class BehaviorBetterJob extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorBetterJob.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorBetterJob.java +index 72f1031e95b375823790f8cac4c102ba1205c9e8..e4821c1a7ceac582b019102230dbe5221add9050 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorBetterJob.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorBetterJob.java +@@ -3,6 +3,7 @@ package net.minecraft.world.entity.ai.behavior; + import com.google.common.collect.ImmutableMap; + import net.minecraft.core.GlobalPos; + import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.ai.memory.MemoryModuleType; + import net.minecraft.world.entity.ai.memory.MemoryStatus; + import net.minecraft.world.entity.ai.village.poi.VillagePlaceType; +@@ -21,11 +22,31 @@ public class BehaviorBetterJob extends Behavior { protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE).get(); diff --git a/patches/Airplane/patches/server/0004-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/Airplane/patches/server/0005-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 71% rename from patches/Airplane/patches/server/0004-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/Airplane/patches/server/0005-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch index 5f2f34ae..cc49eb18 100644 --- a/patches/Airplane/patches/server/0004-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch +++ b/patches/Airplane/patches/server/0005-Strip-raytracing-for-EntityLiving-hasLineOfSight.patch @@ -26,11 +26,47 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 90d41b9e286064f11ce55badfb76574778d933a6..523db5ec954bc420a478bbaaf0d10d5a63024ccd 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3071,7 +3071,7 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/util/MathHelper.java b/src/main/java/net/minecraft/util/MathHelper.java +index cc566784c7dd21cc2c44e0f351347f657e57ddcf..e9e7fcf2b63febe2a7d055826fabb86bc13a5cf3 100644 +--- a/src/main/java/net/minecraft/util/MathHelper.java ++++ b/src/main/java/net/minecraft/util/MathHelper.java +@@ -240,6 +240,7 @@ public class MathHelper { + return f - (float) d(f); + } + ++ public static double getDecimals(double num) { return h(num); } // Airplane + public static double h(double d0) { + return d0 - (double) d(d0); + } +@@ -418,6 +419,7 @@ public class MathHelper { + return f1 + f * (f2 - f1); + } + ++ public static double linearInterpolation(double value1, double value2, double amount) { return d(value1, value2, amount); } // Airplane - OBFHELPER + public static double d(double d0, double d1, double d2) { + return d1 + d0 * (d2 - d1); + } +@@ -434,6 +436,7 @@ public class MathHelper { + return d0 * d0 * d0 * (d0 * (d0 * 6.0D - 15.0D) + 10.0D); + } + ++ public static int sign(double num) { return k(num); } // Airplane - OBFHELPER + public static int k(double d0) { + return d0 == 0.0D ? 0 : (d0 > 0.0D ? 1 : -1); + } +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 561905be42428855a07a2e63aca80d5dd63b22bf..d991e3be65dc94597bd56ad9e034972e0e99a840 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -111,6 +111,7 @@ import net.minecraft.world.phys.AxisAlignedBB; + import net.minecraft.world.phys.MovingObjectPosition; + import net.minecraft.world.phys.MovingObjectPositionEntity; + import net.minecraft.world.phys.Vec3D; ++import net.minecraft.world.phys.shapes.VoxelShapeCollision; + import net.minecraft.world.scores.ScoreboardTeam; + import org.apache.logging.log4j.Logger; + +@@ -3101,7 +3102,7 @@ public abstract class EntityLiving extends Entity { Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ()); Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ()); @@ -39,11 +75,23 @@ index 90d41b9e286064f11ce55badfb76574778d933a6..523db5ec954bc420a478bbaaf0d10d5a } @Override -diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index 5ccf6b483fe15d4ad12ce2d3d11e9440ee9e8ab7..ec82d91804eeed49a6ef67a92fd24a06ae7ee3fb 100644 ---- a/src/main/java/net/minecraft/server/IBlockAccess.java -+++ b/src/main/java/net/minecraft/server/IBlockAccess.java -@@ -44,6 +44,15 @@ public interface IBlockAccess { +diff --git a/src/main/java/net/minecraft/world/level/IBlockAccess.java b/src/main/java/net/minecraft/world/level/IBlockAccess.java +index e612e1d30f76e217b1aa23488ab025adce048f57..c9198d242b9053fad6fa5b53c1894679002d50a7 100644 +--- a/src/main/java/net/minecraft/world/level/IBlockAccess.java ++++ b/src/main/java/net/minecraft/world/level/IBlockAccess.java +@@ -14,9 +14,11 @@ import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.material.Fluid; + import net.minecraft.world.level.material.Material; + import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.world.phys.MovingObjectPosition; + import net.minecraft.world.phys.MovingObjectPositionBlock; + import net.minecraft.world.phys.Vec3D; + import net.minecraft.world.phys.shapes.VoxelShape; ++import net.minecraft.world.phys.shapes.VoxelShapeCollision; + + public interface IBlockAccess { + +@@ -56,6 +58,15 @@ public interface IBlockAccess { return BlockPosition.a(axisalignedbb).map(this::getType); } @@ -59,44 +107,25 @@ index 5ccf6b483fe15d4ad12ce2d3d11e9440ee9e8ab7..ec82d91804eeed49a6ef67a92fd24a06 // CraftBukkit start - moved block handling into separate method for use by Block#rayTrace default MovingObjectPositionBlock rayTraceBlock(RayTrace raytrace1, BlockPosition blockposition) { // Paper start - Prevent raytrace from loading chunks -diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index 2e7721a650c5a351b3584665bd236f92ef577761..b3c2b461b2a654a9e37a57f2f62b3ba8b5bb1634 100644 ---- a/src/main/java/net/minecraft/server/MathHelper.java -+++ b/src/main/java/net/minecraft/server/MathHelper.java -@@ -238,6 +238,7 @@ public class MathHelper { - return f - (float) d(f); - } - -+ public static double getDecimals(double num) { return h(num); } // Airplane - public static double h(double d0) { - return d0 - (double) d(d0); - } -@@ -416,6 +417,7 @@ public class MathHelper { - return f1 + f * (f2 - f1); - } - -+ public static double linearInterpolation(double value1, double value2, double amount) { return d(value1, value2, amount); } // Airplane - OBFHELPER - public static double d(double d0, double d1, double d2) { - return d1 + d0 * (d2 - d1); - } -@@ -432,6 +434,7 @@ public class MathHelper { - return d0 * d0 * d0 * (d0 * (d0 * 6.0D - 15.0D) + 10.0D); - } - -+ public static int sign(double num) { return k(num); } // Airplane - OBFHELPER - public static int k(double d0) { - return d0 == 0.0D ? 0 : (d0 > 0.0D ? 1 : -1); - } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index abd415f02d8b4c28602b6c4aefc0914b5a83165b..9d6ddfec93f49f80fdc88248fc5aaf5ad6ee48da 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -363,6 +363,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index c8a5d4972431ce9615312280f36181a2b9645df7..bbc842a173b12a96b1b63af347d2196ac1cb5f73 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -69,6 +69,8 @@ import net.minecraft.world.level.saveddata.maps.WorldMap; + import net.minecraft.world.level.storage.WorldData; + import net.minecraft.world.level.storage.WorldDataMutable; + import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.world.phys.MovingObjectPosition; ++import net.minecraft.world.phys.Vec3D; + import net.minecraft.world.phys.shapes.OperatorBoolean; + import net.minecraft.world.phys.shapes.VoxelShape; + import net.minecraft.world.phys.shapes.VoxelShapeCollision; +@@ -378,6 +380,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return null; } + // Airplane start - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace) -+ protected MovingObjectPosition.EnumMovingObjectType rayTraceDirect(Vec3D vec3d, Vec3D vec3d1, VoxelShapeCollision voxelshapecoll) { ++ public MovingObjectPosition.EnumMovingObjectType rayTraceDirect(Vec3D vec3d, Vec3D vec3d1, VoxelShapeCollision voxelshapecoll) { + // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions + if (vec3d.equals(vec3d1)) { + return MovingObjectPosition.EnumMovingObjectType.MISS; diff --git a/patches/Airplane/patches/server/0005-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch b/patches/Airplane/patches/server/0006-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch similarity index 85% rename from patches/Airplane/patches/server/0005-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch rename to patches/Airplane/patches/server/0006-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch index 64b5cde5..57d1a407 100644 --- a/patches/Airplane/patches/server/0005-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch +++ b/patches/Airplane/patches/server/0006-Simpler-ShapelessRecipes-comparison-for-Vanilla.patch @@ -23,11 +23,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java -index ecd63281912ae0ed93c5eb5ccb4249833cb23ab1..97825ec914709ca037159c46ecee218a6013ff58 100644 ---- a/src/main/java/net/minecraft/server/ShapelessRecipes.java -+++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java -@@ -18,8 +18,16 @@ public class ShapelessRecipes implements RecipeCrafting { +diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipes.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipes.java +index e112d149fc3a7af7f0c9a5280c94c9b03b2aba2d..d2afc367fb393c6206f9cd599d4603294d457608 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipes.java ++++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipes.java +@@ -26,8 +26,16 @@ public class ShapelessRecipes implements RecipeCrafting { private final String group; private final ItemStack result; private final NonNullList ingredients; @@ -44,7 +44,7 @@ index ecd63281912ae0ed93c5eb5ccb4249833cb23ab1..97825ec914709ca037159c46ecee218a this.key = minecraftkey; this.group = s; this.result = itemstack; -@@ -61,6 +69,28 @@ public class ShapelessRecipes implements RecipeCrafting { +@@ -69,6 +77,28 @@ public class ShapelessRecipes implements RecipeCrafting { } public boolean a(InventoryCrafting inventorycrafting, World world) { @@ -74,7 +74,7 @@ index ecd63281912ae0ed93c5eb5ccb4249833cb23ab1..97825ec914709ca037159c46ecee218a int i = 0; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java -index 4aba511fe8078164bf1467b39645dd9bf6a931e7..56b781e438f0cf1c12dd55eb37356601e47de47f 100644 +index de9c5ed6b03a290fe77eec719f0079fd7bd9b7f5..8c02f6fdffb59153712a3be778f9c454fd87b73b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java @@ -44,6 +44,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe diff --git a/patches/Airplane/patches/server/0006-Use-unmodifiableMap-instead-of-making-copy.patch b/patches/Airplane/patches/server/0007-Use-unmodifiableMap-instead-of-making-copy.patch similarity index 73% rename from patches/Airplane/patches/server/0006-Use-unmodifiableMap-instead-of-making-copy.patch rename to patches/Airplane/patches/server/0007-Use-unmodifiableMap-instead-of-making-copy.patch index 542555a7..05da2173 100644 --- a/patches/Airplane/patches/server/0006-Use-unmodifiableMap-instead-of-making-copy.patch +++ b/patches/Airplane/patches/server/0007-Use-unmodifiableMap-instead-of-making-copy.patch @@ -19,11 +19,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/LootTableInfo.java b/src/main/java/net/minecraft/server/LootTableInfo.java -index cbd034127de8a30b82b27c367bdd9270b43b98b0..25b6e240cf135da0643250b3f498a077dae070da 100644 ---- a/src/main/java/net/minecraft/server/LootTableInfo.java -+++ b/src/main/java/net/minecraft/server/LootTableInfo.java -@@ -34,8 +34,8 @@ public class LootTableInfo { +diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java +index 5c712af849abf1e5f58a7760b19c543474559f77..20cc04be75ab202d4c4ee9a07e9876ceff8422ca 100644 +--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java ++++ b/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java +@@ -43,8 +43,8 @@ public class LootTableInfo { this.world = worldserver; this.d = function; this.f = function1; diff --git a/patches/Airplane/patches/server/0007-Swap-priority-of-checks-in-chunk-ticking.patch b/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch similarity index 80% rename from patches/Airplane/patches/server/0007-Swap-priority-of-checks-in-chunk-ticking.patch rename to patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch index 26e675b0..2dae8f6d 100644 --- a/patches/Airplane/patches/server/0007-Swap-priority-of-checks-in-chunk-ticking.patch +++ b/patches/Airplane/patches/server/0008-Swap-priority-of-checks-in-chunk-ticking.patch @@ -22,11 +22,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 877ba68edec7b8b444ea7cd849fdcb337cfbc60d..63dd6aba40506014b15efecfb8562c4f455ac04e 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1137,7 +1137,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 46f960b9276dced41deb8f741454b6cce5a81529..277132da0b3672a9097b16f3b8534975dc795e3e 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1210,7 +1210,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { gameprofilerfiller.enter("thunder"); final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change diff --git a/patches/Airplane/patches/server/0008-Reduce-projectile-chunk-loading.patch b/patches/Airplane/patches/server/0009-Reduce-projectile-chunk-loading.patch similarity index 69% rename from patches/Airplane/patches/server/0008-Reduce-projectile-chunk-loading.patch rename to patches/Airplane/patches/server/0009-Reduce-projectile-chunk-loading.patch index 0b2d7d38..e953d8d0 100644 --- a/patches/Airplane/patches/server/0008-Reduce-projectile-chunk-loading.patch +++ b/patches/Airplane/patches/server/0009-Reduce-projectile-chunk-loading.patch @@ -19,11 +19,20 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index d85a19905efab7189e461a61becb6ca2b8c50803..4b3d5731a18177c74f02eef91820720104145d1c 100644 ---- a/src/main/java/net/minecraft/server/EntityProjectile.java -+++ b/src/main/java/net/minecraft/server/EntityProjectile.java -@@ -85,6 +85,37 @@ public abstract class EntityProjectile extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +index e55061b6c04b4bde92404a6ef58ba9a52cd99c1d..24d205dd1f31ece82d5cf516b8642eb0172e1a97 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +@@ -4,6 +4,8 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.particles.Particles; + import net.minecraft.network.protocol.Packet; + import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; ++import net.minecraft.server.MinecraftServer; ++import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; +@@ -102,6 +104,37 @@ public abstract class EntityProjectile extends IProjectile { this.setPosition(d0, d1, d2); } diff --git a/patches/Airplane/patches/server/0009-Optimize-random-calls-in-chunk-ticking.patch b/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch similarity index 78% rename from patches/Airplane/patches/server/0009-Optimize-random-calls-in-chunk-ticking.patch rename to patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch index 4b931efa..ebffcff7 100644 --- a/patches/Airplane/patches/server/0009-Optimize-random-calls-in-chunk-ticking.patch +++ b/patches/Airplane/patches/server/0010-Optimize-random-calls-in-chunk-ticking.patch @@ -33,11 +33,54 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8e59a794f6190930cb7bb81a2fe1a1d374dacce7..045b4af6721817b3dbfb05b9aec0bf382de9fcf5 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -53,6 +53,18 @@ public class Chunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index cb83f1152c52a99d25e4e80cc8bf18c6793e8b50..87c87b9767003652814c3726eece64470dbb69a8 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -1000,6 +1000,7 @@ public class ChunkProviderServer extends IChunkProvider { + } + // Paper end - optimize isOutisdeRange + this.world.getMethodProfiler().enter("pollingChunks"); ++ this.world.resetIceAndSnowTick(); // Airplane - reset ice & snow tick random + int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); + boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit + +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 277132da0b3672a9097b16f3b8534975dc795e3e..b33f37309d4dd22c033ad84effa4ff9d6e20a790 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1200,6 +1200,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private final BiomeBase[] biomeBaseCache = new BiomeBase[1]; + // Tuinity end - optimise chunk ice snow ticking + ++ private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Airplane ++ + public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper + ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); + boolean flag = this.isRaining(); +@@ -1210,7 +1212,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + gameprofilerfiller.enter("thunder"); + final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change + +- if (!this.paperConfig.disableThunder && flag && this.random.nextInt(100000) == 0 && this.W()) { // Paper - Disable thunder // Airplane - check this.W last ++ if (!this.paperConfig.disableThunder && flag && chunk.shouldDoLightning(this.random) && this.W()) { // Paper - Disable thunder // Airplane - check this.W last // Airplane - replace random with shouldDoLighting + blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper + if (this.isRainingAt(blockposition)) { + DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); +@@ -1234,7 +1236,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + + gameprofilerfiller.exitEnter("iceandsnow"); +- if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking ++ if (!this.paperConfig.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Airplane - optimize further random ticking + // Paper start - optimise chunk ticking + // Tuinity start - optimise chunk ice snow ticking + BiomeBase[] biomeCache = this.biomeBaseCache; +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index 259d4ac89e84fd334ff65ea8a606e1fc50cc882b..226f9e5a3d867b5365f3ea44c1459ed7265c1b41 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -99,6 +99,18 @@ public class Chunk implements IChunkAccess { private final ChunkCoordIntPair loc; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key private volatile boolean x; @@ -56,7 +99,7 @@ index 8e59a794f6190930cb7bb81a2fe1a1d374dacce7..045b4af6721817b3dbfb05b9aec0bf38 public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) { this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null); } -@@ -287,6 +299,7 @@ public class Chunk implements IChunkAccess { +@@ -333,6 +345,7 @@ public class Chunk implements IChunkAccess { // CraftBukkit start this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this); this.entitySlicesManager = new com.tuinity.tuinity.world.ChunkEntitySlices(this.world, this.loc.x, this.loc.z, 0, 15); // TODO update for 1.17 // Tuinity @@ -64,46 +107,3 @@ index 8e59a794f6190930cb7bb81a2fe1a1d374dacce7..045b4af6721817b3dbfb05b9aec0bf38 } public org.bukkit.Chunk bukkitChunk; -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index b55f7dece329dbb3ff27d57a39c32c69e5baea74..5897d462d350dfbd1464feb92ecf77725651c694 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -975,6 +975,7 @@ public class ChunkProviderServer extends IChunkProvider { - } - // Paper end - optimize isOutisdeRange - this.world.getMethodProfiler().enter("pollingChunks"); -+ this.world.resetIceAndSnowTick(); // Airplane - reset ice & snow tick random - int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); - boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit - -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 63dd6aba40506014b15efecfb8562c4f455ac04e..7660d098046100a4ab168149604ec196a4eea03d 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1127,6 +1127,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { - private final BiomeBase[] biomeBaseCache = new BiomeBase[1]; - // Tuinity end - optimise chunk ice snow ticking - -+ private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Airplane -+ - public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper - ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); - boolean flag = this.isRaining(); -@@ -1137,7 +1139,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - gameprofilerfiller.enter("thunder"); - final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change - -- if (!this.paperConfig.disableThunder && flag && this.random.nextInt(100000) == 0 && this.W()) { // Paper - Disable thunder // Airplane - check this.W last -+ if (!this.paperConfig.disableThunder && flag && chunk.shouldDoLightning(this.random) && this.W()) { // Paper - Disable thunder // Airplane - check this.W last // Airplane - replace random with shouldDoLighting - blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper - if (this.isRainingAt(blockposition)) { - DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); -@@ -1167,7 +1169,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - } - - gameprofilerfiller.exitEnter("iceandsnow"); -- if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking -+ if (!this.paperConfig.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Airplane - optimize further random ticking - // Paper start - optimise chunk ticking - // Tuinity start - optimise chunk ice snow ticking - BiomeBase[] biomeCache = this.biomeBaseCache; diff --git a/patches/Airplane/patches/server/0010-Don-t-get-entity-equipment-if-not-needed.patch b/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch similarity index 82% rename from patches/Airplane/patches/server/0010-Don-t-get-entity-equipment-if-not-needed.patch rename to patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch index 930f284f..63d46e52 100644 --- a/patches/Airplane/patches/server/0010-Don-t-get-entity-equipment-if-not-needed.patch +++ b/patches/Airplane/patches/server/0011-Don-t-get-entity-equipment-if-not-needed.patch @@ -19,11 +19,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 523db5ec954bc420a478bbaaf0d10d5a63024ccd..c5762aebcdd383ab710d4891308a7b1e815c44fd 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -820,11 +820,13 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index d991e3be65dc94597bd56ad9e034972e0e99a840..1a7866bed9cb7f0431454d3af4733de05c0cba78 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -910,11 +910,13 @@ public abstract class EntityLiving extends Entity { } if (entity != null) { diff --git a/patches/Airplane/patches/server/0011-Dynamic-activation-range.patch b/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch similarity index 70% rename from patches/Airplane/patches/server/0011-Dynamic-activation-range.patch rename to patches/Airplane/patches/server/0012-Dynamic-activation-range.patch index f32aea0f..619b1410 100644 --- a/patches/Airplane/patches/server/0011-Dynamic-activation-range.patch +++ b/patches/Airplane/patches/server/0012-Dynamic-activation-range.patch @@ -27,10 +27,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java -index 4feb9686f45ce4ae9f474447496b8e0f6fcb7e31..c39c9929a251b41ab60e1509b4e6c90d0825dc0c 100644 +index fbb9544027a48941bd0938d8f607e8c7ff9443a1..e0bed57aa5547a214ad779dbd0f648f3663147f9 100644 --- a/src/main/java/gg/airplane/AirplaneConfig.java +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -43,4 +43,29 @@ public class AirplaneConfig { +@@ -44,4 +44,29 @@ public class AirplaneConfig { } } @@ -60,11 +60,11 @@ index 4feb9686f45ce4ae9f474447496b8e0f6fcb7e31..c39c9929a251b41ab60e1509b4e6c90d + } + } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 94af972e115491d0f4394dd290ec2d9d426b8d32..426bebc5cd67ffcc72ee56d437cc13f6846e109c 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -197,6 +197,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index feab0ae1930b5271fe0d06a40c180317dcbc9d1d..c6b4af810fe3bda7797ab94316b2357178c9cd49 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -289,6 +289,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne public void inactiveTick() { } // Spigot end public boolean shouldBeRemoved; // Paper @@ -74,34 +74,11 @@ index 94af972e115491d0f4394dd290ec2d9d426b8d32..426bebc5cd67ffcc72ee56d437cc13f6 public float getBukkitYaw() { return this.yaw; -diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index 4a3469aca9f9e47d2ea3f3bae6ce77f5f11d6b50..5af5b50889961b10e812598dbea657c4e2aeceeb 100644 ---- a/src/main/java/net/minecraft/server/EntityHoglin.java -+++ b/src/main/java/net/minecraft/server/EntityHoglin.java -@@ -102,13 +102,18 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - -+ private int behaviorTick; // Airplane - @Override - protected void mobTick() { -+ // Airplane - dynamic tick -+ if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { - this.world.getMethodProfiler().enter("hoglinBrain"); - if (getRider() == null) // Purpur - only use brain if no rider - this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error - this.world.getMethodProfiler().exit(); - HoglinAI.a(this); -+ } -+ // Airplane end - if (this.isConverting()) { - ++this.conversionTicks; - if (this.conversionTicks > 300) { -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index d6a086f59d9df8ef7f727e6a83fa51a14995123e..cb094f00b6c7869632b9dacfc2c8c8e8299fddde 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -133,10 +133,10 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index aae13c2e6c2a30b69c33417932c6a4d0aefeb7f5..f4440a5c4aedb1d7d303517f86a07c856dd1309b 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -201,10 +201,10 @@ public abstract class EntityInsentient extends EntityLiving { @Override public void inactiveTick() { super.inactiveTick(); @@ -114,7 +91,7 @@ index d6a086f59d9df8ef7f727e6a83fa51a14995123e..cb094f00b6c7869632b9dacfc2c8c8e8 this.targetSelector.doTick(); } } -@@ -797,9 +797,11 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -829,9 +829,11 @@ public abstract class EntityInsentient extends EntityLiving { this.bo.a(); this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("targetSelector"); @@ -126,60 +103,11 @@ index d6a086f59d9df8ef7f727e6a83fa51a14995123e..cb094f00b6c7869632b9dacfc2c8c8e8 this.goalSelector.doTick(); this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("navigation"); -diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java -index 4849829df1041568a9fcac6d16501fc0606d95da..2ac74751ac8cea0b829b3d0ed03f052162a78781 100644 ---- a/src/main/java/net/minecraft/server/EntityPiglin.java -+++ b/src/main/java/net/minecraft/server/EntityPiglin.java -@@ -216,13 +216,18 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - return !this.cannotHunt; - } - -+ private int behaviorTick; // Airplane - @Override - protected void mobTick() { -+ // Airplane - dynamic tick -+ if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { - this.world.getMethodProfiler().enter("piglinBrain"); - if (getRider() == null) // Purpur - only use brain if no rider - this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error - this.world.getMethodProfiler().exit(); - PiglinAI.b(this); -+ } -+ // Airplane end - super.mobTick(); - } - -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 850dae5f20649854f013c0e530a3325455b5db4a..9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -210,6 +210,8 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - } - // Purpur end - -+ private int behaviorTick = 0; -+ - @Override - protected void mobTick() { mobTick(false); } - protected void mobTick(boolean inactive) { -@@ -219,7 +221,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; - if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) - // Purpur end -- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper -+ if (!inactive) { -+ if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) { -+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper -+ } -+ } - else if (shouldRestock()) doRestock(); // Purpur - this.world.getMethodProfiler().exit(); - if (this.bF) { -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -index 9cad895c7d008487ce885cbcc2c3966645df4c19..2ce5e07f4dcd0c76073840c35be66b7c65c6e7e8 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -@@ -43,9 +43,14 @@ public class PathfinderGoalSelector { +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +index 637928664f8c7b1c694a234e507c20724294e450..f303c5d6b2e55fc9fd8b49ec21121805e7351034 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +@@ -44,9 +44,14 @@ public class PathfinderGoalSelector { } // Paper start @@ -197,21 +125,88 @@ index 9cad895c7d008487ce885cbcc2c3966645df4c19..2ce5e07f4dcd0c76073840c35be66b7c } public boolean hasTasks() { for (PathfinderGoalWrapped task : getTasks()) { +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +index ab692de8a5b1411e37251fb545e6f579a9929f91..9aa4850e021076fde306eea7eec104c31086c57f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +@@ -121,12 +121,17 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + return (BehaviorController) super.getBehaviorController(); // Airplane - decompile error + } + ++ private int behaviorTick; // Airplane + @Override + protected void mobTick() { ++ // Airplane - dynamic tick ++ if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("hoglinBrain"); + this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error + this.world.getMethodProfiler().exit(); + HoglinAI.a(this); ++ } ++ // Airplane end + if (this.isConverting()) { + ++this.conversionTicks; + if (this.conversionTicks > 300) { +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +index d100b39c420e2326e869aa4059fc800d4c2fc0e4..48acef830eb1d919499e9b79dc6a9af4bdf8a17b 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +@@ -244,12 +244,17 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + return !this.cannotHunt; + } + ++ private int behaviorTick; // Airplane + @Override + protected void mobTick() { ++ // Airplane - dynamic tick ++ if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("piglinBrain"); + this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // Airplane - compile error + this.world.getMethodProfiler().exit(); + PiglinAI.b(this); ++ } ++ // Airplane end + super.mobTick(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 2d0b83923d58cc7b6918b4e2ff2bece13ca26899..d8028675fc82883d716bcfb44431ca6ac7dfda36 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -231,11 +231,17 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + // Spigot End + ++ private int behaviorTick = 0; ++ + @Override + protected void mobTick() { mobTick(false); } + protected void mobTick(boolean inactive) { + this.world.getMethodProfiler().enter("villagerBrain"); +- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper ++ if (!inactive) { ++ if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) { ++ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper ++ } ++ } + this.world.getMethodProfiler().exit(); + if (this.bF) { + this.bF = false; diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 05b165f4f2de1f09164c33c0b222dc660c86ebb9..7cc27df3c9429ccd840b394fcc3b96215a8449ac 100644 +index 5c2eaca0bc63c7880ee928aba6a24761737aa649..6c4c4580faef39e48de5af4db003cf2e3b8a99b5 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -49,6 +49,9 @@ import net.minecraft.server.EntityInsentient; - import net.minecraft.server.EntityLlama; - import net.minecraft.server.EntityWaterAnimal; +@@ -47,6 +47,9 @@ import net.minecraft.world.entity.schedule.Activity; + import net.minecraft.world.entity.item.EntityFallingBlock; + import net.minecraft.world.entity.projectile.EntityEnderSignal; // Paper end +// Airplane start -+import net.minecraft.server.Vec3D; ++import net.minecraft.world.phys.Vec3D; +// Airplane end public class ActivationRange { -@@ -230,7 +233,7 @@ public class ActivationRange +@@ -227,7 +230,7 @@ public class ActivationRange Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThreadNoCache( i1, j1 ); // Paper if ( chunk != null ) { @@ -220,7 +215,7 @@ index 05b165f4f2de1f09164c33c0b222dc660c86ebb9..7cc27df3c9429ccd840b394fcc3b9621 } } } -@@ -243,7 +246,7 @@ public class ActivationRange +@@ -240,7 +243,7 @@ public class ActivationRange * * @param chunk */ @@ -229,7 +224,7 @@ index 05b165f4f2de1f09164c33c0b222dc660c86ebb9..7cc27df3c9429ccd840b394fcc3b9621 { // Paper start Entity[] rawData = chunk.entities.getRawData(); -@@ -252,11 +255,19 @@ public class ActivationRange +@@ -249,11 +252,19 @@ public class ActivationRange //for ( Entity entity : (Collection) slice ) // Paper end { diff --git a/patches/Airplane/patches/server/0012-Reduce-allocs-improve-perf-of-StructureManager.patch b/patches/Airplane/patches/server/0013-Reduce-allocs-improve-perf-of-StructureManager.patch similarity index 73% rename from patches/Airplane/patches/server/0012-Reduce-allocs-improve-perf-of-StructureManager.patch rename to patches/Airplane/patches/server/0013-Reduce-allocs-improve-perf-of-StructureManager.patch index c697efd6..beb93e94 100644 --- a/patches/Airplane/patches/server/0012-Reduce-allocs-improve-perf-of-StructureManager.patch +++ b/patches/Airplane/patches/server/0013-Reduce-allocs-improve-perf-of-StructureManager.patch @@ -8,13 +8,29 @@ getStructureStarts, it inlines getFeatureStarts so it doesn't have to calculate an entire list when it returns early. As well, it uses a LongIterator in order to not allocate longs for each position. -diff --git a/src/main/java/net/minecraft/server/StructureManager.java b/src/main/java/net/minecraft/server/StructureManager.java -index 2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea..fd1f1e2d7e4be227697f534bdc6d9c52ceeeda4b 100644 ---- a/src/main/java/net/minecraft/server/StructureManager.java -+++ b/src/main/java/net/minecraft/server/StructureManager.java -@@ -5,6 +5,11 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper - import java.util.stream.Stream; - import javax.annotation.Nullable; +Airplane +Copyright (C) 2020 Technove LLC + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +diff --git a/src/main/java/net/minecraft/world/level/StructureManager.java b/src/main/java/net/minecraft/world/level/StructureManager.java +index acacbf9617f99b97fc7fd2ba718775e1b3e429e9..967ae0212028d57d366497f7f25c61776c1ac3f2 100644 +--- a/src/main/java/net/minecraft/world/level/StructureManager.java ++++ b/src/main/java/net/minecraft/world/level/StructureManager.java +@@ -15,6 +15,11 @@ import net.minecraft.world.level.levelgen.feature.StructureGenerator; + import net.minecraft.world.level.levelgen.structure.StructurePiece; + import net.minecraft.world.level.levelgen.structure.StructureStart; +// Airplane start +import it.unimi.dsi.fastutil.longs.LongIterator; @@ -24,7 +40,7 @@ index 2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea..fd1f1e2d7e4be227697f534bdc6d9c52 public class StructureManager { private final GeneratorAccess a; public GeneratorAccess getLevel() { return a; } // Paper - OBFHELPER -@@ -41,13 +46,15 @@ public class StructureManager { +@@ -51,13 +56,15 @@ public class StructureManager { public java.util.List> getFeatureStarts(SectionPosition sectionPosition, StructureGenerator structureGenerator, IWorldReader world) { // Tuinity end - add world parameter java.util.List> list = new ObjectArrayList<>(); @@ -43,7 +59,7 @@ index 2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea..fd1f1e2d7e4be227697f534bdc6d9c52 return list; } // Paper end -@@ -75,7 +82,18 @@ public class StructureManager { +@@ -85,7 +92,18 @@ public class StructureManager { } public StructureStart getStructureStarts(BlockPosition blockposition, boolean flag, StructureGenerator structuregenerator, IWorldReader world) { // Paper start - remove structure streams @@ -63,7 +79,7 @@ index 2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea..fd1f1e2d7e4be227697f534bdc6d9c52 if (structurestart.c().b(blockposition)) { if (!flag) { return structurestart; -@@ -86,7 +104,10 @@ public class StructureManager { +@@ -96,7 +114,10 @@ public class StructureManager { } } } diff --git a/patches/Airplane/patches/server/0013-Cache-palette-array.patch b/patches/Airplane/patches/server/0014-Cache-palette-array.patch similarity index 59% rename from patches/Airplane/patches/server/0013-Cache-palette-array.patch rename to patches/Airplane/patches/server/0014-Cache-palette-array.patch index ef970d57..d59e9fde 100644 --- a/patches/Airplane/patches/server/0013-Cache-palette-array.patch +++ b/patches/Airplane/patches/server/0014-Cache-palette-array.patch @@ -7,40 +7,27 @@ The reasoning for reusing it in ChunkRegionLoader is because ThreadLocal lookups are fairly expensive, and if we put it in DataPaletteBlock the ThreadLocal lookup would happen 18 times. -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 5f04591193d58ba7897194142da5efcbec3763dd..e77da341b765725771726283d3a8249b514b40da 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -424,6 +424,7 @@ public class ChunkRegionLoader { - public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess) { - return saveChunk(worldserver, ichunkaccess, null); - } -+ private static final ThreadLocal paletteArray = ThreadLocal.withInitial(() -> new int[4096]); // Airplane - public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess, AsyncSaveData asyncsavedata) { - // Paper end - // Tuinity start - rewrite light impl -@@ -454,6 +455,7 @@ public class ChunkRegionLoader { - - NBTTagCompound nbttagcompound2; - -+ int[] aint = paletteArray.get(); // Airplane - use cached - for (int i = -1; i < 17; ++i) { // Paper - conflict on loop parameter change - int finalI = i; // CraftBukkit - decompile errors - ChunkSection chunksection = (ChunkSection) Arrays.stream(achunksection).filter((chunksection1) -> { -@@ -474,7 +476,7 @@ public class ChunkRegionLoader { - nbttagcompound2 = new NBTTagCompound(); - nbttagcompound2.setByte("Y", (byte) (i & 255)); - if (chunksection != Chunk.a) { -- chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates"); -+ chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates", aint); // Airplane - } - - if (nibblearray != null && !nibblearray.c()) { -diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 73163b417af7e522a4509bf9c1ab56d6499be622..2855a2757c35afc5751a7ca6f3a12cc27c24bf96 100644 ---- a/src/main/java/net/minecraft/server/DataPaletteBlock.java -+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java -@@ -226,12 +226,16 @@ public class DataPaletteBlock implements DataPaletteExpandable { +Airplane +Copyright (C) 2020 Technove LLC + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +diff --git a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java +index a6937366cd9c9d708edb5cd1ab3ac096e7b2032e..a579c5bf9e20c74aa3bf8ef6bc00576409805ca6 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java +@@ -235,12 +235,16 @@ public class DataPaletteBlock implements DataPaletteExpandable { this.b(); } @@ -58,3 +45,32 @@ index 73163b417af7e522a4509bf9c1ab56d6499be622..2855a2757c35afc5751a7ca6f3a12cc2 for (int j = 0; j < 4096; ++j) { T t1 = this.a(j); +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +index ec2b238480413ba9c123d9ddeaa787d9520e1b74..bf96f9e538fc29ca914536e8a7ce727ebe43a8b2 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -468,6 +468,7 @@ public class ChunkRegionLoader { + public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess) { + return saveChunk(worldserver, ichunkaccess, null); + } ++ private static final ThreadLocal paletteArray = ThreadLocal.withInitial(() -> new int[4096]); // Airplane + public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess, AsyncSaveData asyncsavedata) { + // Paper end + // Tuinity start - rewrite light impl +@@ -498,6 +499,7 @@ public class ChunkRegionLoader { + + NBTTagCompound nbttagcompound2; + ++ int[] aint = paletteArray.get(); // Airplane - use cached + for (int i = -1; i < 17; ++i) { // Paper - conflict on loop parameter change + int finalI = i; // CraftBukkit - decompile errors + ChunkSection chunksection = (ChunkSection) Arrays.stream(achunksection).filter((chunksection1) -> { +@@ -518,7 +520,7 @@ public class ChunkRegionLoader { + nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setByte("Y", (byte) (i & 255)); + if (chunksection != Chunk.a) { +- chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates"); ++ chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates", aint); // Airplane + } + + if (nibblearray != null && !nibblearray.c()) { diff --git a/patches/Airplane/patches/server/0014-Reduce-chunk-loading-lookups.patch b/patches/Airplane/patches/server/0015-Reduce-chunk-loading-lookups.patch similarity index 57% rename from patches/Airplane/patches/server/0014-Reduce-chunk-loading-lookups.patch rename to patches/Airplane/patches/server/0015-Reduce-chunk-loading-lookups.patch index 8397f4a9..c494c75b 100644 --- a/patches/Airplane/patches/server/0014-Reduce-chunk-loading-lookups.patch +++ b/patches/Airplane/patches/server/0015-Reduce-chunk-loading-lookups.patch @@ -3,12 +3,35 @@ From: Paul Sauve Date: Thu, 4 Feb 2021 23:33:52 -0600 Subject: [PATCH] Reduce chunk loading & lookups +Airplane +Copyright (C) 2020 Technove LLC -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index df4d5ed5957658ee9ca083ac79b38a1202fe7015..e7568e3df10bc07e9b3b05caa9d41398925cf4d7 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -279,11 +279,18 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index e993b1849beb60515c51ee4f37617faab63ca223..4d7b5d47ab6bd3b1408811c3b9c157b1eb5c30ae 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -57,6 +57,7 @@ import net.minecraft.world.level.World; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.chunk.Chunk; + import net.minecraft.world.level.pathfinder.PathType; + import net.minecraft.world.phys.AxisAlignedBB; + import net.minecraft.world.phys.MovingObjectPositionBlock; +@@ -314,11 +315,18 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { private boolean p(double d0, double d1, double d2) { BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(d0, d1, d2); @@ -29,11 +52,11 @@ index df4d5ed5957658ee9ca083ac79b38a1202fe7015..e7568e3df10bc07e9b3b05caa9d41398 boolean flag = iblockdata.getMaterial().isSolid(); boolean flag1 = iblockdata.getFluid().a((Tag) TagsFluid.WATER); -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index ad520cb36afd0f011b6337f3e42efb01f740a950..b5b0f295d63eb245a6221f88110f1bb1694c641c 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -381,7 +381,10 @@ public final class SpawnerCreature { +diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +index d497006f05f79015cd791849888832bb53f4a414..d98526785ff2fa3b72e8ffffcb89a57a2203a5c8 100644 +--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -415,7 +415,10 @@ public final class SpawnerCreature { } private static List a(WorldServer worldserver, StructureManager structuremanager, ChunkGenerator chunkgenerator, EnumCreatureType enumcreaturetype, BlockPosition blockposition, @Nullable BiomeBase biomebase) { diff --git a/patches/Airplane/patches/server/0015-Skip-POI-finding-if-stuck-in-vehicle.patch b/patches/Airplane/patches/server/0016-Skip-POI-finding-if-stuck-in-vehicle.patch similarity index 59% rename from patches/Airplane/patches/server/0015-Skip-POI-finding-if-stuck-in-vehicle.patch rename to patches/Airplane/patches/server/0016-Skip-POI-finding-if-stuck-in-vehicle.patch index da7b1dd0..244d3884 100644 --- a/patches/Airplane/patches/server/0015-Skip-POI-finding-if-stuck-in-vehicle.patch +++ b/patches/Airplane/patches/server/0016-Skip-POI-finding-if-stuck-in-vehicle.patch @@ -19,11 +19,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -index 83702e07dff72b639af32c8ba9e831e58da92a10..a48f2f82517bc391d5d5b7961e3c7a75175abb65 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java -+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -@@ -57,6 +57,7 @@ public class BehaviorFindPosition extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +index bc8786e2aaeab4dbae4e9c7666ad816bc5bfac3f..09133c5822bc1386bc3d8a5f3c94196420bbfaea 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +@@ -67,6 +67,7 @@ public class BehaviorFindPosition extends Behavior { protected void a(WorldServer worldserver, EntityCreature entitycreature, long i) { this.f = i + 20L + (long) worldserver.getRandom().nextInt(20); @@ -31,11 +31,11 @@ index 83702e07dff72b639af32c8ba9e831e58da92a10..a48f2f82517bc391d5d5b7961e3c7a75 VillagePlace villageplace = worldserver.y(); this.g.long2ObjectEntrySet().removeIf((entry) -> { -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index cba6f414d1a673e735f80662620a8bec78cd09ab..88368ae1633cf8bfb845d52b38110a6828fcf699 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -412,6 +412,7 @@ public abstract class NavigationAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +index 148bdbc2cffb002d8b6dd05e70854ab503804949..48e6a4c588ef39a4bde067d79b96a656c68750ce 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +@@ -433,6 +433,7 @@ public abstract class NavigationAbstract { } } diff --git a/patches/Airplane/patches/server/0016-Airplane-Profiler.patch b/patches/Airplane/patches/server/0017-Airplane-Profiler.patch similarity index 85% rename from patches/Airplane/patches/server/0016-Airplane-Profiler.patch rename to patches/Airplane/patches/server/0017-Airplane-Profiler.patch index d5e0e6ee..de6d15ae 100644 --- a/patches/Airplane/patches/server/0016-Airplane-Profiler.patch +++ b/patches/Airplane/patches/server/0017-Airplane-Profiler.patch @@ -20,10 +20,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/pom.xml b/pom.xml -index 752d62eb3b87ab24260ec2c029bae0d2b0e3b908..02bbe784d0a062dd643e37f3ad04b77a78144828 100644 +index a3a3b17f3b30b55bb50905353e77723091bb5c1f..fc2c3714b6c772d67e258be269aa92dda80cdb12 100644 --- a/pom.xml +++ b/pom.xml -@@ -161,6 +161,13 @@ +@@ -159,8 +159,23 @@ 1.1.0-SNAPSHOT compile @@ -36,24 +36,22 @@ index 752d62eb3b87ab24260ec2c029bae0d2b0e3b908..02bbe784d0a062dd643e37f3ad04b77a + - -@@ -174,6 +181,11 @@ - spigotmc-public - https://hub.spigotmc.org/nexus/content/groups/public/ - ++ + + + jitpack.io + https://jitpack.io + - - - ++ ++ + + + tuinity-${minecraft.version} diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java -index c39c9929a251b41ab60e1509b4e6c90d0825dc0c..4f87df936d0092cbf8cb2a6db9b57f235c287beb 100644 +index e0bed57aa5547a214ad779dbd0f648f3663147f9..39ef53c9dd49d5951103777002f866a64a252bfd 100644 --- a/src/main/java/gg/airplane/AirplaneConfig.java +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -68,4 +68,26 @@ public class AirplaneConfig { +@@ -69,4 +69,26 @@ public class AirplaneConfig { dynamicHoglinBehavior = manual.get("behavior-activation.hoglin", dynamicHoglinBehavior); } @@ -205,21 +203,21 @@ index 0000000000000000000000000000000000000000..f4976428bc721319d2926e97cbe0f64c +} diff --git a/src/main/java/gg/airplane/flare/FlareCommand.java b/src/main/java/gg/airplane/flare/FlareCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba2172df01 +index 0000000000000000000000000000000000000000..ddc90f1589e683f452c5a74d9d2408803edea029 --- /dev/null +++ b/src/main/java/gg/airplane/flare/FlareCommand.java -@@ -0,0 +1,159 @@ +@@ -0,0 +1,149 @@ +package gg.airplane.flare; + +import com.google.common.collect.ImmutableList; +import gg.airplane.AirplaneConfig; +import gg.airplane.flare.exceptions.UserReportableException; +import gg.airplane.flare.profiling.AsyncProfilerIntegration; -+import net.md_5.bungee.api.ChatColor; -+import net.md_5.bungee.api.chat.BaseComponent; -+import net.md_5.bungee.api.chat.ClickEvent; -+import net.md_5.bungee.api.chat.ComponentBuilder; -+import net.md_5.bungee.api.chat.TextComponent; ++import net.kyori.adventure.text.Component; ++import net.kyori.adventure.text.event.ClickEvent; ++import net.kyori.adventure.text.format.NamedTextColor; ++import net.kyori.adventure.text.format.TextColor; ++import net.kyori.adventure.text.format.TextDecoration; +import org.bukkit.Bukkit; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; @@ -234,21 +232,14 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba +public class FlareCommand extends Command { + + private static final String BASE_URL = "https://blog.airplane.gg/flare-tutorial/#setting-the-access-token"; -+ private static final ChatColor HEX = ChatColor.of("#6a7eda"); -+ private static final BaseComponent[] PREFIX = new ComponentBuilder("Flare โœˆ ") -+ .color(HEX) -+ .bold(true) -+ .create(); -+ -+ private static ComponentBuilder create(ComponentBuilder newBuilder) { -+ newBuilder.color(HEX); -+ newBuilder.bold(false); -+ -+ ComponentBuilder builder = new ComponentBuilder(); -+ builder.append(PREFIX); -+ builder.append(newBuilder.create()); -+ return builder; -+ } ++ private static final TextColor HEX = TextColor.fromHexString("#e3eaea"); ++ private static final Component PREFIX = Component.text() ++ .append(Component.text("Flare โœˆ") ++ .color(TextColor.fromHexString("#6a7eda")) ++ .decoration(TextDecoration.BOLD, true) ++ .append(Component.text(" ", HEX) ++ .decoration(TextDecoration.BOLD, false))) ++ .asComponent(); + + public FlareCommand() { + super("flare", "Profile your server with Flare", "/flare", Collections.singletonList("profile")); @@ -259,36 +250,28 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba + public boolean execute(CommandSender sender, String commandLabel, String[] args) { + if (!testPermission(sender)) return true; + if (AirplaneConfig.accessToken.length() == 0) { -+ BaseComponent clickable = new TextComponent(BASE_URL); -+ clickable.setUnderlined(true); -+ clickable.setColor(HEX); -+ clickable.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, BASE_URL)); ++ Component clickable = Component.text(BASE_URL, HEX, TextDecoration.UNDERLINED).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, BASE_URL)); + -+ sender.sendMessage(create(new ComponentBuilder("Flare currently requires an access token to use. To learn more, visit ") -+ .color(HEX) -+ .append(clickable) -+ ) -+ .create()); ++ sender.sendMessage(PREFIX.append(Component.text("Flare currently requires an access token to use. To learn more, visit ").color(HEX).append(clickable))); + return true; + } + + if (AsyncProfilerIntegration.doesNotSupportProfiling()) { -+ sender.sendMessage(create(new ComponentBuilder("Profiling is not supported in this environment, reason: " + AsyncProfilerIntegration.getDisabledReason()) -+ .color(ChatColor.RED) -+ ).create()); ++ sender.sendMessage(PREFIX.append( ++ Component.text("Profiling is not supported in this environment, reason: " + AsyncProfilerIntegration.getDisabledReason(), NamedTextColor.RED))); + return true; + } + if (ProfilingManager.isProfiling()) { + if (args.length == 1 && args[0].equalsIgnoreCase("status")) { -+ sender.sendMessage(create(new ComponentBuilder("Status: " + AsyncProfilerIntegration.status())).create()); ++ sender.sendMessage(PREFIX.append(Component.text("Status: " + AsyncProfilerIntegration.status(), HEX))); + return true; + } + if (ProfilingManager.stop()) { + if (!(sender instanceof ConsoleCommandSender)) { -+ sender.sendMessage(create(new ComponentBuilder("Profiling has been stopped.")).create()); ++ sender.sendMessage(PREFIX.append(Component.text("Profiling has been stopped.", HEX))); + } + } else { -+ sender.sendMessage(create(new ComponentBuilder("Profiling has already been stopped.")).create()); ++ sender.sendMessage(PREFIX.append(Component.text("Profiling has already been stopped.", HEX))); + } + } else { + ProfileType profileType = null; @@ -296,10 +279,11 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba + try { + profileType = ProfileType.valueOf(args[0].toUpperCase()); + } catch (Exception e) { -+ sender.sendMessage(create(new ComponentBuilder("Invalid profile type ") -+ .append(args[0]).color(ChatColor.BOLD) -+ .append("!").color(HEX)).create()); -+ return false; ++ sender.sendMessage(PREFIX.append(Component ++ .text("Invalid profile type ", HEX) ++ .append(Component.text(args[0], HEX, TextDecoration.BOLD) ++ .append(Component.text("!", HEX))) ++ )); + } + } + int interval = 5; @@ -307,10 +291,12 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba + try { + interval = Integer.parseInt(args[1]); + } catch (Exception e) { -+ sender.sendMessage(create(new ComponentBuilder("Invalid time in milliseconds ") -+ .append(args[1]).color(HEX).bold(true) -+ .append("!").color(HEX)).create()); -+ return false; ++ sender.sendMessage(PREFIX.append(Component ++ .text("Invalid time in milliseconds ", HEX) ++ .append(Component.text(args[1], HEX, TextDecoration.BOLD) ++ .append(Component.text("!", HEX))) ++ )); ++ return true; + } + } + int finalInterval = interval; @@ -319,18 +305,20 @@ index 0000000000000000000000000000000000000000..e3ef62ae97b8b92459e1c405525790ba + try { + if (ProfilingManager.start(finalProfileType, finalInterval)) { + if (!(sender instanceof ConsoleCommandSender)) { -+ sender.sendMessage(create(new ComponentBuilder("Profiling has been started: " + ProfilingManager.getProfilingUrl().get()) -+ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get()))) -+ .create()); -+ sender.sendMessage(create(new ComponentBuilder(" Run /" + commandLabel + " to stop profiling.")).create()); ++ sender.sendMessage(PREFIX.append(Component ++ .text("Flare has been started: " + ProfilingManager.getProfilingUrl().get(), HEX) ++ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUrl().get())) ++ )); ++ sender.sendMessage(PREFIX.append(Component.text(" Run /" + commandLabel + " to stop the Flare.", HEX))); + } + } else { -+ sender.sendMessage(create(new ComponentBuilder("Profiling has already been started: " + ProfilingManager.getProfilingUrl().get()) -+ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get()))) -+ .create()); ++ sender.sendMessage(PREFIX.append(Component ++ .text("Flare has already been started: " + ProfilingManager.getProfilingUrl().get(), HEX) ++ .clickEvent(ClickEvent.openUrl(ProfilingManager.getProfilingUrl().get())) ++ )); + } + } catch (UserReportableException e) { -+ sender.sendMessage(create(new ComponentBuilder("Profiling failed to start: " + e.getUserError())).create()); ++ sender.sendMessage(Component.text("Flare failed to start: " + e.getUserError(), NamedTextColor.RED)); + e.printStackTrace(); + } + }); diff --git a/patches/Airplane/patches/server/0017-Multithreaded-entity-tracking.patch b/patches/Airplane/patches/server/0018-Multithreaded-entity-tracking.patch similarity index 84% rename from patches/Airplane/patches/server/0017-Multithreaded-entity-tracking.patch rename to patches/Airplane/patches/server/0018-Multithreaded-entity-tracking.patch index e2de5417..df429e87 100644 --- a/patches/Airplane/patches/server/0017-Multithreaded-entity-tracking.patch +++ b/patches/Airplane/patches/server/0018-Multithreaded-entity-tracking.patch @@ -37,15 +37,15 @@ index be408aebbccbda46e8aa82ef337574137cfa0096..b9bdce7c7ca8b7b107b0dca165d72232 protected final double maxFragFactor; diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java -index 4f87df936d0092cbf8cb2a6db9b57f235c287beb..424325ada75b788ce390378d8df0116e5c50cf3d 100644 +index 39ef53c9dd49d5951103777002f866a64a252bfd..3886c731a69540f638d57a411285da289d3b704b 100644 --- a/src/main/java/gg/airplane/AirplaneConfig.java +++ b/src/main/java/gg/airplane/AirplaneConfig.java -@@ -90,4 +90,18 @@ public class AirplaneConfig { +@@ -91,4 +91,18 @@ public class AirplaneConfig { } } + -+ public static boolean multithreadedEntityTracker = true; ++ public static boolean multithreadedEntityTracker = false; + public static boolean entityTrackerAsyncPackets = false; + + private static void entityTracker() { @@ -61,14 +61,14 @@ index 4f87df936d0092cbf8cb2a6db9b57f235c287beb..424325ada75b788ce390378d8df0116e } diff --git a/src/main/java/gg/airplane/structs/TrackQueue.java b/src/main/java/gg/airplane/structs/TrackQueue.java new file mode 100644 -index 0000000000000000000000000000000000000000..e72229128285e1a48b9b461620620976ca0dc0a4 +index 0000000000000000000000000000000000000000..ae7c5430b4f5970ede602bb234b5ffcee424f6a7 --- /dev/null +++ b/src/main/java/gg/airplane/structs/TrackQueue.java @@ -0,0 +1,84 @@ +package gg.airplane.structs; + +import com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet; -+import net.minecraft.server.Chunk; ++import net.minecraft.world.level.chunk.Chunk; +import net.minecraft.server.MinecraftServer; +import org.apache.logging.log4j.Level; + @@ -149,42 +149,11 @@ index 0000000000000000000000000000000000000000..e72229128285e1a48b9b461620620976 + } + +} -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 045b4af6721817b3dbfb05b9aec0bf382de9fcf5..6cde93d62c4c324a6544401cabe045cbb80f465e 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -65,6 +65,26 @@ public class Chunk implements IChunkAccess { - } - // Airplane end - -+ // Airplane start - entity tracker runnable -+ // prevents needing to allocate new lambda in processTrackQueue -+ public final Runnable entityTracker = new Runnable() { -+ @Override -+ public void run() { -+ Entity[] entities = Chunk.this.entities.getRawData(); -+ for (int i = 0, len = Chunk.this.entities.size(); i < len; ++i) { -+ Entity entity = entities[i]; -+ if (entity != null) { -+ PlayerChunkMap.EntityTracker tracker = ((WorldServer) Chunk.this.getWorld()).getChunkProvider().playerChunkMap.trackedEntities.get(entity.getId()); -+ if (tracker != null) { -+ tracker.updatePlayers(tracker.tracker.getPlayersInTrackRange()); -+ tracker.tickEntry(); -+ } -+ } -+ } -+ } -+ }; -+ // Airplane end -+ - public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) { - this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null); - } -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e384a24d9b46587f66ee3e712a8206b1ca1f3877..8071e8ec7bb505e026ceead84377e61063864bc5 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -52,7 +52,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 59989db6dcf96a8ab5a75775bb588c31cec3418a..534c7266fe9d6f60b74a71e5e61ed248e515dffd 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -182,7 +182,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public NetworkManager networkManager; // Paper public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; @@ -193,11 +162,11 @@ index e384a24d9b46587f66ee3e712a8206b1ca1f3877..8071e8ec7bb505e026ceead84377e610 private final AdvancementDataPlayer advancementDataPlayer; private final ServerStatisticManager serverStatisticManager; private float lastHealthScored = Float.MIN_VALUE; -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e201034087772 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -46,6 +46,10 @@ public class EntityTrackerEntry { +diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +index a1512ee8422fa39a95e4f19c86fe71b77af54ca0..c830b257054b7f8153aa9225c1f61f49a6ea0a84 100644 +--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +@@ -75,6 +75,10 @@ public class EntityTrackerEntry { * Requested in https://github.com/PaperMC/Paper/issues/1537 to allow intercepting packets */ public void sendPlayerPacket(EntityPlayer player, Packet packet) { @@ -208,7 +177,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 player.playerConnection.sendPacket(packet); } -@@ -74,7 +78,7 @@ public class EntityTrackerEntry { +@@ -103,7 +107,7 @@ public class EntityTrackerEntry { public final void tick() { this.a(); } // Paper - OBFHELPER public void a() { @@ -217,7 +186,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 List list = this.tracker.passengers; // Paper - do not copy list if (!list.equals(this.p)) { -@@ -88,6 +92,8 @@ public class EntityTrackerEntry { +@@ -117,6 +121,8 @@ public class EntityTrackerEntry { ItemStack itemstack = entityitemframe.getItem(); if (this.tickCounter % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks @@ -226,7 +195,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 WorldMap worldmap = ItemWorldMap.getSavedMap(itemstack, this.b); Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit -@@ -101,6 +107,8 @@ public class EntityTrackerEntry { +@@ -130,6 +136,8 @@ public class EntityTrackerEntry { entityplayer.playerConnection.sendPacket(packet); } } @@ -235,7 +204,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 } this.c(); -@@ -245,18 +253,25 @@ public class EntityTrackerEntry { +@@ -264,18 +272,25 @@ public class EntityTrackerEntry { // CraftBukkit start - Create PlayerVelocity event boolean cancelled = false; @@ -265,7 +234,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 } if (!cancelled) { -@@ -356,7 +371,9 @@ public class EntityTrackerEntry { +@@ -359,7 +374,9 @@ public class EntityTrackerEntry { if (!list.isEmpty()) { consumer.accept(new PacketPlayOutEntityEquipment(this.tracker.getId(), list)); } @@ -275,7 +244,7 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 } // CraftBukkit start - Fix for nonsensical head yaw -@@ -434,6 +451,10 @@ public class EntityTrackerEntry { +@@ -437,6 +454,10 @@ public class EntityTrackerEntry { // Paper end private void broadcastIncludingSelf(Packet packet) { @@ -286,11 +255,11 @@ index 2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8..63bcd1b61d0485b064d619ddfa0e2010 this.f.accept(packet); if (this.tracker instanceof EntityPlayer) { ((EntityPlayer) this.tracker).playerConnection.sendPacket(packet); -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895d7b7a068 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -731,6 +731,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index d7eede51f1c4ebbe8e00b16efd6331c87db53bb4..585dbb250d975d2e9c34af26b9d5927ce734b407 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -785,6 +785,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); // Paper end } @@ -302,7 +271,7 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 protected final IntSupplier getPrioritySupplier(long i) { return c(i); } // Paper - OBFHELPER protected IntSupplier c(long i) { -@@ -2134,10 +2139,30 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2188,10 +2193,30 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { entity.tracker = null; // Paper - We're no longer tracked } @@ -333,27 +302,27 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet.Iterator iterator = this.world.getChunkProvider().entityTickingChunks.iterator(); try { while (iterator.hasNext()) { -@@ -2403,7 +2428,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2457,7 +2482,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially public class EntityTracker { final EntityTrackerEntry trackerEntry; // Paper - private -> package private - private final Entity tracker; -+ protected final Entity tracker; // Airplane - public for chunk ++ public final Entity tracker; // Airplane - public for chunk private final int trackingDistance; private SectionPosition e; // Paper start -@@ -2422,7 +2447,9 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2476,7 +2501,9 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially // Paper start - use distance map to optimise tracker com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet lastTrackerCandidates; - final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newTrackerCandidates) { -+ synchronized final void tickEntry() { this.trackerEntry.tick(); } // Airplane - move entry tick into sync block ++ public synchronized final void tickEntry() { this.trackerEntry.tick(); } // Airplane - move entry tick into sync block + -+ synchronized final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newTrackerCandidates) { // Airplane ++ public synchronized final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newTrackerCandidates) { // Airplane com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet oldTrackerCandidates = this.lastTrackerCandidates; this.lastTrackerCandidates = newTrackerCandidates; -@@ -2463,7 +2490,13 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2517,7 +2544,13 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially return this.tracker.getId(); } @@ -368,7 +337,7 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 Iterator iterator = this.trackedPlayers.iterator(); while (iterator.hasNext()) { -@@ -2475,6 +2508,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2529,6 +2562,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially } public void broadcastIncludingSelf(Packet packet) { @@ -381,7 +350,7 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 this.broadcast(packet); if (this.tracker instanceof EntityPlayer) { ((EntityPlayer) this.tracker).playerConnection.sendPacket(packet); -@@ -2501,8 +2540,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2555,8 +2594,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially } @@ -392,7 +361,7 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 if (entityplayer != this.tracker) { // Paper start - remove allocation of Vec3D here //Vec3D vec3d = entityplayer.getPositionVector().d(this.tracker.getPositionVector()); // MC-155077, SPIGOT-5113 -@@ -2518,7 +2557,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2572,7 +2611,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially if (!flag1) { ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); @@ -401,3 +370,34 @@ index 3e0bf6df7c4608a5b19024612db52558fd722f4b..74bb2573aa4f52a30341b3763f60a895 if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance; +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index 226f9e5a3d867b5365f3ea44c1459ed7265c1b41..4f5f9eb110cf71a966d1365c7813ba55b5127890 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -111,6 +111,26 @@ public class Chunk implements IChunkAccess { + } + // Airplane end + ++ // Airplane start - entity tracker runnable ++ // prevents needing to allocate new lambda in processTrackQueue ++ public final Runnable entityTracker = new Runnable() { ++ @Override ++ public void run() { ++ Entity[] entities = Chunk.this.entities.getRawData(); ++ for (int i = 0, len = Chunk.this.entities.size(); i < len; ++i) { ++ Entity entity = entities[i]; ++ if (entity != null) { ++ PlayerChunkMap.EntityTracker tracker = ((WorldServer) Chunk.this.getWorld()).getChunkProvider().playerChunkMap.trackedEntities.get(entity.getId()); ++ if (tracker != null) { ++ tracker.updatePlayers(tracker.tracker.getPlayersInTrackRange()); ++ tracker.tickEntry(); ++ } ++ } ++ } ++ } ++ }; ++ // Airplane end ++ + public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) { + this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null); + } diff --git a/patches/Airplane/patches/server/0018-Skip-copying-unloading-tile-entities.patch b/patches/Airplane/patches/server/0019-Skip-copying-unloading-tile-entities.patch similarity index 78% rename from patches/Airplane/patches/server/0018-Skip-copying-unloading-tile-entities.patch rename to patches/Airplane/patches/server/0019-Skip-copying-unloading-tile-entities.patch index 8b1737c8..1f3a98f8 100644 --- a/patches/Airplane/patches/server/0018-Skip-copying-unloading-tile-entities.patch +++ b/patches/Airplane/patches/server/0019-Skip-copying-unloading-tile-entities.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Mar 2021 10:19:15 -0600 Subject: [PATCH] Skip copying unloading tile entities -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9d6ddfec93f49f80fdc88248fc5aaf5ad6ee48da..bdb0e46d9196f4ac164ed09fd9d01db60aaab401 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -44,7 +44,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index bbc842a173b12a96b1b63af347d2196ac1cb5f73..938a8732d1d57ae0cf424fa17c5c5b08cc5df37b 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -106,7 +106,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list public final List tileEntityListTick = Lists.newArrayList(); protected final List tileEntityListPending = Lists.newArrayList(); @@ -17,7 +17,7 @@ index 9d6ddfec93f49f80fdc88248fc5aaf5ad6ee48da..bdb0e46d9196f4ac164ed09fd9d01db6 public final Thread serverThread; private final boolean debugWorld; private int d; -@@ -969,12 +969,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -986,12 +986,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.enter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch b/patches/Airplane/patches/server/0020-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch similarity index 80% rename from patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch rename to patches/Airplane/patches/server/0020-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch index 23588f1d..14ad39d4 100644 --- a/patches/Airplane/patches/server/0019-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch +++ b/patches/Airplane/patches/server/0020-Reduce-entity-chunk-ticking-checks-from-3-to-1.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Mar 2021 10:40:22 -0600 Subject: [PATCH] Reduce entity chunk ticking checks from 3 to 1 -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 7660d098046100a4ab168149604ec196a4eea03d..4e7700443c4f0725c0d032b620f84fcfadbde7a1 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -988,11 +988,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index b33f37309d4dd22c033ad84effa4ff9d6e20a790..b788c33605fc96d17758cf42e508872e38fb4322 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1081,11 +1081,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit end */ gameprofilerfiller.enter("checkDespawn"); @@ -22,7 +22,7 @@ index 7660d098046100a4ab168149604ec196a4eea03d..4e7700443c4f0725c0d032b620f84fcf this.updateNavigatorsInRegion(entity); } } else { -@@ -1022,7 +1023,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1115,7 +1116,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.entitiesById.remove(entity.getId()); // Tuinity this.unregisterEntity(entity); } else if (entity.inChunk && entity.valid) { // Tuinity start - optimise notify() @@ -31,7 +31,7 @@ index 7660d098046100a4ab168149604ec196a4eea03d..4e7700443c4f0725c0d032b620f84fcf this.updateNavigatorsInRegion(entity); } } else { -@@ -1349,7 +1350,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1416,7 +1417,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Tuinity end - log detailed entity tick information @@ -42,7 +42,7 @@ index 7660d098046100a4ab168149604ec196a4eea03d..4e7700443c4f0725c0d032b620f84fcf // Tuinity start - log detailed entity tick information com.tuinity.tuinity.util.TickThread.ensureTickThread("Cannot tick an entity off-main"); try { -@@ -1357,7 +1360,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1424,7 +1427,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { currentlyTickingEntity.lazySet(entity); } // Tuinity end - log detailed entity tick information diff --git a/patches/Airplane/patches/server/0020-Remove-iterators-from-inventory-contains.patch b/patches/Airplane/patches/server/0021-Remove-iterators-from-inventory-contains.patch similarity index 67% rename from patches/Airplane/patches/server/0020-Remove-iterators-from-inventory-contains.patch rename to patches/Airplane/patches/server/0021-Remove-iterators-from-inventory-contains.patch index a8bafded..fec1749c 100644 --- a/patches/Airplane/patches/server/0020-Remove-iterators-from-inventory-contains.patch +++ b/patches/Airplane/patches/server/0021-Remove-iterators-from-inventory-contains.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Mar 2021 12:24:41 -0600 Subject: [PATCH] Remove iterators from inventory contains -diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java -index 3b65711b91c51ac7b4b5b2b0144ffd279fe60eeb..478f33dbbd0b5a9b81ee420f77c97fa8c40e27d6 100644 ---- a/src/main/java/net/minecraft/server/PlayerInventory.java -+++ b/src/main/java/net/minecraft/server/PlayerInventory.java -@@ -609,6 +609,8 @@ public class PlayerInventory implements IInventory, INamableTileEntity { +diff --git a/src/main/java/net/minecraft/world/entity/player/PlayerInventory.java b/src/main/java/net/minecraft/world/entity/player/PlayerInventory.java +index 2df3ae0b72ccb5f816d55fed15396ba5a1affb7f..754a3ea18905b79ae5ae4fc2442c94f0611b6d0e 100644 +--- a/src/main/java/net/minecraft/world/entity/player/PlayerInventory.java ++++ b/src/main/java/net/minecraft/world/entity/player/PlayerInventory.java +@@ -630,6 +630,8 @@ public class PlayerInventory implements IInventory, INamableTileEntity { } public boolean h(ItemStack itemstack) { @@ -17,7 +17,7 @@ index 3b65711b91c51ac7b4b5b2b0144ffd279fe60eeb..478f33dbbd0b5a9b81ee420f77c97fa8 Iterator iterator = this.f.iterator(); while (iterator.hasNext()) { -@@ -623,6 +625,20 @@ public class PlayerInventory implements IInventory, INamableTileEntity { +@@ -644,6 +646,20 @@ public class PlayerInventory implements IInventory, INamableTileEntity { } } } diff --git a/patches/Airplane/patches/server/0021-Cache-entityhuman-display-name.patch b/patches/Airplane/patches/server/0022-Cache-entityhuman-display-name.patch similarity index 69% rename from patches/Airplane/patches/server/0021-Cache-entityhuman-display-name.patch rename to patches/Airplane/patches/server/0022-Cache-entityhuman-display-name.patch index 93b63ee7..1f04ae79 100644 --- a/patches/Airplane/patches/server/0021-Cache-entityhuman-display-name.patch +++ b/patches/Airplane/patches/server/0022-Cache-entityhuman-display-name.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Mar 2021 14:02:04 -0600 Subject: [PATCH] Cache entityhuman display name -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 5581e9f1b8656bd2ee0dd338ffd17ac8297df94f..708f9c5d0b6e30512b3d3ea45ec2b2baf9482669 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -65,7 +65,8 @@ public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index 44038dd278b988508047023107683e5370af54ad..ad85dda5c50b797904824a08513fbcec042128ea 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -162,7 +162,8 @@ public abstract class EntityHuman extends EntityLiving { protected int bG; protected final float bH = 0.02F; private int g; @@ -18,7 +18,7 @@ index 5581e9f1b8656bd2ee0dd338ffd17ac8297df94f..708f9c5d0b6e30512b3d3ea45ec2b2ba private ItemStack bL; private final ItemCooldown bM; @Nullable -@@ -1764,7 +1765,12 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1828,7 +1829,12 @@ public abstract class EntityHuman extends EntityLiving { @Override public IChatBaseComponent getDisplayName() { diff --git a/patches/Airplane/patches/server/0022-Early-return-optimization-for-target-finding.patch b/patches/Airplane/patches/server/0023-Early-return-optimization-for-target-finding.patch similarity index 71% rename from patches/Airplane/patches/server/0022-Early-return-optimization-for-target-finding.patch rename to patches/Airplane/patches/server/0023-Early-return-optimization-for-target-finding.patch index 6270db17..b469f559 100644 --- a/patches/Airplane/patches/server/0022-Early-return-optimization-for-target-finding.patch +++ b/patches/Airplane/patches/server/0023-Early-return-optimization-for-target-finding.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Mar 2021 15:05:28 -0600 Subject: [PATCH] Early return optimization for target finding -diff --git a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -index 3ebe3d0dc4c2c6aee6ea349006a74cbe5aa8e78f..7b80f6f08f274fd1adff114a81919bf41bf2cd53 100644 ---- a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -+++ b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -@@ -80,9 +80,17 @@ public class PathfinderTargetCondition { +diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +index 88972dd8252bd2d2d8e384d616484ff682949fa8..5e8d3b84cbad299e09e8f25bfc712d11e1d1068e 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +@@ -84,9 +84,17 @@ public class PathfinderTargetCondition { } if (this.b > 0.0D) { diff --git a/patches/Airplane/patches/server/0024-More-debug-for-plugins-not-shutting-down-tasks.patch b/patches/Airplane/patches/server/0024-More-debug-for-plugins-not-shutting-down-tasks.patch new file mode 100644 index 00000000..52abdbc2 --- /dev/null +++ b/patches/Airplane/patches/server/0024-More-debug-for-plugins-not-shutting-down-tasks.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paul Sauve +Date: Wed, 17 Mar 2021 13:00:57 -0500 +Subject: [PATCH] More debug for plugins not shutting down tasks + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index b5ffc5f5cf04892d30092625533643c99047c16b..aec6c036ed42078a6cc3540f1f6e46a551e87a2f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -978,6 +978,11 @@ public final class CraftServer implements Server { + plugin.getDescription().getName(), + "This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies." + )); ++ getLogger().log(Level.SEVERE, String.format("%s Stacktrace", worker.getThread().getName())); ++ StackTraceElement[] stackTrace = worker.getThread().getStackTrace(); ++ for (StackTraceElement element : stackTrace) { ++ getLogger().log(Level.SEVERE, " " + element.toString()); ++ } + } + } + // Paper end diff --git a/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch b/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch index 214af468..17256ad6 100644 --- a/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch +++ b/patches/Akarin/patches/server/0001-Disable-the-Snooper.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable the Snooper diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index be48e686272b81dab4f1f584d946e15285934e88..806c699ce25525bc8a382a52e95644479e8ad708 100644 +index e8146dad220330bdcc46e563172b40a66931d17c..34552a2bd96428013dba6f2bead737af75a28d0d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1329,6 +1329,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { // Spigot this.snooper.a(); } -@@ -1336,6 +1338,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant transaction = new ArrayList<>(); private int maxStack = 1; -@@ -76,7 +81,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -101,7 +106,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv @Override public ItemStack splitStack(int i, int j) { @@ -47,7 +47,7 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 ItemStack itemstack = TileEntityLectern.this.book.cloneAndSubtract(j); if (TileEntityLectern.this.book.isEmpty()) { -@@ -91,7 +96,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -116,7 +121,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv @Override public ItemStack splitWithoutUpdate(int i) { @@ -56,7 +56,7 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 ItemStack itemstack = TileEntityLectern.this.book; TileEntityLectern.this.book = ItemStack.b; -@@ -126,7 +131,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -151,7 +156,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv @Override public boolean a(EntityHuman entityhuman) { @@ -65,7 +65,7 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 } @Override -@@ -159,6 +164,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -184,6 +189,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv private ItemStack book; private int page; private int maxPage; @@ -73,7 +73,7 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 public TileEntityLectern() { super(TileEntityTypes.LECTERN); -@@ -180,6 +186,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -205,6 +211,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv } private void k() { @@ -81,7 +81,7 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 this.page = 0; this.maxPage = 0; BlockLectern.setHasBook(this.getWorld(), this.getPosition(), this.getBlock(), false); -@@ -197,6 +204,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv +@@ -222,6 +229,7 @@ public class TileEntityLectern extends TileEntity implements Clearable, ITileInv if (j != this.page) { this.page = j; @@ -90,18 +90,18 @@ index 4b414763d7ecfe48cc196176e00e2ab209813c2e..cb628464d04d65c611a228b9d8ca07a5 if (this.world != null) BlockLectern.a(this.getWorld(), this.getPosition(), this.getBlock()); // CraftBukkit } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index fc1cf7cc6b26171c0baf623f04f6b495d5adf517..fb3af03ca8b23a401efd56891b4efea510d1a449 100644 +index b99423b3b413fc6364c6530a99e3c74dd406e1b4..011426d0ce66299e50bd6dd2295e27bb2a873eb3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -31,6 +31,7 @@ import net.minecraft.server.PacketPlayInCloseWindow; - import net.minecraft.server.PacketPlayOutOpenWindow; - import net.minecraft.server.TileEntity; - import net.minecraft.server.TileEntityContainer; -+import net.minecraft.server.TileEntityLectern; // EMC +@@ -31,6 +31,7 @@ import net.minecraft.world.level.block.BlockWorkbench; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.entity.TileEntity; + import net.minecraft.world.level.block.entity.TileEntityContainer; ++import net.minecraft.world.level.block.entity.TileEntityLectern; // EMC + import net.minecraft.world.level.block.entity.TileEntitySign; + import net.minecraft.world.level.block.state.IBlockData; import org.bukkit.GameMode; - import org.bukkit.Location; - import org.bukkit.Material; -@@ -299,6 +300,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { +@@ -301,6 +302,11 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { if (craft.getInventory() instanceof ITileInventory) { iinventory = (ITileInventory) craft.getInventory(); } @@ -114,7 +114,7 @@ index fc1cf7cc6b26171c0baf623f04f6b495d5adf517..fb3af03ca8b23a401efd56891b4efea5 if (iinventory instanceof ITileInventory) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java -index b99ce1217461595f5ccc8c7565ec3b65d1df83d9..efcc5b534bbfdcacf883940e274f00ea11f957a4 100644 +index 2bd4e644ffbde2e1133b25824a2829bc6b33fa84..06cd47ea0ab93ba9ef92e32a34118102070b582a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java @@ -159,8 +159,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat diff --git a/patches/Empirecraft/patches/server/0003-dont-load-chunks-for-physics.patch b/patches/Empirecraft/patches/server/0003-dont-load-chunks-for-physics.patch index 87e35b0e..1dc107dd 100644 --- a/patches/Empirecraft/patches/server/0003-dont-load-chunks-for-physics.patch +++ b/patches/Empirecraft/patches/server/0003-dont-load-chunks-for-physics.patch @@ -4,25 +4,11 @@ Date: Mon, 16 Mar 2020 03:07:02 -0400 Subject: [PATCH] dont load chunks for physics -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 657885cdaa086293f6b5aa6f3058acd16df0ba35..8724ad342bec7c733b3c825bd62dbfa5c28c06dd 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -593,7 +593,8 @@ public abstract class BlockBase { - EnumDirection enumdirection = aenumdirection[l]; - - blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); -- IBlockData iblockdata = generatoraccess.getType(blockposition_mutableblockposition); -+ IBlockData iblockdata = generatoraccess.getTypeIfLoaded(blockposition_mutableblockposition); // EMC -+ if (iblockdata == null) continue; // EMC - IBlockData iblockdata1 = iblockdata.updateState(enumdirection.opposite(), this.p(), generatoraccess, blockposition_mutableblockposition, blockposition); - - Block.a(iblockdata, iblockdata1, generatoraccess, blockposition_mutableblockposition, i, j); -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index bdb0e46d9196f4ac164ed09fd9d01db60aaab401..27b39f63fa9c340e0b9f2ed82448c870c40ac5c7 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -805,7 +805,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index f0588f5728e476185467d1f4e50b8647df6788dd..fc527d453765c11b988bb78d8f88e948fdac2f9d 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -868,7 +868,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (!this.isClientSide) { @@ -32,3 +18,17 @@ index bdb0e46d9196f4ac164ed09fd9d01db60aaab401..27b39f63fa9c340e0b9f2ed82448c870 try { // CraftBukkit start +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index 5e8b3791ebec2f745af2527dc52c792f30f63106..052ca0f8292a30dda3cc02ed54ae550174de86a7 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -646,7 +646,8 @@ public abstract class BlockBase { + EnumDirection enumdirection = aenumdirection[l]; + + blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection); +- IBlockData iblockdata = generatoraccess.getType(blockposition_mutableblockposition); ++ IBlockData iblockdata = generatoraccess.getTypeIfLoaded(blockposition_mutableblockposition); // EMC ++ if (iblockdata == null) continue; // EMC + IBlockData iblockdata1 = iblockdata.updateState(enumdirection.opposite(), this.p(), generatoraccess, blockposition_mutableblockposition, blockposition); + + Block.a(iblockdata, iblockdata1, generatoraccess, blockposition_mutableblockposition, i, j); diff --git a/patches/Origami/patches/server/0001-Origami-Server-Config.patch b/patches/Origami/patches/server/0001-Origami-Server-Config.patch index ba61d955..883e25ea 100644 --- a/patches/Origami/patches/server/0001-Origami-Server-Config.patch +++ b/patches/Origami/patches/server/0001-Origami-Server-Config.patch @@ -128,11 +128,11 @@ index 0000000000000000000000000000000000000000..fe7330fabe386966c2d203a190a00a78 + +} \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 27b39f63fa9c340e0b9f2ed82448c870c40ac5c7..e280afce30ddc0c2ec54945543ad65b4ebfa71f2 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -97,6 +97,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index fc527d453765c11b988bb78d8f88e948fdac2f9d..171c6e0e9e4718246b81bb9d7514d1f3290bf852 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -160,6 +160,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur @@ -141,16 +141,16 @@ index 27b39f63fa9c340e0b9f2ed82448c870c40ac5c7..e280afce30ddc0c2ec54945543ad65b4 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPosition lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -230,6 +232,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper - this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config - this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig(((WorldDataServer) worlddatamutable).getName(), env); // Purpur -+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config - this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur +@@ -294,6 +296,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config + this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()), env); // Purpur ++ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Origami - World Config + this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur this.generator = gen; + this.world = new CraftWorld((WorldServer) this, gen, env); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f9fd40d33ac72f859a0a7012dbab348fca40c375..12b92ee0491c82a72d1646d14116e187dd965fe6 100644 +index d57292e524cad6306c99c1cf6c5790fe1d07d815..298b0dfc67906a96d61b4d40919d3363cede0401 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -866,6 +866,7 @@ public final class CraftServer implements Server { @@ -170,10 +170,10 @@ index f9fd40d33ac72f859a0a7012dbab348fca40c375..12b92ee0491c82a72d1646d14116e187 Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index b10873022efc8f01ef172e86cad07831d7bf0d5e..448538cc8a3d16b028a0a6f0f05c9370a02f4259 100644 +index a471a3a4191872dae5da7e4f7b41de4491040d5d..655d45b9c664baee77f356d315baacd40209280f 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -154,6 +154,14 @@ public class Main { +@@ -156,6 +156,14 @@ public class Main { .describedAs("Yml file"); // Purpur end @@ -188,7 +188,7 @@ index b10873022efc8f01ef172e86cad07831d7bf0d5e..448538cc8a3d16b028a0a6f0f05c9370 // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() -@@ -287,6 +295,7 @@ public class Main { +@@ -289,6 +297,7 @@ public class Main { } // Paper end System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows diff --git a/patches/Origami/patches/server/0002-Optimize-inventory-API-item-handling.patch b/patches/Origami/patches/server/0002-Optimize-inventory-API-item-handling.patch index 29e15589..669a4c52 100644 --- a/patches/Origami/patches/server/0002-Optimize-inventory-API-item-handling.patch +++ b/patches/Origami/patches/server/0002-Optimize-inventory-API-item-handling.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize inventory API item handling diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index c2802c5bfb5ec82daad32d3a3375f4428ae76dfd..ec40f1933cf3e9da935d6d6def0e3096f7c00028 100644 +index 40e5a2fae032445467ac453f1fab7e366e911283..0fa7c1c9b5237b098fc7bde5ac7851f3a8208021 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -273,11 +273,13 @@ public class CraftInventory implements Inventory { +@@ -274,11 +274,13 @@ public class CraftInventory implements Inventory { } private int firstPartial(ItemStack item) { @@ -24,7 +24,7 @@ index c2802c5bfb5ec82daad32d3a3375f4428ae76dfd..ec40f1933cf3e9da935d6d6def0e3096 for (int i = 0; i < inventory.length; i++) { ItemStack cItem = inventory[i]; if (cItem != null && cItem.getAmount() < cItem.getMaxStackSize() && cItem.isSimilar(filteredItem)) { -@@ -295,9 +297,10 @@ public class CraftInventory implements Inventory { +@@ -296,9 +298,10 @@ public class CraftInventory implements Inventory { /* TODO: some optimization * - Create a 'firstPartial' with a 'fromIndex' * - Record the lastPartial per Material @@ -36,7 +36,7 @@ index c2802c5bfb5ec82daad32d3a3375f4428ae76dfd..ec40f1933cf3e9da935d6d6def0e3096 for (int i = 0; i < items.length; i++) { ItemStack item = items[i]; while (true) { -@@ -307,7 +310,11 @@ public class CraftInventory implements Inventory { +@@ -308,7 +311,11 @@ public class CraftInventory implements Inventory { // Drat! no partial stack if (firstPartial == -1) { // Find a free spot! @@ -49,7 +49,7 @@ index c2802c5bfb5ec82daad32d3a3375f4428ae76dfd..ec40f1933cf3e9da935d6d6def0e3096 if (firstFree == -1) { // No space at all! -@@ -320,9 +327,11 @@ public class CraftInventory implements Inventory { +@@ -321,9 +328,11 @@ public class CraftInventory implements Inventory { stack.setAmount(getMaxItemStack()); setItem(firstFree, stack); item.setAmount(item.getAmount() - getMaxItemStack()); diff --git a/patches/Origami/patches/server/0003-Don-t-load-chunk-with-seed-based-feature-search.patch b/patches/Origami/patches/server/0003-Don-t-load-chunk-with-seed-based-feature-search.patch index a2686fbd..2e7600cb 100644 --- a/patches/Origami/patches/server/0003-Don-t-load-chunk-with-seed-based-feature-search.patch +++ b/patches/Origami/patches/server/0003-Don-t-load-chunk-with-seed-based-feature-search.patch @@ -24,16 +24,16 @@ index fe7330fabe386966c2d203a190a00a785ea21be0..a1a585f5b4b2c10c41b184636149c8dd } \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 8fc283f014783b76afda83097201bb7938a1f9fa..250aeaba3c29ed35a9318768dc6d95ebc092ac00 100644 ---- a/src/main/java/net/minecraft/server/StructureGenerator.java -+++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -151,6 +151,11 @@ public abstract class StructureGenerator +diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java +index 917d147b06b7045ea69917c81f35fcafdd5098dd..5400fcae620912df1dd2c30667cbc4a764252308 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java +@@ -184,6 +184,11 @@ public abstract class StructureGenerator } } // Paper end + // Origami start - seed based feature search doesn't load -+ if (iworldreader instanceof World && ((World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) { ++ if (iworldreader instanceof net.minecraft.world.level.World && ((net.minecraft.world.level.World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) { + return chunkcoordintpair.l(); + } + // Origami end diff --git a/patches/Origami/patches/server/0004-Remove-some-streams-and-object-allocations.patch b/patches/Origami/patches/server/0004-Remove-some-streams-and-object-allocations.patch index c5037988..0962ba82 100644 --- a/patches/Origami/patches/server/0004-Remove-some-streams-and-object-allocations.patch +++ b/patches/Origami/patches/server/0004-Remove-some-streams-and-object-allocations.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Remove some streams and object allocations Partially based on a patch in Spottedleaf's Paper fork -diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 7bfb5cb72820c2e42c2fcf889291b04247b09cab..60f184a0ef2f2011b89385a418f10b8300d88892 100644 ---- a/src/main/java/net/minecraft/server/ChunkMap.java -+++ b/src/main/java/net/minecraft/server/ChunkMap.java -@@ -13,9 +13,10 @@ public abstract class ChunkMap extends LightEngineGraph { +diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java +index b210921a8176d41224b230809cdcbb4a78750460..029e07a7b860d775fa41c37fe14a84e26173c191 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +@@ -16,9 +16,10 @@ public abstract class ChunkMap extends LightEngineGraph { @Override protected void a(long i, int j, boolean flag) { @@ -23,7 +23,7 @@ index 7bfb5cb72820c2e42c2fcf889291b04247b09cab..60f184a0ef2f2011b89385a418f10b83 for (int i1 = -1; i1 <= 1; ++i1) { for (int j1 = -1; j1 <= 1; ++j1) { -@@ -32,9 +33,10 @@ public abstract class ChunkMap extends LightEngineGraph { +@@ -35,9 +36,10 @@ public abstract class ChunkMap extends LightEngineGraph { @Override protected int a(long i, long j, int k) { int l = k; diff --git a/patches/Origami/patches/server/0005-Hopper-Optimizations.patch b/patches/Origami/patches/server/0005-Hopper-Optimizations.patch index f18b68ea..562d2712 100644 --- a/patches/Origami/patches/server/0005-Hopper-Optimizations.patch +++ b/patches/Origami/patches/server/0005-Hopper-Optimizations.patch @@ -26,41 +26,29 @@ index a1a585f5b4b2c10c41b184636149c8dde2a3ae51..f02eb8478cef4ffccee83a1ec4ae5ffb } \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/BlockComposter.java b/src/main/java/net/minecraft/server/BlockComposter.java -index e0dc2f799634d43023dfb37a70620dc8c20c63aa..115eb270c5b5f19432e30eec41a652939a61dd94 100644 ---- a/src/main/java/net/minecraft/server/BlockComposter.java -+++ b/src/main/java/net/minecraft/server/BlockComposter.java -@@ -251,6 +251,7 @@ public class BlockComposter extends Block implements IInventoryHolder { - if ((Integer) iblockdata.get(BlockComposter.a) == 7) { - worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockComposter.a), 3); - worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_COMPOSTER_READY, SoundCategory.BLOCKS, 1.0F, 1.0F); -+ TileEntityHopper.enableTicking(worldserver.getTileEntity(new BlockPosition(blockposition.getX(), blockposition.getY() - 1, blockposition.getZ())), 0); // Origami - don't tick empty hoppers - } - - } -diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index c25dce9a75b0e79f9b59f31892d863f46e2565e9..7d2c2e6e58741a6da10117c62a809ae47ee341ee 100644 ---- a/src/main/java/net/minecraft/server/EntityItem.java -+++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -139,6 +139,13 @@ public class EntityItem extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +index 3b84039a76843a0784e2d71bb66dc322450c2cab..15aaff4797f0343b5aba0302a3dc1e5fae459b5d 100644 +--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java ++++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +@@ -167,6 +167,13 @@ public class EntityItem extends Entity { } } + // Origami start - don't tick empty hoppers + if (!world.origamiConfig.tickEmptyHoppers && locY() >= 1 && (this.age < 10 || this.age > this.getDespawnRate() - 10 + || (int) locX() != (int) lastX || (int) locZ() != (int) lastZ || (int) locY() != (int) lastY)) { -+ TileEntityHopper.enableTicking(world.getTileEntity(new BlockPosition(locX(), locY() - 1, locZ())), 0); ++ net.minecraft.world.level.block.entity.TileEntityHopper.enableTicking(world.getTileEntity(new BlockPosition(locX(), locY() - 1, locZ())), 0); + } + // Origami end + if (!this.world.isClientSide && this.age >= this.getDespawnRate()) { // Spigot // Paper // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { -diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 8e13aebb7043ddfb4b1c02bac46081eb15e906bf..d65044ef409f6a8a05626b655aa88c4e6d434e86 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -138,7 +138,6 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java +index 0166d11cb540a536390f486e1069d6119d8d23d6..b688ff6534e069bc631e2cb84bb1deb3e4f1914a 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartContainer.java +@@ -164,7 +164,6 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp if (!itemstack.isEmpty() && itemstack.getCount() > this.getMaxStackSize()) { itemstack.setCount(this.getMaxStackSize()); } @@ -68,7 +56,7 @@ index 8e13aebb7043ddfb4b1c02bac46081eb15e906bf..d65044ef409f6a8a05626b655aa88c4e } @Override -@@ -152,7 +151,25 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -178,7 +177,25 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp } @Override @@ -88,18 +76,30 @@ index 8e13aebb7043ddfb4b1c02bac46081eb15e906bf..d65044ef409f6a8a05626b655aa88c4e + + private void checkHopperBelow() { + if (!world.origamiConfig.tickEmptyHoppers && !this.isEmpty()) { -+ TileEntityHopper.enableTicking(world.getTileEntity(new BlockPosition(locX(), locY() - 1, locZ())), 0); ++ net.minecraft.world.level.block.entity.TileEntityHopper.enableTicking(world.getTileEntity(new net.minecraft.core.BlockPosition(locX(), locY() - 1, locZ())), 0); + } + } + // Origami end @Override public boolean a(EntityHuman entityhuman) { -diff --git a/src/main/java/net/minecraft/server/TileEntityContainer.java b/src/main/java/net/minecraft/server/TileEntityContainer.java -index 74390aebd353c969353a6efc0904bafe30774d65..b88df070e8e496be43e869b17d312ddf7f788595 100644 ---- a/src/main/java/net/minecraft/server/TileEntityContainer.java -+++ b/src/main/java/net/minecraft/server/TileEntityContainer.java -@@ -84,4 +84,14 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento +diff --git a/src/main/java/net/minecraft/world/level/block/BlockComposter.java b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +index c0b235d5edf3cd14021696d1b4f76ce3de41f5d5..2d6abc0b8b3c9860110f0b5f1df1b3b3bbf30673 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockComposter.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +@@ -302,6 +302,7 @@ public class BlockComposter extends Block implements IInventoryHolder { + if ((Integer) iblockdata.get(BlockComposter.a) == 7) { + worldserver.setTypeAndData(blockposition, (IBlockData) iblockdata.a((IBlockState) BlockComposter.a), 3); + worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_COMPOSTER_READY, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ net.minecraft.world.level.block.entity.TileEntityHopper.enableTicking(worldserver.getTileEntity(new BlockPosition(blockposition.getX(), blockposition.getY() - 1, blockposition.getZ())), 0); // Origami - don't tick empty hoppers + } + + } +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java +index fb7a1a854efcf42f0351ef521aff67d5fcc4ab27..96dfe05ed57f7e2c3dac3a784ae3445ad9975c40 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityContainer.java +@@ -98,4 +98,14 @@ public abstract class TileEntityContainer extends TileEntity implements IInvento return new org.bukkit.Location(world.getWorld(), position.getX(), position.getY(), position.getZ()); } // CraftBukkit end @@ -109,16 +109,16 @@ index 74390aebd353c969353a6efc0904bafe30774d65..b88df070e8e496be43e869b17d312ddf + public void update() { + super.update(); + if (world != null && !world.origamiConfig.tickEmptyHoppers) { -+ TileEntityHopper.enableTicking(world.getTileEntity(position.shift(EnumDirection.DOWN)), world.spigotConfig.hopperCheck); ++ TileEntityHopper.enableTicking(world.getTileEntity(position.shift(net.minecraft.core.EnumDirection.DOWN)), world.spigotConfig.hopperCheck); + } + } + // Origami end } -diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed309c099f 100644 ---- a/src/main/java/net/minecraft/server/TileEntityHopper.java -+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java -@@ -19,8 +19,9 @@ import org.bukkit.inventory.Inventory; +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java +index 537dc52e5ff3325555ee6049bc7f277952983b76..a859e12571ceff2199842e03df77b21ee9d689f2 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java +@@ -47,8 +47,9 @@ import org.bukkit.inventory.Inventory; public class TileEntityHopper extends TileEntityLootable implements IHopper, ITickable { private NonNullList items; @@ -129,7 +129,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed // CraftBukkit start - add fields and methods public List transaction = new java.util.ArrayList(); -@@ -98,7 +99,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -126,7 +127,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi if (itemstack.getCount() > this.getMaxStackSize()) { itemstack.setCount(this.getMaxStackSize()); } @@ -138,7 +138,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed } @Override -@@ -108,7 +109,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -136,7 +137,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @Override public void tick() { @@ -147,7 +147,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed --this.j; this.k = this.world.getTime(); if (!this.m()) { -@@ -117,7 +118,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -145,7 +146,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi boolean result = this.a(() -> { return a((IHopper) this); }); @@ -156,7 +156,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed this.setCooldown(this.world.spigotConfig.hopperCheck); } // Spigot end -@@ -126,6 +127,26 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -154,6 +155,26 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi } } @@ -183,7 +183,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed private boolean a(Supplier supplier) { if (this.world != null && !this.world.isClientSide) { if (!this.m() && (Boolean) this.getBlock().get(BlockHopper.ENABLED)) { -@@ -133,6 +154,10 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -161,6 +182,10 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi if (!this.isEmpty()) { flag = this.k(); @@ -194,7 +194,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed } if (!this.j()) { -@@ -212,7 +237,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -240,7 +265,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi } } if (foundItem && world.paperConfig.cooldownHopperWhenFull) { // Inventory was full - cooldown @@ -203,7 +203,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed } return false; } -@@ -252,7 +277,13 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -280,7 +305,13 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi origItemStack.setCount(origCount); if (world.paperConfig.cooldownHopperWhenFull) { @@ -218,7 +218,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed } return false; -@@ -460,6 +491,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -488,6 +519,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi entityitem = (EntityItem) iterator.next(); } while (!a((IInventory) ihopper, entityitem)); @@ -226,7 +226,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed return true; } } -@@ -548,7 +580,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -576,7 +608,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi itemstack = a(iinventory, iinventory1, itemstack, k, enumdirection); } } @@ -235,7 +235,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed return itemstack; } -@@ -689,7 +721,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -717,7 +749,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi return (double) this.position.getZ() + 0.5D; } @@ -244,7 +244,7 @@ index d432de40eba2767f4ced4d9c642c9d2033acd0ea..271c55d8604680cb995a4dd5d7be56ed this.j = i; } -@@ -716,6 +748,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -744,6 +776,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi BlockPosition blockposition = this.getPosition(); if (VoxelShapes.c(VoxelShapes.a(entity.getBoundingBox().d((double) (-blockposition.getX()), (double) (-blockposition.getY()), (double) (-blockposition.getZ()))), this.aa_(), OperatorBoolean.AND)) { diff --git a/patches/Origami/patches/server/0006-Add-option-to-disable-observer-clocks.patch b/patches/Origami/patches/server/0006-Add-option-to-disable-observer-clocks.patch index 354a892d..1297b351 100644 --- a/patches/Origami/patches/server/0006-Add-option-to-disable-observer-clocks.patch +++ b/patches/Origami/patches/server/0006-Add-option-to-disable-observer-clocks.patch @@ -21,11 +21,11 @@ index f02eb8478cef4ffccee83a1ec4ae5ffbfb0591c1..047e7d42ce54aa1cb28cfe8b194bf5c6 } \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/BlockObserver.java b/src/main/java/net/minecraft/server/BlockObserver.java -index 7dfe632523f7fc4426a035b6bf23917b2ea80389..29c3f328f512ffc6c423a5996e1377040f6c4712 100644 ---- a/src/main/java/net/minecraft/server/BlockObserver.java -+++ b/src/main/java/net/minecraft/server/BlockObserver.java -@@ -52,7 +52,8 @@ public class BlockObserver extends BlockDirectional { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockObserver.java b/src/main/java/net/minecraft/world/level/block/BlockObserver.java +index 291fd45f6f97c561edaaf8b659920d2c3b6aba46..039fd27455c0b56721caf9ce66975aef71d2caa6 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockObserver.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockObserver.java +@@ -64,7 +64,8 @@ public class BlockObserver extends BlockDirectional { @Override public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { diff --git a/patches/Origami/patches/server/0007-Add-timings-for-Behavior.patch b/patches/Origami/patches/server/0007-Add-timings-for-Behavior.patch index 0e622bf7..cd66e06a 100644 --- a/patches/Origami/patches/server/0007-Add-timings-for-Behavior.patch +++ b/patches/Origami/patches/server/0007-Add-timings-for-Behavior.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add timings for Behavior diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 96aaaab5b7685c874463505f9d25e8a0a01a6e7c..5bcbf2e5ee02764425802a4113d28d03a2a49dc8 100644 +index c5f594d45012016d99b83a778a2b9d20a7c086ac..4ca89e5279f0a60d1a8cca7329ec4d70b6582525 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -140,4 +140,10 @@ public class WorldTimingsHandler { @@ -19,11 +19,11 @@ index 96aaaab5b7685c874463505f9d25e8a0a01a6e7c..5bcbf2e5ee02764425802a4113d28d03 + } + // Origami end } -diff --git a/src/main/java/net/minecraft/server/Behavior.java b/src/main/java/net/minecraft/server/Behavior.java -index 0b9d469a92decfb0632805791868ef7faa88c535..071ce4d470044b3cdf0ef150623f5366875b7e04 100644 ---- a/src/main/java/net/minecraft/server/Behavior.java -+++ b/src/main/java/net/minecraft/server/Behavior.java -@@ -9,6 +9,7 @@ public abstract class Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java +index 717e5f71fb919ac8952a077714d7f4581d546a28..ed3a3593b417131837341784b09cb3f9f76a44be 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java +@@ -13,6 +13,7 @@ public abstract class Behavior { protected final Map, MemoryStatus> a; private Behavior.Status b; public final Behavior.Status getStatus() { return this.b; } // Tuinity - OBFHELPER private long c; @@ -31,7 +31,7 @@ index 0b9d469a92decfb0632805791868ef7faa88c535..071ce4d470044b3cdf0ef150623f5366 private final int d; private final int e; -@@ -25,6 +26,10 @@ public abstract class Behavior { +@@ -29,6 +30,10 @@ public abstract class Behavior { this.d = i; this.e = j; this.a = map; @@ -42,7 +42,7 @@ index 0b9d469a92decfb0632805791868ef7faa88c535..071ce4d470044b3cdf0ef150623f5366 } public Behavior.Status a() { -@@ -37,7 +42,9 @@ public abstract class Behavior { +@@ -41,7 +46,9 @@ public abstract class Behavior { int j = this.d + worldserver.getRandom().nextInt(this.e + 1 - this.d); this.c = i + (long) j; diff --git a/patches/Origami/patches/server/0008-Don-t-wake-up-entities-when-damage-event-is-cancelle.patch b/patches/Origami/patches/server/0008-Don-t-wake-up-entities-when-damage-event-is-cancelle.patch index c869d6aa..9f325d64 100644 --- a/patches/Origami/patches/server/0008-Don-t-wake-up-entities-when-damage-event-is-cancelle.patch +++ b/patches/Origami/patches/server/0008-Don-t-wake-up-entities-when-damage-event-is-cancelle.patch @@ -4,11 +4,11 @@ Date: Thu, 23 Apr 2020 18:03:57 +0100 Subject: [PATCH] Don't wake up entities when damage event is cancelled -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index c5762aebcdd383ab710d4891308a7b1e815c44fd..7535a6689f8e67af97bff9643fabd3c615222f99 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1118,9 +1118,12 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 659ccc8075945531ca714c43a034f2d5baa5defb..76aadee76c482d86a7c6655fc661b926cd36fd33 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -1214,9 +1214,12 @@ public abstract class EntityLiving extends Entity { } else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) { return false; } else { @@ -24,7 +24,7 @@ index c5762aebcdd383ab710d4891308a7b1e815c44fd..7535a6689f8e67af97bff9643fabd3c6 this.ticksFarFromPlayer = 0; float f1 = f; -@@ -1873,6 +1876,11 @@ public abstract class EntityLiving extends Entity { +@@ -1969,6 +1972,11 @@ public abstract class EntityLiving extends Entity { if (event.isCancelled()) { return false; } diff --git a/patches/Origami/patches/server/0009-Fix-exp-drop-of-zombie-pigmen-MC-56653.patch b/patches/Origami/patches/server/0009-Fix-exp-drop-of-zombie-pigmen-MC-56653.patch index 92e8be42..66b70990 100644 --- a/patches/Origami/patches/server/0009-Fix-exp-drop-of-zombie-pigmen-MC-56653.patch +++ b/patches/Origami/patches/server/0009-Fix-exp-drop-of-zombie-pigmen-MC-56653.patch @@ -20,11 +20,11 @@ index 047e7d42ce54aa1cb28cfe8b194bf5c6c75824ad..27599f422be266ad2fdbda4961766180 } \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java -index 4c050c841f9846cc74fef51d5eb69f4cbb737ef1..7c426f3b1c65f4e2f4997c8b69c27e8df8f334c0 100644 ---- a/src/main/java/net/minecraft/server/EntityPigZombie.java -+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java -@@ -89,7 +89,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +index 736c45bae020158866514bc760c05a929f47c531..bf72577af3c5631116fbcf086a2c681ea4a4e0a2 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +@@ -123,7 +123,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { protected void mobTick() { AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); diff --git a/patches/Purpur/patches/api/0017-ItemStack-convenience-methods.patch b/patches/Purpur/patches/api/0017-ItemStack-convenience-methods.patch index be6440b5..cab25ff2 100644 --- a/patches/Purpur/patches/api/0017-ItemStack-convenience-methods.patch +++ b/patches/Purpur/patches/api/0017-ItemStack-convenience-methods.patch @@ -46,7 +46,7 @@ index 0a31a5321ac519568db936c94394f71b2e2fcec1..42a77a5f5b8968351a737cb1fd7cebf1 + // Purpur end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 878f09d5e587bc4bd70443fbdb89dac29e5a538d..f0c17f1342d9c70cb4fe1fc46dd8b9006037e860 100644 +index 58f99e3ebac9a01ebffe4d208e16cbee474d4aa3..314658c7dac1b1fbb440ec85133e6670e52ba684 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 878f09d5e587bc4bd70443fbdb89dac29e5a538d..f0c17f1342d9c70cb4fe1fc46dd8b900 /** * Represents a stack of items. -@@ -810,4 +822,627 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor +@@ -843,4 +855,627 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor return itemMeta != null && itemMeta.hasItemFlag(flag); } // Paper end diff --git a/patches/Purpur/patches/api/0031-Fix-javadoc-warnings-missing-param-and-return.patch b/patches/Purpur/patches/api/0031-Fix-javadoc-warnings-missing-param-and-return.patch index 8af5dce5..a21f11cd 100644 --- a/patches/Purpur/patches/api/0031-Fix-javadoc-warnings-missing-param-and-return.patch +++ b/patches/Purpur/patches/api/0031-Fix-javadoc-warnings-missing-param-and-return.patch @@ -419,6 +419,50 @@ index 5bb677ce585b856b3d3e589e29786a29619c56a7..613f00fa387dcc5af3191e550dea9d4d public class CachedSizeConcurrentLinkedQueue extends ConcurrentLinkedQueue { private final LongAdder cachedSize = new LongAdder(); +diff --git a/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java b/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java +index a0f748957f4472103dd27fc95a711a42de7fae89..c66b49f05be7a9cc26ba595829d7751d38aebeb1 100644 +--- a/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java ++++ b/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java +@@ -19,6 +19,11 @@ public final class AsyncChatEvent extends AbstractChatEvent { + } + + /** ++ * @param async Async ++ * @param player Player ++ * @param recipients Recipients ++ * @param formatter Formatter ++ * @param message Message + * @deprecated use {@link #AsyncChatEvent(boolean, Player, Set, ChatComposer, Component)} + */ + @Deprecated +diff --git a/src/main/java/io/papermc/paper/event/player/ChatEvent.java b/src/main/java/io/papermc/paper/event/player/ChatEvent.java +index 13c5df5fb8ce1d0203d99e88dd691019146a8f52..558d6531e9c06e25369074932fd9f0ab00e9e2c8 100644 +--- a/src/main/java/io/papermc/paper/event/player/ChatEvent.java ++++ b/src/main/java/io/papermc/paper/event/player/ChatEvent.java +@@ -24,6 +24,10 @@ public final class ChatEvent extends AbstractChatEvent { + } + + /** ++ * @param player Player ++ * @param recipients Recipients ++ * @param formatter Formatter ++ * @param message Message + * @deprecated use {@link #ChatEvent(Player, Set, ChatComposer, Component)} + */ + @Deprecated +diff --git a/src/main/java/io/papermc/paper/inventory/ItemRarity.java b/src/main/java/io/papermc/paper/inventory/ItemRarity.java +index 74ef8395cc040ce488c2acaa416db20272cc2734..b974627a415cd6897b245275e953cc907a5929d8 100644 +--- a/src/main/java/io/papermc/paper/inventory/ItemRarity.java ++++ b/src/main/java/io/papermc/paper/inventory/ItemRarity.java +@@ -19,7 +19,7 @@ public enum ItemRarity { + + /** + * Gets the color formatting associated with the rarity. +- * @return ++ * @return TextColor + */ + @NotNull + public TextColor getColor() { diff --git a/src/main/java/io/papermc/paper/world/MoonPhase.java b/src/main/java/io/papermc/paper/world/MoonPhase.java index df05153397b42930cd53d37b30824c7e5f008f7e..ebf70fea04a9d37aa5f2ad8e7d6cef73cd3a4541 100644 --- a/src/main/java/io/papermc/paper/world/MoonPhase.java @@ -553,7 +597,7 @@ index afb7b136b461202026290624836446cff9f9e45d..087579fdff09237409c9f80446e7a15a /** diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java -index 1d93a6c42d6c93ffd50c6054e74f3ff75d745b58..0dc013530b39618a7282a094b0bdb4c024f23712 100644 +index e6a83252f42da31ad38f8dc1beccc7aa2c3f54b8..f3b107210473f1707b051c15771ce3bf2a62f171 100644 --- a/src/main/java/org/bukkit/WorldCreator.java +++ b/src/main/java/org/bukkit/WorldCreator.java @@ -71,6 +71,8 @@ public class WorldCreator { diff --git a/patches/Purpur/patches/api/0037-Conflict-on-change-for-adventure-deprecations.patch b/patches/Purpur/patches/api/0037-Conflict-on-change-for-adventure-deprecations.patch new file mode 100644 index 00000000..81563c3e --- /dev/null +++ b/patches/Purpur/patches/api/0037-Conflict-on-change-for-adventure-deprecations.patch @@ -0,0 +1,867 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Wed, 17 Mar 2021 15:56:47 -0500 +Subject: [PATCH] Conflict on change for adventure deprecations + + +diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java +index 801bef2a060962b5c4f92234401e5bc34a62141a..d754200879bda29d582998433e1a304a6988bbbb 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -303,7 +303,7 @@ public final class Bukkit { + * @return the number of players + * @deprecated in favour of {@link Server#sendMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public static int broadcastMessage(@NotNull String message) { + return server.broadcastMessage(message); + } +@@ -935,7 +935,7 @@ public final class Bukkit { + * @return number of message recipients + * @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public static int broadcast(@NotNull String message, @NotNull String permission) { + return server.broadcast(message, permission); + } +@@ -1212,7 +1212,7 @@ public final class Bukkit { + * + * @see InventoryType#isCreatable() + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) { + return server.createInventory(owner, type, title); +@@ -1262,7 +1262,7 @@ public final class Bukkit { + * @throws IllegalArgumentException if the size is not a multiple of 9 + * @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + public static Inventory createInventory(@Nullable InventoryHolder owner, int size, @NotNull String title) throws IllegalArgumentException { + return server.createInventory(owner, size, title); +@@ -1289,7 +1289,7 @@ public final class Bukkit { + * @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public static Merchant createMerchant(@Nullable String title) { + return server.createMerchant(title); + } +@@ -1378,7 +1378,7 @@ public final class Bukkit { + * @deprecated in favour of {@link #motd()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public static String getMotd() { + return server.getMotd(); + } +@@ -1400,7 +1400,7 @@ public final class Bukkit { + * @deprecated in favour of {@link #shutdownMessage()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public static String getShutdownMessage() { + return server.getShutdownMessage(); + } +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index 7a3be414ef9d54d7a852ba92d704011fa7f125ac..0a3acc1aa156900aa2a6a5682ffb8c3dc25e7534 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -250,7 +250,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @return the number of players + * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public int broadcastMessage(@NotNull String message); + + // Paper start +@@ -773,7 +773,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @return number of message recipients + * @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public int broadcast(@NotNull String message, @NotNull String permission); + // Paper start + /** +@@ -1024,7 +1024,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * + * @see InventoryType#isCreatable() + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title); + +@@ -1068,7 +1068,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @throws IllegalArgumentException if the size is not a multiple of 9 + * @deprecated in favour of {@link #createInventory(InventoryHolder, int, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + Inventory createInventory(@Nullable InventoryHolder owner, int size, @NotNull String title) throws IllegalArgumentException; + +@@ -1091,7 +1091,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + Merchant createMerchant(@Nullable String title); + + /** +@@ -1164,7 +1164,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @deprecated in favour of {@link #motd()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getMotd(); + + // Paper start +@@ -1182,7 +1182,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * @deprecated in favour of {@link #shutdownMessage()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getShutdownMessage(); + + /** +diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java +index 6ea9b54d95d80070c01a612c0ce2ab37f0b4ad41..fe9ec9cb7875df4a40d1c4155e13cca9b3628b30 100644 +--- a/src/main/java/org/bukkit/block/Sign.java ++++ b/src/main/java/org/bukkit/block/Sign.java +@@ -48,7 +48,7 @@ public interface Sign extends TileState, Colorable { + * @deprecated in favour of {@link #lines()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String[] getLines(); + + /** +@@ -62,7 +62,7 @@ public interface Sign extends TileState, Colorable { + * @deprecated in favour of {@link #line(int)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getLine(int index) throws IndexOutOfBoundsException; + + /** +@@ -76,7 +76,7 @@ public interface Sign extends TileState, Colorable { + * @throws IndexOutOfBoundsException If the index is out of the range 0..3 + * @deprecated in favour of {@link #line(int, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException; + + /** +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index 2ed61f79fc7a625d00b86ee434d591232518ca3c..c0b75477ab8af71e73b37a66568693a84c5bce74 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -72,7 +72,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @return the friendly name + * @deprecated in favour of {@link #displayName()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + public String getDisplayName(); + +@@ -86,7 +86,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param name The new display name. + * @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setDisplayName(@Nullable String name); + + // Paper start +@@ -127,7 +127,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @deprecated in favour of {@link #playerListName()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getPlayerListName(); + + /** +@@ -138,7 +138,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param name new player list name + * @deprecated in favour of {@link #playerListName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setPlayerListName(@Nullable String name); + + /** +@@ -147,7 +147,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @return player list header or null + * @deprecated in favour of {@link #playerListHeader()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @Nullable + public String getPlayerListHeader(); + +@@ -157,7 +157,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @return player list header or null + * @deprecated in favour of {@link #playerListFooter()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @Nullable + public String getPlayerListFooter(); + +@@ -167,7 +167,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param header player list header, null for empty + * @deprecated in favour of {@link #sendPlayerListHeader(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setPlayerListHeader(@Nullable String header); + + /** +@@ -176,7 +176,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param footer player list footer, null for empty + * @deprecated in favour of {@link #sendPlayerListFooter(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setPlayerListFooter(@Nullable String footer); + + /** +@@ -187,7 +187,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param footer player list footer, null for empty + * @deprecated in favour of {@link #sendPlayerListHeaderAndFooter(net.kyori.adventure.text.Component, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer); + + /** +@@ -227,7 +227,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param message kick message + * @deprecated in favour of {@link #kick(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void kickPlayer(@Nullable String message); + + // Paper start +@@ -590,7 +590,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + * @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException; + + +@@ -612,7 +612,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + * @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List, org.bukkit.DyeColor)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException; + + /** +@@ -1746,7 +1746,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @deprecated in favour of {@link #locale()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getLocale(); + + // Paper start +diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java +index 078228106b299a8e38495f7f881d38de4f87bc95..bd5b3142a88c31a676c08fa3e8175f81f4259835 100644 +--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java ++++ b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java +@@ -37,7 +37,7 @@ public interface CommandMinecart extends Minecart { + * @param name New name for this CommandMinecart. + * @deprecated in favour of {@link #customName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setName(@Nullable String name); + + } +diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java +index 1f79f704abf339150df08900b8ea7da4cefef258..004106913655446774f875015cb79863d21263c8 100644 +--- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java ++++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java +@@ -90,7 +90,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { + * @deprecated in favour of {@link #lines()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String[] getLines() { + return adventure$lines.stream().map(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer()::serialize).toArray(String[]::new); // Paper + } +@@ -106,7 +106,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { + * @deprecated in favour of {@link #line(int)} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getLine(int index) throws IndexOutOfBoundsException { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.adventure$lines.get(index)); // Paper + } +@@ -120,7 +120,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable { + * or < 0} + * @deprecated in favour of {@link #line(int, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setLine(int index, @Nullable String line) throws IndexOutOfBoundsException { + adventure$lines.set(index, line != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(line) : null); // Paper + } +diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +index 3d45d2e41aad6992b40a22030f2a63baeec78757..3cecfe9f7c253ab474829c612cca2dc05fd5d111 100644 +--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java ++++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +@@ -151,7 +151,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { + * @param deathMessage Message to appear to other players on the server. + * @deprecated in favour of {@link #deathMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setDeathMessage(@Nullable String deathMessage) { + this.deathMessage = deathMessage; + this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper +@@ -164,7 +164,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { + * @deprecated in favour of {@link #deathMessage()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getDeathMessage() { + return this.deathMessage != null ? this.deathMessage : (this.adventure$deathMessage != null ? getDeathMessageString(this.adventure$deathMessage) : null); // Paper + } +diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java +index 129eac25da4f27489038fb15ab1aeecb172b60cc..670aca11bbaa2d155cd9d2105ac94c9df71d7d8d 100644 +--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java ++++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java +@@ -170,7 +170,7 @@ public enum InventoryType { + } + + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getDefaultTitle() { + return title; + } +diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +index c9af02b0f62b3d18da1e91d1ea02ce0864fc60b9..5e4ade542c79b87a5174e7affb649d818d546362 100644 +--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +@@ -161,7 +161,7 @@ public class AsyncPlayerPreLoginEvent extends Event { + * @deprecated in favour of {@link #kickMessage()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getKickMessage() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper + } +@@ -172,7 +172,7 @@ public class AsyncPlayerPreLoginEvent extends Event { + * @param message New kick message + * @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setKickMessage(@NotNull final String message) { + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper + } +@@ -192,7 +192,7 @@ public class AsyncPlayerPreLoginEvent extends Event { + * @param message Kick message to display to the user + * @deprecated in favour of {@link #disallow(org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void disallow(@NotNull final Result result, @NotNull final String message) { + this.result = result; + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper +diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java +index 851a189d42e271679abc78f95049d8badf7a2b64..7057c2e95267ad32190c5666f20a0566f7fe32fa 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java +@@ -17,7 +17,7 @@ public class PlayerJoinEvent extends PlayerEvent { + this.joinMessage = joinMessage; + } + +- @Deprecated // Paper end ++ @Deprecated // Paper end // Purpur - conflict on change + public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) { + super(playerJoined); + this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper end +@@ -50,7 +50,7 @@ public class PlayerJoinEvent extends PlayerEvent { + * @deprecated in favour of {@link #joinMessage()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getJoinMessage() { + return this.joinMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.joinMessage); // Paper + } +@@ -61,7 +61,7 @@ public class PlayerJoinEvent extends PlayerEvent { + * @param joinMessage join message. If null, no message will be sent + * @deprecated in favour of {@link #joinMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setJoinMessage(@Nullable String joinMessage) { + this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper + } +diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +index 5c0efe74237dbe6803ce023fde99682ff70d1a92..253e15eb42cab4f578aa89af1e298177779e5cdc 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +@@ -73,7 +73,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { + * @deprecated in favour of {@link #reason()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getReason() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.kickReason); // Paper + } +@@ -85,7 +85,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { + * @deprecated in favour of {@link #leaveMessage()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getLeaveMessage() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.leaveMessage); // Paper + } +@@ -106,7 +106,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { + * @param kickReason kick reason + * @deprecated in favour of {@link #reason(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setReason(@NotNull String kickReason) { + this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper + } +@@ -117,7 +117,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { + * @param leaveMessage leave message + * @deprecated in favour of {@link #leaveMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setLeaveMessage(@NotNull String leaveMessage) { + this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper + } +diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +index 84521186404b8e43c81a2f9513dce2be40d27840..8c65e9e1476d27fc55419290fb53e46dee9b304d 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java +@@ -37,7 +37,7 @@ public class PlayerLocaleChangeEvent extends PlayerEvent { + * @deprecated in favour of {@link #locale()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getLocale() { + return locale; + } +diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +index 75cc54739ef841cd90568d74927d6002d4cfa7e0..712900c9afc3b79806d2b564c0734facf969a6fe 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +@@ -139,7 +139,7 @@ public class PlayerLoginEvent extends PlayerEvent { + * @deprecated in favour of {@link #kickMessage()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getKickMessage() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper + } +@@ -150,7 +150,7 @@ public class PlayerLoginEvent extends PlayerEvent { + * @param message New kick message + * @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setKickMessage(@NotNull final String message) { + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper + } +@@ -181,7 +181,7 @@ public class PlayerLoginEvent extends PlayerEvent { + * @param message Kick message to display to the user + * @deprecated in favour of {@link #disallow(Result, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper start ++ @Deprecated // Paper start // Purpur - conflict on change + public void disallow(@NotNull final Result result, @NotNull final String message) { + this.result = result; + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); +diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +index 123979ed64939d615b061f91c19c630e1e1db8c7..5b85579964dc6a6150f0c0be650a4bf731414838 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +@@ -95,7 +95,7 @@ public class PlayerPreLoginEvent extends Event { + * @return Current kick message + * @deprecated in favour of {@link #kickMessage()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + public String getKickMessage() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper +@@ -107,7 +107,7 @@ public class PlayerPreLoginEvent extends Event { + * @param message New kick message + * @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setKickMessage(@NotNull final String message) { + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper + } +@@ -127,7 +127,7 @@ public class PlayerPreLoginEvent extends Event { + * @param message Kick message to display to the user + * @deprecated in favour of {@link #disallow(org.bukkit.event.player.PlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void disallow(@NotNull final Result result, @NotNull final String message) { + this.result = result; + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper +diff --git a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java +index e43acfb570036adb73d195136573620378cc6a61..1826d11d8b18702ee12c669b50df7f538c324582 100644 +--- a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java ++++ b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java +@@ -61,7 +61,7 @@ public class PlayerQuitEvent extends PlayerEvent { + * @deprecated in favour of {@link #quitMessage()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getQuitMessage() { + return this.quitMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.quitMessage); // Paper + } +@@ -72,7 +72,7 @@ public class PlayerQuitEvent extends PlayerEvent { + * @param quitMessage quit message + * @deprecated in favour of {@link #quitMessage(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setQuitMessage(@Nullable String quitMessage) { + this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper + } +diff --git a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java +index 4f8c85222c7bd33217c7db0ff5f47bf397f8f3e5..c18d6d979bd22814ebdc52b995d2cc7ed46dd87f 100644 +--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java ++++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java +@@ -73,7 +73,7 @@ public class BroadcastMessageEvent extends ServerEvent implements Cancellable { + * @deprecated in favour of {@link #message()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getMessage() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper + } +@@ -84,7 +84,7 @@ public class BroadcastMessageEvent extends ServerEvent implements Cancellable { + * @param message New message to broadcast + * @deprecated in favour of {@link #message(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setMessage(@NotNull String message) { + this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper + } +diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +index ede5a41bc071a9c9cea369b227b37a50222f295d..6c6501d73041a6c69e78f34d3bf2a96a7de5f690 100644 +--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java ++++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +@@ -109,7 +109,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable + * @deprecated in favour of {@link #motd()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getMotd() { + return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.motd); // Paper + } +@@ -120,7 +120,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable + * @param motd the message of the day + * @deprecated in favour of {@link #motd(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setMotd(@NotNull String motd) { + this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper + } +diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java +index b06995aa57aa9cba0bb59f1d26d81015619a08e6..5e33fe46ab9bb034acc6a38a3c00c33c8f029ca6 100644 +--- a/src/main/java/org/bukkit/inventory/InventoryView.java ++++ b/src/main/java/org/bukkit/inventory/InventoryView.java +@@ -464,7 +464,7 @@ public abstract class InventoryView { + * @return The title. + * @deprecated in favour of {@link #title()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + public abstract String getTitle(); + } +diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java +index 1378c8fc2fd187035fc159c8d025d58b5a61f535..2cbeb4ced49cab055e96268077df2ee2e445c980 100644 +--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java +@@ -234,7 +234,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @deprecated in favour of {@link #page(int)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getPage(int page); + + /** +@@ -250,7 +250,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @param data the data to set for that page + * @deprecated in favour of {@link #page(int, net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setPage(int page, @NotNull String data); + + /** +@@ -260,7 +260,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @deprecated in favour of {@link #pages()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + List getPages(); + + /** +@@ -270,7 +270,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @param pages A list of pages to set the book to use + * @deprecated in favour of {@link #pages(List)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setPages(@NotNull List pages); + + /** +@@ -280,7 +280,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @param pages A list of strings, each being a page + * @deprecated in favour of {@link #pages(net.kyori.adventure.text.Component...)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setPages(@NotNull String... pages); + + /** +@@ -290,7 +290,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book { + * @param pages A list of strings, each being a page + * @deprecated in favour of {@link #addPages(net.kyori.adventure.text.Component...)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void addPage(@NotNull String... pages); + + /** +diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +index f093f991f1fedd20fcef041b093398250b7fb286..49d8b1bdad79f452c863f83557ffde7e8f4749c6 100644 +--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java ++++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +@@ -59,7 +59,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste + * @return the display name that is set + * @deprecated in favour of {@link #displayName()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @NotNull + String getDisplayName(); + +@@ -83,7 +83,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste + * @param name the name to set + * @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setDisplayName(@Nullable String name); + + // Paper start +@@ -155,7 +155,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste + * @return a list of lore that is set + * @deprecated in favour of {@link #lore()} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + @Nullable + List getLore(); + +@@ -179,7 +179,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste + * @param lore the lore that will be set + * @deprecated in favour of {@link #lore(List)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setLore(@Nullable List lore); + + /** +diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java +index ed0bc2024a0bb85837e25f75ae89d1fe257b2e60..f6e831f844e1fe99a2617bd64c2290d1f2e96d81 100644 +--- a/src/main/java/org/bukkit/map/MapCursor.java ++++ b/src/main/java/org/bukkit/map/MapCursor.java +@@ -259,7 +259,7 @@ public final class MapCursor { + * @deprecated in favour of {@link #caption()} + */ + @Nullable +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public String getCaption() { + return this.caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.caption); // Paper + } +@@ -270,7 +270,7 @@ public final class MapCursor { + * @param caption new caption + * @deprecated in favour of {@link #caption(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + public void setCaption(@Nullable String caption) { + this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper + } +diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java +index 58bddb11fd534e7c33a4ffd7b72b055ba92c767a..a1b6b1123808378d58c855cacac391ce97df6f19 100644 +--- a/src/main/java/org/bukkit/scoreboard/Objective.java ++++ b/src/main/java/org/bukkit/scoreboard/Objective.java +@@ -47,7 +47,7 @@ public interface Objective { + * @deprecated in favour of {@link #displayName()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getDisplayName() throws IllegalStateException; + + /** +@@ -60,7 +60,7 @@ public interface Objective { + * characters. + * @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentException; + + /** +diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java +index f09ff32cc3ffc16af379a378b1948991435393e8..e9db79d10522895e6f119c0cc87eec1cbc45ba6e 100644 +--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java ++++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java +@@ -89,7 +89,7 @@ public interface Scoreboard { + * @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName) throws IllegalArgumentException; + + /** +@@ -113,7 +113,7 @@ public interface Scoreboard { + * @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component, RenderType)} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName, @NotNull RenderType renderType) throws IllegalArgumentException; + + /** +diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java +index f0af10a5b9ad048be197ed5ec6c8ed2672eb3dd5..705b2268b1c227b34852c14601381230dc626a08 100644 +--- a/src/main/java/org/bukkit/scoreboard/Team.java ++++ b/src/main/java/org/bukkit/scoreboard/Team.java +@@ -110,7 +110,7 @@ public interface Team { + * @deprecated in favour of {@link #displayName()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getDisplayName() throws IllegalStateException; + + /** +@@ -122,7 +122,7 @@ public interface Team { + * @throws IllegalStateException if this team has been unregistered + * @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentException; + + /** +@@ -133,7 +133,7 @@ public interface Team { + * @deprecated in favour of {@link #prefix()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getPrefix() throws IllegalStateException; + + /** +@@ -146,7 +146,7 @@ public interface Team { + * @throws IllegalStateException if this team has been unregistered + * @deprecated in favour of {@link #prefix(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setPrefix(@NotNull String prefix) throws IllegalStateException, IllegalArgumentException; + + /** +@@ -157,7 +157,7 @@ public interface Team { + * @deprecated in favour of {@link #suffix()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + String getSuffix() throws IllegalStateException; + + /** +@@ -170,7 +170,7 @@ public interface Team { + * @throws IllegalStateException if this team has been unregistered + * @deprecated in favour of {@link #suffix(net.kyori.adventure.text.Component)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setSuffix(@NotNull String suffix) throws IllegalStateException, IllegalArgumentException; + + /** +@@ -184,7 +184,7 @@ public interface Team { + * @deprecated in favour of {@link #color()} + */ + @NotNull +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + ChatColor getColor() throws IllegalStateException; + + /** +@@ -197,7 +197,7 @@ public interface Team { + * no color + * @deprecated in favour of {@link #color(net.kyori.adventure.text.format.NamedTextColor)} + */ +- @Deprecated // Paper ++ @Deprecated // Paper // Purpur - conflict on change + void setColor(@NotNull ChatColor color); + + /** diff --git a/patches/Purpur/patches/server/0001-Rebrand.patch b/patches/Purpur/patches/server/0001-Rebrand.patch index f86ad4f5..6448dece 100644 --- a/patches/Purpur/patches/server/0001-Rebrand.patch +++ b/patches/Purpur/patches/server/0001-Rebrand.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Rebrand diff --git a/pom.xml b/pom.xml -index e83e4241a56fe131a75fe21cc1518992c089da2c..752d62eb3b87ab24260ec2c029bae0d2b0e3b908 100644 +index fc2c3714b6c772d67e258be269aa92dda80cdb12..cf6e53e9f483d21b17e2782816be4403fa5be717 100644 --- a/pom.xml +++ b/pom.xml @@ -27,8 +27,10 @@ -- com.tuinity -- tuinity-api +- gg.airplane +- airplane-api + + net.pl3x.purpur + purpur-api @@ -22,7 +22,7 @@ index e83e4241a56fe131a75fe21cc1518992c089da2c..752d62eb3b87ab24260ec2c029bae0d2 compile diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index 74ed02fa9296583977bb721014b10ff8b708b43c..c1280478ee4565003883df9607d4a8a0e8fe4faa 100644 +index 89eeb9d202405747409e65fcf226d95379987e29..4d9e685c691a37078ff7452e50ab8c13999dbe10 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -34,11 +34,23 @@ index 74ed02fa9296583977bb721014b10ff8b708b43c..c1280478ee4565003883df9607d4a8a0 .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) .completer(new ConsoleCommandCompleter(this.server)) ); +diff --git a/src/main/java/gg/airplane/compat/ServerConfigurations.java b/src/main/java/gg/airplane/compat/ServerConfigurations.java +index f4976428bc721319d2926e97cbe0f64c6e9e503c..044ad28bd1fd1c1e25061f9f811fc10baf7f5f72 100644 +--- a/src/main/java/gg/airplane/compat/ServerConfigurations.java ++++ b/src/main/java/gg/airplane/compat/ServerConfigurations.java +@@ -23,6 +23,7 @@ public class ServerConfigurations { + "spigot.yml", + "paper.yml", + "tuinity.yml", ++ "purpur.yml", // Purpur + "airplane.air" + }; + diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java -index 229c3b0f0c650b501f31147adaa17194af57fedd..f88cf526d272fe47b5a474c0b344b748ee4009fa 100644 +index 3bc5cd1e53dd7c94b948e7f57f0dc8e073e349b0..87891161f5b06bb8be0e2016b490484e6daca9d7 100644 --- a/src/main/java/net/minecraft/server/EULA.java +++ b/src/main/java/net/minecraft/server/EULA.java -@@ -70,7 +70,7 @@ public class EULA { +@@ -72,7 +72,7 @@ public class EULA { Properties properties = new Properties(); properties.setProperty("eula", "false"); @@ -48,15 +60,15 @@ 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 afc22e545df03a38c801362d308d135df90361e2..a76137268084e048696b7e8d35e00d26f6766df3 100644 +index 7cbbc1b1161f26f22a7f7832395af0d4a781cb1a..9301d93ffb5a961cb68a5c37c30b656087c1b45c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1524,7 +1524,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit +- return "Airplane"; // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Purpur"; // Purpur // Airplane // Tuinity // Paper // Spigot // CraftBukkit } public CrashReport b(CrashReport crashreport) { @@ -186,20 +198,20 @@ index 0000000000000000000000000000000000000000..cabfcebf9f944f7a2a2a1cffc7401435 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f994e99ebc8fe22e6f6b45f6379ec410a598789f..eeae4862898f093ca4b9819d0d08fdaf219213a0 100644 +index aec6c036ed42078a6cc3540f1f6e46a551e87a2f..f9913d7bd66935f975b756f31e26153ec160b3b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { -- private final String serverName = "Tuinity"; // Paper // Tuinity -+ private final String serverName = "Purpur"; // Paper // Tuinity // Purpur +- private final String serverName = "Airplane"; // Paper // Tuinity // Airplane ++ private final String serverName = "Purpur"; // Paper // Tuinity // Airplane // Purpur private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 57d56ff1b41582f0d249b24165d5b08b02b0f9fe..81cff601a5161c30df90de3cefc18d72cd7ee347 100644 +index 712a32c0b64dace1f3e3d6f8acb8cbef1736b1f9..eba28b9c5cb87dea09bf8430d253725f585f87b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -377,7 +377,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -212,15 +224,15 @@ index 57d56ff1b41582f0d249b24165d5b08b02b0f9fe..81cff601a5161c30df90de3cefc18d72 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 001b1e5197eaa51bfff9031aa6c69876c9a47960..13b98439320ac1401a920c01d7cf5a4b3a23deff 100644 +index 1788d79ea489e446d3d9f541693d4ba3dfc26015..191f5331f0c7871f80f0da9cc38345ce33353577 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { public static String getBukkitVersion() { String result = "Unknown-Version"; -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Purpur +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Airplane // Purpur Properties properties = new Properties(); if (stream != null) { diff --git a/patches/Purpur/patches/server/0002-Purpur-config-files.patch b/patches/Purpur/patches/server/0002-Purpur-config-files.patch index fe7aaf0e..8c906e27 100644 --- a/patches/Purpur/patches/server/0002-Purpur-config-files.patch +++ b/patches/Purpur/patches/server/0002-Purpur-config-files.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Purpur config files diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..4d8740678049aa749b42618470e9cc838555528d 100644 +index b480bd3044370b8eb733166f0c4b737344475993..4d8740678049aa749b42618470e9cc838555528d 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { -- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page +- Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane + Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { @@ -22,7 +22,7 @@ index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..4d8740678049aa749b42618470e9cc83 metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); - metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline")); -- metrics.addCustomChart(new Metrics.SimplePie("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page +- metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane + metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (PaperConfig.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur + metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Purpur @@ -44,11 +44,11 @@ index c56e7fb18f9a56c8025eb70a524f028b5942da37..4b9fdb4f04b333ce32f7fca8f279bf98 try { config.save(CONFIG_FILE); } catch (IOException ex) { -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 2644b190813cc934914aeab78fbd6515d1a37c4a..e3721b53db68171665ba05201155d088ae3cb89f 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -173,6 +173,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +index 24a46ad36613faa5f5a1a12b70f7af886e1608ae..28d47ef97939309ce26b6e4cae14925b510755fd 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -212,6 +212,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return false; } com.destroystokyo.paper.PaperConfig.registerCommands(); @@ -64,11 +64,11 @@ index 2644b190813cc934914aeab78fbd6515d1a37c4a..e3721b53db68171665ba05201155d088 com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now // Paper end com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index bf06ef09cfd4d7618365249d1332d264d8ff1377..ed2192ad7b27eb8fc34be5d7817e1ca4bee5c9d1 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/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 938a8732d1d57ae0cf424fa17c5c5b08cc5df37b..fdcae92b2fe41fa7e3c8d7f23756186e55880315 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -157,6 +157,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config @@ -76,14 +76,11 @@ index bf06ef09cfd4d7618365249d1332d264d8ff1377..ed2192ad7b27eb8fc34be5d7817e1ca4 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPosition lastPhysicsProblem; // Spigot -@@ -185,8 +186,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper - this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper -- this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray - this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config -+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur -+ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray +@@ -249,6 +250,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper + this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config ++ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName())); // Purpur this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit @@ -290,14 +287,14 @@ index 0000000000000000000000000000000000000000..361f7857e461578e90cb71e15027dada +} diff --git a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..4904be939c7a4b1d1583fd7b6232c930b79caba6 +index 0000000000000000000000000000000000000000..536955124afaec5c8a070249c7432cb99bf43d67 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java @@ -0,0 +1,65 @@ +package net.pl3x.purpur.command; + +import net.minecraft.server.MinecraftServer; -+import net.minecraft.server.WorldServer; ++import net.minecraft.server.level.WorldServer; +import net.pl3x.purpur.PurpurConfig; +import org.bukkit.ChatColor; +import org.bukkit.Location; @@ -360,7 +357,7 @@ index 0000000000000000000000000000000000000000..4904be939c7a4b1d1583fd7b6232c930 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eeae4862898f093ca4b9819d0d08fdaf219213a0..a64d375e16f033b875ca80e6678c3a3e198d0220 100644 +index f9913d7bd66935f975b756f31e26153ec160b3b1..3e0b92259ad00541a8da595a918275c1a5b2bc39 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -865,6 +865,7 @@ public final class CraftServer implements Server { @@ -387,7 +384,7 @@ index eeae4862898f093ca4b9819d0d08fdaf219213a0..a64d375e16f033b875ca80e6678c3a3e overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2357,6 +2360,18 @@ public final class CraftServer implements Server { +@@ -2362,6 +2365,18 @@ public final class CraftServer implements Server { } // Tuinity end - add config to timings report @@ -407,10 +404,10 @@ index eeae4862898f093ca4b9819d0d08fdaf219213a0..a64d375e16f033b875ca80e6678c3a3e public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 0f6cb508a170360b6479f9c34048412453fbb89d..a92721dff5c2a9a2a167b36c23d1ef22d2bbd3e1 100644 +index 2774abda3dd1390ae904bf2b177bdd0f11968f40..d28088d510a4a40f3948f224a40a63de4645fa42 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -146,6 +146,14 @@ public class Main { +@@ -148,6 +148,14 @@ public class Main { .describedAs("Yml file"); /* Conctete End - Server Config */ diff --git a/patches/Purpur/patches/server/0004-Barrels-and-enderchests-6-rows.patch b/patches/Purpur/patches/server/0004-Barrels-and-enderchests-6-rows.patch index f2d1d3b8..646b9520 100644 --- a/patches/Purpur/patches/server/0004-Barrels-and-enderchests-6-rows.patch +++ b/patches/Purpur/patches/server/0004-Barrels-and-enderchests-6-rows.patch @@ -4,43 +4,11 @@ Date: Thu, 23 May 2019 21:50:37 -0500 Subject: [PATCH] Barrels and enderchests 6 rows -diff --git a/src/main/java/net/minecraft/server/BlockEnderChest.java b/src/main/java/net/minecraft/server/BlockEnderChest.java -index 896d99d404419fef5bdf6f9083e07dfc978f4e67..9ab8336df4f1702e9cabefb63f279034fdd57486 100644 ---- a/src/main/java/net/minecraft/server/BlockEnderChest.java -+++ b/src/main/java/net/minecraft/server/BlockEnderChest.java -@@ -48,6 +48,27 @@ public class BlockEnderChest extends BlockChestAbstract im - - inventoryenderchest.a(tileentityenderchest); - entityhuman.openContainer(new TileInventory((i, playerinventory, entityhuman1) -> { -+ // Purpur start -+ if (net.pl3x.purpur.PurpurConfig.enderChestSixRows) { -+ if (net.pl3x.purpur.PurpurConfig.enderChestPermissionRows) { -+ org.bukkit.craftbukkit.entity.CraftHumanEntity player = entityhuman.getBukkitEntity(); -+ if (player.hasPermission("purpur.enderchest.rows.six")) { -+ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6); -+ } else if (player.hasPermission("purpur.enderchest.rows.five")) { -+ return new ContainerChest(Containers.GENERIC_9X5, i, playerinventory, inventoryenderchest, 5); -+ } else if (player.hasPermission("purpur.enderchest.rows.four")) { -+ return new ContainerChest(Containers.GENERIC_9X4, i, playerinventory, inventoryenderchest, 4); -+ } else if (player.hasPermission("purpur.enderchest.rows.three")) { -+ return new ContainerChest(Containers.GENERIC_9X3, i, playerinventory, inventoryenderchest, 3); -+ } else if (player.hasPermission("purpur.enderchest.rows.two")) { -+ return new ContainerChest(Containers.GENERIC_9X2, i, playerinventory, inventoryenderchest, 2); -+ } else if (player.hasPermission("purpur.enderchest.rows.one")) { -+ return new ContainerChest(Containers.GENERIC_9X1, i, playerinventory, inventoryenderchest, 1); -+ } -+ } -+ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6); -+ } -+ // Purpur end - return ContainerChest.a(i, playerinventory, inventoryenderchest); - }, BlockEnderChest.e)); - entityhuman.a(StatisticList.OPEN_ENDERCHEST); -diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java -index 8e167a664431b48875a7466be3a440eae089092b..df11848a03d2c08e935624e46489a62bc56de1da 100644 ---- a/src/main/java/net/minecraft/server/InventoryEnderChest.java -+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java -@@ -21,11 +21,34 @@ public class InventoryEnderChest extends InventorySubcontainer { +diff --git a/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java b/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java +index 85b9eba1dba3de69ab65b0e1c5ebb8740ce6e9e5..97f6ba97a4b2a35c0b8a003e1e27ad38831d859d 100644 +--- a/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java ++++ b/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java +@@ -28,11 +28,34 @@ public class InventoryEnderChest extends InventorySubcontainer { } public InventoryEnderChest(EntityHuman owner) { @@ -76,11 +44,59 @@ index 8e167a664431b48875a7466be3a440eae089092b..df11848a03d2c08e935624e46489a62b public void a(TileEntityEnderChest tileentityenderchest) { this.a = tileentityenderchest; } -diff --git a/src/main/java/net/minecraft/server/TileEntityBarrel.java b/src/main/java/net/minecraft/server/TileEntityBarrel.java -index 31d0b40fb7b30b89be1aa923c54af77e40b90b19..e5703b7d37c5f37c850328e9c8bf186d15934bdb 100644 ---- a/src/main/java/net/minecraft/server/TileEntityBarrel.java -+++ b/src/main/java/net/minecraft/server/TileEntityBarrel.java -@@ -49,7 +49,7 @@ public class TileEntityBarrel extends TileEntityLootable { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java b/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java +index 70d10c492b6ba893d56a463c0e71ac6aa8707f81..34ea9d2aeb9d606d487be796283c9d5ed614a6af 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java +@@ -11,6 +11,7 @@ import net.minecraft.world.TileInventory; + import net.minecraft.world.entity.monster.piglin.PiglinAI; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.inventory.ContainerChest; ++import net.minecraft.world.inventory.Containers; + import net.minecraft.world.inventory.InventoryEnderChest; + import net.minecraft.world.item.context.BlockActionContext; + import net.minecraft.world.level.GeneratorAccess; +@@ -81,6 +82,27 @@ public class BlockEnderChest extends BlockChestAbstract im + + inventoryenderchest.a(tileentityenderchest); + entityhuman.openContainer(new TileInventory((i, playerinventory, entityhuman1) -> { ++ // Purpur start ++ if (net.pl3x.purpur.PurpurConfig.enderChestSixRows) { ++ if (net.pl3x.purpur.PurpurConfig.enderChestPermissionRows) { ++ org.bukkit.craftbukkit.entity.CraftHumanEntity player = entityhuman.getBukkitEntity(); ++ if (player.hasPermission("purpur.enderchest.rows.six")) { ++ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6); ++ } else if (player.hasPermission("purpur.enderchest.rows.five")) { ++ return new ContainerChest(Containers.GENERIC_9X5, i, playerinventory, inventoryenderchest, 5); ++ } else if (player.hasPermission("purpur.enderchest.rows.four")) { ++ return new ContainerChest(Containers.GENERIC_9X4, i, playerinventory, inventoryenderchest, 4); ++ } else if (player.hasPermission("purpur.enderchest.rows.three")) { ++ return new ContainerChest(Containers.GENERIC_9X3, i, playerinventory, inventoryenderchest, 3); ++ } else if (player.hasPermission("purpur.enderchest.rows.two")) { ++ return new ContainerChest(Containers.GENERIC_9X2, i, playerinventory, inventoryenderchest, 2); ++ } else if (player.hasPermission("purpur.enderchest.rows.one")) { ++ return new ContainerChest(Containers.GENERIC_9X1, i, playerinventory, inventoryenderchest, 1); ++ } ++ } ++ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6); ++ } ++ // Purpur end + return ContainerChest.a(i, playerinventory, inventoryenderchest); + }, BlockEnderChest.e)); + entityhuman.a(StatisticList.OPEN_ENDERCHEST); +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java +index 7a6f150490bc3ef8a5ed43c401fd70bcc67f40f0..449d2c38abdd35b782a6732006eebb381815bcba 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java +@@ -14,6 +14,7 @@ import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.player.PlayerInventory; + import net.minecraft.world.inventory.Container; + import net.minecraft.world.inventory.ContainerChest; ++import net.minecraft.world.inventory.Containers; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.block.BlockBarrel; + import net.minecraft.world.level.block.Blocks; +@@ -68,7 +69,7 @@ public class TileEntityBarrel extends TileEntityLootable { private TileEntityBarrel(TileEntityTypes tileentitytypes) { super(tileentitytypes); @@ -89,7 +105,7 @@ index 31d0b40fb7b30b89be1aa923c54af77e40b90b19..e5703b7d37c5f37c850328e9c8bf186d } public TileEntityBarrel() { -@@ -78,7 +78,7 @@ public class TileEntityBarrel extends TileEntityLootable { +@@ -97,7 +98,7 @@ public class TileEntityBarrel extends TileEntityLootable { @Override public int getSize() { @@ -98,7 +114,7 @@ index 31d0b40fb7b30b89be1aa923c54af77e40b90b19..e5703b7d37c5f37c850328e9c8bf186d } @Override -@@ -98,6 +98,7 @@ public class TileEntityBarrel extends TileEntityLootable { +@@ -117,6 +118,7 @@ public class TileEntityBarrel extends TileEntityLootable { @Override protected Container createContainer(int i, PlayerInventory playerinventory) { @@ -143,7 +159,7 @@ index 00eb196f8caa2e4f2478972c14f4596071adbd2a..cb7e34924cb5dbff25d1ffe05cfe5bc2 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java -index 9c49d9c21630c48ae6783bfc0f9cbe455862d686..613912e014070382d66d1e3a2e805af1bc741966 100644 +index 614ab2d73db2293116f2272f6cd5c16da446132d..2885dc250f171917393c0356a005b476b23f9c5f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -212,8 +212,10 @@ public class CraftContainer extends Container { @@ -159,10 +175,10 @@ index 9c49d9c21630c48ae6783bfc0f9cbe455862d686..613912e014070382d66d1e3a2e805af1 case DISPENSER: case DROPPER: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index bba9bddc1c0aacade9b7ad56afb1e630caa078fc..c2802c5bfb5ec82daad32d3a3375f4428ae76dfd 100644 +index c3fa97ac34e1fc61ae02f224f8afe5a0b486fb4d..40e5a2fae032445467ac453f1fab7e366e911283 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -81,7 +81,7 @@ public class CraftInventory implements Inventory { +@@ -82,7 +82,7 @@ public class CraftInventory implements Inventory { @Override public void setContents(ItemStack[] items) { diff --git a/patches/Purpur/patches/server/0005-Advancement-API.patch b/patches/Purpur/patches/server/0005-Advancement-API.patch index 1ce8a56b..7fb48f16 100644 --- a/patches/Purpur/patches/server/0005-Advancement-API.patch +++ b/patches/Purpur/patches/server/0005-Advancement-API.patch @@ -4,11 +4,11 @@ Date: Fri, 31 May 2019 21:24:33 -0500 Subject: [PATCH] Advancement API -diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java -index c405047c00d354bbc1449fd2f917b73f980ef1a5..384d4090f8ff1ea718de16affa5c146a2f58d28a 100644 ---- a/src/main/java/net/minecraft/server/Advancement.java -+++ b/src/main/java/net/minecraft/server/Advancement.java -@@ -64,7 +64,7 @@ public class Advancement { +diff --git a/src/main/java/net/minecraft/advancements/Advancement.java b/src/main/java/net/minecraft/advancements/Advancement.java +index e3d5d55a2fe5d86db621d3e0c9322f553386d731..8bfd20ff9a3c96fa9ff5cc618ca7e858e62943a0 100644 +--- a/src/main/java/net/minecraft/advancements/Advancement.java ++++ b/src/main/java/net/minecraft/advancements/Advancement.java +@@ -77,7 +77,7 @@ public class Advancement { } @Nullable @@ -17,11 +17,11 @@ index c405047c00d354bbc1449fd2f917b73f980ef1a5..384d4090f8ff1ea718de16affa5c146a return this.display; } -diff --git a/src/main/java/net/minecraft/server/AdvancementDisplay.java b/src/main/java/net/minecraft/server/AdvancementDisplay.java -index b0d4b7a67679a35fa8f88c241193c0f3814f1e7b..ac4fac89837f4e77dcaec6f9ca90c5aa8a78c4be 100644 ---- a/src/main/java/net/minecraft/server/AdvancementDisplay.java -+++ b/src/main/java/net/minecraft/server/AdvancementDisplay.java -@@ -15,10 +15,11 @@ public class AdvancementDisplay { +diff --git a/src/main/java/net/minecraft/advancements/AdvancementDisplay.java b/src/main/java/net/minecraft/advancements/AdvancementDisplay.java +index 721d7fbab447117349994f710338ca616ab11067..35b84373da154a070f691b0049086cc788f7de4d 100644 +--- a/src/main/java/net/minecraft/advancements/AdvancementDisplay.java ++++ b/src/main/java/net/minecraft/advancements/AdvancementDisplay.java +@@ -25,10 +25,11 @@ public class AdvancementDisplay { private final MinecraftKey d; private final AdvancementFrameType e; private final boolean f; @@ -35,7 +35,7 @@ index b0d4b7a67679a35fa8f88c241193c0f3814f1e7b..ac4fac89837f4e77dcaec6f9ca90c5aa public AdvancementDisplay(ItemStack itemstack, IChatBaseComponent ichatbasecomponent, IChatBaseComponent ichatbasecomponent1, @Nullable MinecraftKey minecraftkey, AdvancementFrameType advancementframetype, boolean flag, boolean flag1, boolean flag2) { this.a = ichatbasecomponent; -@@ -36,22 +37,29 @@ public class AdvancementDisplay { +@@ -46,22 +47,29 @@ public class AdvancementDisplay { this.j = f1; } @@ -65,12 +65,13 @@ index b0d4b7a67679a35fa8f88c241193c0f3814f1e7b..ac4fac89837f4e77dcaec6f9ca90c5aa public boolean j() { return this.h; } -diff --git a/src/main/java/net/minecraft/server/AdvancementFrameType.java b/src/main/java/net/minecraft/server/AdvancementFrameType.java -index 90b78e49c0688dc2fb02df0b6784cd82fad4bc07..9a3a53cf3576c299629a84ba76cb5b9b86a14491 100644 ---- a/src/main/java/net/minecraft/server/AdvancementFrameType.java -+++ b/src/main/java/net/minecraft/server/AdvancementFrameType.java -@@ -1,15 +1,26 @@ - package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/advancements/AdvancementFrameType.java b/src/main/java/net/minecraft/advancements/AdvancementFrameType.java +index f5d24950d317c78a971472821595fc1b44befc6e..f096ecf8d77b085e6c2ef4c3b64f0b65409bb287 100644 +--- a/src/main/java/net/minecraft/advancements/AdvancementFrameType.java ++++ b/src/main/java/net/minecraft/advancements/AdvancementFrameType.java +@@ -4,16 +4,27 @@ import net.minecraft.EnumChatFormat; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; +import org.bukkit.advancement.FrameType; // Purpur + @@ -98,11 +99,11 @@ index 90b78e49c0688dc2fb02df0b6784cd82fad4bc07..9a3a53cf3576c299629a84ba76cb5b9b this.d = s; this.e = i; this.f = enumchatformat; -diff --git a/src/main/java/net/minecraft/server/CriterionTrigger.java b/src/main/java/net/minecraft/server/CriterionTrigger.java -index cfb420a9c7e64ec240fff81d2e3fd32f607847b3..6fd3671c37a4fc42aa438a93d5a749b52f618b1e 100644 ---- a/src/main/java/net/minecraft/server/CriterionTrigger.java -+++ b/src/main/java/net/minecraft/server/CriterionTrigger.java -@@ -26,6 +26,7 @@ public interface CriterionTrigger { +diff --git a/src/main/java/net/minecraft/advancements/CriterionTrigger.java b/src/main/java/net/minecraft/advancements/CriterionTrigger.java +index f2d74473caf96ca6e871311ef87afa128cd4d0bf..851e69a2f5155d9fa2e5652abdea9aee59e4b20a 100644 +--- a/src/main/java/net/minecraft/advancements/CriterionTrigger.java ++++ b/src/main/java/net/minecraft/advancements/CriterionTrigger.java +@@ -29,6 +29,7 @@ public interface CriterionTrigger { this.c = s; } @@ -111,7 +112,7 @@ index cfb420a9c7e64ec240fff81d2e3fd32f607847b3..6fd3671c37a4fc42aa438a93d5a749b5 return this.a; } diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java -index a5aadf2850f273e258f84b6c7bc9ca3649fb884d..b0a7092d623adccd61fd3e094f1ec5e8d95c3691 100644 +index 77abcd6de43302985cdbb2085abece4f621068d4..c859fc16c263e0c50cb01fc722b6f6723d682481 100644 --- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java @@ -27,4 +27,11 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement { @@ -128,13 +129,13 @@ index a5aadf2850f273e258f84b6c7bc9ca3649fb884d..b0a7092d623adccd61fd3e094f1ec5e8 } diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java new file mode 100644 -index 0000000000000000000000000000000000000000..1cbb1e67b64a7e830cfabcd1fc07e998434476c3 +index 0000000000000000000000000000000000000000..0b4ff544e04ec314e78a7a48b5bf90ee699b2ad6 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java @@ -0,0 +1,47 @@ +package org.bukkit.craftbukkit.advancement; + -+import net.minecraft.server.AdvancementDisplay; ++import net.minecraft.advancements.AdvancementDisplay; +import org.bukkit.advancement.FrameType; +import org.bukkit.craftbukkit.util.CraftChatMessage; + diff --git a/patches/Purpur/patches/server/0006-Llama-API.patch b/patches/Purpur/patches/server/0006-Llama-API.patch index 1aa1fd6a..dd9d6492 100644 --- a/patches/Purpur/patches/server/0006-Llama-API.patch +++ b/patches/Purpur/patches/server/0006-Llama-API.patch @@ -4,11 +4,40 @@ Date: Fri, 18 Oct 2019 22:50:12 -0500 Subject: [PATCH] Llama API -diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c591fb405a6 100644 ---- a/src/main/java/net/minecraft/server/EntityLlama.java -+++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -13,7 +13,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java +index 4fd1744f13b87c79ae3f46b28a56daeaba343aa6..34a854131dd939693a6df4d52103714ebe373dc3 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java +@@ -11,7 +11,7 @@ import net.minecraft.world.phys.Vec3D; + + public class PathfinderGoalLlamaFollow extends PathfinderGoal { + +- public final EntityLlama a; ++ public final EntityLlama a; public EntityLlama getLlama() { return a; } // Purpur + private double b; + private int c; + +@@ -23,6 +23,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal { + + @Override + public boolean a() { ++ if (!getLlama().shouldJoinCaravan) return false; // Purpur + if (!this.a.isLeashed() && !this.a.fC()) { + List list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> { + EntityTypes entitytypes = entity.getEntityType(); +@@ -82,6 +83,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal { + + @Override + public boolean b() { ++ if (!getLlama().shouldJoinCaravan) return false; // Purpur + if (this.a.fC() && this.a.fD().isAlive() && this.a(this.a, 0)) { + double d0 = this.a.h((Entity) this.a.fD()); + +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +index 2005cb484ba6b5929ad81d3d120521f247f3d4cf..1c6435bf2cd870b795f87368057d8dfc1e1c938a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +@@ -63,7 +63,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn @Nullable private EntityLlama bB; @Nullable @@ -18,7 +47,7 @@ index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c59 public EntityLlama(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -42,6 +43,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +@@ -92,6 +93,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn nbttagcompound.set("DecorItem", this.inventoryChest.getItem(1).save(new NBTTagCompound())); } @@ -26,7 +55,7 @@ index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c59 } @Override -@@ -53,6 +55,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +@@ -103,6 +105,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn this.inventoryChest.setItem(1, ItemStack.a(nbttagcompound.getCompound("DecorItem"))); } @@ -38,7 +67,7 @@ index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c59 this.fe(); } -@@ -387,19 +394,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +@@ -437,19 +444,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } } @@ -63,7 +92,7 @@ index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c59 public boolean fB() { return this.bC != null; } -@@ -410,7 +422,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn +@@ -460,7 +472,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn } @Nullable @@ -72,37 +101,8 @@ index d9e1b43283bee15c659dd3a99e45d9412aedd0bc..e61f53816cbf09e775762403d97e9c59 return this.bB; } -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java -index 1b29ca2ca0bc5d17673de43bdc854d5b4c96b8b6..47ffa669681da7512ee594ecb643f28576dee444 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalLlamaFollow.java -@@ -6,7 +6,7 @@ import java.util.List; - - public class PathfinderGoalLlamaFollow extends PathfinderGoal { - -- public final EntityLlama a; -+ public final EntityLlama a; public EntityLlama getLlama() { return a; } // Purpur - private double b; - private int c; - -@@ -18,6 +18,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal { - - @Override - public boolean a() { -+ if (!getLlama().shouldJoinCaravan) return false; // Purpur - if (!this.a.isLeashed() && !this.a.fC()) { - List list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> { - EntityTypes entitytypes = entity.getEntityType(); -@@ -77,6 +78,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal { - - @Override - public boolean b() { -+ if (!getLlama().shouldJoinCaravan) return false; // Purpur - if (this.a.fC() && this.a.fD().isAlive() && this.a(this.a, 0)) { - double d0 = this.a.h((Entity) this.a.fD()); - diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java -index 71faa1b38f613db468ee939a7ffac7aaed733d20..43536b0744e5618c10790ae9db399c0506567f2a 100644 +index 818034c62893a71808e3af0aa33393605611acdd..71536b6ae6a423e33667efcf584a0020f36fb189 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java @@ -66,4 +66,48 @@ public class CraftLlama extends CraftChestedHorse implements Llama, CraftRangedE diff --git a/patches/Purpur/patches/server/0007-AFK-API.patch b/patches/Purpur/patches/server/0007-AFK-API.patch index ff6f1e26..5e969b23 100644 --- a/patches/Purpur/patches/server/0007-AFK-API.patch +++ b/patches/Purpur/patches/server/0007-AFK-API.patch @@ -4,31 +4,11 @@ Date: Thu, 8 Aug 2019 15:29:15 -0500 Subject: [PATCH] AFK API -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index f034977f4666385d6e7c7288e453d058c270be01..390aae2733e397ac5c6c457c76bf75f9c8dcd873 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -84,6 +84,15 @@ public abstract class EntityHuman extends EntityLiving { - } - // CraftBukkit end - -+ // Purpur start -+ public void setAfk(boolean setAfk){ -+ } -+ -+ public boolean isAfk() { -+ return false; -+ } -+ // Purpur end -+ - public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) { - 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 c086579073c785b3b7cd556bbb629b91560bd449..e35fdbf915f627c2b9c9ca6314805006aa495e5f 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1940,8 +1940,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 534c7266fe9d6f60b74a71e5e61ed248e515dffd..f30dcbd26ed56ba8f1a99260722a0b395c220954 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -2070,8 +2070,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void resetIdleTimer() { this.ca = SystemUtils.getMonotonicMillis(); @@ -83,11 +63,117 @@ index c086579073c785b3b7cd556bbb629b91560bd449..e35fdbf915f627c2b9c9ca6314805006 public ServerStatisticManager getStatisticManager() { return this.serverStatisticManager; } -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index ad286848ddb7803640ef7eeea46b58473dd1d0c4..2e514b8291a544a88667fbca2389bde4c2ecb109 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -174,28 +174,18 @@ public interface IEntityAccess { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index b788c33605fc96d17758cf42e508872e38fb4322..9a99edb041cfd311212c014fd17aed88b232b074 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1000,7 +1000,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + // CraftBukkit end + + if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> { +- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit ++ return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping && !(purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk()); // CraftBukkit // Purpur + })) { + // CraftBukkit start + long l = this.worldData.getDayTime() + 24000L; +@@ -1347,7 +1347,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + +- if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping())) { // CraftBukkit ++ if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping()) || (purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur + ++i; + } else if (entityplayer.isSleeping()) { + ++j; +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index b7e72fe1cd04219391c75beb7d67a1e32e393a16..789cf1652fec8346c1ea3ca47d9ac43c0765528a 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -397,6 +397,12 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + + if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) { ++ // Purpur start ++ this.player.setAfk(true); ++ if (!this.player.world.purpurConfig.idleTimeoutKick) { ++ return; ++ } ++ // Purpur end + this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854 + this.disconnect(new ChatMessage("multiplayer.disconnect.idling")); + } +@@ -666,6 +672,8 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.lastYaw = to.getYaw(); + this.lastPitch = to.getPitch(); + ++ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur ++ + // Skip the first time we do this + if (true) { // Spigot - don't skip any move events + Location oldTo = to.clone(); +@@ -1402,7 +1410,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + + if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot + flag1 = true; // Tuinity - diff on change, this should be moved wrongly +- PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getDisplayName().getString()); ++ PlayerConnection.LOGGER.warn("{} moved wrongly! ({})", this.player.getDisplayName().getString(), d11); // Purpur + } + + this.player.setLocation(d4, d5, d6, f, f1); +@@ -1452,6 +1460,8 @@ public class PlayerConnection implements PacketListenerPlayIn { + this.lastYaw = to.getYaw(); + this.lastPitch = to.getPitch(); + ++ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur ++ + // Skip the first time we do this + if (from.getX() != Double.MAX_VALUE) { + Location oldTo = to.clone(); +diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src/main/java/net/minecraft/world/entity/IEntitySelector.java +index f5e32faeb6d937cf90b1f3ea251b5cfc91f2338d..f9908fb7cc27a8947030c2100dccf1dc1a4e24f7 100644 +--- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java ++++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java +@@ -15,6 +15,7 @@ import net.minecraft.world.scores.ScoreboardTeamBase; + public final class IEntitySelector { + + public static final Predicate a = Entity::isAlive; ++ public static Predicate isLivingAlive() { return b; } // Purpur - OBFHELPER + public static final Predicate b = EntityLiving::isAlive; + public static final Predicate c = (entity) -> { + return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger(); +@@ -35,6 +36,7 @@ public final class IEntitySelector { + return !entity.isSpectator(); + }; + public static Predicate isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.get(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper ++ public static Predicate notAfk = (player) -> !player.isAfk(); // Purpur + + // Paper start + public static final Predicate affectsSpawning = (entity) -> { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index ad85dda5c50b797904824a08513fbcec042128ea..8f9d0769e7855c3565a34927f3f3741c43e45f35 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -182,6 +182,15 @@ public abstract class EntityHuman extends EntityLiving { + } + // CraftBukkit end + ++ // Purpur start ++ public void setAfk(boolean setAfk){ ++ } ++ ++ public boolean isAfk() { ++ return false; ++ } ++ // Purpur end ++ + public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) { + super(EntityTypes.PLAYER, world); + this.bL = ItemStack.b; +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index a7f2304acf8ee0a15d6eae8c42060e003be13ae7..fd56b2f15e570f266a79c25823a3b3530a693510 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -183,28 +183,18 @@ public interface IEntityAccess { } // Paper end @@ -128,101 +214,15 @@ index ad286848ddb7803640ef7eeea46b58473dd1d0c4..2e514b8291a544a88667fbca2389bde4 } @Nullable -diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index b5e1a860a2569d7668330827614d221b60f3fc78..5f85a1d513f4fdc21b64e1a2b6882e3325b98ddd 100644 ---- a/src/main/java/net/minecraft/server/IEntitySelector.java -+++ b/src/main/java/net/minecraft/server/IEntitySelector.java -@@ -7,6 +7,7 @@ import javax.annotation.Nullable; - public final class IEntitySelector { - - public static final Predicate a = Entity::isAlive; -+ public static Predicate isLivingAlive() { return b; } // Purpur - OBFHELPER - public static final Predicate b = EntityLiving::isAlive; - public static final Predicate c = (entity) -> { - return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger(); -@@ -27,6 +28,7 @@ public final class IEntitySelector { - return !entity.isSpectator(); - }; - public static Predicate isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.get(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper -+ public static Predicate notAfk = (player) -> !player.isAfk(); // Purpur - - // 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 9146b60cff0aa06e2f6b6003bfe9e2be9d2f0d56..bba8dc8fd10dc34179ca3c8cf471fbb3739fa7b4 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -252,6 +252,12 @@ public class PlayerConnection implements PacketListenerPlayIn { - } - - if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) { -+ // Purpur start -+ this.player.setAfk(true); -+ if (!this.player.world.purpurConfig.idleTimeoutKick) { -+ return; -+ } -+ // Purpur end - this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854 - this.disconnect(new ChatMessage("multiplayer.disconnect.idling")); - } -@@ -521,6 +527,8 @@ public class PlayerConnection implements PacketListenerPlayIn { - this.lastYaw = to.getYaw(); - this.lastPitch = to.getPitch(); - -+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur -+ - // Skip the first time we do this - if (true) { // Spigot - don't skip any move events - Location oldTo = to.clone(); -@@ -1257,7 +1265,7 @@ public class PlayerConnection implements PacketListenerPlayIn { - - if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot - flag1 = true; // Tuinity - diff on change, this should be moved wrongly -- PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getDisplayName().getString()); -+ PlayerConnection.LOGGER.warn("{} moved wrongly! ({})", this.player.getDisplayName().getString(), d11); // Purpur - } - - this.player.setLocation(d4, d5, d6, f, f1); -@@ -1307,6 +1315,8 @@ public class PlayerConnection implements PacketListenerPlayIn { - this.lastYaw = to.getYaw(); - this.lastPitch = to.getPitch(); - -+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur -+ - // Skip the first time we do this - if (from.getX() != Double.MAX_VALUE) { - Location oldTo = to.clone(); -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a77fceac7c9e79a6bac05becc21bcb6bf2a1a7c7..be532af2a0de6927a268c631c25f062f370c72ba 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -887,7 +887,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - // CraftBukkit end - - if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> { -- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit -+ return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping && !(purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk()); // CraftBukkit // Purpur - })) { - // CraftBukkit start - long l = this.worldData.getDayTime() + 24000L; -@@ -1231,7 +1231,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - while (iterator.hasNext()) { - EntityPlayer entityplayer = (EntityPlayer) iterator.next(); - -- if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping())) { // CraftBukkit -+ if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping()) || (purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur - ++i; - } else if (entityplayer.isSleeping()) { - ++j; diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index cb7e34924cb5dbff25d1ffe05cfe5bc22e4a90ed..406e840499e09638e8b325d0e52b764e80acc777 100644 +index cb7e34924cb5dbff25d1ffe05cfe5bc22e4a90ed..ee99289165cab9f58b689a7e07aa01622e203863 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -1,6 +1,7 @@ package net.pl3x.purpur; import com.google.common.base.Throwables; -+import net.minecraft.server.LocaleLanguage; ++import net.minecraft.locale.LocaleLanguage; import net.minecraft.server.MinecraftServer; import net.pl3x.purpur.command.PurpurCommand; import org.bukkit.Bukkit; @@ -263,10 +263,10 @@ index 361f7857e461578e90cb71e15027dadaf794cb69..2578a4677d1ee060f687be531e696b7c + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b3636032fd36efe2e7e546dbebdfd5c1208f9951..abf2a6b9d18f04baa077ededa3562a30dbaa4fe4 100644 +index 45e786565ac988abadffda2e7ba3ff1e2880b786..f4052aaa2235894b996d65c569a083f1a09b59a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2482,4 +2482,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2491,4 +2491,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return spigot; } // Spigot end @@ -289,10 +289,10 @@ index b3636032fd36efe2e7e546dbebdfd5c1208f9951..abf2a6b9d18f04baa077ededa3562a30 + // Purpur end } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 18295dceeacefd2586f3e3fe8bd58790740ba14d..f2e978107ef1163ceadb3ea7594eba6e900a8a28 100644 +index 6c4c4580faef39e48de5af4db003cf2e3b8a99b5..dc2d880ded328f8377c207ce15f604ec5c25176c 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -206,6 +206,7 @@ public class ActivationRange +@@ -207,6 +207,7 @@ public class ActivationRange { player.activatedTick = MinecraftServer.currentTick; diff --git a/patches/Purpur/patches/server/0008-Bring-back-server-name.patch b/patches/Purpur/patches/server/0008-Bring-back-server-name.patch index a78c486d..d68487a2 100644 --- a/patches/Purpur/patches/server/0008-Bring-back-server-name.patch +++ b/patches/Purpur/patches/server/0008-Bring-back-server-name.patch @@ -4,11 +4,11 @@ Date: Sun, 26 May 2019 15:19:14 -0500 Subject: [PATCH] Bring back server name -diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -index 15a4f921b1ae2bbc66b7d58238b60151123a7eb3..fe5937d890762ab37a90f189c4992af389d2c41d 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java -+++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -@@ -14,6 +14,7 @@ public class DedicatedServerProperties extends PropertyManager entitytypes, World world) { - super(entitytypes, world); -+ this.safeFallDistance = 10.0F; // Purpur - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index acbdaa097dfd1cba18add0a09ad54ca78d3e0c24..784819d252d94e8040a87f53431fcf2c7a19d1a7 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java -+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -211,7 +211,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven - - @Override - protected int e(float f, float f1) { -- return MathHelper.f((f * 0.5F - 3.0F) * f1); -+ return MathHelper.f((f * 0.5F - this.safeFallDistance) * f1); // Purpur - } - - protected int getChestSlots() { -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index d568db532de83a85d5c387121cec151c160f36bf..ebe18e5926bb9e7d2dacdb09c213c0ad6fb847c4 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -133,6 +133,7 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 1a7866bed9cb7f0431454d3af4733de05c0cba78..30aabde3d6703eefcb6d57bab43666b97197ba1f 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -228,6 +228,7 @@ public abstract class EntityLiving extends Entity { // CraftBukkit start public int expToDrop; public int maxAirTicks = 300; + public float safeFallDistance = 3.0F; // Purpur - boolean forceDrops; - ArrayList drops = new ArrayList(); + public boolean forceDrops; + public ArrayList drops = new ArrayList(); public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes; -@@ -227,8 +228,8 @@ public abstract class EntityLiving extends Entity { +@@ -322,8 +323,8 @@ public abstract class EntityLiving extends Entity { this.cR(); } @@ -52,7 +27,7 @@ index d568db532de83a85d5c387121cec151c160f36bf..ebe18e5926bb9e7d2dacdb09c213c0ad if (!iblockdata.isAir()) { double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D); -@@ -1693,7 +1694,7 @@ public abstract class EntityLiving extends Entity { +@@ -1790,7 +1791,7 @@ public abstract class EntityLiving extends Entity { MobEffect mobeffect = this.getEffect(MobEffects.JUMP); float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1); @@ -61,11 +36,36 @@ index d568db532de83a85d5c387121cec151c160f36bf..ebe18e5926bb9e7d2dacdb09c213c0ad } protected void playBlockStepSound() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +index 1e41c45af6dbcf097d7d6104e63db637f199301a..cb6e2053d1315b65812e7bff8a17988b5b8ab0e4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +@@ -272,7 +272,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + + @Override + protected int e(float f, float f1) { +- return MathHelper.f((f * 0.5F - 3.0F) * f1); ++ return MathHelper.f((f * 0.5F - this.safeFallDistance) * f1); // Purpur + } + + protected int getChestSlots() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +index 3b004160da9a2aed440a3ccda538d78f91c61e87..5e6a92dcdbca686d5a8cfc4aaff72b70b81b111f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +@@ -13,6 +13,7 @@ public class EntityGiantZombie extends EntityMonster { + + public EntityGiantZombie(EntityTypes entitytypes, World world) { + super(entitytypes, world); ++ this.safeFallDistance = 10.0F; // Purpur + } + + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index c1350bbf62fc5c5e18509f378edf16e8b210cfe8..84aeffac2c2c12d98e9cec05314668a93bb5ed91 100644 +index 3d497f69f89455b88fba423de8effb3db83e7af4..b5040de9885556561416bf3282476f3b33925a62 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -833,4 +833,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -843,4 +843,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { getHandle().setHurtDirection(hurtDirection); } // Paper end diff --git a/patches/Purpur/patches/server/0011-Lagging-threshold.patch b/patches/Purpur/patches/server/0011-Lagging-threshold.patch index 907a3efe..72dae110 100644 --- a/patches/Purpur/patches/server/0011-Lagging-threshold.patch +++ b/patches/Purpur/patches/server/0011-Lagging-threshold.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Lagging threshold diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 27013a6d3cd53778690ee0f45aa0a82994412fa2..830f3e52b7e5b8604e7c17227476c397912f93c3 100644 +index 2af7c84167f75f1d16d0fd74a4c8156502325446..34793bc4bd14dc7a34f32ccfec05cf50eb77cee2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -167,6 +167,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant d; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index c79623339cfe8fb8484bcc2a8c3eb119b9e83093..3a6a1f8ce0a30f2bdc08ec36fe9a2381439e7fa4 100644 +index 6966b9d1ce674232d3f867798fa58bd0933ff69e..1cc473eb4d346b1b498a7b170973fb44d8b8aea6 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -396,4 +396,18 @@ public final class CraftItemFactory implements ItemFactory { @@ -33,10 +33,10 @@ index c79623339cfe8fb8484bcc2a8c3eb119b9e83093..3a6a1f8ce0a30f2bdc08ec36fe9a2381 + return null; + } + String name = type.getKey().toString(); -+ net.minecraft.server.MinecraftKey key = new net.minecraft.server.MinecraftKey(name); -+ net.minecraft.server.EntityTypes types = net.minecraft.server.EntityTypes.getFromKey(key); -+ net.minecraft.server.ItemMonsterEgg egg = net.minecraft.server.ItemMonsterEgg.a.get(types); -+ return new net.minecraft.server.ItemStack(egg).asBukkitMirror(); ++ net.minecraft.resources.MinecraftKey key = new net.minecraft.resources.MinecraftKey(name); ++ net.minecraft.world.entity.EntityTypes types = net.minecraft.world.entity.EntityTypes.getFromKey(key); ++ net.minecraft.world.item.ItemMonsterEgg egg = net.minecraft.world.item.ItemMonsterEgg.a.get(types); ++ return new net.minecraft.world.item.ItemStack(egg).asBukkitMirror(); + } + // Purpur end } diff --git a/patches/Purpur/patches/server/0013-PlayerSetSpawnerTypeWithEggEvent.patch b/patches/Purpur/patches/server/0013-PlayerSetSpawnerTypeWithEggEvent.patch index 41fdb7da..c40126d0 100644 --- a/patches/Purpur/patches/server/0013-PlayerSetSpawnerTypeWithEggEvent.patch +++ b/patches/Purpur/patches/server/0013-PlayerSetSpawnerTypeWithEggEvent.patch @@ -4,11 +4,11 @@ Date: Fri, 5 Jul 2019 18:21:00 -0500 Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent -diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b669ca00c 100644 ---- a/src/main/java/net/minecraft/server/EntityTypes.java -+++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -143,6 +143,16 @@ public class EntityTypes { +diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java +index 80c229c1852199fda85c03453d64cae33e413e89..6335e9046a6288f7bcf945ad8c381e080744653d 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java ++++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java +@@ -274,6 +274,16 @@ public class EntityTypes { return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s)); } @@ -25,7 +25,7 @@ index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b public static MinecraftKey getName(EntityTypes entitytypes) { return IRegistry.ENTITY_TYPE.getKey(entitytypes); } -@@ -301,6 +311,16 @@ public class EntityTypes { +@@ -439,6 +449,16 @@ public class EntityTypes { return this.bg; } @@ -42,7 +42,7 @@ index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b public String getDescriptionId() { return f(); } // Paper - OBFHELPER public String f() { if (this.bo == null) { -@@ -310,6 +330,7 @@ public class EntityTypes { +@@ -448,6 +468,7 @@ public class EntityTypes { return this.bo; } @@ -50,13 +50,13 @@ index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b public IChatBaseComponent g() { if (this.bp == null) { this.bp = new ChatMessage(this.f()); -diff --git a/src/main/java/net/minecraft/server/ItemMonsterEgg.java b/src/main/java/net/minecraft/server/ItemMonsterEgg.java -index eeac4aeaf21b43647aa643ec55a1ae842a7ac197..d66acf90d0b1bcd5c6481d2a2ee753c7693995b0 100644 ---- a/src/main/java/net/minecraft/server/ItemMonsterEgg.java -+++ b/src/main/java/net/minecraft/server/ItemMonsterEgg.java -@@ -7,6 +7,13 @@ import java.util.Objects; - import java.util.Optional; - import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java +index addddb64956c63563fc072b35cc511d31c9afd45..5e2d0246146af8bf1de1038f6a1953451b99f0f5 100644 +--- a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java ++++ b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java +@@ -33,6 +33,13 @@ import net.minecraft.world.phys.MovingObjectPosition; + import net.minecraft.world.phys.MovingObjectPositionBlock; + import net.minecraft.world.phys.Vec3D; +// Purpur start +import net.pl3x.purpur.event.PlayerSetSpawnerTypeWithEggEvent; @@ -68,7 +68,7 @@ index eeac4aeaf21b43647aa643ec55a1ae842a7ac197..d66acf90d0b1bcd5c6481d2a2ee753c7 public class ItemMonsterEgg extends Item { public static final Map, ItemMonsterEgg> a = Maps.newIdentityHashMap(); // Purpur - private -> public -@@ -41,6 +48,15 @@ public class ItemMonsterEgg extends Item { +@@ -67,6 +74,15 @@ public class ItemMonsterEgg extends Item { MobSpawnerAbstract mobspawnerabstract = ((TileEntityMobSpawner) tileentity).getSpawner(); EntityTypes entitytypes = this.a(itemstack.getTag()); diff --git a/patches/Purpur/patches/server/0014-EMC-MonsterEggSpawnEvent.patch b/patches/Purpur/patches/server/0014-EMC-MonsterEggSpawnEvent.patch index 690259c1..807ef439 100644 --- a/patches/Purpur/patches/server/0014-EMC-MonsterEggSpawnEvent.patch +++ b/patches/Purpur/patches/server/0014-EMC-MonsterEggSpawnEvent.patch @@ -4,11 +4,11 @@ Date: Sat, 20 Jul 2013 22:40:56 -0400 Subject: [PATCH] EMC - MonsterEggSpawnEvent -diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 36f572990a0c08f21df6f4dc40c5878b669ca00c..ed1e0bd379b95bc090c7cdf57de70ec9cc2dac5a 100644 ---- a/src/main/java/net/minecraft/server/EntityTypes.java -+++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -187,17 +187,31 @@ public class EntityTypes { +diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java +index 6335e9046a6288f7bcf945ad8c381e080744653d..94aca57dd9e08d8841086378a712794e0d9c0e00 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java ++++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java +@@ -318,13 +318,20 @@ public class EntityTypes { @Nullable public Entity spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) { @@ -27,24 +27,23 @@ index 36f572990a0c08f21df6f4dc40c5878b669ca00c..ed1e0bd379b95bc090c7cdf57de70ec9 + // Purpur end // CraftBukkit start - return this.spawnCreature(worldserver, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); -+ return this.spawnCreature(worldserver, itemstack, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // Purpur ++ return this.spawnCreature(worldserver, itemstack, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG, null); // Purpur } @Nullable - public T spawnCreature(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { +@@ -349,9 +356,29 @@ public class EntityTypes { + } + } + // Paper end + // Purpur start -+ return spawnCreature(worldserver, null, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, spawnReason); ++ return spawnCreature(worldserver, null, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, spawnReason, op); + } + + @Nullable -+ public T spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { ++ public T spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason, @Nullable java.util.function.Consumer op) { + // Purpur end - // Paper start - Call PreCreatureSpawnEvent - org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityTypes.getName(this).getKey()); - if (type != null) { -@@ -214,6 +228,19 @@ public class EntityTypes { - // Paper end T t0 = this.createCreature(worldserver, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1); + if (t0 != null && op != null) op.accept(t0); // Paper + // Purpur start + if (spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG && itemstack != null && t0 != null) { diff --git a/patches/Purpur/patches/server/0015-Player-invulnerabilities.patch b/patches/Purpur/patches/server/0015-Player-invulnerabilities.patch index 1c49fdff..db408652 100644 --- a/patches/Purpur/patches/server/0015-Player-invulnerabilities.patch +++ b/patches/Purpur/patches/server/0015-Player-invulnerabilities.patch @@ -4,11 +4,11 @@ Date: Sat, 2 May 2020 20:55:44 -0500 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 e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c346d029cf1 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -154,6 +154,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index f30dcbd26ed56ba8f1a99260722a0b395c220954..7cd1ae92768164b657af9febe9b4feb7fd02f55a 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -284,6 +284,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.canPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper @@ -17,7 +17,7 @@ index e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c34 } // Paper start public BlockPosition getPointInFront(double inFront) { -@@ -989,6 +991,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1119,6 +1121,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } @@ -30,7 +30,7 @@ index e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c34 @Override public boolean damageEntity(DamageSource damagesource, float f) { if (this.isInvulnerable(damagesource)) { -@@ -996,7 +1004,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1126,7 +1134,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } else { boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex); @@ -39,7 +39,7 @@ index e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c34 return false; } else { if (damagesource instanceof EntityDamageSource) { -@@ -1172,6 +1180,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1302,6 +1310,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // Paper end @@ -47,7 +47,7 @@ index e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c34 return this; } } -@@ -2358,9 +2367,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -2488,9 +2497,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public boolean isFrozen() { // Paper - protected > public @@ -66,11 +66,11 @@ index e35fdbf915f627c2b9c9ca6314805006aa495e5f..ee1bb58ce2fdaa4cc347476b8f040c34 @Override 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 bba8dc8fd10dc34179ca3c8cf471fbb3739fa7b4..c586005b34c59710cf398e30924ff3653e0d62fd 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1737,6 +1737,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index 789cf1652fec8346c1ea3ca47d9ac43c0765528a..a056adcae8c4c46ede25fdd33aeab616a1af3a76 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -1882,6 +1882,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer()); // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; @@ -78,11 +78,11 @@ index bba8dc8fd10dc34179ca3c8cf471fbb3739fa7b4..c586005b34c59710cf398e30924ff365 player.getBukkitEntity().setResourcePackStatus(packStatus); this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus)); // Paper end -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index a12e58668e74f2287ddff5bedc00daf2b0a416c1..7f784709ab8c560fd2dae551b6c8c234a2d134c6 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -914,6 +914,8 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index ac98a3122ee30971b31761f3bc564b41d5ac879f..49acc6e43748a2d2a68f1b134421831b2feedd7b 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -998,6 +998,8 @@ public abstract class PlayerList { } // Paper end @@ -108,10 +108,10 @@ index 2578a4677d1ee060f687be531e696b7c7be89e84..c441fcea9b2b5a77b801c8a69541cf42 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index abf2a6b9d18f04baa077ededa3562a30dbaa4fe4..8bf29aca4b5aa0d51ed3cda25b37d30e6c986848 100644 +index f4052aaa2235894b996d65c569a083f1a09b59a3..1ff48eae5e5b732fbd1e720c55e08a30669bebfa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2498,5 +2498,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2507,5 +2507,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetIdleTimer() { getHandle().resetIdleTimer(); } diff --git a/patches/Purpur/patches/server/0016-Anvil-API.patch b/patches/Purpur/patches/server/0016-Anvil-API.patch index e7794f5e..8465320b 100644 --- a/patches/Purpur/patches/server/0016-Anvil-API.patch +++ b/patches/Purpur/patches/server/0016-Anvil-API.patch @@ -4,11 +4,25 @@ Date: Sun, 19 Apr 2020 00:17:56 -0500 Subject: [PATCH] Anvil API -diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de39f60e942 100644 ---- a/src/main/java/net/minecraft/server/ContainerAnvil.java -+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java -@@ -20,6 +20,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +diff --git a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java +index ae5674ae9c539720a657838a640050cd3b4dc5b5..1b2d633f3d5d735039f18f27fb1387bd5a74f0d8 100644 +--- a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java ++++ b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java +@@ -2,8 +2,13 @@ package net.minecraft.world.inventory; + + import java.util.Iterator; + import java.util.Map; ++ ++import net.minecraft.nbt.NBTTagInt; + import net.minecraft.network.chat.ChatComponentText; + import net.minecraft.network.chat.IChatBaseComponent; ++import net.minecraft.network.protocol.game.PacketPlayOutSetSlot; ++import net.minecraft.network.protocol.game.PacketPlayOutWindowData; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; + import net.minecraft.world.entity.player.EntityHuman; +@@ -33,6 +38,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract { public int maximumRepairCost = 40; private CraftInventoryView bukkitEntity; // CraftBukkit end @@ -17,7 +31,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 public ContainerAnvil(int i, PlayerInventory playerinventory) { this(i, playerinventory, ContainerAccess.a); -@@ -38,12 +40,14 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -51,12 +58,14 @@ public class ContainerAnvil extends ContainerAnvilAbstract { @Override protected boolean b(EntityHuman entityhuman, boolean flag) { @@ -33,7 +47,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 entityhuman.levelDown(-this.levelCost.get()); } -@@ -94,6 +98,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -107,6 +116,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract { @Override public void e() { @@ -46,7 +60,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 ItemStack itemstack = this.repairInventory.getItem(0); this.levelCost.set(1); -@@ -170,7 +180,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -183,7 +198,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { int i2 = (Integer) map1.get(enchantment); i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1); @@ -55,7 +69,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 if (this.player.abilities.canInstantlyBuild || itemstack.getItem() == Items.ENCHANTED_BOOK) { flag3 = true; -@@ -182,7 +192,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -195,7 +210,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract { Enchantment enchantment1 = (Enchantment) iterator1.next(); if (enchantment1 != enchantment && !enchantment.isCompatible(enchantment1)) { @@ -64,7 +78,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 ++i; } } -@@ -253,6 +263,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -266,6 +281,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract { this.levelCost.set(maximumRepairCost - 1); // CraftBukkit } @@ -78,7 +92,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit itemstack1 = ItemStack.b; } -@@ -274,6 +291,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -287,6 +309,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract { org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit this.c(); @@ -92,7 +106,7 @@ index fc2038df89f25c07f6f853f6df41fe9b203c3585..4aa6b035a6a8ea39401c6566cd286de3 } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java -index 9374c27061280e51bcbae24573eb5d36736c3e4f..d45f356be39cbe271cd2a257b9dac66b88a346fd 100644 +index fd59f77d78a97898657919a77405b39ca24cddc9..151c478c6cb19d88000da46b6fbb952e97e58c95 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java @@ -9,7 +9,7 @@ import org.bukkit.inventory.AnvilInventory; diff --git a/patches/Purpur/patches/server/0017-Configurable-villager-brain-ticks.patch b/patches/Purpur/patches/server/0017-Configurable-villager-brain-ticks.patch index 078a70d6..ec745238 100644 --- a/patches/Purpur/patches/server/0017-Configurable-villager-brain-ticks.patch +++ b/patches/Purpur/patches/server/0017-Configurable-villager-brain-ticks.patch @@ -4,11 +4,11 @@ Date: Tue, 23 Jul 2019 08:28:21 -0500 Subject: [PATCH] Configurable villager brain ticks -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..1c87bc91515490e2f8579a5321058845c7d30a56 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -56,6 +56,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index d8028675fc82883d716bcfb44431ca6ac7dfda36..5539c4cbea46398e92ab6ec56bb9b821e5f01e02 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -127,6 +127,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation }, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> { return villageplacetype == VillagePlaceType.s; }); @@ -16,7 +16,7 @@ index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..1c87bc91515490e2f8579a5321058845 public EntityVillager(EntityTypes entitytypes, World world) { this(entitytypes, world, VillagerType.PLAINS); -@@ -68,6 +69,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -139,6 +140,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation this.getNavigation().d(true); this.setCanPickupLoot(true); this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE)); @@ -24,7 +24,7 @@ index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..1c87bc91515490e2f8579a5321058845 } @Override -@@ -164,6 +166,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -237,6 +239,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void mobTick() { mobTick(false); } protected void mobTick(boolean inactive) { this.world.getMethodProfiler().enter("villagerBrain"); @@ -32,9 +32,9 @@ index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..1c87bc91515490e2f8579a5321058845 + boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; + if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) + // Purpur end - if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper - this.world.getMethodProfiler().exit(); - if (this.bF) { + if (!inactive) { + if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) { + this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index c441fcea9b2b5a77b801c8a69541cf42050927dc..c7fb5a737cab0083c39732247acb8f4e87562894 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java diff --git a/patches/Purpur/patches/server/0018-Alternative-Keepalive-Handling.patch b/patches/Purpur/patches/server/0018-Alternative-Keepalive-Handling.patch index 898dcc4f..6538d8c4 100644 --- a/patches/Purpur/patches/server/0018-Alternative-Keepalive-Handling.patch +++ b/patches/Purpur/patches/server/0018-Alternative-Keepalive-Handling.patch @@ -4,11 +4,11 @@ Date: Fri, 11 Oct 2019 00:17:39 -0500 Subject: [PATCH] Alternative Keepalive Handling -diff --git a/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java b/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java -index 8e93f1540ba5f995489c1fbcec70d10b011cd9c3..470f92c4fb0919d052b19acff8dff533724fbcc1 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java -+++ b/src/main/java/net/minecraft/server/PacketPlayInKeepAlive.java -@@ -22,6 +22,7 @@ public class PacketPlayInKeepAlive implements Packet { +diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java +index b4c37287362907b8507d156b978ba5b9d961bb7b..9e6e6636539702507abb78515e002819661027af 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java ++++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java +@@ -24,6 +24,7 @@ public class PacketPlayInKeepAlive implements Packet { packetdataserializer.writeLong(this.a); } @@ -16,11 +16,11 @@ index 8e93f1540ba5f995489c1fbcec70d10b011cd9c3..470f92c4fb0919d052b19acff8dff533 public long b() { return this.a; } -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c586005b34c59710cf398e30924ff3653e0d62fd..be29ecfa00d53ad2067015a5261184b4157c604b 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -86,6 +86,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index a056adcae8c4c46ede25fdd33aeab616a1af3a76..68200fe85fc4e66bb58dd35df306ba37604b6b94 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -231,6 +231,7 @@ public class PlayerConnection implements PacketListenerPlayIn { private long lastKeepAlive = SystemUtils.getMonotonicMillis(); private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER @@ -28,7 +28,7 @@ index c586005b34c59710cf398e30924ff3653e0d62fd..be29ecfa00d53ad2067015a5261184b4 // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); -@@ -220,6 +221,21 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -365,6 +366,21 @@ public class PlayerConnection implements PacketListenerPlayIn { long currentTime = SystemUtils.getMonotonicMillis(); long elapsedTime = currentTime - this.getLastPing(); @@ -50,7 +50,7 @@ index c586005b34c59710cf398e30924ff3653e0d62fd..be29ecfa00d53ad2067015a5261184b4 if (this.isPendingPing()) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info -@@ -2908,6 +2924,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -3053,6 +3069,16 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInKeepAlive packetplayinkeepalive) { @@ -68,7 +68,7 @@ index c586005b34c59710cf398e30924ff3653e0d62fd..be29ecfa00d53ad2067015a5261184b4 if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) { int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index a34ed978596f1a466b0b48e7db92ac4f1345a996..9593ac057ef5b79fb54501d7cce1e69e49102918 100644 +index b54ea480321a3d9153a89e842787b27875e43ef4..c856e5bd83f0b6582efdad036262511ff89ec49f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -155,6 +155,11 @@ public class PurpurConfig { diff --git a/patches/Purpur/patches/server/0019-Silk-touch-spawners.patch b/patches/Purpur/patches/server/0019-Silk-touch-spawners.patch index 21764ba8..5f72d5aa 100644 --- a/patches/Purpur/patches/server/0019-Silk-touch-spawners.patch +++ b/patches/Purpur/patches/server/0019-Silk-touch-spawners.patch @@ -5,23 +5,103 @@ Subject: [PATCH] Silk touch spawners diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -index c45d48cef53476fa1602cebaa57c72894bba10d3..8a8ad2a0dc50de1f7f911d0547480b65d03fee0c 100644 +index 71938ad7b3494e803beca7e4022aad12a51f2096..0b77884d8134c328f8fd1bbb8230d260606dc5ee 100644 --- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java -@@ -82,6 +82,7 @@ public final class PaperAdventure { +@@ -81,6 +81,7 @@ public final class PaperAdventure { + }) .build(); public static final LegacyComponentSerializer LEGACY_SECTION_UXRC = LegacyComponentSerializer.builder().flattener(FLATTENER).hexColors().useUnusualXRepeatedCharacterHexFormat().build(); - public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build(); + public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.builder().character(LegacyComponentSerializer.AMPERSAND_CHAR).hexColors().build(); // Purpur + public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build(); static final GsonComponentSerializer GSON = GsonComponentSerializer.builder() .legacyHoverEventSerializer(NBTLegacyHoverEventSerializer.INSTANCE) - .build(); -diff --git a/src/main/java/net/minecraft/server/BlockMobSpawner.java b/src/main/java/net/minecraft/server/BlockMobSpawner.java -index 81e145ff0759322f74888c81df8d2133fece7144..567a6a064254d99ae6a931b91e6bdd94badb19fc 100644 ---- a/src/main/java/net/minecraft/server/BlockMobSpawner.java -+++ b/src/main/java/net/minecraft/server/BlockMobSpawner.java -@@ -1,5 +1,17 @@ - package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java +new file mode 100644 +index 0000000000000000000000000000000000000000..599672ed4d0fc412ad3c0fa2e9d9df7035694fa2 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/ItemSpawner.java +@@ -0,0 +1,35 @@ ++package net.minecraft.server; ++ ++import net.minecraft.core.BlockPosition; ++import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.item.ItemBlock; ++import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.level.World; ++import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.entity.TileEntity; ++import net.minecraft.world.level.block.entity.TileEntityMobSpawner; ++import net.minecraft.world.level.block.state.IBlockData; ++ ++public class ItemSpawner extends ItemBlock { ++ public ItemSpawner(Block block, Info info) { ++ super(block, info); ++ } ++ ++ @Override ++ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) { ++ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata); ++ if (world.purpurConfig.silkTouchEnabled && entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) { ++ TileEntity spawner = world.getTileEntity(blockposition); ++ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) { ++ NBTTagCompound tag = itemstack.getTag(); ++ if (tag.hasKey("Purpur.mob_type")) { ++ EntityTypes.getByName(tag.getString("Purpur.mob_type")).ifPresent(type -> ++ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type)); ++ } ++ } ++ } ++ return handled; ++ } ++} +diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java +index fc5cc610e7ea584ce72600b9d9f47543265725bb..8e9a25495d76251a86268d3059e2960a86dc46b3 100644 +--- a/src/main/java/net/minecraft/world/item/Items.java ++++ b/src/main/java/net/minecraft/world/item/Items.java +@@ -2,6 +2,7 @@ package net.minecraft.world.item; + + import net.minecraft.core.IRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.ItemSpawner; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumItemSlot; +@@ -193,7 +194,7 @@ public class Items { + public static final Item ct = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b); + public static final Item cu = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b); + public static final Item cv = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b); +- public static final Item cw = a(Blocks.SPAWNER); ++ public static final Item cw = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur + public static final Item cx = a(Blocks.OAK_STAIRS, CreativeModeTab.b); + public static final Item cy = a(Blocks.CHEST, CreativeModeTab.c); + public static final Item cz = a(Blocks.DIAMOND_ORE, CreativeModeTab.b); +diff --git a/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java b/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java +index 287dd5f1b2b913df4029966860cd1a426947b187..af3c1a6307fb9e244226794508382d2ffa2aeb4b 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java +@@ -1,14 +1,35 @@ + package net.minecraft.world.level.block; + + import net.minecraft.core.BlockPosition; ++import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.nbt.NBTTagList; ++import net.minecraft.nbt.NBTTagString; ++import net.minecraft.resources.MinecraftKey; + import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.enchantment.EnchantmentManager; ++import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.IBlockAccess; ++import net.minecraft.world.level.World; + import net.minecraft.world.level.block.entity.TileEntity; + import net.minecraft.world.level.block.entity.TileEntityMobSpawner; + import net.minecraft.world.level.block.state.BlockBase; + import net.minecraft.world.level.block.state.IBlockData; +// Purpur start +import io.papermc.paper.adventure.PaperAdventure; @@ -38,7 +118,7 @@ index 81e145ff0759322f74888c81df8d2133fece7144..567a6a064254d99ae6a931b91e6bdd94 public class BlockMobSpawner extends BlockTileEntity { protected BlockMobSpawner(BlockBase.Info blockbase_info) { -@@ -11,6 +23,59 @@ public class BlockMobSpawner extends BlockTileEntity { +@@ -20,6 +41,59 @@ public class BlockMobSpawner extends BlockTileEntity { return new TileEntityMobSpawner(); } @@ -98,7 +178,7 @@ index 81e145ff0759322f74888c81df8d2133fece7144..567a6a064254d99ae6a931b91e6bdd94 @Override public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) { super.dropNaturally(iblockdata, worldserver, blockposition, itemstack); -@@ -23,6 +88,7 @@ public class BlockMobSpawner extends BlockTileEntity { +@@ -32,6 +106,7 @@ public class BlockMobSpawner extends BlockTileEntity { @Override public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) { @@ -106,59 +186,17 @@ index 81e145ff0759322f74888c81df8d2133fece7144..567a6a064254d99ae6a931b91e6bdd94 int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15); return i; -diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java -new file mode 100644 -index 0000000000000000000000000000000000000000..5c7f73918542bbdbc8d8f97671f24091fc6cb83b ---- /dev/null -+++ b/src/main/java/net/minecraft/server/ItemSpawner.java -@@ -0,0 +1,23 @@ -+package net.minecraft.server; -+ -+public class ItemSpawner extends ItemBlock { -+ public ItemSpawner(Block block, Info info) { -+ super(block, info); -+ } -+ -+ @Override -+ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) { -+ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata); -+ if (world.purpurConfig.silkTouchEnabled && entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) { -+ TileEntity spawner = world.getTileEntity(blockposition); -+ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) { -+ NBTTagCompound tag = itemstack.getTag(); -+ if (tag.hasKey("Purpur.mob_type")) { -+ EntityTypes.getByName(tag.getString("Purpur.mob_type")).ifPresent(type -> -+ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type)); -+ } -+ } -+ } -+ return handled; -+ } -+} -diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java -index 1c861bccc2652057cb154667a5bf7269092b2db4..67ebcbe4daa1ef3cef6ca43ec92befbe4156842e 100644 ---- a/src/main/java/net/minecraft/server/Items.java -+++ b/src/main/java/net/minecraft/server/Items.java -@@ -180,7 +180,7 @@ public class Items { - public static final Item ct = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b); - public static final Item cu = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b); - public static final Item cv = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b); -- public static final Item cw = a(Blocks.SPAWNER); -+ public static final Item cw = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur - public static final Item cx = a(Blocks.OAK_STAIRS, CreativeModeTab.b); - public static final Item cy = a(Blocks.CHEST, CreativeModeTab.c); - public static final Item cz = a(Blocks.DIAMOND_ORE, CreativeModeTab.b); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index c7fb5a737cab0083c39732247acb8f4e87562894..ba89efb3159ab04a6239865967f93055cb6be7a9 100644 +index c7fb5a737cab0083c39732247acb8f4e87562894..10a6fcd70869719ed2b2d1442a83ab912e00c898 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1,6 +1,12 @@ package net.pl3x.purpur; -+import net.minecraft.server.IRegistry; -+import net.minecraft.server.Item; -+import net.minecraft.server.Items; -+import net.minecraft.server.MinecraftKey; ++import net.minecraft.core.IRegistry; ++import net.minecraft.world.item.Item; ++import net.minecraft.world.item.Items; ++import net.minecraft.resources.MinecraftKey; import org.bukkit.configuration.ConfigurationSection; + +import java.util.ArrayList; diff --git a/patches/Purpur/patches/server/0020-MC-168772-Fix-Add-turtle-egg-block-options.patch b/patches/Purpur/patches/server/0020-MC-168772-Fix-Add-turtle-egg-block-options.patch index 2c3888d6..ae221310 100644 --- a/patches/Purpur/patches/server/0020-MC-168772-Fix-Add-turtle-egg-block-options.patch +++ b/patches/Purpur/patches/server/0020-MC-168772-Fix-Add-turtle-egg-block-options.patch @@ -4,11 +4,27 @@ Date: Thu, 6 Jun 2019 22:15:46 -0500 Subject: [PATCH] MC-168772 Fix - Add turtle egg block options -diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java -index 00c37493c28805558dea06a20973f32ab0359016..0f147dc938cef428452bd3137c68b52a78f9fbde 100644 ---- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java -+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java -@@ -163,6 +163,23 @@ public class BlockTurtleEgg extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java +index 6093d4c7431a286477c9be97163ea8d64168c3b0..04504901b1933ed760b34b8abb994de8ec340a4e 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java +@@ -9,12 +9,15 @@ import net.minecraft.sounds.SoundEffects; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; + import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.ambient.EntityBat; + import net.minecraft.world.entity.animal.EntityTurtle; ++import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.entity.monster.EntityZombie; + import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.entity.vehicle.EntityMinecartAbstract; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.context.BlockActionContext; + import net.minecraft.world.level.GameRules; +@@ -189,6 +192,23 @@ public class BlockTurtleEgg extends Block { } private boolean a(World world, Entity entity) { @@ -34,7 +50,7 @@ index 00c37493c28805558dea06a20973f32ab0359016..0f147dc938cef428452bd3137c68b52a } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ba89efb3159ab04a6239865967f93055cb6be7a9..f403f9dc6cd148b9f9c901f27ce6a77d4225a53f 100644 +index 10a6fcd70869719ed2b2d1442a83ab912e00c898..2f18ca7ae23e913155f25fd07627f376e401ab0f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -104,6 +104,15 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0021-Fix-vanilla-command-permission-handler.patch b/patches/Purpur/patches/server/0021-Fix-vanilla-command-permission-handler.patch index 6e928c66..6a393adb 100644 --- a/patches/Purpur/patches/server/0021-Fix-vanilla-command-permission-handler.patch +++ b/patches/Purpur/patches/server/0021-Fix-vanilla-command-permission-handler.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix vanilla command permission handler diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index d9c47f3fc18266df3be1f564c01dfc3e26941380..cf35c9d545582173f81347a656faf1940892716f 100644 +index c0fac7369b111e65b896a15848ae22457e5e8914..5278997e522b495b83e53cac5968388d6eca45e4 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -35,6 +35,7 @@ public abstract class CommandNode implements Comparable> { @@ -17,7 +17,7 @@ index d9c47f3fc18266df3be1f564c01dfc3e26941380..cf35c9d545582173f81347a656faf194 public void removeCommand(String name) { children.remove(name); diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -index f34461460049a80c5ff57805927053a36a4db426..8d89e671eb9081f9198f2b2b2ae0b7bd186c1522 100644 +index 5702f18cd39c1e7b5614c28a628108e2204b2ec1..b069ee845b2011b2c669b6c75d0a773f52e06e10 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -87,6 +87,7 @@ public final class VanillaCommandWrapper extends BukkitCommand { diff --git a/patches/Purpur/patches/server/0022-Logger-settings-suppressing-pointless-logs.patch b/patches/Purpur/patches/server/0022-Logger-settings-suppressing-pointless-logs.patch index 467241db..cff6db86 100644 --- a/patches/Purpur/patches/server/0022-Logger-settings-suppressing-pointless-logs.patch +++ b/patches/Purpur/patches/server/0022-Logger-settings-suppressing-pointless-logs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Logger settings (suppressing pointless logs) diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index c680319e4040be2b60795b22a5e65d6444cc67ed..eaa1063ff2bc5621e93043c4de41ca62f1323fde 100644 +index 7a8a1960882e291c46301d07da3e1c5415516893..59d781b5e61c5d2c004bc92300d8d42e81821308 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -@@ -170,6 +170,7 @@ public class AdvancementDataPlayer { +@@ -189,6 +189,7 @@ public class AdvancementDataPlayer { if (advancement == null) { // CraftBukkit start if (entry.getKey().getNamespace().equals("minecraft")) { @@ -17,7 +17,7 @@ index c680319e4040be2b60795b22a5e65d6444cc67ed..eaa1063ff2bc5621e93043c4de41ca62 } // CraftBukkit end diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index 9593ac057ef5b79fb54501d7cce1e69e49102918..ec8efc913f8f0bf6ff559a3a5b439a3d24f3a9b6 100644 +index c856e5bd83f0b6582efdad036262511ff89ec49f..d3c51f1083c4d4df8e413f47d0636ec829dc37a4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -178,4 +178,11 @@ public class PurpurConfig { @@ -33,7 +33,7 @@ index 9593ac057ef5b79fb54501d7cce1e69e49102918..ec8efc913f8f0bf6ff559a3a5b439a3d + } } diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java -index b14333ce9e6921024bc93c2847b84f1fb40a5508..d25204f7d4af1ddd37005ccbcbe6c03d8eefcf47 100644 +index b86604cbf3543b978df000d8f74c6185aa2ae7ec..5df82b0409278bd298e837aa43941247de3f94fe 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java @@ -254,6 +254,7 @@ public final class CraftLegacy { diff --git a/patches/Purpur/patches/server/0023-Disable-outdated-build-check.patch b/patches/Purpur/patches/server/0023-Disable-outdated-build-check.patch index 87d21d81..5cf42bd3 100644 --- a/patches/Purpur/patches/server/0023-Disable-outdated-build-check.patch +++ b/patches/Purpur/patches/server/0023-Disable-outdated-build-check.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable outdated build check diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index a92721dff5c2a9a2a167b36c23d1ef22d2bbd3e1..b10873022efc8f01ef172e86cad07831d7bf0d5e 100644 +index d28088d510a4a40f3948f224a40a63de4645fa42..a471a3a4191872dae5da7e4f7b41de4491040d5d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -259,7 +259,7 @@ public class Main { +@@ -261,7 +261,7 @@ public class Main { System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } diff --git a/patches/Purpur/patches/server/0024-Giants-AI-settings.patch b/patches/Purpur/patches/server/0024-Giants-AI-settings.patch index 66320129..84798f01 100644 --- a/patches/Purpur/patches/server/0024-Giants-AI-settings.patch +++ b/patches/Purpur/patches/server/0024-Giants-AI-settings.patch @@ -4,11 +4,11 @@ Date: Sun, 12 May 2019 00:43:12 -0500 Subject: [PATCH] Giants AI settings -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2ec48858be8eb2c522c9685b43bd36b3b581cf8b..7cafc89e048e43f339f5289f38674b18d052e70d 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index c6b4af810fe3bda7797ab94316b2357178c9cd49..b7c72eaf5715a30bb8f82891f9830f9f62ec03c9 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -228,7 +228,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne public double D; public double E; public double F; @@ -17,11 +17,94 @@ index 2ec48858be8eb2c522c9685b43bd36b3b581cf8b..7cafc89e048e43f339f5289f38674b18 public boolean noclip; public float I; protected final Random random; -diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java -index 9f4f56c47ecd4b35ebf33ca0bf9a040074ababf2..565c938d879940d8e12fe320ea8524d2cf679c1f 100644 ---- a/src/main/java/net/minecraft/server/EntityGiantZombie.java -+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java -@@ -4,9 +4,66 @@ public class EntityGiantZombie extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index f4440a5c4aedb1d7d303517f86a07c856dd1309b..7443fe924486404931c11793acc67e2f03de4e41 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -1020,6 +1020,7 @@ public abstract class EntityInsentient extends EntityLiving { + return f; + } + ++ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER + protected void a(DifficultyDamageScaler difficultydamagescaler) { + if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) { + int i = this.random.nextInt(2); +@@ -1127,6 +1128,7 @@ public abstract class EntityInsentient extends EntityLiving { + } + } + ++ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER + protected void b(DifficultyDamageScaler difficultydamagescaler) { + float f = difficultydamagescaler.d(); + +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 30aabde3d6703eefcb6d57bab43666b97197ba1f..ffc5ca763a22a1c4d06ffdb72c30482c13ec0a7b 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -261,6 +261,7 @@ public abstract class EntityLiving extends Entity { + this.activeItem = ItemStack.b; + this.by = Optional.empty(); + this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes)); ++ this.initAttributes(); // Purpur + this.craftAttributes = new CraftAttributeMap(attributeMap); // CraftBukkit + // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor + this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.MAX_HEALTH).getValue()); +@@ -276,6 +277,8 @@ public abstract class EntityLiving extends Entity { + this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap())))); + } + ++ protected void initAttributes() {} // Purpur ++ + public BehaviorController getBehaviorController() { + return this.bg; + } +@@ -2276,7 +2279,7 @@ public abstract class EntityLiving extends Entity { + this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z); + } + +- protected float dJ() { ++ protected float dJ() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER + return 0.42F * this.getBlockJumpFactor(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +index 5e6a92dcdbca686d5a8cfc4aaff72b70b81b111f..a188a89143cb1b0243dacdec33c446ca4120219f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +@@ -1,21 +1,99 @@ + package net.minecraft.world.entity.monster; + + import net.minecraft.core.BlockPosition; ++import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.world.DifficultyDamageScaler; ++import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.EnumItemSlot; ++import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsRestriction; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand; ++import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget; ++import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget; ++import net.minecraft.world.entity.animal.EntityIronGolem; ++import net.minecraft.world.entity.animal.EntityTurtle; ++import net.minecraft.world.entity.npc.EntityVillager; ++import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.Items; + import net.minecraft.world.level.IWorldReader; + import net.minecraft.world.level.World; ++import net.minecraft.world.level.WorldAccess; + + public class EntityGiantZombie extends EntityMonster { public EntityGiantZombie(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -89,7 +172,7 @@ index 9f4f56c47ecd4b35ebf33ca0bf9a040074ababf2..565c938d879940d8e12fe320ea8524d2 @Override protected float b(EntityPose entitypose, EntitySize entitysize) { return 10.440001F; -@@ -18,6 +75,6 @@ public class EntityGiantZombie extends EntityMonster { +@@ -27,6 +105,6 @@ public class EntityGiantZombie extends EntityMonster { @Override public float a(BlockPosition blockposition, IWorldReader iworldreader) { @@ -97,58 +180,8 @@ index 9f4f56c47ecd4b35ebf33ca0bf9a040074ababf2..565c938d879940d8e12fe320ea8524d2 + return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns } } -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index a47217c020d2c2a3caddafa0549dc827373798dd..07908edcaffb5ee1be8a71f3f0affb91c7e6e51b 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -950,6 +950,7 @@ public abstract class EntityInsentient extends EntityLiving { - return f; - } - -+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER - protected void a(DifficultyDamageScaler difficultydamagescaler) { - if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) { - int i = this.random.nextInt(2); -@@ -1057,6 +1058,7 @@ public abstract class EntityInsentient extends EntityLiving { - } - } - -+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER - protected void b(DifficultyDamageScaler difficultydamagescaler) { - float f = difficultydamagescaler.d(); - -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ebe18e5926bb9e7d2dacdb09c213c0ad6fb847c4..996242d7c62984b67b9443356c509d0c7c85e33a 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -166,6 +166,7 @@ public abstract class EntityLiving extends Entity { - this.activeItem = ItemStack.b; - this.by = Optional.empty(); - this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes)); -+ this.initAttributes(); // Purpur - this.craftAttributes = new CraftAttributeMap(attributeMap); // CraftBukkit - // CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor - this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.MAX_HEALTH).getValue()); -@@ -181,6 +182,8 @@ public abstract class EntityLiving extends Entity { - this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap())))); - } - -+ protected void initAttributes() {} // Purpur -+ - public BehaviorController getBehaviorController() { - return this.bg; - } -@@ -2179,7 +2182,7 @@ public abstract class EntityLiving extends Entity { - this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z); - } - -- protected float dJ() { -+ protected float dJ() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER - return 0.42F * this.getBlockJumpFactor(); - } - diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f403f9dc6cd148b9f9c901f27ce6a77d4225a53f..3207b8b6166bd28796cb9c199c3ab466f7c0a02e 100644 +index 2f18ca7ae23e913155f25fd07627f376e401ab0f..1c87c929aaae17631100d1aa30b3e7ecce52686f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -113,6 +113,28 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0025-Illusioners-AI-settings.patch b/patches/Purpur/patches/server/0025-Illusioners-AI-settings.patch index de8ef59b..ffcf44ac 100644 --- a/patches/Purpur/patches/server/0025-Illusioners-AI-settings.patch +++ b/patches/Purpur/patches/server/0025-Illusioners-AI-settings.patch @@ -4,11 +4,11 @@ Date: Fri, 5 Jul 2019 11:09:25 -0500 Subject: [PATCH] Illusioners AI settings -diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index 50442b3a498d1bab4270e69952a79f5182153ece..c57bf5091430709778dc21d70c8a32819c9d6639 100644 ---- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -@@ -19,6 +19,15 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java +index fee9a5140f097225b5da58b18bfbd528dffdc77b..cb092bee9d6827d4b0276bfa9b033cf7ca86ead4 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java +@@ -56,6 +56,15 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan } @@ -25,7 +25,7 @@ index 50442b3a498d1bab4270e69952a79f5182153ece..c57bf5091430709778dc21d70c8a3281 protected void initPathfinder() { super.initPathfinder(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 3207b8b6166bd28796cb9c199c3ab466f7c0a02e..5c716a6b4f9ff33912ebb274b36eef70679ea87b 100644 +index 1c87c929aaae17631100d1aa30b3e7ecce52686f..d6bd971a62af7341f8dc8b3afe32786ced6fcd41 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -135,6 +135,20 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0026-Zombie-horse-naturally-spawn.patch b/patches/Purpur/patches/server/0026-Zombie-horse-naturally-spawn.patch index 61d76318..5735e1e3 100644 --- a/patches/Purpur/patches/server/0026-Zombie-horse-naturally-spawn.patch +++ b/patches/Purpur/patches/server/0026-Zombie-horse-naturally-spawn.patch @@ -4,11 +4,19 @@ Date: Sun, 7 Jul 2019 19:52:16 -0500 Subject: [PATCH] Zombie horse naturally spawn -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index be532af2a0de6927a268c631c25f062f370c72ba..4f0159cd0b7a438084a3fc9cf681dbce6e41a125 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1104,12 +1104,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 9a99edb041cfd311212c014fd17aed88b232b074..9d4ceaebf43b349454f10abfb5bb995d084c11fb 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace; + import net.minecraft.world.entity.ai.village.poi.VillagePlaceType; + import net.minecraft.world.entity.animal.EntityAnimal; + import net.minecraft.world.entity.animal.EntityWaterAnimal; ++import net.minecraft.world.entity.animal.horse.EntityHorseAbstract; + import net.minecraft.world.entity.animal.horse.EntityHorseSkeleton; + import net.minecraft.world.entity.boss.EntityComplexPart; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; +@@ -1220,12 +1221,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper if (flag1) { @@ -34,7 +42,7 @@ index be532af2a0de6927a268c631c25f062f370c72ba..4f0159cd0b7a438084a3fc9cf681dbce EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5c716a6b4f9ff33912ebb274b36eef70679ea87b..04dfb820053925c2835bdcec702d5a467a9fe48e 100644 +index d6bd971a62af7341f8dc8b3afe32786ced6fcd41..81b0e17a4bc5022ea757f03c2546808148d6e957 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -155,4 +155,9 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0027-Charged-creeper-naturally-spawn.patch b/patches/Purpur/patches/server/0027-Charged-creeper-naturally-spawn.patch index c35e4b07..3f2e7f99 100644 --- a/patches/Purpur/patches/server/0027-Charged-creeper-naturally-spawn.patch +++ b/patches/Purpur/patches/server/0027-Charged-creeper-naturally-spawn.patch @@ -4,11 +4,36 @@ Date: Fri, 29 Nov 2019 22:37:44 -0600 Subject: [PATCH] Charged creeper naturally spawn -diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index b2f028422d9a7a84e49e383b78032feb887a85c0..ff80ac7db73b7c7dd6ac62ac128af1cab961d075 100644 ---- a/src/main/java/net/minecraft/server/EntityCreeper.java -+++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -24,6 +24,17 @@ public class EntityCreeper extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +index 9c8abb18c0ed850939b6691396f5d551e13c7af9..1986f6a672b97c1f0366bdb76e185815b8ca3bd6 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +@@ -9,6 +9,7 @@ import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; ++import net.minecraft.world.DifficultyDamageScaler; + import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.damagesource.DamageSource; +@@ -17,6 +18,8 @@ import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityAreaEffectCloud; + import net.minecraft.world.entity.EntityLightning; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget; +@@ -39,6 +42,7 @@ import net.minecraft.world.level.IMaterial; + import net.minecraft.world.level.World; + + // CraftBukkit start ++import net.minecraft.world.level.WorldAccess; + import org.bukkit.craftbukkit.event.CraftEventFactory; + import org.bukkit.event.entity.CreatureSpawnEvent; + import org.bukkit.event.entity.ExplosionPrimeEvent; +@@ -59,6 +63,17 @@ public class EntityCreeper extends EntityMonster { super(entitytypes, world); } @@ -27,7 +52,7 @@ index b2f028422d9a7a84e49e383b78032feb887a85c0..ff80ac7db73b7c7dd6ac62ac128af1ca protected void initPathfinder() { this.goalSelector.a(1, new PathfinderGoalFloat(this)); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 04dfb820053925c2835bdcec702d5a467a9fe48e..5b8961a061c4a877cfa856f6d9f6d77060060829 100644 +index 81b0e17a4bc5022ea757f03c2546808148d6e957..638ee71a78d9e75de6ddd7f0aec67a023bb8c06a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -113,6 +113,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0028-Rabbit-naturally-spawn-toast-and-killer.patch b/patches/Purpur/patches/server/0028-Rabbit-naturally-spawn-toast-and-killer.patch index 11dbd070..53243413 100644 --- a/patches/Purpur/patches/server/0028-Rabbit-naturally-spawn-toast-and-killer.patch +++ b/patches/Purpur/patches/server/0028-Rabbit-naturally-spawn-toast-and-killer.patch @@ -4,11 +4,11 @@ Date: Sat, 31 Aug 2019 17:47:11 -0500 Subject: [PATCH] Rabbit naturally spawn toast and killer -diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index 80a4a71753a1fd9f62e75f0b4ea9307ed7072c4f..f17608730fca96af4f9779863a8c25723a3bd5cf 100644 ---- a/src/main/java/net/minecraft/server/EntityRabbit.java -+++ b/src/main/java/net/minecraft/server/EntityRabbit.java -@@ -297,6 +297,10 @@ public class EntityRabbit extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +index dcbb07fb6ab799d4526a2da0614c193c7abba715..180fc927074dc683ad4d482a00dd4e04ff7923d0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +@@ -352,6 +352,10 @@ public class EntityRabbit extends EntityAnimal { if (!this.hasCustomName()) { this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bp))); } @@ -19,7 +19,7 @@ index 80a4a71753a1fd9f62e75f0b4ea9307ed7072c4f..f17608730fca96af4f9779863a8c2572 } this.datawatcher.set(EntityRabbit.bo, i); -@@ -318,6 +322,16 @@ public class EntityRabbit extends EntityAnimal { +@@ -373,6 +377,16 @@ public class EntityRabbit extends EntityAnimal { } private int a(GeneratorAccess generatoraccess) { @@ -37,7 +37,7 @@ index 80a4a71753a1fd9f62e75f0b4ea9307ed7072c4f..f17608730fca96af4f9779863a8c2572 int i = this.random.nextInt(100); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5b8961a061c4a877cfa856f6d9f6d77060060829..f51f60110dd6117979b9d9b230065ad21135824c 100644 +index 638ee71a78d9e75de6ddd7f0aec67a023bb8c06a..6dcfbebd850d71587da5a78a3acf09d8ae413072 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -154,6 +154,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0029-Fix-outdated-server-showing-in-ping-before-server-fu.patch b/patches/Purpur/patches/server/0029-Fix-outdated-server-showing-in-ping-before-server-fu.patch index 40454d09..fecb9d6b 100644 --- a/patches/Purpur/patches/server/0029-Fix-outdated-server-showing-in-ping-before-server-fu.patch +++ b/patches/Purpur/patches/server/0029-Fix-outdated-server-showing-in-ping-before-server-fu.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Fix 'outdated server' showing in ping before server fully boots -diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java -index d0fad346dd4511722f958a8c0bda67492184fb62..1df22ad7b35d6bd974e7fe805920542654c1b9d0 100644 ---- a/src/main/java/net/minecraft/server/PacketStatusListener.java -+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java -@@ -133,6 +133,7 @@ public class PacketStatusListener implements PacketStatusInListener { +diff --git a/src/main/java/net/minecraft/server/network/PacketStatusListener.java b/src/main/java/net/minecraft/server/network/PacketStatusListener.java +index e1997563984540e6edf5d3b697d029dc5f3c40e1..847c91305d23b99e612b9e5f988df14d3fb84a8c 100644 +--- a/src/main/java/net/minecraft/server/network/PacketStatusListener.java ++++ b/src/main/java/net/minecraft/server/network/PacketStatusListener.java +@@ -146,6 +146,7 @@ public class PacketStatusListener implements PacketStatusInListener { this.networkManager.sendPacket(new PacketStatusOutServerInfo(ping)); */ diff --git a/patches/Purpur/patches/server/0030-Make-Iron-Golems-Swim.patch b/patches/Purpur/patches/server/0030-Make-Iron-Golems-Swim.patch index 04f7ed16..13b90cad 100644 --- a/patches/Purpur/patches/server/0030-Make-Iron-Golems-Swim.patch +++ b/patches/Purpur/patches/server/0030-Make-Iron-Golems-Swim.patch @@ -4,11 +4,19 @@ Date: Sat, 15 Jun 2019 03:12:15 -0500 Subject: [PATCH] Make Iron Golems Swim -diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java -index 0a5c27e732540e03c87e6da0fbdc6e3c2e382810..bdff2368836dca230a6622a205d5772834afc6ee 100644 ---- a/src/main/java/net/minecraft/server/EntityIronGolem.java -+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java -@@ -24,6 +24,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +index 5e2b49d120b724cb5a7ae00940ded4f4875ea8a1..62cff5faafa076d05ebc59ad5c4fb020bea0509e 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +@@ -30,6 +30,7 @@ import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.IEntityAngerable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; + import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack; + import net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsTarget; +@@ -70,6 +71,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { @Override protected void initPathfinder() { @@ -17,7 +25,7 @@ index 0a5c27e732540e03c87e6da0fbdc6e3c2e382810..bdff2368836dca230a6622a205d57728 this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F)); this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false)); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f51f60110dd6117979b9d9b230065ad21135824c..3ec33a96396e49d1ddb9f7eea804e4ae8080efbd 100644 +index 6dcfbebd850d71587da5a78a3acf09d8ae413072..decd0e755deede2b092866a8f7f6b46520435bbe 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -154,6 +154,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0031-Dont-send-useless-entity-packets.patch b/patches/Purpur/patches/server/0031-Dont-send-useless-entity-packets.patch index 7ce1309a..a363d91e 100644 --- a/patches/Purpur/patches/server/0031-Dont-send-useless-entity-packets.patch +++ b/patches/Purpur/patches/server/0031-Dont-send-useless-entity-packets.patch @@ -4,11 +4,32 @@ Date: Sat, 6 Jul 2019 17:00:04 -0500 Subject: [PATCH] Dont send useless entity packets -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 2402c18e6a18221a43bea9fc68278da9d19eede4..e51b6bd0698593867e6821326d223770766d717f 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -172,6 +172,7 @@ public class EntityTrackerEntry { +diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutEntity.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutEntity.java +index 0eed10a6c4e0c7245f219d19ed1e2e5c94364db9..2b54a5f3347f788b751892105f888663bb349629 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutEntity.java ++++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutEntity.java +@@ -9,11 +9,11 @@ import net.minecraft.world.phys.Vec3D; + public class PacketPlayOutEntity implements Packet { + + protected int a; +- protected short b; +- protected short c; +- protected short d; +- protected byte e; +- protected byte f; ++ protected short b; public short getX() { return b; } // Purpur - OBFHELPER ++ protected short c; public short getY() { return c; } // Purpur - OBFHELPER ++ protected short d; public short getZ() { return d; } // Purpur - OBFHELPER ++ protected byte e; public byte getYaw() { return e; } // Purpur - OBFHELPER ++ protected byte f; public byte getPitch() { return f; } // Purpur - OBFHELPER + protected boolean g; + protected boolean h; + protected boolean i; +diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +index c830b257054b7f8153aa9225c1f61f49a6ea0a84..3a66a34db2b8ac612431131cea80e57ee72de05f 100644 +--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +@@ -209,6 +209,7 @@ public class EntityTrackerEntry { this.o = 0; packet1 = new PacketPlayOutEntityTeleport(this.tracker); } @@ -16,7 +37,7 @@ index 2402c18e6a18221a43bea9fc68278da9d19eede4..e51b6bd0698593867e6821326d223770 } if ((this.e || this.tracker.impulse || this.tracker instanceof EntityLiving && ((EntityLiving) this.tracker).isGliding()) && this.tickCounter > 0) { -@@ -258,6 +259,22 @@ public class EntityTrackerEntry { +@@ -302,6 +303,22 @@ public class EntityTrackerEntry { } @@ -39,29 +60,8 @@ index 2402c18e6a18221a43bea9fc68278da9d19eede4..e51b6bd0698593867e6821326d223770 public void a(EntityPlayer entityplayer) { this.tracker.c(entityplayer); entityplayer.c(this.tracker); -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java -index 8e48407fd405ac4c3eece7762b8155c5d0f00fa0..91c4e658230bb8bbce9d0f56db0768a7c09f0095 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java -@@ -5,11 +5,11 @@ import java.io.IOException; - public class PacketPlayOutEntity implements Packet { - - protected int a; -- protected short b; -- protected short c; -- protected short d; -- protected byte e; -- protected byte f; -+ protected short b; public short getX() { return b; } // Purpur - OBFHELPER -+ protected short c; public short getY() { return c; } // Purpur - OBFHELPER -+ protected short d; public short getZ() { return d; } // Purpur - OBFHELPER -+ protected byte e; public byte getYaw() { return e; } // Purpur - OBFHELPER -+ protected byte f; public byte getPitch() { return f; } // Purpur - OBFHELPER - protected boolean g; - protected boolean h; - protected boolean i; diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index ec8efc913f8f0bf6ff559a3a5b439a3d24f3a9b6..a2f3c5c81d93814f89a778c8c58d36b416ea1efc 100644 +index d3c51f1083c4d4df8e413f47d0636ec829dc37a4..d12749a8084ede08d8efa80db279511f3c84b044 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -179,6 +179,11 @@ public class PurpurConfig { diff --git a/patches/Purpur/patches/server/0032-Tulips-change-fox-type.patch b/patches/Purpur/patches/server/0032-Tulips-change-fox-type.patch index 1be43418..4c440e6e 100644 --- a/patches/Purpur/patches/server/0032-Tulips-change-fox-type.patch +++ b/patches/Purpur/patches/server/0032-Tulips-change-fox-type.patch @@ -4,11 +4,20 @@ Date: Sat, 13 Jul 2019 15:56:22 -0500 Subject: [PATCH] Tulips change fox type -diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 56c119e8d11c5ffb1f90ac4249bce434b3e78884..8845afd83d47902d5192ec1a9146b6f20c5667d3 100644 ---- a/src/main/java/net/minecraft/server/EntityFox.java -+++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -37,9 +37,9 @@ public class EntityFox extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +index a3b714a9d63c6bb33a2731fb9293c9d155754b17..cea46348c0876e168376061fbaf258048e9358cb 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +@@ -30,6 +30,8 @@ import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsFluid; + import net.minecraft.util.MathHelper; + import net.minecraft.world.DifficultyDamageScaler; ++import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityAgeable; +@@ -107,9 +109,9 @@ public class EntityFox extends EntityAnimal { private static final Predicate bv = (entity) -> { return !entity.bx() && IEntitySelector.e.test(entity); }; @@ -21,7 +30,7 @@ index 56c119e8d11c5ffb1f90ac4249bce434b3e78884..8845afd83d47902d5192ec1a9146b6f2 private float bz; private float bA; private float bB; -@@ -227,6 +227,11 @@ public class EntityFox extends EntityAnimal { +@@ -297,6 +299,11 @@ public class EntityFox extends EntityAnimal { } private void initializePathFinderGoals() { @@ -33,7 +42,7 @@ index 56c119e8d11c5ffb1f90ac4249bce434b3e78884..8845afd83d47902d5192ec1a9146b6f2 if (this.getFoxType() == EntityFox.Type.RED) { this.targetSelector.a(4, this.bw); this.targetSelector.a(4, this.bx); -@@ -259,6 +264,7 @@ public class EntityFox extends EntityAnimal { +@@ -329,6 +336,7 @@ public class EntityFox extends EntityAnimal { public void setFoxType(EntityFox.Type entityfox_type) { this.datawatcher.set(EntityFox.bo, entityfox_type.b()); @@ -41,7 +50,7 @@ index 56c119e8d11c5ffb1f90ac4249bce434b3e78884..8845afd83d47902d5192ec1a9146b6f2 } private List fa() { -@@ -576,6 +582,27 @@ public class EntityFox extends EntityAnimal { +@@ -646,6 +654,27 @@ public class EntityFox extends EntityAnimal { return this.fa().contains(uuid); } @@ -69,11 +78,11 @@ index 56c119e8d11c5ffb1f90ac4249bce434b3e78884..8845afd83d47902d5192ec1a9146b6f2 @Override protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper -diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java -index 67ebcbe4daa1ef3cef6ca43ec92befbe4156842e..4c379916d8d7797038d2980761c49f44c010dea8 100644 ---- a/src/main/java/net/minecraft/server/Items.java -+++ b/src/main/java/net/minecraft/server/Items.java -@@ -119,8 +119,8 @@ public class Items { +diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java +index 8e9a25495d76251a86268d3059e2960a86dc46b3..993a88a5937417016821ef9d7cd58e4ee097491c 100644 +--- a/src/main/java/net/minecraft/world/item/Items.java ++++ b/src/main/java/net/minecraft/world/item/Items.java +@@ -133,8 +133,8 @@ public class Items { public static final Item bk = a(Blocks.ALLIUM, CreativeModeTab.c); public static final Item bl = a(Blocks.AZURE_BLUET, CreativeModeTab.c); public static final Item bm = a(Blocks.RED_TULIP, CreativeModeTab.c); @@ -85,7 +94,7 @@ index 67ebcbe4daa1ef3cef6ca43ec92befbe4156842e..4c379916d8d7797038d2980761c49f44 public static final Item bq = a(Blocks.OXEYE_DAISY, CreativeModeTab.c); public static final Item br = a(Blocks.CORNFLOWER, CreativeModeTab.c); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 3ec33a96396e49d1ddb9f7eea804e4ae8080efbd..459ff8ffe7c0bf09fe93d89b3433bc930bb52f06 100644 +index decd0e755deede2b092866a8f7f6b46520435bbe..081675005077c5070f7745e24fd2ee7400fe2320 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -118,6 +118,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0033-Breedable-Polar-Bears.patch b/patches/Purpur/patches/server/0033-Breedable-Polar-Bears.patch index f7eff416..4a2ecee2 100644 --- a/patches/Purpur/patches/server/0033-Breedable-Polar-Bears.patch +++ b/patches/Purpur/patches/server/0033-Breedable-Polar-Bears.patch @@ -4,11 +4,33 @@ Date: Thu, 26 Mar 2020 19:46:44 -0500 Subject: [PATCH] Breedable Polar Bears -diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index 914c6e48d60ac8feadc08e52e050899fe1396a8d..99f0bd8f82520778d469ec51745034e6ebd3238a 100644 ---- a/src/main/java/net/minecraft/server/EntityPolarBear.java -+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java -@@ -23,6 +23,30 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +index 49f26d487229a732902d5bf48d305b0864e90d63..f25f5ced218555af0d62844a78842cfc7599d608 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +@@ -34,6 +34,7 @@ import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.IEntityAngerable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowParent; + import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; +@@ -41,11 +42,13 @@ import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack; + import net.minecraft.world.entity.ai.goal.PathfinderGoalPanic; + import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround; + import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStroll; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalTempt; + import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget; + import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget; + import net.minecraft.world.entity.ai.goal.target.PathfinderGoalUniversalAngerReset; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.crafting.RecipeItemStack; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.World; + import net.minecraft.world.level.WorldAccess; +@@ -68,6 +71,30 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { super(entitytypes, world); } @@ -39,7 +61,7 @@ index 914c6e48d60ac8feadc08e52e050899fe1396a8d..99f0bd8f82520778d469ec51745034e6 @Override public EntityAgeable createChild(WorldServer worldserver, EntityAgeable entityageable) { return (EntityAgeable) EntityTypes.POLAR_BEAR.a((World) worldserver); -@@ -30,7 +54,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -75,7 +102,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { @Override public boolean k(ItemStack itemstack) { @@ -48,7 +70,7 @@ index 914c6e48d60ac8feadc08e52e050899fe1396a8d..99f0bd8f82520778d469ec51745034e6 } @Override -@@ -39,6 +63,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -84,6 +111,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new EntityPolarBear.c()); this.goalSelector.a(1, new EntityPolarBear.d()); @@ -61,7 +83,7 @@ index 914c6e48d60ac8feadc08e52e050899fe1396a8d..99f0bd8f82520778d469ec51745034e6 this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D)); this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D)); this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); -@@ -180,10 +210,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -225,10 +258,12 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { return flag; } @@ -75,7 +97,7 @@ index 914c6e48d60ac8feadc08e52e050899fe1396a8d..99f0bd8f82520778d469ec51745034e6 this.datawatcher.set(EntityPolarBear.bo, flag); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 459ff8ffe7c0bf09fe93d89b3433bc930bb52f06..09b66b9ca3185528d0bc5f0a1d811c5a42039339 100644 +index 081675005077c5070f7745e24fd2ee7400fe2320..fa43c015976aabaae8843983976c9c939a49016f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -164,6 +164,14 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0034-Chickens-can-retaliate.patch b/patches/Purpur/patches/server/0034-Chickens-can-retaliate.patch index 853a0507..3fa2e23d 100644 --- a/patches/Purpur/patches/server/0034-Chickens-can-retaliate.patch +++ b/patches/Purpur/patches/server/0034-Chickens-can-retaliate.patch @@ -4,11 +4,24 @@ Date: Sun, 12 Apr 2020 13:19:34 -0500 Subject: [PATCH] Chickens can retaliate -diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index 182469fd39cb23633a3225cf1a64ab6b291e4cdf..8fb5d5c75e79a81ab46af3fbb96ebc41804113c4 100644 ---- a/src/main/java/net/minecraft/server/EntityChicken.java -+++ b/src/main/java/net/minecraft/server/EntityChicken.java -@@ -17,16 +17,33 @@ public class EntityChicken extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +index cd6fb8efb20a2d32de59d479b1dbf5ee69d5df37..600d6ebdf554dbaa8ca46a22a12d8b4e3255d987 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +@@ -20,10 +20,12 @@ import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowParent; + import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack; + import net.minecraft.world.entity.ai.goal.PathfinderGoalPanic; + import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround; + import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand; + import net.minecraft.world.entity.ai.goal.PathfinderGoalTempt; ++import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; +@@ -51,16 +53,33 @@ public class EntityChicken extends EntityAnimal { this.a(PathType.WATER, 0.0F); } @@ -43,7 +56,7 @@ index 182469fd39cb23633a3225cf1a64ab6b291e4cdf..8fb5d5c75e79a81ab46af3fbb96ebc41 } @Override -@@ -35,7 +52,7 @@ public class EntityChicken extends EntityAnimal { +@@ -69,7 +88,7 @@ public class EntityChicken extends EntityAnimal { } public static AttributeProvider.Builder eK() { @@ -53,7 +66,7 @@ index 182469fd39cb23633a3225cf1a64ab6b291e4cdf..8fb5d5c75e79a81ab46af3fbb96ebc41 @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 09b66b9ca3185528d0bc5f0a1d811c5a42039339..c2a13de7f0cafc8c93c5255e0f65f5e8ad439c7a 100644 +index fa43c015976aabaae8843983976c9c939a49016f..78218f2d59203b8f2b286fd09b3f6bdebb47565c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -113,6 +113,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0035-Add-option-to-set-armorstand-step-height.patch b/patches/Purpur/patches/server/0035-Add-option-to-set-armorstand-step-height.patch index cef5e351..0a3d1916 100644 --- a/patches/Purpur/patches/server/0035-Add-option-to-set-armorstand-step-height.patch +++ b/patches/Purpur/patches/server/0035-Add-option-to-set-armorstand-step-height.patch @@ -4,11 +4,11 @@ Date: Sun, 6 Oct 2019 12:46:35 -0500 Subject: [PATCH] Add option to set armorstand step height -diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 0ef9516fbe9283cb1aca71eb9dbdbec0d98c8fa4..9e37bf25689691f9640b294c482978e8e3b6e627 100644 ---- a/src/main/java/net/minecraft/server/EntityArmorStand.java -+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -625,6 +625,7 @@ public class EntityArmorStand extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +index c0e0750adef0ae6aff7635c84f6585f06c5fc38d..89d3734489b65245e815376edf4e2d9baea1563a 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +@@ -660,6 +660,7 @@ public class EntityArmorStand extends EntityLiving { @Override public void tick() { @@ -17,7 +17,7 @@ index 0ef9516fbe9283cb1aca71eb9dbdbec0d98c8fa4..9e37bf25689691f9640b294c482978e8 if (!this.canTick) { if (this.noTickPoseDirty) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index c2a13de7f0cafc8c93c5255e0f65f5e8ad439c7a..0fa01267fa35f1afdc81c2636f9efa8506bcebb6 100644 +index 78218f2d59203b8f2b286fd09b3f6bdebb47565c..90f367f2f04f9bf66b7f54ffe784db16c7ca868b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -63,6 +63,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0036-Cat-spawning-options.patch b/patches/Purpur/patches/server/0036-Cat-spawning-options.patch index 87d154a0..5ba975a9 100644 --- a/patches/Purpur/patches/server/0036-Cat-spawning-options.patch +++ b/patches/Purpur/patches/server/0036-Cat-spawning-options.patch @@ -4,23 +4,44 @@ Date: Thu, 26 Dec 2019 18:52:55 -0600 Subject: [PATCH] Cat spawning options -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 2e514b8291a544a88667fbca2389bde4c2ecb109..288105ae657ade252032aa0ac9c191a8e8ebf549 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -47,6 +47,7 @@ public interface IEntityAccess { - } +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index 13d94ecd703b3cd0412e138532d2dd74e5bf250d..6082eed2d28f3be65daa7e7eb6f2c2a89bb28ff1 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +@@ -191,6 +191,7 @@ public class VillagePlace extends RegionFileSection { + ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition); } -+ default List getEntitiesInAABB(Class oclass, AxisAlignedBB axisalignedbb) { return a(oclass, axisalignedbb); } // Purpur - OBFHELPER - default List a(Class oclass, AxisAlignedBB axisalignedbb) { - return this.a(oclass, axisalignedbb, IEntitySelector.g); ++ public long count(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return a(predicate, blockposition, i, villageplace_occupancy); } // Purpur - OBFHELPER + public long a(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { + return this.c(predicate, blockposition, i, villageplace_occupancy).count(); } -diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java -index 5e17868a76ea8e3f105c11d496d6da12afa0da41..5a0f8779672a9e34f6970045361630ab5af3990b 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerCat.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java -@@ -16,7 +16,7 @@ public class MobSpawnerCat implements MobSpawner { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java +index db1ddce5774754891dc8a3ea5b66951ebc3a07a8..6a45ab049a4beeeaf7b3b5acf2946767f6e1198f 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java +@@ -53,7 +53,7 @@ public class VillagePlaceType { + public static final VillagePlaceType o = a("shepherd", a(Blocks.LOOM), 1, 1); + public static final VillagePlaceType p = a("toolsmith", a(Blocks.SMITHING_TABLE), 1, 1); + public static final VillagePlaceType q = a("weaponsmith", a(Blocks.GRINDSTONE), 1, 1); +- public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); ++ public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); public static VillagePlaceType home() { return r; } // Purpur - OBFHELPER + public static final VillagePlaceType s = a("meeting", a(Blocks.BELL), 32, 6); + public static final VillagePlaceType t = a("beehive", a(Blocks.BEEHIVE), 0, 1); + public static final VillagePlaceType u = a("bee_nest", a(Blocks.BEE_NEST), 0, 1); +@@ -92,6 +92,7 @@ public class VillagePlaceType { + return this.D; + } + ++ public Predicate predicate() { return c(); } // Purpur - OBFHELPER + public Predicate c() { + return this.E; + } +diff --git a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java +index 7a495cf88d723790ee3f63645cb4792052284f32..2f54c26151c049df9d071c887dd33e48df041437 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java ++++ b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java +@@ -34,7 +34,7 @@ public class MobSpawnerCat implements MobSpawner { if (this.a > 0) { return 0; } else { @@ -29,7 +50,7 @@ index 5e17868a76ea8e3f105c11d496d6da12afa0da41..5a0f8779672a9e34f6970045361630ab EntityPlayer entityplayer = worldserver.q_(); if (entityplayer == null) { -@@ -50,10 +50,12 @@ public class MobSpawnerCat implements MobSpawner { +@@ -68,10 +68,12 @@ public class MobSpawnerCat implements MobSpawner { } private int a(WorldServer worldserver, BlockPosition blockposition) { @@ -46,7 +67,7 @@ index 5e17868a76ea8e3f105c11d496d6da12afa0da41..5a0f8779672a9e34f6970045361630ab if (list.size() < 5) { return this.a(blockposition, worldserver); -@@ -64,9 +66,11 @@ public class MobSpawnerCat implements MobSpawner { +@@ -82,9 +84,11 @@ public class MobSpawnerCat implements MobSpawner { } private int b(WorldServer worldserver, BlockPosition blockposition) { @@ -61,41 +82,20 @@ index 5e17868a76ea8e3f105c11d496d6da12afa0da41..5a0f8779672a9e34f6970045361630ab return list.size() < 1 ? this.a(blockposition, worldserver) : 0; } -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 245bdedd17b844dcd13aa0b60dffb1cac6a5bdb8..64e251fb63e67b9ebf11779580b1bff6def6d1c6 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -178,6 +178,7 @@ public class VillagePlace extends RegionFileSection { - ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition); +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index fd56b2f15e570f266a79c25823a3b3530a693510..18a5d11cce748695c8f03be565d2ea37a276a981 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -56,6 +56,7 @@ public interface IEntityAccess { + } } -+ public long count(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return a(predicate, blockposition, i, villageplace_occupancy); } // Purpur - OBFHELPER - public long a(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { - return this.c(predicate, blockposition, i, villageplace_occupancy).count(); - } -diff --git a/src/main/java/net/minecraft/server/VillagePlaceType.java b/src/main/java/net/minecraft/server/VillagePlaceType.java -index a5718af9b614ae505067131f04ebb490617d6aa4..b6b4c8c491d692f93d2c38d602ff99b0611b72aa 100644 ---- a/src/main/java/net/minecraft/server/VillagePlaceType.java -+++ b/src/main/java/net/minecraft/server/VillagePlaceType.java -@@ -44,7 +44,7 @@ public class VillagePlaceType { - public static final VillagePlaceType o = a("shepherd", a(Blocks.LOOM), 1, 1); - public static final VillagePlaceType p = a("toolsmith", a(Blocks.SMITHING_TABLE), 1, 1); - public static final VillagePlaceType q = a("weaponsmith", a(Blocks.GRINDSTONE), 1, 1); -- public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); -+ public static final VillagePlaceType r = a("home", VillagePlaceType.z, 1, 1); public static VillagePlaceType home() { return r; } // Purpur - OBFHELPER - public static final VillagePlaceType s = a("meeting", a(Blocks.BELL), 32, 6); - public static final VillagePlaceType t = a("beehive", a(Blocks.BEEHIVE), 0, 1); - public static final VillagePlaceType u = a("bee_nest", a(Blocks.BEE_NEST), 0, 1); -@@ -83,6 +83,7 @@ public class VillagePlaceType { - return this.D; - } - -+ public Predicate predicate() { return c(); } // Purpur - OBFHELPER - public Predicate c() { - return this.E; ++ default List getEntitiesInAABB(Class oclass, AxisAlignedBB axisalignedbb) { return a(oclass, axisalignedbb); } // Purpur - OBFHELPER + default List a(Class oclass, AxisAlignedBB axisalignedbb) { + return this.a(oclass, axisalignedbb, IEntitySelector.g); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 0fa01267fa35f1afdc81c2636f9efa8506bcebb6..9c5de125a6ed207f238dff1e17e38a4083c4c251 100644 +index 90f367f2f04f9bf66b7f54ffe784db16c7ca868b..9e935668147d1cd822f33c9e8d41e9541022aa8a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -118,6 +118,15 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0037-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch b/patches/Purpur/patches/server/0037-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch index 3355e6be..d57feb8e 100644 --- a/patches/Purpur/patches/server/0037-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch +++ b/patches/Purpur/patches/server/0037-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch @@ -4,11 +4,11 @@ Date: Thu, 2 Jan 2020 01:23:22 -0600 Subject: [PATCH] MC-147659 - Fix non black cats spawning in swamp huts -diff --git a/src/main/java/net/minecraft/server/MobSpawnerCat.java b/src/main/java/net/minecraft/server/MobSpawnerCat.java -index 5a0f8779672a9e34f6970045361630ab5af3990b..25bb494350cd771166a78a7b14726cee8f01b02e 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerCat.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerCat.java -@@ -80,8 +80,9 @@ public class MobSpawnerCat implements MobSpawner { +diff --git a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java +index 2f54c26151c049df9d071c887dd33e48df041437..5d0da07970bfe304debe244e5df39981f90161f6 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java ++++ b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerCat.java +@@ -98,8 +98,9 @@ public class MobSpawnerCat implements MobSpawner { if (entitycat == null) { return 0; } else { diff --git a/patches/Purpur/patches/server/0038-Cows-eat-mushrooms.patch b/patches/Purpur/patches/server/0038-Cows-eat-mushrooms.patch index f145d2aa..32aa6e24 100644 --- a/patches/Purpur/patches/server/0038-Cows-eat-mushrooms.patch +++ b/patches/Purpur/patches/server/0038-Cows-eat-mushrooms.patch @@ -4,11 +4,11 @@ Date: Sat, 4 May 2019 01:10:30 -0500 Subject: [PATCH] Cows eat mushrooms -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7cafc89e048e43f339f5289f38674b18d052e70d..4edb489012ddc9454e412f06acc4587a3572c8d3 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2791,6 +2791,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index b7c72eaf5715a30bb8f82891f9830f9f62ec03c9..c8071e2909c03bd8eafb92fbf8fd8701642df1f9 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2886,6 +2886,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.invulnerable = flag; } @@ -16,11 +16,40 @@ index 7cafc89e048e43f339f5289f38674b18d052e70d..4edb489012ddc9454e412f06acc4587a public void u(Entity entity) { this.setPositionRotation(entity.locX(), entity.locY(), entity.locZ(), entity.yaw, entity.pitch); } -diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 42e6761c8b18b79ffd3f4d5e853ea87a2c153c23..cfb009c811bd2908d38da1b0007cb7aaed4e42c3 100644 ---- a/src/main/java/net/minecraft/server/EntityCow.java -+++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -16,6 +16,7 @@ public class EntityCow extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index ffc5ca763a22a1c4d06ffdb72c30482c13ec0a7b..1902b706345ff0031aaa8babde8cabffced99b78 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -176,7 +176,7 @@ public abstract class EntityLiving extends Entity { + public int maxNoDamageTicks; + public final float ay; + public final float az; +- public float aA; ++ public float aA; public float getRenderYawOffset() { return this.aA; } public void setRenderYawOffset(float f) { this.aA = f; } // Purpur - OBFHELPER + public float aB; + public float aC; + public float aD; +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +index 1b43688ad232620410aa924cef02b54630ab1313..962dde5fcc617bc39b7d06a1e295370b9d60696c 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +@@ -1,6 +1,7 @@ + package net.minecraft.world.entity.animal; + + import net.minecraft.core.BlockPosition; ++import net.minecraft.core.particles.Particles; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -28,6 +29,7 @@ import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.item.crafting.RecipeItemStack; + import net.minecraft.world.level.World; ++import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.state.IBlockData; + + // CraftBukkit start +@@ -46,6 +48,7 @@ public class EntityCow extends EntityAnimal { this.goalSelector.a(0, new PathfinderGoalFloat(this)); this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D)); this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); @@ -28,7 +57,7 @@ index 42e6761c8b18b79ffd3f4d5e853ea87a2c153c23..cfb009c811bd2908d38da1b0007cb7aa this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false)); this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D)); this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); -@@ -70,11 +71,80 @@ public class EntityCow extends EntityAnimal { +@@ -100,11 +103,80 @@ public class EntityCow extends EntityAnimal { entityhuman.a(enumhand, itemstack1); return EnumInteractionResult.a(this.world.isClientSide); @@ -109,21 +138,8 @@ index 42e6761c8b18b79ffd3f4d5e853ea87a2c153c23..cfb009c811bd2908d38da1b0007cb7aa @Override public EntityCow createChild(WorldServer worldserver, EntityAgeable entityageable) { return (EntityCow) EntityTypes.COW.a((World) worldserver); -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 996242d7c62984b67b9443356c509d0c7c85e33a..8cc440e0e7108e2c7ca29b2f8a2fc5a723dcef0d 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -81,7 +81,7 @@ public abstract class EntityLiving extends Entity { - public int maxNoDamageTicks; - public final float ay; - public final float az; -- public float aA; -+ public float aA; public float getRenderYawOffset() { return this.aA; } public void setRenderYawOffset(float f) { this.aA = f; } // Purpur - OBFHELPER - public float aB; - public float aC; - public float aD; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9c5de125a6ed207f238dff1e17e38a4083c4c251..0c841b824a93d5e43bad171d1ca828eca3e891df 100644 +index 9e935668147d1cd822f33c9e8d41e9541022aa8a..277cc8361e8faf54b95be1e9f1467a97de14ecc4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -132,6 +132,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0039-Fix-cow-rotation-when-shearing-mooshroom.patch b/patches/Purpur/patches/server/0039-Fix-cow-rotation-when-shearing-mooshroom.patch index aa8b1176..6f213940 100644 --- a/patches/Purpur/patches/server/0039-Fix-cow-rotation-when-shearing-mooshroom.patch +++ b/patches/Purpur/patches/server/0039-Fix-cow-rotation-when-shearing-mooshroom.patch @@ -4,11 +4,11 @@ Date: Fri, 3 May 2019 23:53:16 -0500 Subject: [PATCH] Fix cow rotation when shearing mooshroom -diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index c9112f783c81d58570e622a0e784da1e2a93d0ff..91cfe60f764a573e3724b48a9ae02e806c1e4fb8 100644 ---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java -+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -136,7 +136,13 @@ public class EntityMushroomCow extends EntityCow implements IShearable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +index 9face4480dcc89d9106ebe596020c1888350ef2d..d28d4d2c1eff2c130f49c2bce3c19da212dba5dc 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +@@ -172,7 +172,13 @@ public class EntityMushroomCow extends EntityCow implements IShearable { entitycow.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); entitycow.setHealth(this.getHealth()); diff --git a/patches/Purpur/patches/server/0040-Pigs-give-saddle-back.patch b/patches/Purpur/patches/server/0040-Pigs-give-saddle-back.patch index 5d5df6e5..4645c333 100644 --- a/patches/Purpur/patches/server/0040-Pigs-give-saddle-back.patch +++ b/patches/Purpur/patches/server/0040-Pigs-give-saddle-back.patch @@ -4,11 +4,11 @@ Date: Sun, 12 May 2019 01:14:46 -0500 Subject: [PATCH] Pigs give saddle back -diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 01ca5983cade997b1f0d27fdf495c74c6daa0922..6ea3e4ffc3f42f4282adf3554944f24d92ca2079 100644 ---- a/src/main/java/net/minecraft/server/EntityPig.java -+++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -109,6 +109,18 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +index 676ca381a5e111fc15f319e73504e4e60dbf0d2b..1a540e41e6161d011ca4ed30c68ae9df4567b8db 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +@@ -156,6 +156,18 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { if (!flag && this.hasSaddle() && !this.isVehicle() && !entityhuman.eq()) { if (!this.world.isClientSide) { @@ -28,7 +28,7 @@ index 01ca5983cade997b1f0d27fdf495c74c6daa0922..6ea3e4ffc3f42f4282adf3554944f24d } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 0c841b824a93d5e43bad171d1ca828eca3e891df..24ef91788ff69004eed1b136a0ceb6176db00e76 100644 +index 277cc8361e8faf54b95be1e9f1467a97de14ecc4..5ac1aba522151c42255caf9d29c5b780218ccd32 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -188,6 +188,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch b/patches/Purpur/patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch index e6f2006d..42df6eae 100644 --- a/patches/Purpur/patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch +++ b/patches/Purpur/patches/server/0041-Snowman-drop-and-put-back-pumpkin.patch @@ -4,11 +4,11 @@ Date: Fri, 3 May 2019 23:58:44 -0500 Subject: [PATCH] Snowman drop and put back pumpkin -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index a11c599a9779aa084a1d7d1b6b3485d5b9c23906..c39f3c06eb199a24f32a5c581e877073b580502c 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -124,6 +124,14 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index b1e2892c7c9f0e35f69332e93917593d97c304a8..44119f52a4f169ffcea53fb69393bfedfd1a62a7 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -160,6 +160,14 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt } return EnumInteractionResult.a(this.world.isClientSide); @@ -23,7 +23,7 @@ index a11c599a9779aa084a1d7d1b6b3485d5b9c23906..c39f3c06eb199a24f32a5c581e877073 } else { return EnumInteractionResult.PASS; } -@@ -134,6 +142,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +@@ -170,6 +178,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt this.world.playSound((EntityHuman) null, (Entity) this, SoundEffects.ENTITY_SNOW_GOLEM_SHEAR, soundcategory, 1.0F, 1.0F); if (!this.world.s_()) { this.setHasPumpkin(false); @@ -32,7 +32,7 @@ index a11c599a9779aa084a1d7d1b6b3485d5b9c23906..c39f3c06eb199a24f32a5c581e877073 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 24ef91788ff69004eed1b136a0ceb6176db00e76..609307a409365829e61430da47aa75125afcb8c4 100644 +index 5ac1aba522151c42255caf9d29c5b780218ccd32..fa01ef3c0cc723acaaf348066cddf91f1deb3c72 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -208,6 +208,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0042-Ender-dragon-always-drop-full-exp.patch b/patches/Purpur/patches/server/0042-Ender-dragon-always-drop-full-exp.patch index 1f34cc0d..9dd6fd48 100644 --- a/patches/Purpur/patches/server/0042-Ender-dragon-always-drop-full-exp.patch +++ b/patches/Purpur/patches/server/0042-Ender-dragon-always-drop-full-exp.patch @@ -4,11 +4,11 @@ Date: Sat, 24 Aug 2019 14:42:54 -0500 Subject: [PATCH] Ender dragon always drop full exp -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 50b93c93cfede2d64a996a22b811994b352149af..de025a48c7ca08d8ae71d2d9239121dc4a86a339 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -564,7 +564,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index 07160de8725787551df327c0790b2d6e0876524f..3fff101637708a1a12f9a457bd3512ae94a8f884 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -613,7 +613,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { boolean flag = this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT); short short0 = 500; @@ -18,7 +18,7 @@ index 50b93c93cfede2d64a996a22b811994b352149af..de025a48c7ca08d8ae71d2d9239121dc } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 609307a409365829e61430da47aa75125afcb8c4..66c0725c3dc28e49387d2b9f1a15aa0758763c08 100644 +index fa01ef3c0cc723acaaf348066cddf91f1deb3c72..bab91f0416f31a8273593bb7725658674eb41621 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -142,6 +142,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0043-Signs-editable-on-right-click.patch b/patches/Purpur/patches/server/0043-Signs-editable-on-right-click.patch index c217038d..706c4e9a 100644 --- a/patches/Purpur/patches/server/0043-Signs-editable-on-right-click.patch +++ b/patches/Purpur/patches/server/0043-Signs-editable-on-right-click.patch @@ -4,11 +4,19 @@ Date: Fri, 24 May 2019 02:39:25 -0500 Subject: [PATCH] Signs editable on right click -diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java -index 3585fd82c14338a82302ca403e91e6cfe65e1c19..770ad5edfb44acb69e7da33226ca6bf7c01a77b7 100644 ---- a/src/main/java/net/minecraft/server/BlockSign.java -+++ b/src/main/java/net/minecraft/server/BlockSign.java -@@ -56,6 +56,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSign.java b/src/main/java/net/minecraft/world/level/block/BlockSign.java +index 6b461080439dd9ce5b8d34b79d446558bbd5c1f1..19f4403b9f1142c71e7b2c7c0fd5a78027d4ffe4 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSign.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSign.java +@@ -6,6 +6,7 @@ import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemDye; ++import net.minecraft.world.item.ItemSign; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.IBlockAccess; +@@ -80,6 +81,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo } } @@ -26,11 +34,11 @@ index 3585fd82c14338a82302ca403e91e6cfe65e1c19..770ad5edfb44acb69e7da33226ca6bf7 return tileentitysign.b(entityhuman) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS; } else { return EnumInteractionResult.PASS; -diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 3c7847b1156a486e253a0e9f74a857e841d90619..1e6bb566c0a718bba289b2e727a832e0aa6b7f15 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySign.java -+++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -112,6 +112,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java +index 7f78f388584899b13ff983f0dc37c679bfb1507e..96d0524482281f8570464962c0fd5319199440d7 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java +@@ -132,6 +132,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // return this.isEditable; } @@ -39,7 +47,7 @@ index 3c7847b1156a486e253a0e9f74a857e841d90619..1e6bb566c0a718bba289b2e727a832e0 // Paper start //this.c = entityhuman; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 66c0725c3dc28e49387d2b9f1a15aa0758763c08..8393a0253ac16a8f15f78288d6cc31f8688c403c 100644 +index bab91f0416f31a8273593bb7725658674eb41621..ea95a4116371d58eb36be51093af7f0fa28e3dfd 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -109,6 +109,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0044-Signs-allow-color-codes.patch b/patches/Purpur/patches/server/0044-Signs-allow-color-codes.patch index 20ff197a..542180f7 100644 --- a/patches/Purpur/patches/server/0044-Signs-allow-color-codes.patch +++ b/patches/Purpur/patches/server/0044-Signs-allow-color-codes.patch @@ -4,11 +4,11 @@ Date: Thu, 6 Jun 2019 17:40:30 -0500 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 ee1bb58ce2fdaa4cc347476b8f040c346d029cf1..4cd9937d97343e33a4c417b4a7af9ee2601b18b0 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1449,6 +1449,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 7cd1ae92768164b657af9febe9b4feb7fd02f55a..fe583fbc58309564d35d4cdd56fafc4de8ba31c8 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -1579,6 +1579,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public void openSign(TileEntitySign tileentitysign) { @@ -16,11 +16,11 @@ index ee1bb58ce2fdaa4cc347476b8f040c346d029cf1..4cd9937d97343e33a4c417b4a7af9ee2 tileentitysign.a((EntityHuman) this); 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 be29ecfa00d53ad2067015a5261184b4157c604b..4d0dcbcc00e44c4912302dd0e7331471f33cb370 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2902,6 +2902,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index 68200fe85fc4e66bb58dd35df306ba37604b6b94..bbb3b44bdceb8fb0363f771b8cf1b8245b5c8d3d 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -3047,6 +3047,15 @@ public class PlayerConnection implements PacketListenerPlayIn { } } // Paper end @@ -36,19 +36,19 @@ index be29ecfa00d53ad2067015a5261184b4157c604b..4d0dcbcc00e44c4912302dd0e7331471 lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterAllowedChatCharacters(currentLine))); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. } SignChangeEvent event = new SignChangeEvent(org.bukkit.craftbukkit.block.CraftBlock.at(worldserver, blockposition), this.getPlayer(), lines); -diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 1e6bb566c0a718bba289b2e727a832e0aa6b7f15..cbbaf8ca4b6425e2ce58e500b13b3b5269704c3c 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySign.java -+++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -2,6 +2,7 @@ package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java +index 96d0524482281f8570464962c0fd5319199440d7..a87a2fa507dc3bd6d9979db5868e7ef6ea1eddbd 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySign.java +@@ -1,6 +1,7 @@ + package net.minecraft.world.level.block.entity; import com.mojang.brigadier.exceptions.CommandSyntaxException; - import javax.annotation.Nullable; +import io.papermc.paper.adventure.PaperAdventure; // Purpur - - public class TileEntitySign extends TileEntity implements ICommandListener { // CraftBukkit - implements - -@@ -92,6 +93,18 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // + import javax.annotation.Nullable; + import net.minecraft.commands.CommandListenerWrapper; + import net.minecraft.commands.ICommandListener; +@@ -112,6 +113,18 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // this.g[i] = null; } @@ -68,7 +68,7 @@ index 1e6bb566c0a718bba289b2e727a832e0aa6b7f15..cbbaf8ca4b6425e2ce58e500b13b3b52 @Override public PacketPlayOutTileEntityData getUpdatePacket() { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 8393a0253ac16a8f15f78288d6cc31f8688c403c..484da2bf267cab4e4569c98111398af64c834eed 100644 +index ea95a4116371d58eb36be51093af7f0fa28e3dfd..b67f87f38d0ff99ff62d2103ecc737317a435102 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -109,8 +109,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0045-Allow-soil-to-moisten-from-water-directly-under-it.patch b/patches/Purpur/patches/server/0045-Allow-soil-to-moisten-from-water-directly-under-it.patch index 68ddef66..4363243b 100644 --- a/patches/Purpur/patches/server/0045-Allow-soil-to-moisten-from-water-directly-under-it.patch +++ b/patches/Purpur/patches/server/0045-Allow-soil-to-moisten-from-water-directly-under-it.patch @@ -4,11 +4,11 @@ Date: Fri, 21 Jun 2019 14:37:10 -0500 Subject: [PATCH] Allow soil to moisten from water directly under it -diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java -index a315e2628c35ee713b68741c6e52c4b140c05f27..8dd48669c29dd51ed4d535dad0b0319f4bb2250c 100644 ---- a/src/main/java/net/minecraft/server/BlockSoil.java -+++ b/src/main/java/net/minecraft/server/BlockSoil.java -@@ -116,19 +116,14 @@ public class BlockSoil extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +index 3bedb1c6a0f221c7b40ee0a50f676e8b05bd37a7..2bbaa2fb426869223a9b2f07406496c1b0daff3f 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +@@ -139,19 +139,14 @@ public class BlockSoil extends Block { } private static boolean a(IWorldReader iworldreader, BlockPosition blockposition) { @@ -36,7 +36,7 @@ index a315e2628c35ee713b68741c6e52c4b140c05f27..8dd48669c29dd51ed4d535dad0b0319f @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 484da2bf267cab4e4569c98111398af64c834eed..56793a9e8f963b63a22aac5337299fbfb07389f0 100644 +index b67f87f38d0ff99ff62d2103ecc737317a435102..2e4a928a3e88fb3d961d9530695cd7154321c79b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -109,6 +109,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0046-Controllable-Minecarts.patch b/patches/Purpur/patches/server/0046-Controllable-Minecarts.patch index 98d4f641..26e91dce 100644 --- a/patches/Purpur/patches/server/0046-Controllable-Minecarts.patch +++ b/patches/Purpur/patches/server/0046-Controllable-Minecarts.patch @@ -4,11 +4,19 @@ Date: Sat, 29 Jun 2019 02:32:40 -0500 Subject: [PATCH] Controllable Minecarts -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 2291135eaef64c403183724cb6e413cd7e472672..bc61aaff65a7dc1e7534452b285953b83adb7000 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -36,6 +36,12 @@ public class BlockPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java +index 8edc279e7a3fdfb7e10718f1deee34b7e3fb2f28..a01b69c43acf4beb65c8b7a8a800c44121068d46 100644 +--- a/src/main/java/net/minecraft/core/BlockPosition.java ++++ b/src/main/java/net/minecraft/core/BlockPosition.java +@@ -11,6 +11,7 @@ import java.util.stream.StreamSupport; + import javax.annotation.concurrent.Immutable; + import net.minecraft.SystemUtils; + import net.minecraft.util.MathHelper; ++import net.minecraft.world.entity.Entity; + import net.minecraft.world.level.block.EnumBlockRotation; + import net.minecraft.world.level.levelgen.structure.StructureBoundingBox; + import net.minecraft.world.phys.AxisAlignedBB; +@@ -42,6 +43,12 @@ public class BlockPosition extends BaseBlockPosition { private static final int m = 38; // Paper end @@ -21,11 +29,31 @@ index 2291135eaef64c403183724cb6e413cd7e472672..bc61aaff65a7dc1e7534452b285953b8 public BlockPosition(int i, int j, int k) { super(i, j, k); } -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8cc440e0e7108e2c7ca29b2f8a2fc5a723dcef0d..46b1bc644c0584fe7006ea9f111d7f4837299dc9 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -99,9 +99,9 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index fe583fbc58309564d35d4cdd56fafc4de8ba31c8..4a2ea4c83107e957bda69604ca0ae98c504cf962 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -106,6 +106,7 @@ import net.minecraft.world.entity.monster.EntityMonster; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.player.EnumChatVisibility; + import net.minecraft.world.entity.projectile.EntityArrow; ++import net.minecraft.world.entity.vehicle.EntityMinecartAbstract; + import net.minecraft.world.inventory.Container; + import net.minecraft.world.inventory.ContainerHorse; + import net.minecraft.world.inventory.ICrafting; +@@ -1132,6 +1133,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (this.isInvulnerable(damagesource)) { + return false; + } else { ++ if (damagesource == DamageSource.FALL && getRootVehicle() instanceof EntityMinecartAbstract && world.purpurConfig.controllableMinecarts && !world.purpurConfig.controllableMinecartsFallDamage) return false; // Purpur + boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex); + + if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 1902b706345ff0031aaa8babde8cabffced99b78..c3acf0de92f1dbbcfbe7a9673c843107a6bd00b7 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -194,9 +194,9 @@ public abstract class EntityLiving extends Entity { protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER public float lastDamage; public boolean jumping; // Paper protected -> public @@ -38,11 +66,11 @@ index 8cc440e0e7108e2c7ca29b2f8a2fc5a723dcef0d..46b1bc644c0584fe7006ea9f111d7f48 protected int aU; protected double aV; protected double aW; -diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index be859a1b41254b299a507d03e453dc8efee6f3dd..4de2877f30a9b231a5c8bbd1739416991e9d7633 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -@@ -445,16 +445,62 @@ public abstract class EntityMinecartAbstract extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java +index 75a88ab5d5b0fdb98ea8d61bb6b82049b21101f3..3cd9a7956f9cbb3f66764adfede12b3b25024c41 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityMinecartAbstract.java +@@ -484,16 +484,62 @@ public abstract class EntityMinecartAbstract extends Entity { public void a(int i, int j, int k, boolean flag) {} @@ -52,11 +80,11 @@ index be859a1b41254b299a507d03e453dc8efee6f3dd..4de2877f30a9b231a5c8bbd173941699 + public double getControllableSpeed() { + BlockPosition position = new BlockPosition(this); + Block block = world.getType(position).getBlock(); -+ if (!block.material.isSolid()) { ++ if (!block.getMaterial().isSolid()) { + block = world.getType(position.shift(EnumDirection.DOWN)).getBlock(); + } + Double speed = world.purpurConfig.controllableMinecartsBlockSpeeds.get(block); -+ if (!block.material.isSolid()) { ++ if (!block.getMaterial().isSolid()) { + speed = lastSpeed; + } else if (speed == null) { + speed = world.purpurConfig.controllableMinecartsBaseSpeed; @@ -105,23 +133,11 @@ index be859a1b41254b299a507d03e453dc8efee6f3dd..4de2877f30a9b231a5c8bbd173941699 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 4cd9937d97343e33a4c417b4a7af9ee2601b18b0..f200faf78ab887d1b58677e20039765cb67ac6b8 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1002,6 +1002,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - if (this.isInvulnerable(damagesource)) { - return false; - } else { -+ if (damagesource == DamageSource.FALL && getRootVehicle() instanceof EntityMinecartAbstract && world.purpurConfig.controllableMinecarts && !world.purpurConfig.controllableMinecartsFallDamage) return false; // Purpur - boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex); - - if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur -diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java -index ceef7aaf923026ff1044d6feba4297279eb44157..002651aaf3b8a9b489fe323756cd1ad13f9874e8 100644 ---- a/src/main/java/net/minecraft/server/ItemMinecart.java -+++ b/src/main/java/net/minecraft/server/ItemMinecart.java -@@ -103,8 +103,10 @@ public class ItemMinecart extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemMinecart.java b/src/main/java/net/minecraft/world/item/ItemMinecart.java +index 527f3ed664854cdd938c34f00a064bc2f77148cc..d50a1093aa9b6d7187b59566309a3abd05125e07 100644 +--- a/src/main/java/net/minecraft/world/item/ItemMinecart.java ++++ b/src/main/java/net/minecraft/world/item/ItemMinecart.java +@@ -121,8 +121,10 @@ public class ItemMinecart extends Item { IBlockData iblockdata = world.getType(blockposition); if (!iblockdata.a((Tag) TagsBlock.RAILS)) { @@ -134,7 +150,7 @@ index ceef7aaf923026ff1044d6feba4297279eb44157..002651aaf3b8a9b489fe323756cd1ad1 ItemStack itemstack = itemactioncontext.getItemStack(); if (!world.isClientSide) { -@@ -131,6 +133,6 @@ public class ItemMinecart extends Item { +@@ -149,6 +151,6 @@ public class ItemMinecart extends Item { itemstack.subtract(1); return EnumInteractionResult.a(world.isClientSide); @@ -142,19 +158,39 @@ index ceef7aaf923026ff1044d6feba4297279eb44157..002651aaf3b8a9b489fe323756cd1ad1 + //} // Purpur - place minecarts anywhere } } +diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java +index 596b4597313b87296d39027b13555b5ad1cba9e6..5ea059cde9e1a089c2ade12512e4a7abd07c5b8a 100644 +--- a/src/main/java/net/minecraft/world/level/block/Block.java ++++ b/src/main/java/net/minecraft/world/level/block/Block.java +@@ -41,6 +41,7 @@ import net.minecraft.world.level.block.entity.TileEntity; + import net.minecraft.world.level.block.state.BlockBase; + import net.minecraft.world.level.block.state.BlockStateList; + import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.material.Material; + import net.minecraft.world.level.storage.loot.LootTableInfo; + import net.minecraft.world.level.storage.loot.parameters.LootContextParameters; + import net.minecraft.world.phys.Vec3D; +@@ -83,6 +84,7 @@ public class Block extends BlockBase implements IMaterial { + return timing; + } + // Paper end ++ public Material getMaterial() { return material; } // Purpur - OBFHELPER + @Nullable + private String name; + @Nullable diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 56793a9e8f963b63a22aac5337299fbfb07389f0..c6682064ff5d653d14f658396a6a5461d4554fab 100644 +index 2e4a928a3e88fb3d961d9530695cd7154321c79b..3a6a19bd4e952a6deb1def80755387cab75bbad8 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1,5 +1,7 @@ +@@ -1,13 +1,18 @@ package net.pl3x.purpur; -+import net.minecraft.server.Block; -+import net.minecraft.server.Blocks; - import net.minecraft.server.IRegistry; - import net.minecraft.server.Item; - import net.minecraft.server.Items; -@@ -7,7 +9,10 @@ import net.minecraft.server.MinecraftKey; + import net.minecraft.core.IRegistry; ++import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.item.Item; + import net.minecraft.world.item.Items; + import net.minecraft.resources.MinecraftKey; import org.bukkit.configuration.ConfigurationSection; import java.util.ArrayList; diff --git a/patches/Purpur/patches/server/0047-Disable-loot-drops-on-death-by-cramming.patch b/patches/Purpur/patches/server/0047-Disable-loot-drops-on-death-by-cramming.patch index 2280fd22..a0f21760 100644 --- a/patches/Purpur/patches/server/0047-Disable-loot-drops-on-death-by-cramming.patch +++ b/patches/Purpur/patches/server/0047-Disable-loot-drops-on-death-by-cramming.patch @@ -4,11 +4,11 @@ Date: Wed, 3 Jul 2019 23:58:31 -0500 Subject: [PATCH] Disable loot drops on death by cramming -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 46b1bc644c0584fe7006ea9f111d7f4837299dc9..1dddf80e11db54a666de8c3b0d7a5c8a5f1f93ab 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1501,8 +1501,10 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index c3acf0de92f1dbbcfbe7a9673c843107a6bd00b7..1602c00e04cccdee4e9eb4f4512145e8b1aeaf57 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -1598,8 +1598,10 @@ public abstract class EntityLiving extends Entity { this.dropInventory(); // CraftBukkit - from below if (this.cW() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { @@ -20,7 +20,7 @@ index 46b1bc644c0584fe7006ea9f111d7f4837299dc9..1dddf80e11db54a666de8c3b0d7a5c8a // CraftBukkit start - Call death event org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index c6682064ff5d653d14f658396a6a5461d4554fab..8d1ad37f17935331ee867c15f91842cdc53d4450 100644 +index 3a6a19bd4e952a6deb1def80755387cab75bbad8..b16ea97f4119fe2cd7c218f3fecbb7202c362665 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -112,6 +112,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0048-Players-should-not-cram-to-death.patch b/patches/Purpur/patches/server/0048-Players-should-not-cram-to-death.patch index de7dcb56..0c25fcd8 100644 --- a/patches/Purpur/patches/server/0048-Players-should-not-cram-to-death.patch +++ b/patches/Purpur/patches/server/0048-Players-should-not-cram-to-death.patch @@ -4,11 +4,11 @@ Date: Sun, 21 Jul 2019 18:01:46 -0500 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 f200faf78ab887d1b58677e20039765cb67ac6b8..ce48b823db35ca2d7557cfc840801349b19cbd54 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1426,7 +1426,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 4a2ea4c83107e957bda69604ca0ae98c504cf962..e129480fa1045fbeaafa97045d53696b44952bcf 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -1557,7 +1557,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public boolean isInvulnerable(DamageSource damagesource) { diff --git a/patches/Purpur/patches/server/0049-Option-to-toggle-milk-curing-bad-omen.patch b/patches/Purpur/patches/server/0049-Option-to-toggle-milk-curing-bad-omen.patch index 8b3e52e7..a109e04b 100644 --- a/patches/Purpur/patches/server/0049-Option-to-toggle-milk-curing-bad-omen.patch +++ b/patches/Purpur/patches/server/0049-Option-to-toggle-milk-curing-bad-omen.patch @@ -4,11 +4,20 @@ Date: Wed, 10 Jul 2019 20:43:05 -0500 Subject: [PATCH] Option to toggle milk curing bad omen -diff --git a/src/main/java/net/minecraft/server/ItemMilkBucket.java b/src/main/java/net/minecraft/server/ItemMilkBucket.java -index fcf254bbaeb3c0ffdb6834a8d5ad2c3cf4235e5b..79554e18fc39ecd9db87618a59d2e6709049820e 100644 ---- a/src/main/java/net/minecraft/server/ItemMilkBucket.java -+++ b/src/main/java/net/minecraft/server/ItemMilkBucket.java -@@ -20,7 +20,9 @@ public class ItemMilkBucket extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemMilkBucket.java b/src/main/java/net/minecraft/world/item/ItemMilkBucket.java +index 6085c5f75bd85cca3462613c18c2e2bf26205d1b..e20452f55c531f76ecaae9ba5d0ea3f8edf96127 100644 +--- a/src/main/java/net/minecraft/world/item/ItemMilkBucket.java ++++ b/src/main/java/net/minecraft/world/item/ItemMilkBucket.java +@@ -5,6 +5,8 @@ import net.minecraft.server.level.EntityPlayer; + import net.minecraft.stats.StatisticList; + import net.minecraft.world.EnumHand; + import net.minecraft.world.InteractionResultWrapper; ++import net.minecraft.world.effect.MobEffect; ++import net.minecraft.world.effect.MobEffects; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.level.World; +@@ -29,7 +31,9 @@ public class ItemMilkBucket extends Item { } if (!world.isClientSide) { @@ -19,7 +28,7 @@ index fcf254bbaeb3c0ffdb6834a8d5ad2c3cf4235e5b..79554e18fc39ecd9db87618a59d2e670 return itemstack.isEmpty() ? new ItemStack(Items.BUCKET) : itemstack; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 8d1ad37f17935331ee867c15f91842cdc53d4450..bec457e5aac17b0db0788110ceda778c81f26042 100644 +index b16ea97f4119fe2cd7c218f3fecbb7202c362665..a892d9af3753c4ca8f3733c64bece1cd1ed468c6 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -113,8 +113,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0050-End-gateway-should-check-if-entity-can-use-portal.patch b/patches/Purpur/patches/server/0050-End-gateway-should-check-if-entity-can-use-portal.patch index a5e2168c..b1cf7f92 100644 --- a/patches/Purpur/patches/server/0050-End-gateway-should-check-if-entity-can-use-portal.patch +++ b/patches/Purpur/patches/server/0050-End-gateway-should-check-if-entity-can-use-portal.patch @@ -4,11 +4,11 @@ Date: Sat, 21 Mar 2020 18:33:05 -0500 Subject: [PATCH] End gateway should check if entity can use portal -diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index b740c9b66a77df1ff20fba794c49a1de4292ba88..e616b3759561e0d6e471f914f3dc843fe7464f2e 100644 ---- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java -+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -128,6 +128,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +index 855c49164277ca96ca08fb204d851a5ad6789990..d918194e45953764fa3fd286b715714330a60941 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +@@ -153,6 +153,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick public void b(Entity entity) { if (this.world instanceof WorldServer && !this.f()) { diff --git a/patches/Purpur/patches/server/0051-Fix-the-dead-lagging-the-server.patch b/patches/Purpur/patches/server/0051-Fix-the-dead-lagging-the-server.patch index 7a83a5cc..f24ce7d2 100644 --- a/patches/Purpur/patches/server/0051-Fix-the-dead-lagging-the-server.patch +++ b/patches/Purpur/patches/server/0051-Fix-the-dead-lagging-the-server.patch @@ -4,11 +4,11 @@ Date: Fri, 6 Mar 2020 13:37:26 -0600 Subject: [PATCH] Fix the dead lagging the server -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4edb489012ddc9454e412f06acc4587a3572c8d3..05902a6e9b1dd326776cac3bd70c438f9e83da26 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1536,6 +1536,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index c8071e2909c03bd8eafb92fbf8fd8701642df1f9..7c9fc120d2b58ca969b8a0ff9619e96f4f34b1c4 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1631,6 +1631,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F; this.lastYaw = this.yaw; this.lastPitch = this.pitch; @@ -16,11 +16,11 @@ index 4edb489012ddc9454e412f06acc4587a3572c8d3..05902a6e9b1dd326776cac3bd70c438f } public void f(double d0, double d1, double d2) { -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1dddf80e11db54a666de8c3b0d7a5c8a5f1f93ab..b273b021b0e3484a3189c3d6d55284b3c45a41ad 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2500,7 +2500,7 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 1602c00e04cccdee4e9eb4f4512145e8b1aeaf57..c540886511261303d2266ac97353e1b98c1f9601 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2597,7 +2597,7 @@ public abstract class EntityLiving extends Entity { } } diff --git a/patches/Purpur/patches/server/0052-Skip-events-if-there-s-no-listeners.patch b/patches/Purpur/patches/server/0052-Skip-events-if-there-s-no-listeners.patch index 0ac08c76..70de8683 100644 --- a/patches/Purpur/patches/server/0052-Skip-events-if-there-s-no-listeners.patch +++ b/patches/Purpur/patches/server/0052-Skip-events-if-there-s-no-listeners.patch @@ -4,11 +4,11 @@ Date: Sat, 4 Apr 2020 03:07:59 -0500 Subject: [PATCH] Skip events if there's no listeners -diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index e56ff365118c50486f36cb15a4ca062c5a481674..17753c8a997aa286460be5d8eb6508e2eaed18ce 100644 ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -278,6 +278,7 @@ public class CommandDispatcher { +diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java +index a70e0761aeddee8fafff971b5cbd0422ab560fb5..6fc5ee06c3bed8d9aa0e13dd7fa8d70ff6711f85 100644 +--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java +@@ -362,6 +362,7 @@ public class CommandDispatcher { } private void runSync(EntityPlayer entityplayer, Collection bukkit, RootCommandNode rootcommandnode) { @@ -16,7 +16,7 @@ index e56ff365118c50486f36cb15a4ca062c5a481674..17753c8a997aa286460be5d8eb6508e2 // Paper end - Async command map building new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(entityplayer.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper PlayerCommandSendEvent event = new PlayerCommandSendEvent(entityplayer.getBukkitEntity(), new LinkedHashSet<>(bukkit)); -@@ -290,6 +291,7 @@ public class CommandDispatcher { +@@ -374,6 +375,7 @@ public class CommandDispatcher { } } // CraftBukkit end diff --git a/patches/Purpur/patches/server/0053-Add-permission-for-F3-N-debug.patch b/patches/Purpur/patches/server/0053-Add-permission-for-F3-N-debug.patch index 56fcc54c..a1955281 100644 --- a/patches/Purpur/patches/server/0053-Add-permission-for-F3-N-debug.patch +++ b/patches/Purpur/patches/server/0053-Add-permission-for-F3-N-debug.patch @@ -4,11 +4,11 @@ Date: Sat, 28 Dec 2019 04:21:54 -0600 Subject: [PATCH] Add permission for F3+N debug -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7f784709ab8c560fd2dae551b6c8c234a2d134c6..f9043744ad0a622c6aa5e5bd3986fb9f60cab4c3 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1073,6 +1073,7 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 49acc6e43748a2d2a68f1b134421831b2feedd7b..54e009ee763a689125eb521f9144951aac53a4c0 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -1157,6 +1157,7 @@ public abstract class PlayerList { } else { b0 = (byte) (24 + i); } diff --git a/patches/Purpur/patches/server/0054-Add-wither-skeleton-takes-wither-damage-option.patch b/patches/Purpur/patches/server/0054-Add-wither-skeleton-takes-wither-damage-option.patch index f756a37a..84f792bb 100644 --- a/patches/Purpur/patches/server/0054-Add-wither-skeleton-takes-wither-damage-option.patch +++ b/patches/Purpur/patches/server/0054-Add-wither-skeleton-takes-wither-damage-option.patch @@ -4,11 +4,11 @@ Date: Tue, 14 Jan 2020 19:43:40 -0600 Subject: [PATCH] Add wither skeleton takes wither damage option -diff --git a/src/main/java/net/minecraft/server/EntitySkeletonWither.java b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -index 1ae9910fefece1a3fe6410b27642da6edd8f296d..c872be77a6cd767520d5412b38ec4ed4fa87ac2f 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeletonWither.java -+++ b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -@@ -97,6 +97,6 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +index 85ba95615963fd6b28c454b25992e7c5b7019ae5..a90ac635ef7aef5289d21f948db7b170b23160d3 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +@@ -122,6 +122,6 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { @Override public boolean d(MobEffect mobeffect) { @@ -17,7 +17,7 @@ index 1ae9910fefece1a3fe6410b27642da6edd8f296d..c872be77a6cd767520d5412b38ec4ed4 } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index bec457e5aac17b0db0788110ceda778c81f26042..d6a95f47c42538b574ec55c0cfffe064b80fdef0 100644 +index a892d9af3753c4ca8f3733c64bece1cd1ed468c6..28ac3fcfb73acddd13712f5c625bd61be99cb7c5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -279,6 +279,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0055-Configurable-TPS-Catchup.patch b/patches/Purpur/patches/server/0055-Configurable-TPS-Catchup.patch index 5cdfaf81..ecd7757a 100644 --- a/patches/Purpur/patches/server/0055-Configurable-TPS-Catchup.patch +++ b/patches/Purpur/patches/server/0055-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 830f3e52b7e5b8604e7c17227476c397912f93c3..d1d5216f14fd2fb9b3bebcdb3864bbaed1f3d5c2 100644 +index 34793bc4bd14dc7a34f32ccfec05cf50eb77cee2..5367c3b7bdfb6951986e5c844fb978f42a0bfec5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1010,7 +1010,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0 && !this.z()) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index d6a95f47c42538b574ec55c0cfffe064b80fdef0..4a0bbc0cd41b4a50ebad9b4569e07d727fc3e482 100644 +index 28ac3fcfb73acddd13712f5c625bd61be99cb7c5..5d4432177aabbfd72e549b3bb5cf5381f71ce07a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -114,9 +114,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0057-Add-enderman-and-creeper-griefing-controls.patch b/patches/Purpur/patches/server/0057-Add-enderman-and-creeper-griefing-controls.patch index 86df8a15..ef0b1893 100644 --- a/patches/Purpur/patches/server/0057-Add-enderman-and-creeper-griefing-controls.patch +++ b/patches/Purpur/patches/server/0057-Add-enderman-and-creeper-griefing-controls.patch @@ -4,11 +4,11 @@ Date: Sun, 26 Apr 2020 16:28:38 -0500 Subject: [PATCH] Add enderman and creeper griefing controls -diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index ff80ac7db73b7c7dd6ac62ac128af1cab961d075..36bf307985624a3567eb1196e034470bd7002e1e 100644 ---- a/src/main/java/net/minecraft/server/EntityCreeper.java -+++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -216,7 +216,7 @@ public class EntityCreeper extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +index 1986f6a672b97c1f0366bdb76e185815b8ca3bd6..f1ff9a323eaa636b21e64860d2a83a2ba6c164ea 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +@@ -255,7 +255,7 @@ public class EntityCreeper extends EntityMonster { public void explode() { if (!this.world.isClientSide) { @@ -17,11 +17,11 @@ index ff80ac7db73b7c7dd6ac62ac128af1cab961d075..36bf307985624a3567eb1196e034470b float f = this.isPowered() ? 2.0F : 1.0F; // CraftBukkit start -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index f53525eb32a6096ae24fd23756b2169d5d39e9d4..7b175240e44b0c7eb5044d7bcaf54dac22f50f2a 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -369,6 +369,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 4d7b5d47ab6bd3b1408811c3b9c157b1eb5c30ae..72142f5c777c6218050bc2b69891072d256ea57d 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -431,6 +431,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @Override public boolean a() { @@ -29,7 +29,7 @@ index f53525eb32a6096ae24fd23756b2169d5d39e9d4..7b175240e44b0c7eb5044d7bcaf54dac return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); } -@@ -402,7 +403,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -464,7 +465,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal { @@ -38,7 +38,7 @@ index f53525eb32a6096ae24fd23756b2169d5d39e9d4..7b175240e44b0c7eb5044d7bcaf54dac public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { this.a = entityenderman; -@@ -410,6 +411,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -472,6 +473,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @Override public boolean a() { @@ -47,7 +47,7 @@ index f53525eb32a6096ae24fd23756b2169d5d39e9d4..7b175240e44b0c7eb5044d7bcaf54dac } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 4a0bbc0cd41b4a50ebad9b4569e07d727fc3e482..236b4f51ea805c671b905c1b081538b67cee7f57 100644 +index 5d4432177aabbfd72e549b3bb5cf5381f71ce07a..ab703cbb1b4322b62246d974e3efa08884496ede 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -191,8 +191,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0058-Entities-pick-up-loot-bypass-mob-griefing-gamerule.patch b/patches/Purpur/patches/server/0058-Entities-pick-up-loot-bypass-mob-griefing-gamerule.patch index 2378d907..38589b23 100644 --- a/patches/Purpur/patches/server/0058-Entities-pick-up-loot-bypass-mob-griefing-gamerule.patch +++ b/patches/Purpur/patches/server/0058-Entities-pick-up-loot-bypass-mob-griefing-gamerule.patch @@ -4,11 +4,11 @@ Date: Fri, 24 Apr 2020 09:33:11 -0500 Subject: [PATCH] Entities pick up loot bypass mob-griefing gamerule -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 07908edcaffb5ee1be8a71f3f0affb91c7e6e51b..d38102bbf48dd498d80911e954e910a33d390daa 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -546,7 +546,7 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index 7443fe924486404931c11793acc67e2f03de4e41..d8a627ed1fad1fca37d8f8a3a344b80a60fc5e2f 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -614,7 +614,7 @@ public abstract class EntityInsentient extends EntityLiving { public void movementTick() { super.movementTick(); this.world.getMethodProfiler().enter("looting"); @@ -18,7 +18,7 @@ index 07908edcaffb5ee1be8a71f3f0affb91c7e6e51b..d38102bbf48dd498d80911e954e910a3 Iterator iterator = list.iterator(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 236b4f51ea805c671b905c1b081538b67cee7f57..2fae60a6fd767cc6d0aed7a6241ba5a6bf05eaca 100644 +index ab703cbb1b4322b62246d974e3efa08884496ede..29cab794e485b8e07b9e56f8cfb917934364121b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -113,10 +113,12 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0059-Villagers-farming-can-bypass-mob-griefing-gamerule.patch b/patches/Purpur/patches/server/0059-Villagers-farming-can-bypass-mob-griefing-gamerule.patch index 846453c8..a13ad74c 100644 --- a/patches/Purpur/patches/server/0059-Villagers-farming-can-bypass-mob-griefing-gamerule.patch +++ b/patches/Purpur/patches/server/0059-Villagers-farming-can-bypass-mob-griefing-gamerule.patch @@ -4,11 +4,11 @@ Date: Fri, 24 Apr 2020 09:37:29 -0500 Subject: [PATCH] Villagers farming can bypass mob-griefing gamerule -diff --git a/src/main/java/net/minecraft/server/BehaviorFarm.java b/src/main/java/net/minecraft/server/BehaviorFarm.java -index 54a555509e3d83e9749609dc35897ad151bca681..0ff202c0d77681f7e0d55d57c69dd0e455336eba 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFarm.java -+++ b/src/main/java/net/minecraft/server/BehaviorFarm.java -@@ -18,7 +18,7 @@ public class BehaviorFarm extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java +index bd998ea93d7e8748b0a938f0a76b4ccf388c7b27..42c70a6c2972ac38e889a6d42fe2d7d4f6017d57 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java +@@ -38,7 +38,7 @@ public class BehaviorFarm extends Behavior { } protected boolean a(WorldServer worldserver, EntityVillager entityvillager) { @@ -18,7 +18,7 @@ index 54a555509e3d83e9749609dc35897ad151bca681..0ff202c0d77681f7e0d55d57c69dd0e4 } else if (entityvillager.getVillagerData().getProfession() != VillagerProfession.FARMER) { return false; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2fae60a6fd767cc6d0aed7a6241ba5a6bf05eaca..edcbec38dfb5b32f4b8ba40c7a1ac6e26f0a4c3b 100644 +index 29cab794e485b8e07b9e56f8cfb917934364121b..c51628f1f30bcd0206fc2b04ed83aca4ab7fd51a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -285,9 +285,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0060-Villagers-follow-emerald-blocks.patch b/patches/Purpur/patches/server/0060-Villagers-follow-emerald-blocks.patch index 2598a925..5eafb9e9 100644 --- a/patches/Purpur/patches/server/0060-Villagers-follow-emerald-blocks.patch +++ b/patches/Purpur/patches/server/0060-Villagers-follow-emerald-blocks.patch @@ -4,11 +4,19 @@ Date: Fri, 29 Nov 2019 22:10:12 -0600 Subject: [PATCH] Villagers follow emerald blocks -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 1c87bc91515490e2f8579a5321058845c7d30a56..3ae6e9fceb8feea8340fc542727423379a3f8863 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -72,6 +72,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 5539c4cbea46398e92ab6ec56bb9b821e5f01e02..2464f1a5a922a5557e2d00233033714533acad76 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -59,6 +59,7 @@ import net.minecraft.world.entity.ai.BehaviorController; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.behavior.Behaviors; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalTempt; + import net.minecraft.world.entity.ai.gossip.Reputation; + import net.minecraft.world.entity.ai.gossip.ReputationType; + import net.minecraft.world.entity.ai.memory.MemoryModuleType; +@@ -143,6 +144,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation this.brainTickOffset = getRandom().nextInt(100); // Purpur } @@ -22,11 +30,25 @@ index 1c87bc91515490e2f8579a5321058845c7d30a56..3ae6e9fceb8feea8340fc54272742337 @Override public BehaviorController getBehaviorController() { return (BehaviorController) super.getBehaviorController(); // CraftBukkit - decompile error -diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java -index e0cc45a7494cd6f06169b64ee8ffc16aa1932f8f..baf74566ec8569677e6f03aef96645c13ec94d89 100644 ---- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java -+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java -@@ -18,6 +18,8 @@ import io.papermc.paper.event.player.PlayerTradeEvent; +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java +index 49821f0f26864c35be84a4a4288857a04668fbba..91142526187f96615b5cbd3ed3b68d9175cb9f8b 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java +@@ -25,11 +25,13 @@ import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.crafting.RecipeItemStack; + import net.minecraft.world.item.trading.IMerchant; + import net.minecraft.world.item.trading.MerchantRecipe; + import net.minecraft.world.item.trading.MerchantRecipeList; + import net.minecraft.world.level.World; + import net.minecraft.world.level.WorldAccess; ++import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.pathfinder.PathType; + + // CraftBukkit start +@@ -45,6 +47,8 @@ import io.papermc.paper.event.player.PlayerTradeEvent; public abstract class EntityVillagerAbstract extends EntityAgeable implements NPC, IMerchant { @@ -35,11 +57,19 @@ index e0cc45a7494cd6f06169b64ee8ffc16aa1932f8f..baf74566ec8569677e6f03aef96645c1 // CraftBukkit start private CraftMerchant craftMerchant; -diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index 250a4e5ddd626794482678a64023f0f5459520e1..d990aae60e5a6056b44249cb7039470c6757b7fb 100644 ---- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java -+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -@@ -42,6 +42,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +index 37e1b2bf33510c3603efadf219b462e667f573c2..6c13a34a7ab220a3bba1c091f4f6a9e1340212f6 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +@@ -26,6 +26,7 @@ import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtTradingPlayer; + import net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsRestriction; + import net.minecraft.world.entity.ai.goal.PathfinderGoalPanic; + import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalTempt; + import net.minecraft.world.entity.ai.goal.PathfinderGoalTradeWithPlayer; + import net.minecraft.world.entity.ai.goal.PathfinderGoalUseItem; + import net.minecraft.world.entity.monster.EntityEvoker; +@@ -85,6 +86,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.5D)); this.goalSelector.a(1, new PathfinderGoalLookAtTradingPlayer(this)); this.goalSelector.a(2, new EntityVillagerTrader.a(this, 2.0D, 0.35D)); @@ -48,7 +78,7 @@ index 250a4e5ddd626794482678a64023f0f5459520e1..d990aae60e5a6056b44249cb7039470c this.goalSelector.a(8, new PathfinderGoalRandomStrollLand(this, 0.35D)); this.goalSelector.a(9, new PathfinderGoalInteract(this, EntityHuman.class, 3.0F, 1.0F)); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index edcbec38dfb5b32f4b8ba40c7a1ac6e26f0a4c3b..a1f85ef007f2ed410f1662405b0b1175c544e0b6 100644 +index c51628f1f30bcd0206fc2b04ed83aca4ab7fd51a..7d66e253391522d754146275024ffb017a685e6f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -286,10 +286,17 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0061-Allow-leashing-villagers.patch b/patches/Purpur/patches/server/0061-Allow-leashing-villagers.patch index af680a00..ebe097cc 100644 --- a/patches/Purpur/patches/server/0061-Allow-leashing-villagers.patch +++ b/patches/Purpur/patches/server/0061-Allow-leashing-villagers.patch @@ -4,11 +4,19 @@ Date: Thu, 3 Oct 2019 18:08:03 -0500 Subject: [PATCH] Allow leashing villagers -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index d38102bbf48dd498d80911e954e910a33d390daa..566d6a2551ffbcf4366596cab87a7239a75156c6 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1147,6 +1147,7 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index d8a627ed1fad1fca37d8f8a3a344b80a60fc5e2f..1a1561ab4276bd3654adc2cc2219f3bdb3924b88 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -49,6 +49,7 @@ import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.entity.monster.EntityBlaze; + import net.minecraft.world.entity.monster.EntityEnderman; + import net.minecraft.world.entity.monster.IMonster; ++import net.minecraft.world.entity.npc.EntityVillagerAbstract; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.vehicle.EntityBoat; + import net.minecraft.world.item.Item; +@@ -1217,6 +1218,7 @@ public abstract class EntityInsentient extends EntityLiving { if (!this.isAlive()) { return EnumInteractionResult.PASS; } else if (this.getLeashHolder() == entityhuman) { @@ -16,11 +24,11 @@ index d38102bbf48dd498d80911e954e910a33d390daa..566d6a2551ffbcf4366596cab87a7239 // CraftBukkit start - fire PlayerUnleashEntityEvent // Paper start - drop leash variable PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, entityhuman, !entityhuman.abilities.canInstantlyBuild); -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 3ae6e9fceb8feea8340fc542727423379a3f8863..1fa6cf564099323c8332e68cadf64c28dfc84998 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -77,6 +77,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 2464f1a5a922a5557e2d00233033714533acad76..aeb3c82afeda3f1688b1b6617c6d05da2e7a3c76 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -149,6 +149,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void initPathfinder() { if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS)); } @@ -32,11 +40,11 @@ index 3ae6e9fceb8feea8340fc542727423379a3f8863..1fa6cf564099323c8332e68cadf64c28 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index d990aae60e5a6056b44249cb7039470c6757b7fb..432956d9d5f2706014d67232b88e6b86011484f3 100644 ---- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java -+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -@@ -49,6 +49,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +index 6c13a34a7ab220a3bba1c091f4f6a9e1340212f6..e0324cdb2d4c85714eaad490a7a5c826b38e6b16 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +@@ -93,6 +93,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); } @@ -51,7 +59,7 @@ index d990aae60e5a6056b44249cb7039470c6757b7fb..432956d9d5f2706014d67232b88e6b86 @Override public EntityAgeable createChild(WorldServer worldserver, EntityAgeable entityageable) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a1f85ef007f2ed410f1662405b0b1175c544e0b6..a9e7ddd55aa2b9b2c8f172069353b070c427b806 100644 +index 7d66e253391522d754146275024ffb017a685e6f..b6d6685f135ee66a25f29c0f00a63bbe78d0c3a5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -285,17 +285,21 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0062-Implement-configurable-search-radius-for-villagers-t.patch b/patches/Purpur/patches/server/0062-Implement-configurable-search-radius-for-villagers-t.patch index 192067b6..1d450ba2 100644 --- a/patches/Purpur/patches/server/0062-Implement-configurable-search-radius-for-villagers-t.patch +++ b/patches/Purpur/patches/server/0062-Implement-configurable-search-radius-for-villagers-t.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Implement configurable search radius for villagers to spawn iron golems -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 1fa6cf564099323c8332e68cadf64c28dfc84998..8002c55497f772eadae3242cad06d529571e97bf 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -892,6 +892,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index aeb3c82afeda3f1688b1b6617c6d05da2e7a3c76..2fad37812bfa39872e99c4432e1982d62f65efb7 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -970,6 +970,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @Nullable private EntityIronGolem d(WorldServer worldserver) { @@ -18,7 +18,7 @@ index 1fa6cf564099323c8332e68cadf64c28dfc84998..8002c55497f772eadae3242cad06d529 for (int i = 0; i < 10; ++i) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a9e7ddd55aa2b9b2c8f172069353b070c427b806..0de099d29b5e351822e59af6e389dc91c67eb2b2 100644 +index b6d6685f135ee66a25f29c0f00a63bbe78d0c3a5..81f0538f6e5ab48a07459b102ea1f4533a63d031 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -288,12 +288,16 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0063-Implement-infinite-lava.patch b/patches/Purpur/patches/server/0063-Implement-infinite-lava.patch index d3a7fa09..5c1093d6 100644 --- a/patches/Purpur/patches/server/0063-Implement-infinite-lava.patch +++ b/patches/Purpur/patches/server/0063-Implement-infinite-lava.patch @@ -4,11 +4,11 @@ Date: Sat, 23 Nov 2019 17:55:42 -0600 Subject: [PATCH] Implement infinite lava -diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java -index cf9d3faabe8732d27c436f4806c727592e475f81..46bdeca19a0da06a1fcbd7043a26689b64459d67 100644 ---- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java -+++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java -@@ -196,7 +196,7 @@ public abstract class FluidTypeFlowing extends FluidType { +diff --git a/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java b/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java +index 6bb4ec00e40795ced73648fefcd1f5027e0113cd..963b7edab813cd32f04c51fd2c6c137988e2a754 100644 +--- a/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java ++++ b/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java +@@ -217,7 +217,7 @@ public abstract class FluidTypeFlowing extends FluidType { } } @@ -17,7 +17,7 @@ index cf9d3faabe8732d27c436f4806c727592e475f81..46bdeca19a0da06a1fcbd7043a26689b IBlockData iblockdata2 = iworldreader.getType(blockposition.down()); Fluid fluid1 = iblockdata2.getFluid(); -@@ -267,6 +267,17 @@ public abstract class FluidTypeFlowing extends FluidType { +@@ -288,6 +288,17 @@ public abstract class FluidTypeFlowing extends FluidType { return (Fluid) this.e().h().set(FluidTypeFlowing.FALLING, flag); } @@ -35,11 +35,11 @@ index cf9d3faabe8732d27c436f4806c727592e475f81..46bdeca19a0da06a1fcbd7043a26689b protected abstract boolean f(); protected void a(GeneratorAccess generatoraccess, BlockPosition blockposition, IBlockData iblockdata, EnumDirection enumdirection, Fluid fluid) { -diff --git a/src/main/java/net/minecraft/server/FluidTypeLava.java b/src/main/java/net/minecraft/server/FluidTypeLava.java -index 29930e801cdcb97bec2fb113ec478fe9c4a63b63..ffab2391925f577420ee52f3aa05041afa61464e 100644 ---- a/src/main/java/net/minecraft/server/FluidTypeLava.java -+++ b/src/main/java/net/minecraft/server/FluidTypeLava.java -@@ -147,6 +147,18 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { +diff --git a/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java b/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java +index b362a728b5d17256768847ab09e2505a9cc1918b..86f2e969d98c833700f0f48baf7610ad95b3f8a1 100644 +--- a/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java ++++ b/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java +@@ -163,6 +163,18 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { generatoraccess.triggerEffect(1501, blockposition, 0); } @@ -59,7 +59,7 @@ index 29930e801cdcb97bec2fb113ec478fe9c4a63b63..ffab2391925f577420ee52f3aa05041a protected boolean f() { return false; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 0de099d29b5e351822e59af6e389dc91c67eb2b2..37bc3033b3b7281da4f8783d3fbe9a0a4d33a9de 100644 +index 81f0538f6e5ab48a07459b102ea1f4533a63d031..29bb808b1efe392157971a1a21c66eb9b85579d8 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -158,6 +158,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0064-Make-lava-flow-speed-configurable.patch b/patches/Purpur/patches/server/0064-Make-lava-flow-speed-configurable.patch index 56ea9ec1..c5dd85c1 100644 --- a/patches/Purpur/patches/server/0064-Make-lava-flow-speed-configurable.patch +++ b/patches/Purpur/patches/server/0064-Make-lava-flow-speed-configurable.patch @@ -4,11 +4,11 @@ Date: Thu, 2 Jan 2020 11:31:36 -0600 Subject: [PATCH] Make lava flow speed configurable -diff --git a/src/main/java/net/minecraft/server/FluidTypeLava.java b/src/main/java/net/minecraft/server/FluidTypeLava.java -index ffab2391925f577420ee52f3aa05041afa61464e..d981aa5a5f001333675eabd50497bbfa2dcf1df3 100644 ---- a/src/main/java/net/minecraft/server/FluidTypeLava.java -+++ b/src/main/java/net/minecraft/server/FluidTypeLava.java -@@ -129,7 +129,7 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { +diff --git a/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java b/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java +index 86f2e969d98c833700f0f48baf7610ad95b3f8a1..e706695d42d7557f818595aa30fb3cfc35ba9f6b 100644 +--- a/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java ++++ b/src/main/java/net/minecraft/world/level/material/FluidTypeLava.java +@@ -145,7 +145,7 @@ public abstract class FluidTypeLava extends FluidTypeFlowing { @Override public int a(IWorldReader iworldreader) { @@ -18,7 +18,7 @@ index ffab2391925f577420ee52f3aa05041afa61464e..d981aa5a5f001333675eabd50497bbfa @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 37bc3033b3b7281da4f8783d3fbe9a0a4d33a9de..d5adf653c6a561fe1de9e340d85c9439f8c559f5 100644 +index 29bb808b1efe392157971a1a21c66eb9b85579d8..d51ee6ff1b73f0bafec88fd5445df37a1182c5d0 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -160,9 +160,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0065-Add-player-death-exp-control-options.patch b/patches/Purpur/patches/server/0065-Add-player-death-exp-control-options.patch index bb0ffd36..c3a58fd6 100644 --- a/patches/Purpur/patches/server/0065-Add-player-death-exp-control-options.patch +++ b/patches/Purpur/patches/server/0065-Add-player-death-exp-control-options.patch @@ -4,11 +4,11 @@ Date: Thu, 26 Dec 2019 22:08:37 -0600 Subject: [PATCH] Add player death exp control options -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 390aae2733e397ac5c6c457c76bf75f9c8dcd873..ab2ad054ce8d896e38ab4eb6ed38d8ea73d42954 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -85,6 +85,8 @@ public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index 8f9d0769e7855c3565a34927f3f3741c43e45f35..2ee7daa155d812af8f84ba646106d801d2fb0fec 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -183,6 +183,8 @@ public abstract class EntityHuman extends EntityLiving { // CraftBukkit end // Purpur start @@ -17,7 +17,7 @@ index 390aae2733e397ac5c6c457c76bf75f9c8dcd873..ab2ad054ce8d896e38ab4eb6ed38d8ea public void setAfk(boolean setAfk){ } -@@ -1716,9 +1718,18 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1814,9 +1816,18 @@ public abstract class EntityHuman extends EntityLiving { @Override protected int getExpValue(EntityHuman entityhuman) { if (!this.world.getGameRules().getBoolean(GameRules.KEEP_INVENTORY) && !this.isSpectator()) { @@ -40,7 +40,7 @@ index 390aae2733e397ac5c6c457c76bf75f9c8dcd873..ab2ad054ce8d896e38ab4eb6ed38d8ea return 0; } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index d5adf653c6a561fe1de9e340d85c9439f8c559f5..c5574ac52d050cc1b89ab2dbd4dad5ce5e331f83 100644 +index d51ee6ff1b73f0bafec88fd5445df37a1182c5d0..e10aa8ddbcea3588b2da08de929eed18cb9f022c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -123,6 +123,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0066-Add-canSaveToDisk-to-Entity.patch b/patches/Purpur/patches/server/0066-Add-canSaveToDisk-to-Entity.patch index 411f4098..545c8112 100644 --- a/patches/Purpur/patches/server/0066-Add-canSaveToDisk-to-Entity.patch +++ b/patches/Purpur/patches/server/0066-Add-canSaveToDisk-to-Entity.patch @@ -4,23 +4,11 @@ Date: Tue, 18 Feb 2020 20:07:08 -0600 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 076d6c1e1cc049dd312ecb30518e7b25fc2d7371..5f04591193d58ba7897194142da5efcbec3763dd 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -536,6 +536,7 @@ public class ChunkRegionLoader { - - while (iterator1.hasNext()) { - Entity entity = (Entity) iterator1.next(); -+ if (!entity.canSaveToDisk()) continue; // Purpur - final EntityTypes entityType = entity.getEntityType(); - final int saveLimit = worldserver.paperConfig.entityPerChunkSaveLimits.getOrDefault(entityType, -1); - if (saveLimit > -1) { -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 05902a6e9b1dd326776cac3bd70c438f9e83da26..a1776d7fad2aad6bd323c6c97472fdca0b4618db 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -321,6 +321,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 7c9fc120d2b58ca969b8a0ff9619e96f4f34b1c4..4e6ec59c982fe0870f514b59082ab0a7de4d93ef 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -416,6 +416,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.headHeight = this.getHeadHeight(EntityPose.STANDING, this.size); } @@ -33,3 +21,15 @@ index 05902a6e9b1dd326776cac3bd70c438f9e83da26..a1776d7fad2aad6bd323c6c97472fdca public boolean isSpectator() { return false; } +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +index bf96f9e538fc29ca914536e8a7ce727ebe43a8b2..5997f3e47f3d509c271f38eb2785f126066f5c6e 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -582,6 +582,7 @@ public class ChunkRegionLoader { + + while (iterator1.hasNext()) { + Entity entity = (Entity) iterator1.next(); ++ if (!entity.canSaveToDisk()) continue; // Purpur + final EntityTypes entityType = entity.getEntityType(); + final int saveLimit = worldserver.paperConfig.entityPerChunkSaveLimits.getOrDefault(entityType, -1); + if (saveLimit > -1) { diff --git a/patches/Purpur/patches/server/0067-Configurable-void-damage-height.patch b/patches/Purpur/patches/server/0067-Configurable-void-damage-height.patch index a094150b..8ce3026a 100644 --- a/patches/Purpur/patches/server/0067-Configurable-void-damage-height.patch +++ b/patches/Purpur/patches/server/0067-Configurable-void-damage-height.patch @@ -4,11 +4,11 @@ Date: Thu, 27 Feb 2020 21:42:19 -0600 Subject: [PATCH] Configurable void damage height -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a1776d7fad2aad6bd323c6c97472fdca0b4618db..b60eee0d86d55224c9fc8caf3a3a13089c0150e9 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -624,7 +624,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 4e6ec59c982fe0870f514b59082ab0a7de4d93ef..b114d12d9d17071fb96f5ab225b85cdd5ad06861 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -719,7 +719,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne // Paper start protected void performVoidDamage() { @@ -18,7 +18,7 @@ index a1776d7fad2aad6bd323c6c97472fdca0b4618db..b60eee0d86d55224c9fc8caf3a3a1308 && this.locY() >= world.paperConfig.netherVoidTopDamageHeight)) { this.doVoidDamage(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index c5574ac52d050cc1b89ab2dbd4dad5ce5e331f83..4d34957c6255af571e593e015fa9dcafa733aceb 100644 +index e10aa8ddbcea3588b2da08de929eed18cb9f022c..ef5a691861cdf249f0430fca7f7bbe241479926e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -116,11 +116,13 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0068-Dispenser-curse-of-binding-protection.patch b/patches/Purpur/patches/server/0068-Dispenser-curse-of-binding-protection.patch index 267c455f..9edb53f9 100644 --- a/patches/Purpur/patches/server/0068-Dispenser-curse-of-binding-protection.patch +++ b/patches/Purpur/patches/server/0068-Dispenser-curse-of-binding-protection.patch @@ -4,11 +4,19 @@ Date: Sun, 25 Aug 2019 00:09:52 -0500 Subject: [PATCH] Dispenser curse of binding protection -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 566d6a2551ffbcf4366596cab87a7239a75156c6..9807441d53fcf4ef7aaffe3801542f5a371eb7af 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -996,6 +996,13 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index 1a1561ab4276bd3654adc2cc2219f3bdb3924b88..462bcb7cfe2daa27c10a7a0318bef9b739e586f4 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -65,6 +65,7 @@ import net.minecraft.world.item.ItemSword; + import net.minecraft.world.item.ItemTool; + import net.minecraft.world.item.Items; + import net.minecraft.world.item.enchantment.EnchantmentManager; ++import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.IBlockAccess; +@@ -1067,6 +1068,13 @@ public abstract class EntityInsentient extends EntityLiving { } @@ -22,11 +30,11 @@ index 566d6a2551ffbcf4366596cab87a7239a75156c6..9807441d53fcf4ef7aaffe3801542f5a public static EnumItemSlot j(ItemStack itemstack) { Item item = itemstack.getItem(); -diff --git a/src/main/java/net/minecraft/server/ItemArmor.java b/src/main/java/net/minecraft/server/ItemArmor.java -index 669a5041184846ca8430a7f0d3197025fe6d437e..7cd2e871b5a429a86dbc3c4208d247a4246ea1a8 100644 ---- a/src/main/java/net/minecraft/server/ItemArmor.java -+++ b/src/main/java/net/minecraft/server/ItemArmor.java -@@ -35,7 +35,7 @@ public class ItemArmor extends Item implements ItemWearable { +diff --git a/src/main/java/net/minecraft/world/item/ItemArmor.java b/src/main/java/net/minecraft/world/item/ItemArmor.java +index 7962808aebf67cf9bc1dc4c1e106e943536fdced..d072b604a1cd8835c1fe658831cdaf9f27d02cd5 100644 +--- a/src/main/java/net/minecraft/world/item/ItemArmor.java ++++ b/src/main/java/net/minecraft/world/item/ItemArmor.java +@@ -54,7 +54,7 @@ public class ItemArmor extends Item implements ItemWearable { return false; } else { EntityLiving entityliving = (EntityLiving) list.get(0); @@ -35,7 +43,7 @@ index 669a5041184846ca8430a7f0d3197025fe6d437e..7cd2e871b5a429a86dbc3c4208d247a4 ItemStack itemstack1 = itemstack.cloneAndSubtract(1); // CraftBukkit start World world = isourceblock.getWorld(); -@@ -94,6 +94,7 @@ public class ItemArmor extends Item implements ItemWearable { +@@ -113,6 +113,7 @@ public class ItemArmor extends Item implements ItemWearable { this.m = builder.build(); } @@ -44,7 +52,7 @@ index 669a5041184846ca8430a7f0d3197025fe6d437e..7cd2e871b5a429a86dbc3c4208d247a4 return this.b; } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 4d34957c6255af571e593e015fa9dcafa733aceb..26df95f502d117398c7c9c65b298b97b62021700 100644 +index ef5a691861cdf249f0430fca7f7bbe241479926e..5b42e8347a42a16f79fbbc122e5cd82533e53b8c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -162,6 +162,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0069-Add-option-for-boats-to-eject-players-on-land.patch b/patches/Purpur/patches/server/0069-Add-option-for-boats-to-eject-players-on-land.patch index ced4a492..96abfcc6 100644 --- a/patches/Purpur/patches/server/0069-Add-option-for-boats-to-eject-players-on-land.patch +++ b/patches/Purpur/patches/server/0069-Add-option-for-boats-to-eject-players-on-land.patch @@ -4,11 +4,11 @@ Date: Sat, 7 Sep 2019 22:47:59 -0500 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 15ce9f90306d062f36d1651d7426813e897523bf..05c702bbdb8addea5c69faa0479609e8959945f1 100644 ---- a/src/main/java/net/minecraft/server/EntityBoat.java -+++ b/src/main/java/net/minecraft/server/EntityBoat.java -@@ -442,6 +442,7 @@ public class EntityBoat extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +index 5e2c13bd6e52ffe182ef034e05ba6fe1cb301005..01839c7319e175477ded7001e00e5937734ff516 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +@@ -487,6 +487,7 @@ public class EntityBoat extends Entity { if (f > 0.0F) { this.aw = f; @@ -17,7 +17,7 @@ index 15ce9f90306d062f36d1651d7426813e897523bf..05c702bbdb8addea5c69faa0479609e8 } else { return EntityBoat.EnumStatus.IN_AIR; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 26df95f502d117398c7c9c65b298b97b62021700..5eae6c99e35d53f5340bc81034823a2f1ed85544 100644 +index 5b42e8347a42a16f79fbbc122e5cd82533e53b8c..f443fadcafdbc3d69c86730e3fb1a71078d7fdf5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -112,12 +112,14 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0070-Add-obfhelpers-for-plugin-use.patch b/patches/Purpur/patches/server/0070-Add-obfhelpers-for-plugin-use.patch index 217ab639..793fe557 100644 --- a/patches/Purpur/patches/server/0070-Add-obfhelpers-for-plugin-use.patch +++ b/patches/Purpur/patches/server/0070-Add-obfhelpers-for-plugin-use.patch @@ -4,11 +4,11 @@ Date: Wed, 1 Jan 2020 20:12:39 -0600 Subject: [PATCH] Add obfhelpers for plugin use -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index afa1dc693bc2e2e68294a1d3dec1c078ea95b286..7f3df9ba37076c0a982803148d21b0985f62f12c 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -639,6 +639,7 @@ public final class ItemStack { +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index fee862951f2767d4a3c5268dff157c185378a939..91a1b2e955b04f0cc1ca05d7ee4d832d9efb97cb 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -694,6 +694,7 @@ public final class ItemStack { return this.tag; } diff --git a/patches/Purpur/patches/server/0071-Mending-mends-most-damages-equipment-first.patch b/patches/Purpur/patches/server/0071-Mending-mends-most-damages-equipment-first.patch index 40561954..275938db 100644 --- a/patches/Purpur/patches/server/0071-Mending-mends-most-damages-equipment-first.patch +++ b/patches/Purpur/patches/server/0071-Mending-mends-most-damages-equipment-first.patch @@ -4,11 +4,48 @@ Date: Sun, 14 Jul 2019 19:52:47 -0500 Subject: [PATCH] Mending mends most damages equipment first -diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 7b263594304a9b745f583fe7178ac16936cbd93b..33e2dc3a1003fe95fa71999fc24df84131238a6a 100644 ---- a/src/main/java/net/minecraft/server/EnchantmentManager.java -+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java -@@ -251,7 +251,30 @@ public class EnchantmentManager { +diff --git a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java +index a7551e95185895a290be70d501496279eaf884ae..31d36ead273e8397ba2c826b791a2cf59306ff7f 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java ++++ b/src/main/java/net/minecraft/world/entity/EntityExperienceOrb.java +@@ -236,7 +236,7 @@ public class EntityExperienceOrb extends Entity { + if (this.d == 0 && entityhuman.bu == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper + entityhuman.bu = 2; + entityhuman.receive(this, 1); +- Entry entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f); ++ Entry entry = world.purpurConfig.useBetterMending ? EnchantmentManager.getMostDamagedEquipment(Enchantments.MENDING, entityhuman) : EnchantmentManager.a(Enchantments.MENDING, entityhuman, ItemStack::isDamaged); // Purpur + + if (entry != null) { + ItemStack itemstack = (ItemStack) entry.getValue(); +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 91a1b2e955b04f0cc1ca05d7ee4d832d9efb97cb..fcc6ee9481d577d39339cd0ac24dab06bd76e5c6 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -468,10 +468,19 @@ public final class ItemStack { + } + } + ++ public boolean isDamaged() { return f(); } // Purpur - OBFHELPER + public boolean f() { + return this.e() && this.getDamage() > 0; + } + ++ public float getDamagePercent() { ++ if (isDamaged()) { ++ return (float) getDamage() / (float) getItem().getMaxDurability(); ++ } else { ++ return 0F; ++ } ++ } ++ + public int getDamage() { + return this.tag == null ? 0 : this.tag.getInt("Damage"); + } +diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java +index 72afbf8f537770540e90a2880ea81de137ea10f5..b2d28c2bf0a9e93d38583e2d734c12fed4f63d5d 100644 +--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java ++++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentManager.java +@@ -269,7 +269,30 @@ public class EnchantmentManager { return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0; } @@ -40,45 +77,8 @@ index 7b263594304a9b745f583fe7178ac16936cbd93b..33e2dc3a1003fe95fa71999fc24df841 @Nullable public static Entry b(Enchantment enchantment, EntityLiving entityliving) { return a(enchantment, entityliving, (itemstack) -> { return true; -diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 4a94ce72d559263ef5fa4fb16dc286f531f51d55..4aee11c980105a523bdcb35470053aae51b002df 100644 ---- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java -+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -@@ -221,7 +221,7 @@ public class EntityExperienceOrb extends Entity { - if (this.d == 0 && entityhuman.bu == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - entityhuman.bu = 2; - entityhuman.receive(this, 1); -- Entry entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f); -+ Entry entry = world.purpurConfig.useBetterMending ? EnchantmentManager.getMostDamagedEquipment(Enchantments.MENDING, entityhuman) : EnchantmentManager.a(Enchantments.MENDING, entityhuman, ItemStack::isDamaged); // Purpur - - if (entry != null) { - ItemStack itemstack = (ItemStack) entry.getValue(); -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 7f3df9ba37076c0a982803148d21b0985f62f12c..e747ee83f1a69a4a4bad87e720abc9b085fb6149 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -413,10 +413,19 @@ public final class ItemStack { - } - } - -+ public boolean isDamaged() { return f(); } // Purpur - OBFHELPER - public boolean f() { - return this.e() && this.getDamage() > 0; - } - -+ public float getDamagePercent() { -+ if (isDamaged()) { -+ return (float) getDamage() / (float) getItem().getMaxDurability(); -+ } else { -+ return 0F; -+ } -+ } -+ - public int getDamage() { - return this.tag == null ? 0 : this.tag.getInt("Damage"); - } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5eae6c99e35d53f5340bc81034823a2f1ed85544..66e74ee74b56e25ca46704ca6cec403f15126c33 100644 +index f443fadcafdbc3d69c86730e3fb1a71078d7fdf5..e66b79218e960d11da4759187e4473685ccb9a9e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -112,6 +112,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0072-Add-5-second-tps-average-in-tps.patch b/patches/Purpur/patches/server/0072-Add-5-second-tps-average-in-tps.patch index 932487e7..2201dc09 100644 --- a/patches/Purpur/patches/server/0072-Add-5-second-tps-average-in-tps.patch +++ b/patches/Purpur/patches/server/0072-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 d1d5216f14fd2fb9b3bebcdb3864bbaed1f3d5c2..1fa06582ff843e62a8a4701d98b3f5cad8770a73 100644 +index 5367c3b7bdfb6951986e5c844fb978f42a0bfec5..c6c4349954cb302e933739870814f54e426bd825 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -166,7 +166,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0) { @@ -58,7 +66,7 @@ index e747ee83f1a69a4a4bad87e720abc9b085fb6149..a4edfb02fd350433020b0f3699726b61 int k = 0; for (int l = 0; j > 0 && l < i; ++l) { -@@ -491,6 +491,12 @@ public final class ItemStack { +@@ -546,6 +546,12 @@ public final class ItemStack { if (this.isDamaged(i, t0.getRandom(), t0 instanceof EntityPlayer ? (EntityPlayer) t0 : null)) { consumer.accept(t0); Item item = this.getItem(); @@ -71,11 +79,11 @@ index e747ee83f1a69a4a4bad87e720abc9b085fb6149..a4edfb02fd350433020b0f3699726b61 // CraftBukkit start - Check for item breaking if (this.count == 1 && t0 instanceof EntityHuman) { org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((EntityHuman) t0, this); -diff --git a/src/main/java/net/minecraft/server/ItemTrident.java b/src/main/java/net/minecraft/server/ItemTrident.java -index 4eeeecef51cedcd0fe46ac4983472e214ccc9dad..0109d8db4f154802daef570e6d8b479cb5a49dab 100644 ---- a/src/main/java/net/minecraft/server/ItemTrident.java -+++ b/src/main/java/net/minecraft/server/ItemTrident.java -@@ -101,6 +101,16 @@ public class ItemTrident extends Item implements ItemVanishable { +diff --git a/src/main/java/net/minecraft/world/item/ItemTrident.java b/src/main/java/net/minecraft/world/item/ItemTrident.java +index 9896477b54cf91a88bdfc3d85018a59193b32859..0711d195c654edef5875f587e391bacfdea096da 100644 +--- a/src/main/java/net/minecraft/world/item/ItemTrident.java ++++ b/src/main/java/net/minecraft/world/item/ItemTrident.java +@@ -123,6 +123,16 @@ public class ItemTrident extends Item implements ItemVanishable { f2 *= f6 / f5; f3 *= f6 / f5; f4 *= f6 / f5; @@ -93,7 +101,7 @@ index 4eeeecef51cedcd0fe46ac4983472e214ccc9dad..0109d8db4f154802daef570e6d8b479c 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 66e74ee74b56e25ca46704ca6cec403f15126c33..ef977c50ab987f0762e1f9efd8ac6f559c38aaef 100644 +index e66b79218e960d11da4759187e4473685ccb9a9e..7f6b028f32af113e5898a0f2f39e0ec6c4e4dd11 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/Purpur/patches/server/0074-Item-entity-immunities.patch b/patches/Purpur/patches/server/0074-Item-entity-immunities.patch index 7f6d4142..9f5a5a24 100644 --- a/patches/Purpur/patches/server/0074-Item-entity-immunities.patch +++ b/patches/Purpur/patches/server/0074-Item-entity-immunities.patch @@ -4,11 +4,61 @@ Date: Sat, 22 Feb 2020 15:54:08 -0600 Subject: [PATCH] Item entity immunities -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b60eee0d86d55224c9fc8caf3a3a13089c0150e9..4642497ea63815253751836d9c34838f2c9fb4e6 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1485,6 +1485,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +index 3a66a34db2b8ac612431131cea80e57ee72de05f..70a1ff235690a5990f94bd9cf97d670b2f4c2aea 100644 +--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +@@ -31,6 +31,7 @@ import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EnumItemSlot; + import net.minecraft.world.entity.ai.attributes.AttributeModifiable; + import net.minecraft.world.entity.decoration.EntityItemFrame; ++import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.projectile.EntityArrow; + import net.minecraft.world.item.ItemStack; +@@ -67,7 +68,7 @@ public class EntityTrackerEntry { + private boolean q; + private boolean r; + // CraftBukkit start +- final Set trackedPlayers; // Paper - private -> package ++ public final Set trackedPlayers; // Paper - private -> public + // Paper start + private java.util.Map trackedPlayerMap = null; + +@@ -143,6 +144,15 @@ public class EntityTrackerEntry { + this.c(); + } + ++ // Purpur start - respawn burning item entities on client (client kills them) ++ if (tracker.fireTicks > 0 && tracker instanceof EntityItem) { ++ EntityItem item = (EntityItem) tracker; ++ if (item.immuneToFire && !item.dead) { ++ item.respawnOnClient(); ++ } ++ } ++ // Purpur end ++ + if (this.tickCounter % this.d == 0 || this.tracker.impulse || this.tracker.getDataWatcher().a()) { + int i; + int j; +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 585dbb250d975d2e9c34af26b9d5927ce734b407..58d2f1a10186e889bdd2249724a7f21f3a0a6a6e 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -2481,7 +2481,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + + public class EntityTracker { + +- final EntityTrackerEntry trackerEntry; // Paper - private -> package private ++ public final EntityTrackerEntry trackerEntry; // Paper - private -> public + public final Entity tracker; // Airplane - public for chunk + private final int trackingDistance; + private SectionPosition e; +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index b114d12d9d17071fb96f5ab225b85cdd5ad06861..7f897bebdc1fe2b7ce9528db9a7dd0fc0cf6c008 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1580,6 +1580,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } @@ -16,11 +66,24 @@ index b60eee0d86d55224c9fc8caf3a3a13089c0150e9..4642497ea63815253751836d9c34838f public boolean a(Tag tag) { return this.O == tag; } -diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 9a8b7e06f14f17dfea08d7031c83f77491aaca65..c25dce9a75b0e79f9b59f31892d863f46e2565e9 100644 ---- a/src/main/java/net/minecraft/server/EntityItem.java -+++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -24,6 +24,9 @@ public class EntityItem extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +index 5dc3670f35b04d933e96c4b42aa9fbcf941e69c7..3b84039a76843a0784e2d71bb66dc322450c2cab 100644 +--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java ++++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +@@ -10,10 +10,12 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.network.protocol.Packet; ++import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata; + import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.stats.StatisticList; +@@ -50,6 +52,9 @@ public class EntityItem extends Entity { public final float b; private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit public boolean canMobPickup = true; // Paper @@ -30,7 +93,7 @@ index 9a8b7e06f14f17dfea08d7031c83f77491aaca65..c25dce9a75b0e79f9b59f31892d863f4 public EntityItem(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -275,6 +278,16 @@ public class EntityItem extends Entity { +@@ -301,6 +306,16 @@ public class EntityItem extends Entity { return false; } else if (!this.getItemStack().getItem().a(damagesource)) { return false; @@ -47,7 +110,7 @@ index 9a8b7e06f14f17dfea08d7031c83f77491aaca65..c25dce9a75b0e79f9b59f31892d863f4 } else { // CraftBukkit start if (org.bukkit.craftbukkit.event.CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) { -@@ -455,6 +468,9 @@ public class EntityItem extends Entity { +@@ -481,6 +496,9 @@ public class EntityItem extends Entity { com.google.common.base.Preconditions.checkArgument(!itemstack.isEmpty(), "Cannot drop air"); // CraftBukkit this.getDataWatcher().set(EntityItem.ITEM, itemstack); this.getDataWatcher().markDirty(EntityItem.ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty @@ -57,7 +120,7 @@ index 9a8b7e06f14f17dfea08d7031c83f77491aaca65..c25dce9a75b0e79f9b59f31892d863f4 } @Override -@@ -536,4 +552,15 @@ public class EntityItem extends Entity { +@@ -562,4 +580,15 @@ public class EntityItem extends Entity { super.setPositionRaw(x, y, z); } // Paper end - fix MC-4 @@ -73,28 +136,8 @@ index 9a8b7e06f14f17dfea08d7031c83f77491aaca65..c25dce9a75b0e79f9b59f31892d863f4 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index e51b6bd0698593867e6821326d223770766d717f..2f758b3d3eaf5d5781a2072d0f3f7442b73cb9a8 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -106,6 +106,15 @@ public class EntityTrackerEntry { - this.c(); - } - -+ // Purpur start - respawn burning item entities on client (client kills them) -+ if (tracker.fireTicks > 0 && tracker instanceof EntityItem) { -+ EntityItem item = (EntityItem) tracker; -+ if (item.immuneToFire && !item.dead) { -+ item.respawnOnClient(); -+ } -+ } -+ // Purpur end -+ - if (this.tickCounter % this.d == 0 || this.tracker.impulse || this.tracker.getDataWatcher().a()) { - 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 ef977c50ab987f0762e1f9efd8ac6f559c38aaef..1e38e2e87ad30a908d9cf8d1455bb9250e281e55 100644 +index 7f6b028f32af113e5898a0f2f39e0ec6c4e4dd11..54ec01c01026f14f1f91aad2639109af853e10e4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -101,6 +101,39 @@ public class PurpurWorldConfig { @@ -138,7 +181,7 @@ index ef977c50ab987f0762e1f9efd8ac6f559c38aaef..1e38e2e87ad30a908d9cf8d1455bb925 public boolean idleTimeoutTickNearbyEntities = true; public boolean idleTimeoutCountAsSleeping = false; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index bcbaad11852a51436a00c8e172bdd841ba93ec3c..8c0b618ac66688f1fef42ae292745c2844aa12df 100644 +index 7a78ef2f6f673568c0528fa46168c69d21f51a66..0418291a69216081353c05c99d11dcd913b6b8cb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -114,4 +114,36 @@ public class CraftItem extends CraftEntity implements Item { diff --git a/patches/Purpur/patches/server/0075-Add-ping-command.patch b/patches/Purpur/patches/server/0075-Add-ping-command.patch index 88cd37db..794b27b4 100644 --- a/patches/Purpur/patches/server/0075-Add-ping-command.patch +++ b/patches/Purpur/patches/server/0075-Add-ping-command.patch @@ -4,28 +4,11 @@ Date: Fri, 13 Mar 2020 22:29:10 -0500 Subject: [PATCH] Add /ping command -diff --git a/src/main/java/net/minecraft/server/ArgumentEntity.java b/src/main/java/net/minecraft/server/ArgumentEntity.java -index 1194f91a51f87bc461af039fe0819aaf3e5c8bdd..9141976d1d6c5cef9eb4d415df2ad3b8f14ce913 100644 ---- a/src/main/java/net/minecraft/server/ArgumentEntity.java -+++ b/src/main/java/net/minecraft/server/ArgumentEntity.java -@@ -69,10 +69,12 @@ public class ArgumentEntity implements ArgumentType { - return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).c((CommandListenerWrapper) commandcontext.getSource()); - } - -+ public static ArgumentEntity players() { return d(); } // Purpur - OBFHELPER - public static ArgumentEntity d() { - return new ArgumentEntity(false, true); - } - -+ public static Collection getPlayers(CommandContext commandcontext, String s) throws CommandSyntaxException { return f(commandcontext, s); } // Purpur - OBFHELPER - public static Collection f(CommandContext commandcontext, String s) throws CommandSyntaxException { - List list = ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource()); - -diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index 17753c8a997aa286460be5d8eb6508e2eaed18ce..d080bf58ebc9c1dc9d41fae7d515547bc3f26d54 100644 ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -107,6 +107,7 @@ public class CommandDispatcher { +diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java +index 6fc5ee06c3bed8d9aa0e13dd7fa8d70ff6711f85..e8fe4984fdc67536561a1ad08b328a30b30b8717 100644 +--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java +@@ -191,6 +191,7 @@ public class CommandDispatcher { CommandIdleTimeout.a(this.b); CommandStop.a(this.b); CommandWhitelist.a(this.b); @@ -33,7 +16,7 @@ index 17753c8a997aa286460be5d8eb6508e2eaed18ce..d080bf58ebc9c1dc9d41fae7d515547b } if (commanddispatcher_servertype.d) { -@@ -338,10 +339,12 @@ public class CommandDispatcher { +@@ -422,10 +423,12 @@ public class CommandDispatcher { } @@ -46,7 +29,7 @@ index 17753c8a997aa286460be5d8eb6508e2eaed18ce..d080bf58ebc9c1dc9d41fae7d515547b public static RequiredArgumentBuilder a(String s, ArgumentType argumenttype) { return RequiredArgumentBuilder.argument(s, argumenttype); } -@@ -357,6 +360,7 @@ public class CommandDispatcher { +@@ -441,6 +444,7 @@ public class CommandDispatcher { }; } @@ -54,11 +37,11 @@ index 17753c8a997aa286460be5d8eb6508e2eaed18ce..d080bf58ebc9c1dc9d41fae7d515547b public com.mojang.brigadier.CommandDispatcher a() { return this.b; } -diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java -index 31543b38a7c46d93333c5f96fdb718b0a7a087b2..8a605b88584a574d5814e97d83c63661b56cf753 100644 ---- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java -+++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java -@@ -190,6 +190,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys +diff --git a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java b/src/main/java/net/minecraft/commands/CommandListenerWrapper.java +index 8402af32cc476d7f468842eb4f34c7521d72bcc8..4480fe75cfad35a5104b5116c5ec2c80d18f15f5 100644 +--- a/src/main/java/net/minecraft/commands/CommandListenerWrapper.java ++++ b/src/main/java/net/minecraft/commands/CommandListenerWrapper.java +@@ -211,6 +211,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys } } @@ -66,8 +49,25 @@ index 31543b38a7c46d93333c5f96fdb718b0a7a087b2..8a605b88584a574d5814e97d83c63661 public EntityPlayer h() throws CommandSyntaxException { if (!(this.k instanceof EntityPlayer)) { throw CommandListenerWrapper.a.create(); +diff --git a/src/main/java/net/minecraft/commands/arguments/ArgumentEntity.java b/src/main/java/net/minecraft/commands/arguments/ArgumentEntity.java +index bbad2b1399d9d2e16bfa77563bd564f7c6f640d7..a85c4525335fa46bc23a6dd57cfaea1f697b3daa 100644 +--- a/src/main/java/net/minecraft/commands/arguments/ArgumentEntity.java ++++ b/src/main/java/net/minecraft/commands/arguments/ArgumentEntity.java +@@ -78,10 +78,12 @@ public class ArgumentEntity implements ArgumentType { + return ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).c((CommandListenerWrapper) commandcontext.getSource()); + } + ++ public static ArgumentEntity players() { return d(); } // Purpur - OBFHELPER + public static ArgumentEntity d() { + return new ArgumentEntity(false, true); + } + ++ public static Collection getPlayers(CommandContext commandcontext, String s) throws CommandSyntaxException { return f(commandcontext, s); } // Purpur - OBFHELPER + public static Collection f(CommandContext commandcontext, String s) throws CommandSyntaxException { + List list = ((EntitySelector) commandcontext.getArgument(s, EntitySelector.class)).d((CommandListenerWrapper) commandcontext.getSource()); + diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index 10900ef825f88657f287c8c5b71a89338ba54c11..ebf74ddb9786d3bcccb62c85352bb6c2278433f3 100644 +index 8572cc59ad94cb5ac8b7625587c4dc23a1efbd4d..33c135aa02bbbaebbc503aaf665d8d00998b6b40 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -133,10 +133,12 @@ public class PurpurConfig { @@ -85,16 +85,16 @@ index 10900ef825f88657f287c8c5b71a89338ba54c11..ebf74ddb9786d3bcccb62c85352bb6c2 public static String serverModName = "Purpur"; diff --git a/src/main/java/net/pl3x/purpur/command/PingCommand.java b/src/main/java/net/pl3x/purpur/command/PingCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..3d4762c4a179aaf4e270af018b940f93f1a7d9cd +index 0000000000000000000000000000000000000000..1d636d7c541d127a473d5be2509e5db29936e8ad --- /dev/null +++ b/src/main/java/net/pl3x/purpur/command/PingCommand.java @@ -0,0 +1,37 @@ +package net.pl3x.purpur.command; + -+import net.minecraft.server.ArgumentEntity; -+import net.minecraft.server.CommandDispatcher; -+import net.minecraft.server.CommandListenerWrapper; -+import net.minecraft.server.EntityPlayer; ++import net.minecraft.commands.arguments.ArgumentEntity; ++import net.minecraft.commands.CommandDispatcher; ++import net.minecraft.commands.CommandListenerWrapper; ++import net.minecraft.server.level.EntityPlayer; +import net.pl3x.purpur.PurpurConfig; +import org.bukkit.craftbukkit.util.CraftChatMessage; + diff --git a/patches/Purpur/patches/server/0076-Configurable-jockey-options.patch b/patches/Purpur/patches/server/0076-Configurable-jockey-options.patch index 20427c19..bc0f3d15 100644 --- a/patches/Purpur/patches/server/0076-Configurable-jockey-options.patch +++ b/patches/Purpur/patches/server/0076-Configurable-jockey-options.patch @@ -4,11 +4,11 @@ Date: Thu, 26 Mar 2020 21:39:32 -0500 Subject: [PATCH] Configurable jockey options -diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 9ae0897bfd6a4577901d9189d0dba22f3ec2110c..1a102816921fa3b40f6d364bb826db4459f68eb2 100644 ---- a/src/main/java/net/minecraft/server/EntityDrowned.java -+++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -21,6 +21,23 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +index e4794760fc918cccbdc3f8d10ab21dd9b6f29e8e..ea776755767f29e49de2792afa30f79420d0fa4c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +@@ -72,6 +72,23 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { this.navigationLand = new Navigation(this, world); } @@ -32,11 +32,11 @@ index 9ae0897bfd6a4577901d9189d0dba22f3ec2110c..1a102816921fa3b40f6d364bb826db44 @Override protected void m() { this.goalSelector.a(1, new EntityDrowned.c(this, 1.0D)); -diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java -index 65bae8c9f28c23b0b5dd5d048e7fc7daf328075c..32b75f710b12efbcecec2c8d72d4d8cb725870fe 100644 ---- a/src/main/java/net/minecraft/server/EntityPigZombie.java -+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java -@@ -21,6 +21,23 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +index cc1bff409cad2eb6264d4b691599576960080ccd..af00a4245ca39f208810d1ec758e512cbf5648f3 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +@@ -55,6 +55,23 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { this.a(PathType.LAVA, 8.0F); } @@ -60,11 +60,11 @@ index 65bae8c9f28c23b0b5dd5d048e7fc7daf328075c..32b75f710b12efbcecec2c8d72d4d8cb @Override 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 c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240aa17508c 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; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +index 634416c354184bc6a2348c27c55e9868009ccd28..5ac950614fc90d02a568bb38f71faee124584c16 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +@@ -3,6 +3,7 @@ package net.minecraft.world.entity.monster; import com.mojang.serialization.DynamicOps; import java.time.LocalDate; import java.time.temporal.ChronoField; @@ -72,7 +72,7 @@ index c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240 import java.util.List; import java.util.Random; import java.util.UUID; -@@ -44,6 +45,20 @@ public class EntityZombie extends EntityMonster { +@@ -106,6 +107,20 @@ public class EntityZombie extends EntityMonster { this(EntityTypes.ZOMBIE, world); } @@ -93,7 +93,7 @@ index c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240 @Override protected void initPathfinder() { if (world.paperConfig.zombiesTargetTurtleEggs) this.goalSelector.a(4, new EntityZombie.a(this, 1.0D, 3)); // Paper -@@ -444,19 +459,19 @@ public class EntityZombie extends EntityMonster { +@@ -506,19 +521,19 @@ public class EntityZombie extends EntityMonster { if (object instanceof EntityZombie.GroupDataZombie) { EntityZombie.GroupDataZombie entityzombie_groupdatazombie = (EntityZombie.GroupDataZombie) object; @@ -119,7 +119,7 @@ index c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240 EntityChicken entitychicken1 = (EntityChicken) EntityTypes.CHICKEN.a(this.world); entitychicken1.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, 0.0F); -@@ -464,6 +479,7 @@ public class EntityZombie extends EntityMonster { +@@ -526,6 +541,7 @@ public class EntityZombie extends EntityMonster { entitychicken1.setChickenJockey(true); this.startRiding(entitychicken1); worldaccess.addEntity(entitychicken1, CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit @@ -127,7 +127,7 @@ index c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240 } } } -@@ -566,7 +582,7 @@ public class EntityZombie extends EntityMonster { +@@ -628,7 +644,7 @@ public class EntityZombie extends EntityMonster { public static class GroupDataZombie implements GroupDataEntity { @@ -136,11 +136,11 @@ index c081dfa775dc93afd96eff88953c9a5f21f2adb9..291748b3436c18653fa959cfd8c92240 public final boolean b; public GroupDataZombie(boolean flag, boolean flag1) { -diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java -index 2d2830adc5229a8db7fc4b1170ea4c6f263e7182..ce6d79780197eb9300130036a8ed84648a17f9cf 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieHusk.java -+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java -@@ -8,6 +8,23 @@ public class EntityZombieHusk extends EntityZombie { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +index ce08413134de6101420ccb957da925ea1e3b0884..5d3e5873f19aaf8389eb5525693b9378ea9f94ee 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +@@ -22,6 +22,23 @@ public class EntityZombieHusk extends EntityZombie { super(entitytypes, world); } @@ -164,11 +164,11 @@ index 2d2830adc5229a8db7fc4b1170ea4c6f263e7182..ce6d79780197eb9300130036a8ed8464 public static boolean a(EntityTypes entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { return b(entitytypes, worldaccess, enummobspawn, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || worldaccess.e(blockposition)); } -diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index b90605c463d378cea06c3cb84aad4c97145d00ce..5a71381c9f1832710001b6bfa63d6815c3cd1ab0 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieVillager.java -+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java -@@ -28,6 +28,23 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +index c03f4655dcca3d9635a7e13244b7977425a3f291..167ea96ec4072a9415a2ae9d7a0db118bfb94e19 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +@@ -70,6 +70,23 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo this.setVillagerData(this.getVillagerData().withProfession((VillagerProfession) IRegistry.VILLAGER_PROFESSION.a(this.random))); } @@ -193,7 +193,7 @@ index b90605c463d378cea06c3cb84aad4c97145d00ce..5a71381c9f1832710001b6bfa63d6815 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 1e38e2e87ad30a908d9cf8d1455bb9250e281e55..dd6a86d5765008f98e59b54a365d824e390fdf94 100644 +index 54ec01c01026f14f1f91aad2639109af853e10e4..1ebc8d04020aec7e36dfed5196dde9e9fe6ada0f 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -275,6 +275,15 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0077-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch b/patches/Purpur/patches/server/0077-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch index 4d6e5230..49562dcb 100644 --- a/patches/Purpur/patches/server/0077-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch +++ b/patches/Purpur/patches/server/0077-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch @@ -4,11 +4,11 @@ Date: Thu, 9 May 2019 18:26:06 -0500 Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms -diff --git a/src/main/java/net/minecraft/server/DamageSource.java b/src/main/java/net/minecraft/server/DamageSource.java -index 6fe5678cffc2487fe00c953d772f764bb37a4b11..bd0267ee4b3782f6d1ec39cba7966ba4f62f1adf 100644 ---- a/src/main/java/net/minecraft/server/DamageSource.java -+++ b/src/main/java/net/minecraft/server/DamageSource.java -@@ -88,6 +88,7 @@ public class DamageSource { +diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java +index 53ea8a6d90faf4f7f8fd0819be4499422bdd4cbe..6ba14f603b8ec69597c70677cc317f802d6afae9 100644 +--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java ++++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java +@@ -99,6 +99,7 @@ public class DamageSource { return (new EntityDamageSourceIndirect("thrown", entity, entity1)).c(); } @@ -16,11 +16,11 @@ index 6fe5678cffc2487fe00c953d772f764bb37a4b11..bd0267ee4b3782f6d1ec39cba7966ba4 public static DamageSource c(Entity entity, @Nullable Entity entity1) { return (new EntityDamageSourceIndirect("indirectMagic", entity, entity1)).setIgnoreArmor().setMagic(); } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4642497ea63815253751836d9c34838f2c9fb4e6..4b9e44aad705247c075e435ebc6eb9b1393f7b17 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2151,8 +2151,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 7f897bebdc1fe2b7ce9528db9a7dd0fc0cf6c008..5ac6b7759cf43dbbad1bcf74d5d86efd69883cf5 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2246,8 +2246,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return this.a(new ItemStack(imaterial), (float) i); } @@ -31,11 +31,19 @@ index 4642497ea63815253751836d9c34838f2c9fb4e6..4b9e44aad705247c075e435ebc6eb9b1 return this.a(itemstack, 0.0F); } -diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java -index 362ca695d88a7c788421cc557b8110b954d8153a..1942fae27051af79b6eb1d790a219da100bf889e 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java -+++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java -@@ -13,6 +13,12 @@ public class EntityEnderCrystal extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java +index 9658d93615a51375204481cfe0a1fce6f105fd70..2c983e6a092464d1867fcbe875b2e1461ec8556b 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java +@@ -14,6 +14,7 @@ import net.minecraft.server.level.WorldServer; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.monster.EntityPhantom; + import net.minecraft.world.level.Explosion; + import net.minecraft.world.level.IBlockAccess; + import net.minecraft.world.level.World; +@@ -30,6 +31,12 @@ public class EntityEnderCrystal extends Entity { private static final DataWatcherObject> c = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.m); private static final DataWatcherObject d = DataWatcher.a(EntityEnderCrystal.class, DataWatcherRegistry.i); public int b; @@ -48,7 +56,7 @@ index 362ca695d88a7c788421cc557b8110b954d8153a..1942fae27051af79b6eb1d790a219da1 public EntityEnderCrystal(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -51,7 +57,50 @@ public class EntityEnderCrystal extends Entity { +@@ -68,7 +75,50 @@ public class EntityEnderCrystal extends Entity { } } @@ -99,11 +107,32 @@ index 362ca695d88a7c788421cc557b8110b954d8153a..1942fae27051af79b6eb1d790a219da1 @Override protected void saveData(NBTTagCompound nbttagcompound) { -diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0cc4a339f6 100644 ---- a/src/main/java/net/minecraft/server/EntityPhantom.java -+++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -9,9 +9,10 @@ import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index 42cf3fa42b73739182d26fbb524ee5b304c799b2..daf738e8f0987aa6ab200189d7a26d166918b8fc 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -12,6 +12,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -36,18 +37,23 @@ import net.minecraft.world.entity.ai.control.EntityAIBodyControl; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition; + import net.minecraft.world.entity.animal.EntityCat; ++import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal; + import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.Items; + import net.minecraft.world.level.World; + import net.minecraft.world.level.WorldAccess; + import net.minecraft.world.level.levelgen.HeightMap; ++import net.minecraft.world.level.storage.loot.LootTableInfo; + import net.minecraft.world.phys.Vec3D; + public class EntityPhantom extends EntityFlying implements IMonster { private static final DataWatcherObject b = DataWatcher.a(EntityPhantom.class, DataWatcherRegistry.b); @@ -117,7 +146,7 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c public EntityPhantom(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -30,11 +31,37 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -66,11 +72,37 @@ public class EntityPhantom extends EntityFlying implements IMonster { @Override protected void initPathfinder() { @@ -159,8 +188,8 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c @Override protected void initDatawatcher() { -@@ -198,6 +225,136 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } +@@ -235,6 +267,136 @@ public class EntityPhantom extends EntityFlying implements IMonster { + public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } // Paper end + // Purpur start @@ -296,7 +325,7 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c class b extends PathfinderGoal { private final PathfinderTargetCondition b; -@@ -210,6 +367,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -247,6 +409,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { @Override public boolean a() { @@ -304,7 +333,7 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c if (this.c > 0) { --this.c; return false; -@@ -238,6 +396,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -275,6 +438,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { @Override public boolean b() { @@ -312,7 +341,7 @@ index 3a70900c73e3a6c4f40cf74406534f4bfd3eb67b..dfce36368da9bdd9285c490a802f7a0c EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); return entityliving != null ? EntityPhantom.this.a(entityliving, PathfinderTargetCondition.a) : false; -@@ -252,6 +411,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -289,6 +453,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { @Override public boolean a() { @@ -321,7 +350,7 @@ 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 dd6a86d5765008f98e59b54a365d824e390fdf94..88cac6394f67ec113a781a552261f760fc95eb16 100644 +index 1ebc8d04020aec7e36dfed5196dde9e9fe6ada0f..d5e1ca888c6fe0910f54e30b3b59af4dfde86cb3 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -349,6 +349,15 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0078-Add-phantom-spawning-options.patch b/patches/Purpur/patches/server/0078-Add-phantom-spawning-options.patch index b4a2f084..aa48eb23 100644 --- a/patches/Purpur/patches/server/0078-Add-phantom-spawning-options.patch +++ b/patches/Purpur/patches/server/0078-Add-phantom-spawning-options.patch @@ -4,11 +4,11 @@ Date: Fri, 3 Jul 2020 00:03:52 -0500 Subject: [PATCH] Add phantom spawning options -diff --git a/src/main/java/net/minecraft/server/DifficultyDamageScaler.java b/src/main/java/net/minecraft/server/DifficultyDamageScaler.java -index 75745af3435434bddd420536ca3bbea3a9f181d6..84c0ec1b50758b433980765d087e15d8a8eaaaf7 100644 ---- a/src/main/java/net/minecraft/server/DifficultyDamageScaler.java -+++ b/src/main/java/net/minecraft/server/DifficultyDamageScaler.java -@@ -13,6 +13,7 @@ public class DifficultyDamageScaler { +diff --git a/src/main/java/net/minecraft/world/DifficultyDamageScaler.java b/src/main/java/net/minecraft/world/DifficultyDamageScaler.java +index c2fe4329576e6dcd5df435bc580d79a2b6db1fcd..44f19d8c8f5d344b2659cf01eb4be40f5510a2c2 100644 +--- a/src/main/java/net/minecraft/world/DifficultyDamageScaler.java ++++ b/src/main/java/net/minecraft/world/DifficultyDamageScaler.java +@@ -14,6 +14,7 @@ public class DifficultyDamageScaler { this.b = this.a(enumdifficulty, i, j, f); } @@ -16,7 +16,7 @@ index 75745af3435434bddd420536ca3bbea3a9f181d6..84c0ec1b50758b433980765d087e15d8 public EnumDifficulty a() { return this.a; } -@@ -21,6 +22,7 @@ public class DifficultyDamageScaler { +@@ -22,6 +23,7 @@ public class DifficultyDamageScaler { return this.b; } @@ -24,11 +24,11 @@ index 75745af3435434bddd420536ca3bbea3a9f181d6..84c0ec1b50758b433980765d087e15d8 public boolean a(float f) { return this.b > f; } -diff --git a/src/main/java/net/minecraft/server/EnumDifficulty.java b/src/main/java/net/minecraft/server/EnumDifficulty.java -index e0e72779c0f4e4856ed5682122fedf0321db11cb..386eae71a146e06ca60f8bf11429fe2131232a21 100644 ---- a/src/main/java/net/minecraft/server/EnumDifficulty.java -+++ b/src/main/java/net/minecraft/server/EnumDifficulty.java -@@ -19,6 +19,7 @@ public enum EnumDifficulty { +diff --git a/src/main/java/net/minecraft/world/EnumDifficulty.java b/src/main/java/net/minecraft/world/EnumDifficulty.java +index 53fac6aa71938805264b7cc4769e63a9d4a66114..a1a80aab7ef6fdb2a35082fa452d0b46c1fcdcbe 100644 +--- a/src/main/java/net/minecraft/world/EnumDifficulty.java ++++ b/src/main/java/net/minecraft/world/EnumDifficulty.java +@@ -21,6 +21,7 @@ public enum EnumDifficulty { this.g = s; } @@ -36,11 +36,11 @@ index e0e72779c0f4e4856ed5682122fedf0321db11cb..386eae71a146e06ca60f8bf11429fe21 public int a() { return this.f; } -diff --git a/src/main/java/net/minecraft/server/IBlockLightAccess.java b/src/main/java/net/minecraft/server/IBlockLightAccess.java -index 03a89301f2b3d29e39c6c9d05ee072527f652efc..fa5eb188da64cc1409cc614515e8c70b0a341dd0 100644 ---- a/src/main/java/net/minecraft/server/IBlockLightAccess.java -+++ b/src/main/java/net/minecraft/server/IBlockLightAccess.java -@@ -12,6 +12,7 @@ public interface IBlockLightAccess extends IBlockAccess { +diff --git a/src/main/java/net/minecraft/world/level/IBlockLightAccess.java b/src/main/java/net/minecraft/world/level/IBlockLightAccess.java +index 8b2e57c833c03940f2e0727e00decce59f263269..642bf019d32a2fdc18718337ecfe45d24022f8bd 100644 +--- a/src/main/java/net/minecraft/world/level/IBlockLightAccess.java ++++ b/src/main/java/net/minecraft/world/level/IBlockLightAccess.java +@@ -15,6 +15,7 @@ public interface IBlockLightAccess extends IBlockAccess { return this.e().b(blockposition, i); } @@ -48,15 +48,56 @@ index 03a89301f2b3d29e39c6c9d05ee072527f652efc..fa5eb188da64cc1409cc614515e8c70b default boolean e(BlockPosition blockposition) { return this.getBrightness(EnumSkyBlock.SKY, blockposition) >= this.K(); } -diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index 4e3f01bc79b6ed2a322155f29f1d0dcf298c8b82..ac1ea2f0c15bccf94f203194a5a7b10ec125ffb8 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -@@ -1,85 +1,99 @@ - package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +index d98526785ff2fa3b72e8ffffcb89a57a2203a5c8..7859d84471436b427138593776ebd30a0429b6b4 100644 +--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -431,6 +431,7 @@ public final class SpawnerCreature { + return new BlockPosition(i, l, j); + } + ++ public static boolean canSpawn(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, EntityTypes entitytypes) { return a(iblockaccess, blockposition, iblockdata, fluid, entitytypes); } // Purpur - OBFHELPER + public static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, EntityTypes entitytypes) { + 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/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index fdcae92b2fe41fa7e3c8d7f23756186e55880315..1591578de15a011d823b21c92c4c00ecb7ca91d8 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1749,6 +1749,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return new DifficultyDamageScaler(this.getDifficulty(), this.getDayTime(), i, f); + } + ++ public int getSkyDarkness() { return c(); } // Purpur - OBFHELPER + @Override + public int c() { + return this.d; +diff --git a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java +index e4f5e570636862481aac92ec9b74d6cf5723eb6e..e954adeff4fbfc1aa85ac3785c0c4c86bde24cdb 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/MobSpawnerPhantom.java +@@ -1,9 +1,6 @@ + package net.minecraft.world.level.levelgen; -import java.util.Iterator; -import java.util.Random; + import net.minecraft.core.BlockPosition; +-import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.server.MCUtil; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; +@@ -15,92 +12,103 @@ import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.monster.EntityPhantom; +-import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.level.GameRules; +-import net.minecraft.world.level.IBlockAccess; + import net.minecraft.world.level.MobSpawner; + import net.minecraft.world.level.SpawnerCreature; +-import net.minecraft.world.level.World; +-import net.minecraft.world.level.block.state.IBlockData; +-import net.minecraft.world.level.material.Fluid; +import com.destroystokyo.paper.event.entity.PhantomPreSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent; @@ -132,7 +173,7 @@ index 4e3f01bc79b6ed2a322155f29f1d0dcf298c8b82..ac1ea2f0c15bccf94f203194a5a7b10e - } - // Paper end - EntityPhantom entityphantom = (EntityPhantom) EntityTypes.PHANTOM.a((World) worldserver); -- entityphantom.spawningEntity = entityhuman.uniqueID; // Paper +- entityphantom.setSpawningEntity(entityhuman.getUniqueID()); // Paper - entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); - groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); - worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit @@ -207,7 +248,7 @@ index 4e3f01bc79b6ed2a322155f29f1d0dcf298c8b82..ac1ea2f0c15bccf94f203194a5a7b10e + continue; } + -+ phantom.spawningEntity = player.uniqueID; // Paper ++ phantom.setSpawningEntity(player.getUniqueID()); // Paper + phantom.setPositionRotation(spawnPos, 0.0F, 0.0F); + groupData = phantom.prepare(world, dmgScaler, EnumMobSpawn.NATURAL, groupData, null); + world.addEntity(phantom, CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit @@ -220,32 +261,8 @@ index 4e3f01bc79b6ed2a322155f29f1d0dcf298c8b82..ac1ea2f0c15bccf94f203194a5a7b10e + // Purpur end - rewrite entire thing } } -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 53fd0549c965b2252ad80648d61ff1f7cd2b837a..ad520cb36afd0f011b6337f3e42efb01f740a950 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -394,6 +394,7 @@ public final class SpawnerCreature { - return new BlockPosition(i, l, j); - } - -+ public static boolean canSpawn(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, EntityTypes entitytypes) { return a(iblockaccess, blockposition, iblockdata, fluid, entitytypes); } // Purpur - OBFHELPER - public static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, EntityTypes entitytypes) { - 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 ed2192ad7b27eb8fc34be5d7817e1ca4bee5c9d1..905ec2bee2f47d9126b77a5bc1abfc4941b42815 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1597,6 +1597,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return new DifficultyDamageScaler(this.getDifficulty(), this.getDayTime(), i, f); - } - -+ public int getSkyDarkness() { return c(); } // Purpur - OBFHELPER - @Override - 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 88cac6394f67ec113a781a552261f760fc95eb16..fedc39bdbbd328296c5c08d220d6695fe08fdf91 100644 +index d5e1ca888c6fe0910f54e30b3b59af4dfde86cb3..104947fbf7c68c94e5b0b72b13307197e041ae1c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -352,10 +352,34 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0079-Implement-bed-explosion-options.patch b/patches/Purpur/patches/server/0079-Implement-bed-explosion-options.patch index f03b86fa..3867f485 100644 --- a/patches/Purpur/patches/server/0079-Implement-bed-explosion-options.patch +++ b/patches/Purpur/patches/server/0079-Implement-bed-explosion-options.patch @@ -4,11 +4,11 @@ Date: Sat, 4 Jul 2020 13:12:43 -0500 Subject: [PATCH] Implement bed explosion options -diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java -index 24a5c64b65f0098b1395d352cc2f99bbbbaf9c94..738535d01adf8bfd895b5057e595042253f32f87 100644 ---- a/src/main/java/net/minecraft/server/BlockBed.java -+++ b/src/main/java/net/minecraft/server/BlockBed.java -@@ -88,7 +88,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockBed.java b/src/main/java/net/minecraft/world/level/block/BlockBed.java +index eca84595342756e3550883551e487aaf79574fde..d81c05c092173b7e74045cfab1018d2eed28c401 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockBed.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockBed.java +@@ -127,7 +127,7 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { world.a(blockposition1, false); } @@ -18,17 +18,17 @@ index 24a5c64b65f0098b1395d352cc2f99bbbbaf9c94..738535d01adf8bfd895b5057e5950422 } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index fedc39bdbbd328296c5c08d220d6695fe08fdf91..35e4f4160358b12b61d2763b8d2f5ff51022b666 100644 +index 104947fbf7c68c94e5b0b72b13307197e041ae1c..5486dd15752e9c260275a6b3d5ed702e6bf14a81 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; +@@ -1,6 +1,7 @@ + package net.pl3x.purpur; - import net.minecraft.server.Block; - import net.minecraft.server.Blocks; -+import net.minecraft.server.Explosion; - import net.minecraft.server.IRegistry; - import net.minecraft.server.Item; - import net.minecraft.server.Items; + import net.minecraft.core.IRegistry; ++import net.minecraft.world.level.Explosion; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.item.Item; @@ -12,6 +13,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/patches/Purpur/patches/server/0080-Implement-respawn-anchor-explosion-options.patch b/patches/Purpur/patches/server/0080-Implement-respawn-anchor-explosion-options.patch index 506b6b6c..669c9d39 100644 --- a/patches/Purpur/patches/server/0080-Implement-respawn-anchor-explosion-options.patch +++ b/patches/Purpur/patches/server/0080-Implement-respawn-anchor-explosion-options.patch @@ -4,11 +4,11 @@ Date: Sat, 4 Jul 2020 13:23:19 -0500 Subject: [PATCH] Implement respawn anchor explosion options -diff --git a/src/main/java/net/minecraft/server/BlockRespawnAnchor.java b/src/main/java/net/minecraft/server/BlockRespawnAnchor.java -index 21c5ad83a95bcd23071423c0e8336656b760fcde..521d161a3d015b641b61de21401c79ac20eb73a7 100644 ---- a/src/main/java/net/minecraft/server/BlockRespawnAnchor.java -+++ b/src/main/java/net/minecraft/server/BlockRespawnAnchor.java -@@ -83,10 +83,7 @@ public class BlockRespawnAnchor extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java +index 028e98decf8b0496b4ebcd1aad3aa474e5c4e7c1..9b7a7f1ae50baf53d314bbf1588afeb8e61dae5d 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockRespawnAnchor.java +@@ -115,10 +115,7 @@ public class BlockRespawnAnchor extends Block { private void d(IBlockData iblockdata, World world, final BlockPosition blockposition) { world.a(blockposition, false); @@ -20,7 +20,7 @@ index 21c5ad83a95bcd23071423c0e8336656b760fcde..521d161a3d015b641b61de21401c79ac return a(blockposition1, world); }); final boolean flag1 = flag || world.getFluid(blockposition.up()).a((Tag) TagsFluid.WATER); -@@ -97,7 +94,7 @@ public class BlockRespawnAnchor extends Block { +@@ -129,7 +126,7 @@ public class BlockRespawnAnchor extends Block { } }; @@ -30,7 +30,7 @@ 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 35e4f4160358b12b61d2763b8d2f5ff51022b666..07e60861c99db1ee1ba7a01c7a666a83e644aa2a 100644 +index 5486dd15752e9c260275a6b3d5ed702e6bf14a81..a366742e8d11513b469ffb8dafd98a4c0d8ab30a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -251,6 +251,22 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0081-Add-allow-water-in-end-world-option.patch b/patches/Purpur/patches/server/0081-Add-allow-water-in-end-world-option.patch index 184906a9..043e8668 100644 --- a/patches/Purpur/patches/server/0081-Add-allow-water-in-end-world-option.patch +++ b/patches/Purpur/patches/server/0081-Add-allow-water-in-end-world-option.patch @@ -4,33 +4,11 @@ Date: Sun, 5 Jul 2020 23:40:16 -0500 Subject: [PATCH] Add allow water in end world option -diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java -index aba5c6b8713c04302632bd1d289fd968c9e0607a..b75f6ded5d4bd3150789fba773a2c76c3e55bb90 100644 ---- a/src/main/java/net/minecraft/server/BlockIce.java -+++ b/src/main/java/net/minecraft/server/BlockIce.java -@@ -13,7 +13,7 @@ public class BlockIce extends BlockHalfTransparent { - public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) { - super.a(world, entityhuman, blockposition, iblockdata, tileentity, itemstack); - if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) { -- if (world.getDimensionManager().isNether()) { -+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - world.a(blockposition, false); - return; - } -@@ -41,7 +41,7 @@ public class BlockIce extends BlockHalfTransparent { - return; - } - // CraftBukkit end -- if (world.getDimensionManager().isNether()) { -+ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur - world.a(blockposition, false); - } else { - world.setTypeUpdate(blockposition, Blocks.WATER.getBlockData()); -diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java -index 223361a1a8b41ebe91e0db39f40cf12a4968b1b4..07f23572bdf15c57a53e32646f2fc64fff404948 100644 ---- a/src/main/java/net/minecraft/server/ItemBucket.java -+++ b/src/main/java/net/minecraft/server/ItemBucket.java -@@ -123,7 +123,7 @@ public class ItemBucket extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemBucket.java b/src/main/java/net/minecraft/world/item/ItemBucket.java +index d126f668828e0788e369294c0b376ef52b344f2c..154a76b1b77a97bdf65153250c41275f72f6f73f 100644 +--- a/src/main/java/net/minecraft/world/item/ItemBucket.java ++++ b/src/main/java/net/minecraft/world/item/ItemBucket.java +@@ -152,7 +152,7 @@ public class ItemBucket extends Item { // CraftBukkit end if (!flag1) { return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand @@ -39,7 +17,7 @@ index 223361a1a8b41ebe91e0db39f40cf12a4968b1b4..07f23572bdf15c57a53e32646f2fc64f int i = blockposition.getX(); int j = blockposition.getY(); int k = blockposition.getZ(); -@@ -131,7 +131,7 @@ public class ItemBucket extends Item { +@@ -160,7 +160,7 @@ public class ItemBucket extends Item { world.playSound(entityhuman, blockposition, SoundEffects.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F); for (int l = 0; l < 8; ++l) { @@ -48,11 +26,11 @@ index 223361a1a8b41ebe91e0db39f40cf12a4968b1b4..07f23572bdf15c57a53e32646f2fc64f } return true; -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 905ec2bee2f47d9126b77a5bc1abfc4941b42815..d86a23c6febc638080c0d26857839918db22ce93 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1672,4 +1672,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 1591578de15a011d823b21c92c4c00ecb7ca91d8..4a445520b9b103a32dd281dc6bef5a47df8dee5f 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1824,4 +1824,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final boolean isDebugWorld() { return this.debugWorld; } @@ -67,19 +45,33 @@ index 905ec2bee2f47d9126b77a5bc1abfc4941b42815..d86a23c6febc638080c0d26857839918 + } + // Purpur end } +diff --git a/src/main/java/net/minecraft/world/level/block/BlockIce.java b/src/main/java/net/minecraft/world/level/block/BlockIce.java +index 461c85b426aab30c34529897e55aa842b45d0555..486a03f2582d6ece2775cb2db127953d31d041f8 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockIce.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockIce.java +@@ -27,7 +27,7 @@ public class BlockIce extends BlockHalfTransparent { + public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) { + super.a(world, entityhuman, blockposition, iblockdata, tileentity, itemstack); + if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) { +- if (world.getDimensionManager().isNether()) { ++ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur + world.a(blockposition, false); + return; + } +@@ -55,7 +55,7 @@ public class BlockIce extends BlockHalfTransparent { + return; + } + // CraftBukkit end +- if (world.getDimensionManager().isNether()) { ++ if (world.isNether() || (world.isTheEnd() && !net.pl3x.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) { // Purpur + world.a(blockposition, false); + } else { + world.setTypeUpdate(blockposition, Blocks.WATER.getBlockData()); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index ebf74ddb9786d3bcccb62c85352bb6c2278433f3..c12146fe8ac1d89c6c1051a8f64ea29a9214e64b 100644 +index 33c135aa02bbbaebbc503aaf665d8d00998b6b40..c7962b45e818bbfa841a1249156472dc750d6194 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -1,7 +1,6 @@ - package net.pl3x.purpur; - - import com.google.common.base.Throwables; --import net.minecraft.server.LocaleLanguage; - import net.minecraft.server.MinecraftServer; - import net.pl3x.purpur.command.PurpurCommand; - import org.bukkit.Bukkit; -@@ -186,6 +185,11 @@ public class PurpurConfig { +@@ -186,6 +186,11 @@ public class PurpurConfig { dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets); } diff --git a/patches/Purpur/patches/server/0082-Allow-color-codes-in-books.patch b/patches/Purpur/patches/server/0082-Allow-color-codes-in-books.patch index 0383380b..d6a1964f 100644 --- a/patches/Purpur/patches/server/0082-Allow-color-codes-in-books.patch +++ b/patches/Purpur/patches/server/0082-Allow-color-codes-in-books.patch @@ -4,11 +4,11 @@ Date: Tue, 3 Nov 2020 01:25:06 -0600 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 4d0dcbcc00e44c4912302dd0e7331471f33cb370..70cb98b3db5f9966e91da0ccd81e7610455a4f4e 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1058,7 +1058,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index bbb3b44bdceb8fb0363f771b8cf1b8245b5c8d3d..c2d9b76a915bbfaa3382512b3f9ab906e058c0f9 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -1203,7 +1203,8 @@ public class PlayerConnection implements PacketListenerPlayIn { if (itemstack.getItem() == Items.WRITABLE_BOOK) { NBTTagList nbttaglist = new NBTTagList(); @@ -18,7 +18,7 @@ index 4d0dcbcc00e44c4912302dd0e7331471f33cb370..70cb98b3db5f9966e91da0ccd81e7610 ItemStack old = itemstack.cloneItemStack(); // CraftBukkit itemstack.a("pages", (NBTBase) nbttaglist); CraftEventFactory.handleEditBookEvent(player, i, old, itemstack); // CraftBukkit -@@ -1076,13 +1077,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1221,13 +1222,14 @@ public class PlayerConnection implements PacketListenerPlayIn { itemstack1.setTag(nbttagcompound.clone()); } @@ -35,7 +35,7 @@ index 4d0dcbcc00e44c4912302dd0e7331471f33cb370..70cb98b3db5f9966e91da0ccd81e7610 ChatComponentText chatcomponenttext = new ChatComponentText(s1); String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext); -@@ -1094,6 +1096,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1239,6 +1241,16 @@ public class PlayerConnection implements PacketListenerPlayIn { } } diff --git a/patches/Purpur/patches/server/0083-Entity-lifespan.patch b/patches/Purpur/patches/server/0083-Entity-lifespan.patch index d2c9c935..40344f02 100644 --- a/patches/Purpur/patches/server/0083-Entity-lifespan.patch +++ b/patches/Purpur/patches/server/0083-Entity-lifespan.patch @@ -4,11 +4,23 @@ Date: Sat, 11 Jul 2020 19:41:34 -0500 Subject: [PATCH] Entity lifespan -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a76bdda71 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -54,7 +54,7 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index c2d9b76a915bbfaa3382512b3f9ab906e058c0f9..319d9d2ba8ce3b5311746938b06999702847ce0b 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -2443,6 +2443,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + boolean triggerLeashUpdate = itemInHand != null && itemInHand.getItem() == Items.LEAD && entity instanceof EntityInsentient; + Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem(); + PlayerInteractEntityEvent event; ++ if (entity instanceof EntityInsentient) ((EntityInsentient) entity).ticksSinceLastInteraction = 0; // Purpur + if (packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT) { + 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/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index 462bcb7cfe2daa27c10a7a0318bef9b739e586f4..c9136f1b54ff0620a621b703b4e7487f4a63b01d 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -124,7 +124,7 @@ public abstract class EntityInsentient extends EntityLiving { private NBTTagCompound by; private BlockPosition bz; private float bA; @@ -17,7 +29,7 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a public boolean aware = true; // CraftBukkit protected EntityInsentient(EntityTypes entitytypes, World world) { -@@ -206,6 +206,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -276,6 +276,7 @@ public abstract class EntityInsentient extends EntityLiving { entityliving = null; } } @@ -25,7 +37,7 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a this.goalTarget = entityliving; return true; // CraftBukkit end -@@ -250,10 +251,35 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -320,10 +321,35 @@ public abstract class EntityInsentient extends EntityLiving { this.m(); this.F(); } @@ -62,7 +74,7 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a @Override protected void c(DamageSource damagesource) { this.m(); -@@ -427,6 +453,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -497,6 +523,7 @@ public abstract class EntityInsentient extends EntityLiving { } nbttagcompound.setBoolean("Bukkit.Aware", this.aware); // CraftBukkit @@ -70,7 +82,7 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a } @Override -@@ -497,6 +524,11 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -567,6 +594,11 @@ public abstract class EntityInsentient extends EntityLiving { this.aware = nbttagcompound.getBoolean("Bukkit.Aware"); } // CraftBukkit end @@ -82,7 +94,7 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a } @Override -@@ -1553,7 +1585,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1625,7 +1657,7 @@ public abstract class EntityInsentient extends EntityLiving { this.a((EntityLiving) this, entity); this.z(entity); } @@ -91,20 +103,8 @@ index 9807441d53fcf4ef7aaffe3801542f5a371eb7af..ee005e482396f8ff7e46a7ca981c843a return flag; } -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 70cb98b3db5f9966e91da0ccd81e7610455a4f4e..48d032ed74effcfd66e1ab01548913964bca4d19 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2298,6 +2298,7 @@ public class PlayerConnection implements PacketListenerPlayIn { - boolean triggerLeashUpdate = itemInHand != null && itemInHand.getItem() == Items.LEAD && entity instanceof EntityInsentient; - Item origItem = this.player.inventory.getItemInHand() == null ? null : this.player.inventory.getItemInHand().getItem(); - PlayerInteractEntityEvent event; -+ if (entity instanceof EntityInsentient) ((EntityInsentient) entity).ticksSinceLastInteraction = 0; // Purpur - if (packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.INTERACT) { - 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 07e60861c99db1ee1ba7a01c7a666a83e644aa2a..2e3fee6bc4f3af7ad07a0db5657ffb3238e77e96 100644 +index a366742e8d11513b469ffb8dafd98a4c0d8ab30a..021dbb20793dd365c181c4d8a2ebc429af85778b 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/Purpur/patches/server/0084-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch b/patches/Purpur/patches/server/0084-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch index 5c670470..0b3facab 100644 --- a/patches/Purpur/patches/server/0084-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch +++ b/patches/Purpur/patches/server/0084-Add-option-to-teleport-to-spawn-if-outside-world-bor.patch @@ -4,23 +4,11 @@ Date: Mon, 13 Jul 2020 11:40:00 -0500 Subject: [PATCH] Add option to teleport to spawn if outside world border -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8bc0fb58ef18ce7828451857a97460bbde567c6b..a8cd7f0abf58e69d276e469bd7d5ef6ae619263d 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -281,6 +281,7 @@ public abstract class EntityLiving extends Entity { - double d1 = this.world.getWorldBorder().getDamageAmount(); - - if (d1 > 0.0D) { -+ if (world.purpurConfig.teleportIfOutsideBorder && this instanceof EntityPlayer) { ((EntityPlayer) this).teleport(MCUtil.toLocation(world, world.getSpawn())); return; } // Purpur - this.damageEntity(DamageSource.STUCK, (float) Math.max(1, MathHelper.floor(-d0 * d1))); - } - } -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ce48b823db35ca2d7557cfc840801349b19cbd54..2aef37c4602d9c3ec12a2b5deade36801c171be0 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -2425,4 +2425,26 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index e129480fa1045fbeaafa97045d53696b44952bcf..9de660f0c679f101512bddf7c6582ca6cd18ca5b 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -2556,4 +2556,26 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return (CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end @@ -47,8 +35,28 @@ index ce48b823db35ca2d7557cfc840801349b19cbd54..2aef37c4602d9c3ec12a2b5deade3680 + } + // Purpur end } +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 5a060b98fe9f3edc199cd520a636505c653556e9..e453502c34f717797c4b67a7149d2e0da1b1232d 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -45,6 +45,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.level.ChunkProviderServer; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; +@@ -376,6 +377,7 @@ public abstract class EntityLiving extends Entity { + double d1 = this.world.getWorldBorder().getDamageAmount(); + + if (d1 > 0.0D) { ++ if (world.purpurConfig.teleportIfOutsideBorder && this instanceof EntityPlayer) { ((EntityPlayer) this).teleport(MCUtil.toLocation(world, world.getSpawn())); return; } // Purpur + this.damageEntity(DamageSource.STUCK, (float) Math.max(1, MathHelper.floor(-d0 * d1))); + } + } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2e3fee6bc4f3af7ad07a0db5657ffb3238e77e96..5d35651f43de81c8cf047479ad9c88c4b3f1c38c 100644 +index 021dbb20793dd365c181c4d8a2ebc429af85778b..b9e252c3db715c288493d5b98fc20d84de46c4e4 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/Purpur/patches/server/0085-Squid-EAR-immunity.patch b/patches/Purpur/patches/server/0085-Squid-EAR-immunity.patch index 10eb1517..d3e35185 100644 --- a/patches/Purpur/patches/server/0085-Squid-EAR-immunity.patch +++ b/patches/Purpur/patches/server/0085-Squid-EAR-immunity.patch @@ -5,7 +5,7 @@ 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 5d35651f43de81c8cf047479ad9c88c4b3f1c38c..32bb2524641722d16b6bafcc6b1af2793c1d9a45 100644 +index b9e252c3db715c288493d5b98fc20d84de46c4e4..cdb7a97ecececa78a200acc898535d33c950a668 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -453,6 +453,11 @@ public class PurpurWorldConfig { @@ -21,14 +21,22 @@ index 5d35651f43de81c8cf047479ad9c88c4b3f1c38c..32bb2524641722d16b6bafcc6b1af279 public boolean villagerUseBrainTicksOnlyWhenLagging = true; public boolean villagerCanBeLeashed = false; diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index f2e978107ef1163ceadb3ea7594eba6e900a8a28..05b165f4f2de1f09164c33c0b222dc660c86ebb9 100644 +index dc2d880ded328f8377c207ce15f604ec5c25176c..5881497825b3c11ce5d23e4f609fd769ba6a76e1 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -377,6 +377,7 @@ public class ActivationRange +@@ -11,6 +11,7 @@ import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.ambient.EntityAmbient; + import net.minecraft.world.entity.animal.EntityAnimal; + import net.minecraft.world.entity.animal.EntitySheep; ++import net.minecraft.world.entity.animal.EntitySquid; + import net.minecraft.world.entity.boss.EntityComplexPart; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; +@@ -386,6 +387,7 @@ public class ActivationRange */ public static boolean checkIfActive(Entity entity) { -+ if (entity.world.purpurConfig.squidImmuneToEAR && entity instanceof net.minecraft.server.EntitySquid) return true; // Purpur ++ if (entity.world.purpurConfig.squidImmuneToEAR && entity instanceof EntitySquid) return true; // Purpur // Never safe to skip fireworks or entities not yet added to chunk if ( !entity.inChunk || entity instanceof EntityFireworks ) { return true; diff --git a/patches/Purpur/patches/server/0086-Configurable-end-spike-seed.patch b/patches/Purpur/patches/server/0086-Configurable-end-spike-seed.patch index fd9b5fce..f3fbc88e 100644 --- a/patches/Purpur/patches/server/0086-Configurable-end-spike-seed.patch +++ b/patches/Purpur/patches/server/0086-Configurable-end-spike-seed.patch @@ -4,11 +4,11 @@ Date: Wed, 15 Jul 2020 11:49:36 -0500 Subject: [PATCH] Configurable end spike seed -diff --git a/src/main/java/net/minecraft/server/WorldGenEnder.java b/src/main/java/net/minecraft/server/WorldGenEnder.java -index 00a1707209b21fc0163960c957864f798da15554..5eb9b3d35e12c2d3dc5f158cbed0b0a0853ee116 100644 ---- a/src/main/java/net/minecraft/server/WorldGenEnder.java -+++ b/src/main/java/net/minecraft/server/WorldGenEnder.java -@@ -23,12 +23,14 @@ public class WorldGenEnder extends WorldGenerator a(GeneratorAccessSeed generatoraccessseed) { @@ -25,7 +25,7 @@ index 00a1707209b21fc0163960c957864f798da15554..5eb9b3d35e12c2d3dc5f158cbed0b0a0 List list = worldgenfeatureendspikeconfiguration.c(); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index c12146fe8ac1d89c6c1051a8f64ea29a9214e64b..c86f5178590f0b496f018858e21086a594de5dce 100644 +index c7962b45e818bbfa841a1249156472dc750d6194..4eaf0857339a10570a23259e802b65677a2aa018 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -1,5 +1,6 @@ @@ -33,9 +33,9 @@ index c12146fe8ac1d89c6c1051a8f64ea29a9214e64b..c86f5178590f0b496f018858e21086a5 +import co.aikar.timings.TimingsManager; import com.google.common.base.Throwables; + import net.minecraft.locale.LocaleLanguage; import net.minecraft.server.MinecraftServer; - import net.pl3x.purpur.command.PurpurCommand; -@@ -140,6 +141,13 @@ public class PurpurConfig { +@@ -141,6 +142,13 @@ public class PurpurConfig { pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput); } diff --git a/patches/Purpur/patches/server/0087-Configurable-dungeon-seed.patch b/patches/Purpur/patches/server/0087-Configurable-dungeon-seed.patch index c63b1a9b..8f0bf654 100644 --- a/patches/Purpur/patches/server/0087-Configurable-dungeon-seed.patch +++ b/patches/Purpur/patches/server/0087-Configurable-dungeon-seed.patch @@ -4,11 +4,11 @@ Date: Wed, 15 Jul 2020 12:40:25 -0500 Subject: [PATCH] Configurable dungeon seed -diff --git a/src/main/java/net/minecraft/server/WorldGenDungeons.java b/src/main/java/net/minecraft/server/WorldGenDungeons.java -index 07f7b69fefe66ec4f26ca7b4fb3b752e80aeed07..6aa1626f38df0cd8ae8a417dc4fca213b82664c9 100644 ---- a/src/main/java/net/minecraft/server/WorldGenDungeons.java -+++ b/src/main/java/net/minecraft/server/WorldGenDungeons.java -@@ -11,12 +11,21 @@ public class WorldGenDungeons extends WorldGenerator[] ab = new EntityTypes[]{EntityTypes.SKELETON, EntityTypes.ZOMBIE, EntityTypes.ZOMBIE, EntityTypes.SPIDER}; private static final IBlockData ac = Blocks.CAVE_AIR.getBlockData(); @@ -31,10 +31,10 @@ index 07f7b69fefe66ec4f26ca7b4fb3b752e80aeed07..6aa1626f38df0cd8ae8a417dc4fca213 int i = random.nextInt(2) + 2; int j = -i - 1; diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index c86f5178590f0b496f018858e21086a594de5dce..d0b4a9a1a9dea069ea543aa63b950fc5d08c9d02 100644 +index 4eaf0857339a10570a23259e802b65677a2aa018..6faa180bb2a5aa3bd8c4b4845848a63b9366f1eb 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -141,10 +141,13 @@ public class PurpurConfig { +@@ -142,10 +142,13 @@ public class PurpurConfig { pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput); } diff --git a/patches/Purpur/patches/server/0088-Phantoms-burn-in-light.patch b/patches/Purpur/patches/server/0088-Phantoms-burn-in-light.patch index 79673c8a..69a703ce 100644 --- a/patches/Purpur/patches/server/0088-Phantoms-burn-in-light.patch +++ b/patches/Purpur/patches/server/0088-Phantoms-burn-in-light.patch @@ -4,11 +4,27 @@ Date: Sun, 12 Apr 2020 20:41:59 -0700 Subject: [PATCH] Phantoms burn in light -diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index dfce36368da9bdd9285c490a802f7a0cc4a339f6..bdfe073dcd255a7359127f9ae3a962642be5526d 100644 ---- a/src/main/java/net/minecraft/server/EntityPhantom.java -+++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -13,6 +13,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index daf738e8f0987aa6ab200189d7a26d166918b8fc..07ede7b75a65a5815f1ae1ebf03ec0fdb4621afb 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -18,6 +18,7 @@ import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; + import net.minecraft.world.DifficultyDamageScaler; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityFlying; +@@ -41,6 +42,7 @@ import net.minecraft.world.entity.boss.enderdragon.EntityEnderCrystal; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; ++import net.minecraft.world.item.crafting.RecipeItemStack; + import net.minecraft.world.level.World; + import net.minecraft.world.level.WorldAccess; + import net.minecraft.world.level.levelgen.HeightMap; +@@ -54,6 +56,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { private BlockPosition d; public void setHome(BlockPosition home) { this.d = home; } public BlockPosition getHome() { return this.d; } // Purpur - OBFHELPER private EntityPhantom.AttackPhase bo; public AttackPhase getAttackPhase() { return this.bo; } // Purpur - OBFHELPER private Vec3D crystalPosition; // Purpur @@ -16,7 +32,7 @@ index dfce36368da9bdd9285c490a802f7a0cc4a339f6..bdfe073dcd255a7359127f9ae3a96264 public EntityPhantom(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -125,7 +126,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -166,7 +169,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { @Override public void movementTick() { @@ -25,7 +41,7 @@ index dfce36368da9bdd9285c490a802f7a0cc4a339f6..bdfe073dcd255a7359127f9ae3a96264 this.setOnFire(8); } -@@ -374,7 +375,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -416,7 +419,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { } else { this.c = 60; List list = EntityPhantom.this.world.a(this.b, (EntityLiving) EntityPhantom.this, EntityPhantom.this.getBoundingBox().grow(16.0D, 64.0D, 16.0D)); @@ -34,7 +50,7 @@ index dfce36368da9bdd9285c490a802f7a0cc4a339f6..bdfe073dcd255a7359127f9ae3a96264 if (!list.isEmpty()) { list.sort(Comparator.comparing(Entity::locY).reversed()); Iterator iterator = list.iterator(); -@@ -473,6 +474,12 @@ public class EntityPhantom extends EntityFlying implements IMonster { +@@ -515,6 +518,12 @@ public class EntityPhantom extends EntityFlying implements IMonster { return false; } else if (entityliving instanceof EntityHuman && (((EntityHuman) entityliving).isSpectator() || ((EntityHuman) entityliving).isCreative())) { return false; @@ -47,11 +63,11 @@ index dfce36368da9bdd9285c490a802f7a0cc4a339f6..bdfe073dcd255a7359127f9ae3a96264 } else if (!this.a()) { return false; } else { -diff --git a/src/main/java/net/minecraft/server/Items.java b/src/main/java/net/minecraft/server/Items.java -index 4c379916d8d7797038d2980761c49f44c010dea8..ea6b61c9b88f33d29f7266d7614c80372db31b72 100644 ---- a/src/main/java/net/minecraft/server/Items.java -+++ b/src/main/java/net/minecraft/server/Items.java -@@ -173,7 +173,7 @@ public class Items { +diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java +index 993a88a5937417016821ef9d7cd58e4ee097491c..64b4fcf6f43c39db0fe57fc7a74f0d954e966a61 100644 +--- a/src/main/java/net/minecraft/world/item/Items.java ++++ b/src/main/java/net/minecraft/world/item/Items.java +@@ -187,7 +187,7 @@ public class Items { public static final Item cm = a(Blocks.BOOKSHELF, CreativeModeTab.b); public static final Item cn = a(Blocks.MOSSY_COBBLESTONE, CreativeModeTab.b); public static final Item co = a(Blocks.OBSIDIAN, CreativeModeTab.b); @@ -60,7 +76,7 @@ index 4c379916d8d7797038d2980761c49f44c010dea8..ea6b61c9b88f33d29f7266d7614c8037 public static final Item cq = a(Blocks.END_ROD, CreativeModeTab.c); public static final Item cr = a(Blocks.CHORUS_PLANT, CreativeModeTab.c); public static final Item cs = a(Blocks.CHORUS_FLOWER, CreativeModeTab.c); -@@ -225,7 +225,7 @@ public class Items { +@@ -239,7 +239,7 @@ public class Items { public static final Item dm = a(Blocks.SOUL_SOIL, CreativeModeTab.b); public static final Item dn = a(Blocks.BASALT, CreativeModeTab.b); public static final Item do_ = a(Blocks.cP, CreativeModeTab.b); @@ -70,7 +86,7 @@ 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 32bb2524641722d16b6bafcc6b1af2793c1d9a45..fd7eabb033d8900bfab28c3d4a06626f7c0c3ef3 100644 +index cdb7a97ecececa78a200acc898535d33c950a668..0a6b27327b0252911ac68f0584643e2d1c5bf09a 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -408,6 +408,9 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0089-Configurable-villager-breeding.patch b/patches/Purpur/patches/server/0089-Configurable-villager-breeding.patch index 99448886..c1451ec4 100644 --- a/patches/Purpur/patches/server/0089-Configurable-villager-breeding.patch +++ b/patches/Purpur/patches/server/0089-Configurable-villager-breeding.patch @@ -4,11 +4,11 @@ Date: Tue, 31 Mar 2020 23:48:55 -0700 Subject: [PATCH] Configurable villager breeding -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 8002c55497f772eadae3242cad06d529571e97bf..762f1acf435c6e7b6d695fc1b2120de0116f46da 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -640,7 +640,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 2fad37812bfa39872e99c4432e1982d62f65efb7..d3032682af94428419daa02f55b6040090d8df73 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -718,7 +718,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @Override public boolean canBreed() { @@ -18,7 +18,7 @@ index 8002c55497f772eadae3242cad06d529571e97bf..762f1acf435c6e7b6d695fc1b2120de0 private boolean fr() { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index fd7eabb033d8900bfab28c3d4a06626f7c0c3ef3..a47962e2cc277a5c86b9cb5ab793e84286bd9af1 100644 +index 0a6b27327b0252911ac68f0584643e2d1c5bf09a..d56ec897bd3c7706b63d210568e60069c48b1a62 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -471,6 +471,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0090-Redstone-deactivates-spawners.patch b/patches/Purpur/patches/server/0090-Redstone-deactivates-spawners.patch index ecf5db43..62de831a 100644 --- a/patches/Purpur/patches/server/0090-Redstone-deactivates-spawners.patch +++ b/patches/Purpur/patches/server/0090-Redstone-deactivates-spawners.patch @@ -4,11 +4,11 @@ Date: Tue, 14 Apr 2020 00:35:12 -0700 Subject: [PATCH] Redstone deactivates spawners -diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index c2e830db7aa2944a477624e149a3ba66d112b68a..3b4cc9871c123cfd134783745145c407bbccea0f 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -51,6 +51,7 @@ public abstract class MobSpawnerAbstract { +diff --git a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java +index 5538404456dfee42257fad9040fcc0fefdfc5fab..b3a03dc66e803d9dc7000cc7d6960e87b089b3ed 100644 +--- a/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java ++++ b/src/main/java/net/minecraft/world/level/MobSpawnerAbstract.java +@@ -69,6 +69,7 @@ public abstract class MobSpawnerAbstract { private boolean h() { BlockPosition blockposition = this.b(); @@ -16,7 +16,7 @@ index c2e830db7aa2944a477624e149a3ba66d112b68a..3b4cc9871c123cfd134783745145c407 return this.a().isAffectsSpawningPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper } -@@ -329,7 +330,7 @@ public abstract class MobSpawnerAbstract { +@@ -347,7 +348,7 @@ public abstract class MobSpawnerAbstract { public abstract void a(int i); @@ -26,7 +26,7 @@ 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 a47962e2cc277a5c86b9cb5ab793e84286bd9af1..743d1fe2eab2157a1100d0ef13d65ce85b10dbaa 100644 +index d56ec897bd3c7706b63d210568e60069c48b1a62..ad32a4b3a601396c8d485d2264088d6cb4c92ebf 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -284,6 +284,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0091-Totems-work-in-inventory.patch b/patches/Purpur/patches/server/0091-Totems-work-in-inventory.patch index 8b9f5ff2..83c0864b 100644 --- a/patches/Purpur/patches/server/0091-Totems-work-in-inventory.patch +++ b/patches/Purpur/patches/server/0091-Totems-work-in-inventory.patch @@ -4,11 +4,11 @@ Date: Wed, 29 Apr 2020 00:45:58 -0700 Subject: [PATCH] Totems work in inventory -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index a8cd7f0abf58e69d276e469bd7d5ef6ae619263d..4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1328,6 +1328,19 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index e453502c34f717797c4b67a7149d2e0da1b1232d..df9ab64ed3800dfdf9e175fc95a8d3d7dba00c51 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -1426,6 +1426,19 @@ public abstract class EntityLiving extends Entity { } } @@ -29,7 +29,7 @@ index a8cd7f0abf58e69d276e469bd7d5ef6ae619263d..4b7ff69eac4dd5fd5c9b0b26d133daeb 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 743d1fe2eab2157a1100d0ef13d65ce85b10dbaa..40a248746ea53640697395a155c18215fd2bbe51 100644 +index ad32a4b3a601396c8d485d2264088d6cb4c92ebf..2e3667c2c2530a1222f2ad7a4988ba8076759dc4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -201,6 +201,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0092-Populator-seed-controls.patch b/patches/Purpur/patches/server/0092-Populator-seed-controls.patch index 8da04c77..81310b66 100644 --- a/patches/Purpur/patches/server/0092-Populator-seed-controls.patch +++ b/patches/Purpur/patches/server/0092-Populator-seed-controls.patch @@ -18,7 +18,7 @@ index 5e672a0660d0aceffcdb26d185590ca18aa4f023..4b171a2a60e24947e884f8988920f335 } final Object val = config.get(key); diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index eb53f0a9012884ce2ab6b6d8cfeefaffa3a48ead..8f95c3c22a4f3f90f001e34ded081708ede59454 100644 +index d29b537bbe4f852162b720d6b23b741829af21f9..c3669383050241df97e25c89d80720ad446c690d 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -1,5 +1,6 @@ @@ -27,8 +27,8 @@ index eb53f0a9012884ce2ab6b6d8cfeefaffa3a48ead..8f95c3c22a4f3f90f001e34ded081708 +import co.aikar.timings.TimingsManager; import com.destroystokyo.paper.util.SneakyThrow; import net.minecraft.server.MinecraftServer; - import net.minecraft.server.TicketType; -@@ -401,6 +402,19 @@ public final class TuinityConfig { + import net.minecraft.server.level.TicketType; +@@ -410,6 +411,19 @@ public final class TuinityConfig { this.spawnLimitAmbient = this.getInt(path + ".ambient", -1); } @@ -49,11 +49,21 @@ index eb53f0a9012884ce2ab6b6d8cfeefaffa3a48ead..8f95c3c22a4f3f90f001e34ded081708 } \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 3fc101552e3c229076c91a1cfa45206b4cc7a04c..60d5c08706dc8b2f895ff7083d3a611a73ac19d2 100644 ---- a/src/main/java/net/minecraft/server/BiomeBase.java -+++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -227,6 +227,10 @@ public final class BiomeBase { +diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeBase.java b/src/main/java/net/minecraft/world/level/biome/BiomeBase.java +index 9bbd175f7e20591bbefdbddcb5e998e7098c5adb..c4fb051739c1c186c1574185e0653f513755987d 100644 +--- a/src/main/java/net/minecraft/world/level/biome/BiomeBase.java ++++ b/src/main/java/net/minecraft/world/level/biome/BiomeBase.java +@@ -23,7 +23,9 @@ import net.minecraft.core.SectionPosition; + import net.minecraft.data.RegistryGeneration; + import net.minecraft.resources.MinecraftKey; + import net.minecraft.resources.RegistryFileCodec; ++import net.minecraft.server.level.ChunkProviderServer; + import net.minecraft.server.level.RegionLimitedWorldAccess; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.util.INamable; + import net.minecraft.world.level.ChunkCoordIntPair; + import net.minecraft.world.level.EnumSkyBlock; +@@ -257,6 +259,10 @@ public final class BiomeBase { return this.k; } @@ -64,7 +74,7 @@ index 3fc101552e3c229076c91a1cfa45206b4cc7a04c..60d5c08706dc8b2f895ff7083d3a611a public void a(StructureManager structuremanager, ChunkGenerator chunkgenerator, RegionLimitedWorldAccess regionlimitedworldaccess, long i, SeededRandom seededrandom, BlockPosition blockposition) { List>>> list = this.k.c(); int j = WorldGenStage.Decoration.values().length; -@@ -263,12 +267,24 @@ public final class BiomeBase { +@@ -293,12 +299,24 @@ public final class BiomeBase { } } diff --git a/patches/Purpur/patches/server/0093-Add-vindicator-johnny-spawn-chance.patch b/patches/Purpur/patches/server/0093-Add-vindicator-johnny-spawn-chance.patch index 5d463fc9..260c328a 100644 --- a/patches/Purpur/patches/server/0093-Add-vindicator-johnny-spawn-chance.patch +++ b/patches/Purpur/patches/server/0093-Add-vindicator-johnny-spawn-chance.patch @@ -4,11 +4,19 @@ Date: Fri, 24 Jul 2020 19:38:21 -0500 Subject: [PATCH] Add vindicator johnny spawn chance -diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 4761ddfedeed54e79788a6f60f06a805efd60ab1..23b350f793539672b6990327ed52e9bb3bdbf54e 100644 ---- a/src/main/java/net/minecraft/server/EntityVindicator.java -+++ b/src/main/java/net/minecraft/server/EntityVindicator.java -@@ -82,6 +82,12 @@ public class EntityVindicator extends EntityIllagerAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +index f0eda0b83bab8e3a8adbb569b5997402b0e08e9a..fe84d6d2b74b6ae00c4c66682107296a40b69adc 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +@@ -6,6 +6,7 @@ import java.util.Map; + import java.util.function.Predicate; + import javax.annotation.Nullable; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; +@@ -122,6 +123,12 @@ public class EntityVindicator extends EntityIllagerAbstract { ((Navigation) this.getNavigation()).a(true); this.a(difficultydamagescaler); this.b(difficultydamagescaler); @@ -22,7 +30,7 @@ index 4761ddfedeed54e79788a6f60f06a805efd60ab1..23b350f793539672b6990327ed52e9bb } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 40a248746ea53640697395a155c18215fd2bbe51..87c68707aaab2d0e49d4e9c17de94b28a4324799 100644 +index 2e3667c2c2530a1222f2ad7a4988ba8076759dc4..4901e9b0f418132fbe48a424df57d0e7a8103821 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/Purpur/patches/server/0094-Add-option-to-disable-mushroom-block-updates.patch b/patches/Purpur/patches/server/0094-Add-option-to-disable-mushroom-block-updates.patch index 34604e82..29d6cca5 100644 --- a/patches/Purpur/patches/server/0094-Add-option-to-disable-mushroom-block-updates.patch +++ b/patches/Purpur/patches/server/0094-Add-option-to-disable-mushroom-block-updates.patch @@ -4,11 +4,11 @@ Date: Tue, 4 Aug 2020 17:11:58 -0500 Subject: [PATCH] Add option to disable mushroom block updates -diff --git a/src/main/java/net/minecraft/server/BlockHugeMushroom.java b/src/main/java/net/minecraft/server/BlockHugeMushroom.java -index e8f340b9f2a1e5de9cf7e8cf595de8a806cb528a..3490af6fe0cf2eccac9753778cf4085f95d5da93 100644 ---- a/src/main/java/net/minecraft/server/BlockHugeMushroom.java -+++ b/src/main/java/net/minecraft/server/BlockHugeMushroom.java -@@ -14,30 +14,57 @@ public class BlockHugeMushroom extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java b/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java +index 987301bfb9d963e3bebc2653bd95cf7f17a2a1e4..fd61c18905e81b1b193260f1c32b4ad0e29be227 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockHugeMushroom.java +@@ -24,30 +24,57 @@ public class BlockHugeMushroom extends Block { public BlockHugeMushroom(BlockBase.Info blockbase_info) { super(blockbase_info); @@ -73,10 +73,10 @@ index e8f340b9f2a1e5de9cf7e8cf595de8a806cb528a..3490af6fe0cf2eccac9753778cf4085f @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index d0b4a9a1a9dea069ea543aa63b950fc5d08c9d02..17a8b43892fdab87a80cbf076c7814bfab087142 100644 +index 6faa180bb2a5aa3bd8c4b4845848a63b9366f1eb..b50c740b799062240e65625cbf44c32ee07f3551 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -201,6 +201,11 @@ public class PurpurConfig { +@@ -202,6 +202,11 @@ public class PurpurConfig { allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd); } diff --git a/patches/Purpur/patches/server/0095-Dispensers-place-anvils-option.patch b/patches/Purpur/patches/server/0095-Dispensers-place-anvils-option.patch index cbebe020..e4141e44 100644 --- a/patches/Purpur/patches/server/0095-Dispensers-place-anvils-option.patch +++ b/patches/Purpur/patches/server/0095-Dispensers-place-anvils-option.patch @@ -4,11 +4,11 @@ Date: Tue, 4 Aug 2020 21:11:03 -0500 Subject: [PATCH] Dispensers place anvils option -diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 30ba21ac1bced18a9d0946b7c3ed55971ada48bb..23796bd657f071a337fdf76d777e33c207baf7a7 100644 ---- a/src/main/java/net/minecraft/server/EnumDirection.java -+++ b/src/main/java/net/minecraft/server/EnumDirection.java -@@ -112,6 +112,7 @@ public enum EnumDirection implements INamable { +diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java +index 7918d830a4aef09c9f517284e83a9376299116ad..29d747f7fc5824a222755ebf96dfe053896d43d0 100644 +--- a/src/main/java/net/minecraft/core/EnumDirection.java ++++ b/src/main/java/net/minecraft/core/EnumDirection.java +@@ -116,6 +116,7 @@ public enum EnumDirection implements INamable { return fromType1(this.h); } @@ -16,7 +16,7 @@ index 30ba21ac1bced18a9d0946b7c3ed55971ada48bb..23796bd657f071a337fdf76d777e33c2 public EnumDirection g() { switch (this) { case NORTH: -@@ -127,6 +128,7 @@ public enum EnumDirection implements INamable { +@@ -131,6 +132,7 @@ public enum EnumDirection implements INamable { } } @@ -24,7 +24,7 @@ index 30ba21ac1bced18a9d0946b7c3ed55971ada48bb..23796bd657f071a337fdf76d777e33c2 public EnumDirection h() { switch (this) { case NORTH: -@@ -158,6 +160,7 @@ public enum EnumDirection implements INamable { +@@ -162,6 +164,7 @@ public enum EnumDirection implements INamable { return this.j; } @@ -32,11 +32,19 @@ index 30ba21ac1bced18a9d0946b7c3ed55971ada48bb..23796bd657f071a337fdf76d777e33c2 public EnumDirection.EnumAxis n() { return this.k; } -diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java -index 1277a9c8f06936c53f02dc6cfd2eb5184a7b37a2..5675544e018ce6d4fa608680989980edb0ea625a 100644 ---- a/src/main/java/net/minecraft/server/IDispenseBehavior.java -+++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java -@@ -915,6 +915,23 @@ public interface IDispenseBehavior { +diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java +index 93093c05da53e5ddc59fac179081af2e0893706d..a6f74fc09843de9ad5af5c45e303e754ceea2c6d 100644 +--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java ++++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java +@@ -52,6 +52,7 @@ import net.minecraft.world.level.IMaterial; + import net.minecraft.world.level.IWorldReader; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.BlockAnvil; + import net.minecraft.world.level.block.BlockBeehive; + import net.minecraft.world.level.block.BlockCampfire; + import net.minecraft.world.level.block.BlockDispenser; +@@ -989,6 +990,23 @@ public interface IDispenseBehavior { } })); BlockDispenser.a((IMaterial) Items.SHEARS.getItem(), (IDispenseBehavior) (new DispenseBehaviorShears())); @@ -61,7 +69,7 @@ index 1277a9c8f06936c53f02dc6cfd2eb5184a7b37a2..5675544e018ce6d4fa608680989980ed 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 87c68707aaab2d0e49d4e9c17de94b28a4324799..ade194e572b37365cc2becc69081bac8ca34ca46 100644 +index 4901e9b0f418132fbe48a424df57d0e7a8103821..de573b8e09a3ad334991cc313208e0c91990e8a9 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -251,8 +251,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0096-Allow-anvil-colors.patch b/patches/Purpur/patches/server/0096-Allow-anvil-colors.patch index 8f946d11..7b2e4ab6 100644 --- a/patches/Purpur/patches/server/0096-Allow-anvil-colors.patch +++ b/patches/Purpur/patches/server/0096-Allow-anvil-colors.patch @@ -4,11 +4,11 @@ Date: Tue, 4 Aug 2020 22:08:23 -0500 Subject: [PATCH] Allow anvil colors -diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index 4aa6b035a6a8ea39401c6566cd286de39f60e942..02924766a4c655f149b58bf1ded8e0610f8900a3 100644 ---- a/src/main/java/net/minecraft/server/ContainerAnvil.java -+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java -@@ -10,6 +10,13 @@ import org.apache.logging.log4j.Logger; +diff --git a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java +index 1b2d633f3d5d735039f18f27fb1387bd5a74f0d8..77810fbb70bf2e1ad03c28c0d69ceaa63221d94c 100644 +--- a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java ++++ b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java +@@ -28,6 +28,13 @@ import org.apache.logging.log4j.Logger; import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit end @@ -22,7 +22,7 @@ index 4aa6b035a6a8ea39401c6566cd286de39f60e942..02924766a4c655f149b58bf1ded8e061 public class ContainerAnvil extends ContainerAnvilAbstract { private static final Logger LOGGER = LogManager.getLogger(); -@@ -251,6 +258,17 @@ public class ContainerAnvil extends ContainerAnvilAbstract { +@@ -269,6 +276,17 @@ public class ContainerAnvil extends ContainerAnvilAbstract { } else if (!this.renameText.equals(itemstack.getName().getString())) { b1 = 1; i += b1; @@ -41,7 +41,7 @@ index 4aa6b035a6a8ea39401c6566cd286de39f60e942..02924766a4c655f149b58bf1ded8e061 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index ade194e572b37365cc2becc69081bac8ca34ca46..227bdc2d24d4d6dbacbf5b93497d1a4b61290af0 100644 +index de573b8e09a3ad334991cc313208e0c91990e8a9..1e5dfaac19af7047243b991745a341782850cf20 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -234,6 +234,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0097-Add-no-tick-block-list.patch b/patches/Purpur/patches/server/0097-Add-no-tick-block-list.patch index 446f93bc..057e7b57 100644 --- a/patches/Purpur/patches/server/0097-Add-no-tick-block-list.patch +++ b/patches/Purpur/patches/server/0097-Add-no-tick-block-list.patch @@ -4,28 +4,11 @@ Date: Fri, 7 Aug 2020 12:53:36 -0500 Subject: [PATCH] Add no-tick block list -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 829d4a7508e1656dbdc912096b7eafcf30cbb5b2..6aea156d7c7a9ca8a357aad6a6781d7209c9b8ae 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -617,10 +617,12 @@ public abstract class BlockBase { - } - - public void a(WorldServer worldserver, BlockPosition blockposition, Random random) { -+ if (worldserver.purpurConfig.noTickBlocks.contains(getBlock())) return; // Purpur - this.getBlock().tickAlways(this.p(), worldserver, blockposition, random); - } - - public void b(WorldServer worldserver, BlockPosition blockposition, Random random) { -+ if (worldserver.purpurConfig.noTickBlocks.contains(getBlock())) return; // Purpur - this.getBlock().tick(this.p(), worldserver, blockposition, random); - } - -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4f0159cd0b7a438084a3fc9cf681dbce6e41a125..af7c9562cb7eac9d1e985d5337c8d127d875bcfb 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -418,14 +418,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 9d4ceaebf43b349454f10abfb5bb995d084c11fb..93c1fedd3af277e261bfd18c2239643fb42cb21a 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -532,14 +532,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit end if (com.destroystokyo.paper.PaperConfig.useOptimizedTickList) { this.nextTickListBlock = new com.destroystokyo.paper.server.ticklist.PaperTickList<>(this, (block) -> { @@ -42,8 +25,25 @@ index 4f0159cd0b7a438084a3fc9cf681dbce6e41a125..af7c9562cb7eac9d1e985d5337c8d127 }, IRegistry.BLOCK::getKey, this::b, "Blocks"); // Paper - Timings this.nextTickListFluid = new TickListServer<>(this, (fluidtype) -> { return fluidtype == null || fluidtype == FluidTypes.EMPTY; +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index 0b852fa247c65cb1e889ad4e55886e256f89a763..2ec82dcb9d989590e59f88a02d1c205b3200cadc 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -670,10 +670,12 @@ public abstract class BlockBase { + } + + public void a(WorldServer worldserver, BlockPosition blockposition, Random random) { ++ if (worldserver.purpurConfig.noTickBlocks.contains(getBlock())) return; // Purpur + this.getBlock().tickAlways(this.p(), worldserver, blockposition, random); + } + + public void b(WorldServer worldserver, BlockPosition blockposition, Random random) { ++ if (worldserver.purpurConfig.noTickBlocks.contains(getBlock())) return; // Purpur + this.getBlock().tick(this.p(), worldserver, blockposition, random); + } + diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 227bdc2d24d4d6dbacbf5b93497d1a4b61290af0..5b344d7eb8e4c031deb660955f2d1914f3ce4800 100644 +index 1e5dfaac19af7047243b991745a341782850cf20..608bd272762314f661920ab16bf17dbf108df178 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/Purpur/patches/server/0098-Add-option-to-disable-dolphin-treasure-searching.patch b/patches/Purpur/patches/server/0098-Add-option-to-disable-dolphin-treasure-searching.patch index 748e9e07..856b2230 100644 --- a/patches/Purpur/patches/server/0098-Add-option-to-disable-dolphin-treasure-searching.patch +++ b/patches/Purpur/patches/server/0098-Add-option-to-disable-dolphin-treasure-searching.patch @@ -4,11 +4,11 @@ Date: Sat, 8 Aug 2020 16:11:51 -0500 Subject: [PATCH] Add option to disable dolphin treasure searching -diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java -index 2916ee89ef7a14619703dfbe7efd5c78a2f34337..664f9693368852bfb06a7a3bd0862a10cbc81747 100644 ---- a/src/main/java/net/minecraft/server/EntityDolphin.java -+++ b/src/main/java/net/minecraft/server/EntityDolphin.java -@@ -329,6 +329,7 @@ public class EntityDolphin extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +index 5d18e19eafd5dc01a6caa45075d8c0598f1bb709..e0a9b931c26dbd4e7739d09ae45e1cee72ab210c 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +@@ -393,6 +393,7 @@ public class EntityDolphin extends EntityWaterAnimal { @Override public boolean a() { @@ -17,7 +17,7 @@ index 2916ee89ef7a14619703dfbe7efd5c78a2f34337..664f9693368852bfb06a7a3bd0862a10 } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5b344d7eb8e4c031deb660955f2d1914f3ce4800..07cc9766d420d5584c53692e37abaca5b5ac95f5 100644 +index 608bd272762314f661920ab16bf17dbf108df178..450a582b007fda07e1a2afbb40201a9929b554ba 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -353,6 +353,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0099-Short-enderman-height.patch b/patches/Purpur/patches/server/0099-Short-enderman-height.patch index e536d472..38b5c037 100644 --- a/patches/Purpur/patches/server/0099-Short-enderman-height.patch +++ b/patches/Purpur/patches/server/0099-Short-enderman-height.patch @@ -4,23 +4,11 @@ Date: Mon, 10 Aug 2020 21:46:22 -0500 Subject: [PATCH] Short enderman height -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 7b175240e44b0c7eb5044d7bcaf54dac22f50f2a..e3364032669b473c799b759f5f89468b7584d9f5 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -321,6 +321,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - public boolean damageEntity(DamageSource damagesource, float f) { - if (this.isInvulnerable(damagesource)) { - return false; -+ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height - } else if (damagesource instanceof EntityDamageSourceIndirect) { - if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start - for (int i = 0; i < 64; ++i) { -diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ed1e0bd379b95bc090c7cdf57de70ec9cc2dac5a..06fe0fca1936853748997c63f325df99da5fa2ee 100644 ---- a/src/main/java/net/minecraft/server/EntityTypes.java -+++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -137,7 +137,8 @@ public class EntityTypes { +diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java +index 94aca57dd9e08d8841086378a712794e0d9c0e00..6eb91f73b7040c13c43c3e3c319244640bfbbeaf 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java ++++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java +@@ -268,7 +268,8 @@ public class EntityTypes { private IChatBaseComponent bp; @Nullable private MinecraftKey bq; @@ -30,20 +18,32 @@ index ed1e0bd379b95bc090c7cdf57de70ec9cc2dac5a..06fe0fca1936853748997c63f325df99 private static EntityTypes a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 72142f5c777c6218050bc2b69891072d256ea57d..52aa47036acee2ec21ae2d6f4df634ecbf04b3b0 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -383,6 +383,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + public boolean damageEntity(DamageSource damagesource, float f) { + if (this.isInvulnerable(damagesource)) { + return false; ++ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height + } else if (damagesource instanceof EntityDamageSourceIndirect) { + if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start + for (int i = 0; i < 64; ++i) { diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index 17a8b43892fdab87a80cbf076c7814bfab087142..c314a8c9a921a95cea43b748e2037521d948e1e7 100644 +index b50c740b799062240e65625cbf44c32ee07f3551..bfae3043ef6bf402011045bd9682117aa3021468 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -2,6 +2,8 @@ package net.pl3x.purpur; - - import co.aikar.timings.TimingsManager; +@@ -4,6 +4,8 @@ import co.aikar.timings.TimingsManager; import com.google.common.base.Throwables; -+import net.minecraft.server.EntitySize; -+import net.minecraft.server.EntityTypes; + import net.minecraft.locale.LocaleLanguage; import net.minecraft.server.MinecraftServer; ++import net.minecraft.world.entity.EntitySize; ++import net.minecraft.world.entity.EntityTypes; import net.pl3x.purpur.command.PurpurCommand; import org.bukkit.Bukkit; -@@ -191,6 +193,12 @@ public class PurpurConfig { + import org.bukkit.command.Command; +@@ -192,6 +194,12 @@ public class PurpurConfig { enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); } diff --git a/patches/Purpur/patches/server/0100-Stop-squids-floating-on-top-of-water.patch b/patches/Purpur/patches/server/0100-Stop-squids-floating-on-top-of-water.patch index 788f66df..3cb8f108 100644 --- a/patches/Purpur/patches/server/0100-Stop-squids-floating-on-top-of-water.patch +++ b/patches/Purpur/patches/server/0100-Stop-squids-floating-on-top-of-water.patch @@ -4,11 +4,11 @@ Date: Thu, 13 Aug 2020 04:00:26 -0500 Subject: [PATCH] Stop squids floating on top of water -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4b9e44aad705247c075e435ebc6eb9b1393f7b17..30408e9e8b4acec56a95852558ead6a581b8565c 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -3461,8 +3461,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 5ac6b7759cf43dbbad1bcf74d5d86efd69883cf5..240f30f6ca6007ba8e7de1c3e033b2a8493838e7 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -3556,8 +3556,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.lastYaw = this.yaw; } @@ -23,11 +23,19 @@ index 4b9e44aad705247c075e435ebc6eb9b1393f7b17..30408e9e8b4acec56a95852558ead6a5 int i = MathHelper.floor(axisalignedbb.minX); int j = MathHelper.f(axisalignedbb.maxX); int k = MathHelper.floor(axisalignedbb.minY); -diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index b21605a62365fe24f315f35bd840b4740fc80f0e..148e4b158734f136832e5c17bdc69634c0f294aa 100644 ---- a/src/main/java/net/minecraft/server/EntitySquid.java -+++ b/src/main/java/net/minecraft/server/EntitySquid.java -@@ -25,6 +25,14 @@ public class EntitySquid extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +index 92ff03f8e8286f710fd5e63b4d103e489787d453..081929990a8208f643d298a885acc4ddfa401bfb 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +@@ -26,6 +26,7 @@ import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.level.material.Fluid; ++import net.minecraft.world.phys.AxisAlignedBB; + import net.minecraft.world.phys.Vec3D; + + public class EntitySquid extends EntityWaterAnimal { +@@ -51,6 +52,14 @@ public class EntitySquid extends EntityWaterAnimal { this.bu = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } @@ -43,7 +51,7 @@ 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 07cc9766d420d5584c53692e37abaca5b5ac95f5..637cac2758a44e72794953b9fbca2accb7d86b6a 100644 +index 450a582b007fda07e1a2afbb40201a9929b554ba..4f5b815f22a906d8438c82204d24417e5d1cc66c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -499,8 +499,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0101-Ridables.patch b/patches/Purpur/patches/server/0101-Ridables.patch index 6853acda..95c55bbc 100644 --- a/patches/Purpur/patches/server/0101-Ridables.patch +++ b/patches/Purpur/patches/server/0101-Ridables.patch @@ -4,11 +4,501 @@ Date: Sun, 5 Jul 2020 22:19:49 -0500 Subject: [PATCH] Ridables -diff --git a/src/main/java/net/minecraft/server/AttributeDefaults.java b/src/main/java/net/minecraft/server/AttributeDefaults.java -index 8f95a4e49714e352b9cdf82d7f4acdd3459978ad..ab05b5e403cf54756aa35891dc0d950187a9d4ec 100644 ---- a/src/main/java/net/minecraft/server/AttributeDefaults.java -+++ b/src/main/java/net/minecraft/server/AttributeDefaults.java -@@ -9,7 +9,80 @@ import org.apache.logging.log4j.Logger; +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index c6c4349954cb302e933739870814f54e426bd825..5de12553875af626fa597ca440e52682624e35c8 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1530,6 +1530,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper + worldserver.hasEntityMoveEvent = EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper ++ worldserver.hasRidableMoveEvent = net.pl3x.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur + TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper + + this.methodProfiler.a(() -> { +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java b/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java +new file mode 100644 +index 0000000000000000000000000000000000000000..70961ec1d385dfd7c17fed6f33e4eb7fd57bc34a +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java +@@ -0,0 +1,21 @@ ++package net.minecraft.server; ++ ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.goal.PathfinderGoal; ++ ++import java.util.EnumSet; ++ ++public class PathfinderGoalHasRider extends PathfinderGoal { ++ public final EntityInsentient entity; ++ ++ public PathfinderGoalHasRider(EntityInsentient entity) { ++ this.entity = entity; ++ setTypes(EnumSet.of(Type.JUMP, Type.MOVE, Type.LOOK, Type.TARGET, Type.UNKNOWN_BEHAVIOR)); ++ } ++ ++ // shouldExecute ++ @Override ++ public boolean a() { ++ return entity.hasRider(); ++ } ++} +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java +new file mode 100644 +index 0000000000000000000000000000000000000000..8b66d1215a6eef1302b5ecb46a4b3d502846fef8 +--- /dev/null ++++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java +@@ -0,0 +1,18 @@ ++package net.minecraft.server; ++ ++import net.minecraft.world.entity.animal.horse.EntityHorseAbstract; ++ ++public class PathfinderGoalHorseHasRider extends PathfinderGoalHasRider { ++ private final EntityHorseAbstract horse; ++ ++ public PathfinderGoalHorseHasRider(EntityHorseAbstract entity) { ++ super(entity); ++ this.horse = entity; ++ } ++ ++ // shouldExecute ++ @Override ++ public boolean a() { ++ return super.a() && horse.hasSaddle(); ++ } ++} +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 9de660f0c679f101512bddf7c6582ca6cd18ca5b..e1a6e4a359eb2aa484d479fde398473c349a63ba 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -643,6 +643,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + + this.advancementDataPlayer.b(this); ++ ++ // Purpur start ++ if (this.world.purpurConfig.useNightVisionWhenRiding && this.getVehicle() != null && this.getVehicle().getRider() == this && world.getTime() % 100 == 0) { // 5 seconds ++ MobEffect nightVision = this.getEffect(MobEffects.NIGHT_VISION); ++ if (nightVision == null || nightVision.getDuration() <= 300) { // 15 seconds ++ this.addEffect(new MobEffect(MobEffects.NIGHT_VISION, 400, 0)); // 20 seconds ++ } ++ } ++ // Purpur end + } + + public void playerTick() { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 93c1fedd3af277e261bfd18c2239643fb42cb21a..e601109b264f5dcd22c5181f77f4c548b0906398 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -216,6 +216,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public final UUID uuid; + public boolean hasPhysicsEvent = true; // Paper + public boolean hasEntityMoveEvent = false; // Paper ++ public boolean hasRidableMoveEvent = false; // Purpur + private static Throwable getAddToWorldStackTrace(Entity entity) { + return new Throwable(entity + " Added to world at " + new java.util.Date()); + } +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index 319d9d2ba8ce3b5311746938b06999702847ce0b..8d53548bc0d8076d3831b72673ab5412a77919a4 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -2452,6 +2452,8 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + this.server.getPluginManager().callEvent(event); + ++ player.processClick(enumhand); // Purpur ++ + // Fish bucket - SPIGOT-4048 + if ((entity instanceof EntityFish && origItem != null && origItem.getItem() == Items.WATER_BUCKET) && (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem)) { + this.sendPacket(new PacketPlayOutSpawnEntityLiving((EntityFish) entity)); +diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java +index 6ba14f603b8ec69597c70677cc317f802d6afae9..24fd920394774bf38d2818a4cd013670f7b20ba9 100644 +--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java ++++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java +@@ -67,6 +67,7 @@ public class DamageSource { + return new EntityDamageSource("mob", entityliving); + } + ++ public static DamageSource indirectMobAttack(Entity entity, EntityLiving entityliving) { return a(entity, entityliving); } // Purpur - OBFHELPER + public static DamageSource a(Entity entity, EntityLiving entityliving) { + return new EntityDamageSourceIndirect("mob", entity, entityliving); + } +@@ -128,6 +129,7 @@ public class DamageSource { + return this.B; + } + ++ public DamageSource setProjectile() { return c(); } // Purpur - OBFHELPER + public DamageSource c() { + this.B = true; + return this; +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 240f30f6ca6007ba8e7de1c3e033b2a8493838e7..d1bbf4127a2e0836bedb33a81e3fd18a8e8eb962 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -22,6 +22,7 @@ import net.minecraft.BlockUtil; + import net.minecraft.CrashReport; + import net.minecraft.CrashReportSystemDetails; + import net.minecraft.ReportedException; ++import net.minecraft.SystemUtils; + import net.minecraft.advancements.CriterionTriggers; + import net.minecraft.commands.CommandListenerWrapper; + import net.minecraft.commands.ICommandListener; +@@ -197,7 +198,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + private int id; + public boolean i; public final boolean blocksEntitySpawning() { return this.i; } // Paper - OBFHELPER + public final List passengers; +- protected int j; ++ protected int j; public int getRideCooldown() { return j; } // Purpur - OBFHELPER + @Nullable + private Entity vehicle; + public boolean attachedToPlayer; +@@ -213,7 +214,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + public float lastYaw; + public float lastPitch; + private AxisAlignedBB boundingBox; +- protected boolean onGround; ++ public boolean onGround; // Purpur - protected -> public + public boolean positionChanged; + public boolean v; + public boolean velocityChanged; +@@ -269,7 +270,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + private boolean az; + private final double[] aA; + private long aB; +- private EntitySize size; ++ protected EntitySize size; // Purpur - private -> protected + private float headHeight; + // CraftBukkit start + public boolean persist = true; +@@ -1590,6 +1591,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; + } + ++ public void moveRelative(float speed, Vec3D motion) { this.a(speed, motion); } // Purpur - OBFHELPER + public void a(float f, Vec3D vec3d) { + Vec3D vec3d1 = a(vec3d, f, this.yaw); + +@@ -2346,6 +2348,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return this.a(entity, false); + } + ++ public boolean startRiding(Entity entity, boolean flag) { return a(entity, flag); } // Purpur - OBFHELPER + public boolean a(Entity entity, boolean flag) { + for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) { + if (entity1.vehicle == this) { +@@ -2441,6 +2444,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + this.passengers.add(entity); + } + ++ // Purpur start ++ if (isRidable() && passengers.get(0) == entity && entity instanceof EntityHuman) { ++ EntityHuman entityhuman = (EntityHuman) entity; ++ onMount(entityhuman); ++ this.rider = entityhuman; ++ } ++ // Purpur end + } + return true; // CraftBukkit + } +@@ -2481,6 +2491,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return false; + } + // Spigot end ++ // Purpur start ++ if (rider != null && passengers.get(0) == rider) { ++ onDismount(rider); ++ this.rider = null; ++ } ++ // Purpur end + this.passengers.remove(entity); + entity.j = 60; + } +@@ -2646,6 +2662,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + this.setFlag(4, flag); + } + ++ public boolean isGlowing() { return bE(); } // Purpur - OBFHELPER + public boolean bE() { + return this.glowing || this.world.isClientSide && this.getFlag(6); + } +@@ -2868,6 +2885,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + + public void setHeadRotation(float f) {} + ++ public void setBodyYaw(float yaw) { n(yaw); } // Purpur - OBFHELPER + public void n(float f) {} + + public boolean bL() { +@@ -3309,6 +3327,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return false; + } + ++ // Purpur Start ++ public void sendMessage(String str) { ++ sendMessage(org.bukkit.craftbukkit.util.CraftChatMessage.fromStringOrNull(str)); ++ } ++ ++ public void sendMessage(IChatBaseComponent ichatbasecomponent) { ++ if (ichatbasecomponent != null) { ++ sendMessage(ichatbasecomponent, SystemUtils.getNullUUID()); ++ } ++ } ++ // Purpur end ++ + @Override + public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {} + +@@ -3761,4 +3791,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return ((ChunkProviderServer) world.getChunkProvider()).isInEntityTickingChunk(this); + } + // Paper end ++ ++ // Purpur start ++ private EntityHuman rider; ++ ++ public EntityHuman getRider() { ++ return rider; ++ } ++ ++ public boolean hasRider() { ++ return rider != null; ++ } ++ ++ public boolean isRidable() { ++ return false; ++ } ++ ++ public boolean isRidableInWater() { ++ return false; ++ } ++ ++ public void onMount(EntityHuman entityhuman) { ++ if (this instanceof EntityInsentient) { ++ ((EntityInsentient) this).setGoalTarget(null, null, false); ++ ((EntityInsentient) this).getNavigation().stopPathfinding(); ++ } ++ entityhuman.setJumping(false); // fixes jump on mount ++ } ++ ++ public void onDismount(EntityHuman entityhuman) { ++ } ++ ++ public boolean onSpacebar() { ++ return false; ++ } ++ ++ public boolean onClick(EnumHand hand) { ++ return false; ++ } ++ ++ public boolean processClick(EnumHand hand) { ++ return false; ++ } ++ // Purpur end + } +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index c9136f1b54ff0620a621b703b4e7487f4a63b01d..8b7f840bb1b24996b40c9bef85f4c1e98e39caec 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -100,7 +100,7 @@ public abstract class EntityInsentient extends EntityLiving { + protected int f; + protected ControllerLook lookController; + protected ControllerMove moveController; +- protected ControllerJump bi; ++ protected ControllerJump bi; public ControllerJump getJumpController() { return bi; } // Purpur - OBFHELPER + private final EntityAIBodyControl c; + protected NavigationAbstract navigation; + public PathfinderGoalSelector goalSelector; +@@ -138,8 +138,8 @@ public abstract class EntityInsentient extends EntityLiving { + this.bA = -1.0F; + this.goalSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); + this.targetSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); +- this.lookController = new ControllerLook(this); +- this.moveController = new ControllerMove(this); ++ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); // Purpur ++ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); // Purpur + this.bi = new ControllerJump(this); + this.c = this.r(); + this.navigation = this.b(world); +@@ -328,10 +328,10 @@ public abstract class EntityInsentient extends EntityLiving { + // Purpur start + private void incrementTicksSinceLastInteraction() { + ++ticksSinceLastInteraction; +- //if (hasRider()) { +- // ticksSinceLastInteraction = 0; +- // return; +- //} ++ if (hasRider()) { ++ ticksSinceLastInteraction = 0; ++ return; ++ } + if (world.purpurConfig.entityLifeSpan <= 0) { + return; // feature disabled + } +@@ -626,14 +626,17 @@ public abstract class EntityInsentient extends EntityLiving { + return super.dp(); + } + ++ public void setForwardSpeed(float speed) { this.t(speed); } // Purpur - OBFHELPER + public void t(float f) { + this.aT = f; + } + ++ public void setVerticalSpeed(float speed) { this.u(speed); } // Purpur - OBFHELPER + public void u(float f) { + this.aS = f; + } + ++ public void setStrafeSpeed(float speed) { this.v(speed); } // Purpur - OBFHELPER + public void v(float f) { + this.aR = f; + } +@@ -1325,7 +1328,7 @@ public abstract class EntityInsentient extends EntityLiving { + protected void a(EntityHuman entityhuman, EntityInsentient entityinsentient) {} + + protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { +- return EnumInteractionResult.PASS; ++ return tryRide(entityhuman, enumhand); // Purpur + } + + public boolean ev() { +@@ -1706,4 +1709,54 @@ public abstract class EntityInsentient extends EntityLiving { + this.unleash(true, event.isDropLeash()); + // Paper end + } ++ ++ // Purpur start ++ public double getMaxY() { ++ return world.getHeight(); ++ } ++ ++ public EnumInteractionResult tryRide(EntityHuman entityhuman, EnumHand enumhand) { ++ if (!isRidable()) { ++ return EnumInteractionResult.PASS; ++ } ++ if (enumhand != EnumHand.MAIN_HAND) { ++ return EnumInteractionResult.PASS; ++ } ++ if (entityhuman.isSneaking()) { ++ return EnumInteractionResult.PASS; ++ } ++ if (!entityhuman.getItemInHand(enumhand).isEmpty()) { ++ return EnumInteractionResult.PASS; ++ } ++ if (!passengers.isEmpty() || entityhuman.isPassenger()) { ++ return EnumInteractionResult.PASS; ++ } ++ if (this instanceof EntityTameableAnimal) { ++ EntityTameableAnimal tameable = (EntityTameableAnimal) this; ++ if (tameable.isTamed() && !tameable.isOwner(entityhuman)) { ++ return EnumInteractionResult.PASS; ++ } ++ if (!tameable.isTamed() && !world.purpurConfig.untamedTamablesAreRidable) { ++ return EnumInteractionResult.PASS; ++ } ++ } ++ if (this instanceof EntityAgeable) { ++ EntityAgeable ageable = (EntityAgeable) this; ++ if (ageable.isBaby() && !world.purpurConfig.babiesAreRidable) { ++ return EnumInteractionResult.PASS; ++ } ++ } ++ if (!entityhuman.getBukkitEntity().hasPermission("allow.ride." + getEntityType().getName())) { ++ entityhuman.sendMessage(net.pl3x.purpur.PurpurConfig.cannotRideMob); ++ return EnumInteractionResult.PASS; ++ } ++ entityhuman.yaw = this.yaw; ++ entityhuman.pitch = this.pitch; ++ if (entityhuman.startRiding(this)) { ++ return EnumInteractionResult.SUCCESS; ++ } else { ++ return EnumInteractionResult.PASS; ++ } ++ } ++ // Purpur end + } +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index df9ab64ed3800dfdf9e175fc95a8d3d7dba00c51..617657ff7f27996ed7d97801dc49c9a39f59a240 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -559,7 +559,7 @@ public abstract class EntityLiving extends Entity { + + @Override + public boolean bt() { +- return false; ++ return isRidableInWater(); // Purpur + } + + protected void cU() { +@@ -2300,7 +2300,7 @@ public abstract class EntityLiving extends Entity { + return 0.42F * this.getBlockJumpFactor(); + } + +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + float f = this.dJ(); + + if (this.hasEffect(MobEffects.JUMP)) { +@@ -2549,10 +2549,12 @@ public abstract class EntityLiving extends Entity { + return this.onGround ? this.dN() * (0.21600002F / (f * f * f)) : this.aE; + } + ++ public float getSpeed() { return dN(); } // Purpur - OBFHELPER + public float dN() { + return this.bu; + } + ++ public void setSpeed(float speed) { q(speed); } // Purpur - OBFHELPER + public void q(float f) { + this.bu = f; + } +@@ -2951,6 +2953,20 @@ public abstract class EntityLiving extends Entity { + } + } + // Paper end ++ // Purpur start ++ if (hasRider() && ((WorldServer) world).hasRidableMoveEvent && this instanceof EntityInsentient) { ++ if (lastX != locX() || lastY != locY() || lastZ != locZ() || lastYaw != yaw || lastPitch != pitch) { ++ Location from = new Location(world.getWorld(), lastX, lastY, lastZ, lastYaw, lastPitch); ++ Location to = new Location (world.getWorld(), locX(), locY(), locZ(), yaw, pitch); ++ net.pl3x.purpur.event.entity.RidableMoveEvent event = new net.pl3x.purpur.event.entity.RidableMoveEvent((org.bukkit.entity.Mob) getBukkitLivingEntity(), (Player) getRider().getBukkitEntity(), from, to.clone()); ++ if (!event.callEvent()) { ++ setLocation(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch()); ++ } else if (!to.equals(event.getTo())) { ++ setLocation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch()); ++ } ++ } ++ } ++ // Purpur end + if (!this.world.isClientSide && this.dO() && this.aG()) { + this.damageEntity(DamageSource.DROWN, 1.0F); + } +diff --git a/src/main/java/net/minecraft/world/entity/EntityTameableAnimal.java b/src/main/java/net/minecraft/world/entity/EntityTameableAnimal.java +index 74636c4c0851da1cd5732daa0a2d1a4edda2050f..cdb56555889d17913d7b0c03d5ba23408a500f26 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityTameableAnimal.java ++++ b/src/main/java/net/minecraft/world/entity/EntityTameableAnimal.java +@@ -144,6 +144,7 @@ public abstract class EntityTameableAnimal extends EntityAnimal { + return this.i(entityliving) ? false : super.c(entityliving); + } + ++ public boolean isOwner(EntityLiving entityLiving) { return i(entityLiving); } // Purpur - OBFHELPER + public boolean i(EntityLiving entityliving) { + return entityliving == this.getOwner(); + } +diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeDefaults.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeDefaults.java +index 1b9cf77aa5d73b4834e5260a91d338620e0bb6b3..b6cc0e1286294e64568d11c452684071d4c5b636 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeDefaults.java ++++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeDefaults.java +@@ -50,6 +50,7 @@ import net.minecraft.world.entity.monster.EntityGuardianElder; + import net.minecraft.world.entity.monster.EntityIllagerIllusioner; + import net.minecraft.world.entity.monster.EntityMagmaCube; + import net.minecraft.world.entity.monster.EntityMonster; ++import net.minecraft.world.entity.monster.EntityPhantom; + import net.minecraft.world.entity.monster.EntityPigZombie; + import net.minecraft.world.entity.monster.EntityPillager; + import net.minecraft.world.entity.monster.EntityRavager; +@@ -74,7 +75,80 @@ import org.apache.logging.log4j.Logger; public class AttributeDefaults { private static final Logger LOGGER = LogManager.getLogger(); @@ -90,11 +580,11 @@ index 8f95a4e49714e352b9cdf82d7f4acdd3459978ad..ab05b5e403cf54756aa35891dc0d9501 public static AttributeProvider a(EntityTypes entitytypes) { return (AttributeProvider) AttributeDefaults.b.get(entitytypes); -diff --git a/src/main/java/net/minecraft/server/AttributeProvider.java b/src/main/java/net/minecraft/server/AttributeProvider.java -index dd235a6fc4bc731a344d7211879f9b40bb622c3e..ac902c614dd3054f1a09298a42a88248b69552cd 100644 ---- a/src/main/java/net/minecraft/server/AttributeProvider.java -+++ b/src/main/java/net/minecraft/server/AttributeProvider.java -@@ -101,6 +101,7 @@ public class AttributeProvider { +diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeProvider.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeProvider.java +index c75659d0f2a6a198f338c38b600e639a4cb3d9ee..5edad3ee07cc0357442ede3a1e14e8d5c121e530 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeProvider.java ++++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeProvider.java +@@ -102,6 +102,7 @@ public class AttributeProvider { return this; } @@ -102,19 +592,20 @@ index dd235a6fc4bc731a344d7211879f9b40bb622c3e..ac902c614dd3054f1a09298a42a88248 public AttributeProvider a() { this.b = true; return new AttributeProvider(this.a); -diff --git a/src/main/java/net/minecraft/server/ControllerLookDolphin.java b/src/main/java/net/minecraft/server/ControllerLookDolphin.java -index e5bdddfc14b36b3a7b72ca92a9a14245fddb8833..8200ba60b7642a49742809a9c2e2ab7587259a71 100644 ---- a/src/main/java/net/minecraft/server/ControllerLookDolphin.java -+++ b/src/main/java/net/minecraft/server/ControllerLookDolphin.java -@@ -1,6 +1,6 @@ - package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/world/entity/ai/control/ControllerLookDolphin.java b/src/main/java/net/minecraft/world/entity/ai/control/ControllerLookDolphin.java +index bf059f201c662d6492b093184e7feec711b846e8..1b472a659c140b368173237d54633f0dfbeb7419 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/control/ControllerLookDolphin.java ++++ b/src/main/java/net/minecraft/world/entity/ai/control/ControllerLookDolphin.java +@@ -3,7 +3,7 @@ package net.minecraft.world.entity.ai.control; + import net.minecraft.util.MathHelper; + import net.minecraft.world.entity.EntityInsentient; -public class ControllerLookDolphin extends ControllerLook { +public class ControllerLookDolphin extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur private final int h; -@@ -10,7 +10,7 @@ public class ControllerLookDolphin extends ControllerLook { +@@ -13,7 +13,7 @@ public class ControllerLookDolphin extends ControllerLook { } @Override @@ -123,11 +614,11 @@ index e5bdddfc14b36b3a7b72ca92a9a14245fddb8833..8200ba60b7642a49742809a9c2e2ab75 if (this.d) { this.d = false; this.a.aC = this.a(this.a.aC, this.h() + 20.0F, this.b); -diff --git a/src/main/java/net/minecraft/server/ControllerMove.java b/src/main/java/net/minecraft/server/ControllerMove.java -index 8f9fb058c11ba5c2e887df048025284cd834ffe9..eaf44694683685e06dd1f012699e5c9d1f91c850 100644 ---- a/src/main/java/net/minecraft/server/ControllerMove.java -+++ b/src/main/java/net/minecraft/server/ControllerMove.java -@@ -6,9 +6,9 @@ public class ControllerMove { +diff --git a/src/main/java/net/minecraft/world/entity/ai/control/ControllerMove.java b/src/main/java/net/minecraft/world/entity/ai/control/ControllerMove.java +index 2aa5789437ba7eb20579da238c407a65a25b1d44..434229b146978ba7dc08a83ea55fdb3ab743fbf8 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/control/ControllerMove.java ++++ b/src/main/java/net/minecraft/world/entity/ai/control/ControllerMove.java +@@ -20,9 +20,9 @@ public class ControllerMove { protected double b; protected double c; protected double d; @@ -140,188 +631,19 @@ index 8f9fb058c11ba5c2e887df048025284cd834ffe9..eaf44694683685e06dd1f012699e5c9d protected ControllerMove.Operation h; public ControllerMove(EntityInsentient entityinsentient) { -diff --git a/src/main/java/net/minecraft/server/DamageSource.java b/src/main/java/net/minecraft/server/DamageSource.java -index bd0267ee4b3782f6d1ec39cba7966ba4f62f1adf..8b36ac2b0950a827763aa2357700f37eec5d00d3 100644 ---- a/src/main/java/net/minecraft/server/DamageSource.java -+++ b/src/main/java/net/minecraft/server/DamageSource.java -@@ -56,6 +56,7 @@ public class DamageSource { - return new EntityDamageSource("mob", entityliving); - } - -+ public static DamageSource indirectMobAttack(Entity entity, EntityLiving entityliving) { return a(entity, entityliving); } // Purpur - OBFHELPER - public static DamageSource a(Entity entity, EntityLiving entityliving) { - return new EntityDamageSourceIndirect("mob", entity, entityliving); - } -@@ -117,6 +118,7 @@ public class DamageSource { - return this.B; - } - -+ public DamageSource setProjectile() { return c(); } // Purpur - OBFHELPER - public DamageSource c() { - this.B = true; - return this; -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a402cce2768 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -105,7 +105,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - private int id; - public boolean i; public final boolean blocksEntitySpawning() { return this.i; } // Paper - OBFHELPER - public final List passengers; -- protected int j; -+ protected int j; public int getRideCooldown() { return j; } // Purpur - OBFHELPER - @Nullable - private Entity vehicle; - public boolean attachedToPlayer; -@@ -121,7 +121,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - public float lastYaw; - public float lastPitch; - private AxisAlignedBB boundingBox; -- protected boolean onGround; -+ public boolean onGround; // Purpur - protected -> public - public boolean positionChanged; - public boolean v; - public boolean velocityChanged; -@@ -177,7 +177,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - private boolean az; - private final double[] aA; - private long aB; -- private EntitySize size; -+ protected EntitySize size; // Purpur - private -> protected - private float headHeight; - // CraftBukkit start - public boolean persist = true; -@@ -1495,6 +1495,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; - } - -+ public void moveRelative(float speed, Vec3D motion) { this.a(speed, motion); } // Purpur - OBFHELPER - public void a(float f, Vec3D vec3d) { - Vec3D vec3d1 = a(vec3d, f, this.yaw); - -@@ -2251,6 +2252,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return this.a(entity, false); - } - -+ public boolean startRiding(Entity entity, boolean flag) { return a(entity, flag); } // Purpur - OBFHELPER - public boolean a(Entity entity, boolean flag) { - for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) { - if (entity1.vehicle == this) { -@@ -2346,6 +2348,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.passengers.add(entity); - } - -+ // Purpur start -+ if (isRidable() && passengers.get(0) == entity && entity instanceof EntityHuman) { -+ EntityHuman entityhuman = (EntityHuman) entity; -+ onMount(entityhuman); -+ this.rider = entityhuman; -+ } -+ // Purpur end - } - return true; // CraftBukkit - } -@@ -2386,6 +2395,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return false; - } - // Spigot end -+ // Purpur start -+ if (rider != null && passengers.get(0) == rider) { -+ onDismount(rider); -+ this.rider = null; -+ } -+ // Purpur end - this.passengers.remove(entity); - entity.j = 60; - } -@@ -2551,6 +2566,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.setFlag(4, flag); - } - -+ public boolean isGlowing() { return bE(); } // Purpur - OBFHELPER - public boolean bE() { - return this.glowing || this.world.isClientSide && this.getFlag(6); - } -@@ -2773,6 +2789,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - - public void setHeadRotation(float f) {} - -+ public void setBodyYaw(float yaw) { n(yaw); } // Purpur - OBFHELPER - public void n(float f) {} - - public boolean bL() { -@@ -3214,6 +3231,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return false; - } - -+ // Purpur Start -+ public void sendMessage(String str) { -+ sendMessage(org.bukkit.craftbukkit.util.CraftChatMessage.fromStringOrNull(str)); -+ } -+ -+ public void sendMessage(IChatBaseComponent ichatbasecomponent) { -+ if (ichatbasecomponent != null) { -+ sendMessage(ichatbasecomponent, SystemUtils.getNullUUID()); -+ } -+ } -+ // Purpur end -+ - @Override - public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {} - -@@ -3666,4 +3695,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return ((ChunkProviderServer) world.getChunkProvider()).isInEntityTickingChunk(this); - } - // Paper end -+ -+ // Purpur start -+ private EntityHuman rider; -+ -+ public EntityHuman getRider() { -+ return rider; -+ } -+ -+ public boolean hasRider() { -+ return rider != null; -+ } -+ -+ public boolean isRidable() { -+ return false; -+ } -+ -+ public boolean isRidableInWater() { -+ return false; -+ } -+ -+ public void onMount(EntityHuman entityhuman) { -+ if (this instanceof EntityInsentient) { -+ ((EntityInsentient) this).setGoalTarget(null, null, false); -+ ((EntityInsentient) this).getNavigation().stopPathfinding(); -+ } -+ entityhuman.setJumping(false); // fixes jump on mount -+ } -+ -+ public void onDismount(EntityHuman entityhuman) { -+ } -+ -+ public boolean onSpacebar() { -+ return false; -+ } -+ -+ public boolean onClick(EnumHand hand) { -+ return false; -+ } -+ -+ public boolean processClick(EnumHand hand) { -+ return false; -+ } -+ // Purpur end - } -diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java -index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..7677f4a2ec8bacadcbc6e68e13f56256f1963552 100644 ---- a/src/main/java/net/minecraft/server/EntityBat.java -+++ b/src/main/java/net/minecraft/server/EntityBat.java -@@ -15,9 +15,48 @@ public class EntityBat extends EntityAmbient { +diff --git a/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java b/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java +index 61ebb278cf4ef57ae7a86c6c6ef1fa14559f21e2..ce40df98f61b9176989c0000d078597d44e996e2 100644 +--- a/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java ++++ b/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java +@@ -21,6 +21,7 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition; +@@ -40,9 +41,48 @@ public class EntityBat extends EntityAmbient { public EntityBat(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -370,7 +692,7 @@ index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..7677f4a2ec8bacadcbc6e68e13f56256 @Override protected void initDatawatcher() { super.initDatawatcher(); -@@ -62,7 +101,7 @@ public class EntityBat extends EntityAmbient { +@@ -87,7 +127,7 @@ public class EntityBat extends EntityAmbient { protected void collideNearby() {} public static AttributeProvider.Builder m() { @@ -379,7 +701,7 @@ index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..7677f4a2ec8bacadcbc6e68e13f56256 } public boolean isAsleep() { -@@ -94,6 +133,13 @@ public class EntityBat extends EntityAmbient { +@@ -119,6 +159,13 @@ public class EntityBat extends EntityAmbient { @Override protected void mobTick() { @@ -393,11 +715,27 @@ index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..7677f4a2ec8bacadcbc6e68e13f56256 super.mobTick(); BlockPosition blockposition = this.getChunkCoordinates(); BlockPosition blockposition1 = blockposition.up(); -diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb137482e63 100644 ---- a/src/main/java/net/minecraft/server/EntityBee.java -+++ b/src/main/java/net/minecraft/server/EntityBee.java -@@ -37,6 +37,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +index 1d1f71a995a99b2101891a7a5bda7bec5d67f118..0c6d3dae70eeea844a31f9edf54410db13e0b04b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +@@ -22,6 +22,7 @@ import net.minecraft.network.protocol.game.PacketDebug; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -44,6 +45,7 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMonsterType; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.IEntityAngerable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; +@@ -111,6 +113,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB public EntityBee(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -405,7 +743,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 // Paper start - apply gravity to bees when they get stuck in the void, fixes MC-167279 this.moveController = new ControllerMoveFlying(this, 20, true) { @Override -@@ -46,6 +47,22 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -120,6 +123,22 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB } super.tick(); } @@ -428,7 +766,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 }; // Paper end this.lookController = new EntityBee.j(this); -@@ -56,6 +73,35 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -130,6 +149,35 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB this.a(PathType.FENCE, -1.0F); } @@ -464,7 +802,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 @Override protected void initDatawatcher() { super.initDatawatcher(); -@@ -70,6 +116,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -144,6 +192,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB @Override protected void initPathfinder() { @@ -472,7 +810,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 this.goalSelector.a(0, new EntityBee.b(this, 1.399999976158142D, true)); this.goalSelector.a(1, new EntityBee.d()); this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); -@@ -85,6 +132,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -159,6 +208,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB this.goalSelector.a(7, new EntityBee.g()); this.goalSelector.a(8, new EntityBee.l()); this.goalSelector.a(9, new PathfinderGoalFloat(this)); @@ -480,7 +818,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 this.targetSelector.a(1, (new EntityBee.h(this)).a(new Class[0])); this.targetSelector.a(2, new EntityBee.c(this)); this.targetSelector.a(3, new PathfinderGoalUniversalAngerReset<>(this, true)); -@@ -555,6 +603,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -629,6 +679,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB private d() { super(); // CraftBukkit - decompile error @@ -488,7 +826,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 } @Override -@@ -617,6 +666,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -691,6 +742,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB private g() { super(); // CraftBukkit - decompile error @@ -496,7 +834,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 } @Override -@@ -681,6 +731,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -755,6 +807,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB private i() { super(); // CraftBukkit - decompile error @@ -504,7 +842,7 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 } @Override -@@ -904,16 +955,16 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +@@ -978,16 +1031,16 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB } } @@ -524,91 +862,19 @@ index f73641ddb3e82bc653732105ef0a3d41a28e845f..d8354ec4d19fc3fbddc2551ee217acb1 } } -diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java -index 74082136b38491a0a50d152c455edfa61a6afb9f..dcfad16e06450068d5801fc002c9650102dbf995 100644 ---- a/src/main/java/net/minecraft/server/EntityBlaze.java -+++ b/src/main/java/net/minecraft/server/EntityBlaze.java -@@ -10,6 +10,7 @@ public class EntityBlaze extends EntityMonster { - - public EntityBlaze(EntityTypes entitytypes, World world) { - super(entitytypes, world); -+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this, 0.3F); // Purpur - this.a(PathType.WATER, -1.0F); - this.a(PathType.LAVA, 8.0F); - this.a(PathType.DANGER_FIRE, 0.0F); -@@ -17,19 +18,50 @@ public class EntityBlaze extends EntityMonster { - this.f = 10; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.blazeRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.blazeRidableInWater; -+ } -+ -+ @Override -+ public double getMaxY() { -+ return world.purpurConfig.blazeMaxY; -+ } -+ -+ @Override -+ public void g(Vec3D vec3d) { -+ super.g(vec3d); -+ if (hasRider() && !onGround) { -+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); -+ setSpeed(speed); -+ Vec3D mot = getMot(); -+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); -+ setMot(mot.a(0.9D)); -+ } -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(4, new EntityBlaze.PathfinderGoalBlazeFireball(this)); - this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D)); - this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F)); - this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); -- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur -+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - } - - public static AttributeProvider.Builder m() { -- return EntityMonster.eR().a(GenericAttributes.ATTACK_DAMAGE, 6.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.23000000417232513D).a(GenericAttributes.FOLLOW_RANGE, 48.0D); -+ return EntityMonster.eR().a(GenericAttributes.ATTACK_DAMAGE, 6.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.23000000417232513D).a(GenericAttributes.FOLLOW_RANGE, 48.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur - } - - @Override -@@ -84,6 +116,14 @@ public class EntityBlaze extends EntityMonster { - - @Override - protected void mobTick() { -+ // Purpur start -+ if (hasRider()) { -+ Vec3D mot = getMot(); -+ setMot(mot.x, getVertical() > 0 ? 0.07D : -0.07D, mot.z); -+ return; -+ } -+ // Purpur end -+ - --this.c; - if (this.c <= 0) { - this.c = 100; -diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c12e6955bb 100644 ---- a/src/main/java/net/minecraft/server/EntityCat.java -+++ b/src/main/java/net/minecraft/server/EntityCat.java -@@ -41,6 +41,25 @@ public class EntityCat extends EntityTameableAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +index c8f529b3fd227ce3354f442038b27cd716f57254..3efb010d0e045d14051a33bd7465669e415c26bd 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +@@ -14,6 +14,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -104,6 +105,25 @@ public class EntityCat extends EntityTameableAnimal { super(entitytypes, world); } @@ -634,7 +900,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 public MinecraftKey eU() { return (MinecraftKey) EntityCat.bq.getOrDefault(this.getCatType(), EntityCat.bq.get(0)); } -@@ -48,7 +67,8 @@ public class EntityCat extends EntityTameableAnimal { +@@ -111,7 +131,8 @@ public class EntityCat extends EntityTameableAnimal { @Override protected void initPathfinder() { this.bx = new EntityCat.PathfinderGoalTemptChance(this, 0.6D, EntityCat.br, true); @@ -644,7 +910,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 this.goalSelector.a(1, new PathfinderGoalSit(this)); this.goalSelector.a(2, new EntityCat.b(this)); this.goalSelector.a(3, this.bx); -@@ -60,6 +80,7 @@ public class EntityCat extends EntityTameableAnimal { +@@ -123,6 +144,7 @@ public class EntityCat extends EntityTameableAnimal { this.goalSelector.a(10, new PathfinderGoalBreed(this, 0.8D)); this.goalSelector.a(11, new PathfinderGoalRandomStrollLand(this, 0.8D, 1.0000001E-5F)); this.goalSelector.a(12, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 10.0F)); @@ -652,7 +918,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 this.targetSelector.a(1, new PathfinderGoalRandomTargetNonTamed<>(this, EntityRabbit.class, false, (Predicate) null)); this.targetSelector.a(1, new PathfinderGoalRandomTargetNonTamed<>(this, EntityTurtle.class, false, EntityTurtle.bo)); } -@@ -76,6 +97,7 @@ public class EntityCat extends EntityTameableAnimal { +@@ -139,6 +161,7 @@ public class EntityCat extends EntityTameableAnimal { this.datawatcher.set(EntityCat.bs, i); } @@ -660,7 +926,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 public void x(boolean flag) { this.datawatcher.set(EntityCat.bt, flag); } -@@ -84,6 +106,7 @@ public class EntityCat extends EntityTameableAnimal { +@@ -147,6 +170,7 @@ public class EntityCat extends EntityTameableAnimal { return (Boolean) this.datawatcher.get(EntityCat.bt); } @@ -668,7 +934,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 public void y(boolean flag) { this.datawatcher.set(EntityCat.bu, flag); } -@@ -302,6 +325,7 @@ public class EntityCat extends EntityTameableAnimal { +@@ -365,6 +389,7 @@ public class EntityCat extends EntityTameableAnimal { @Override public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { @@ -676,7 +942,7 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 ItemStack itemstack = entityhuman.b(enumhand); Item item = itemstack.getItem(); -@@ -399,6 +423,7 @@ public class EntityCat extends EntityTameableAnimal { +@@ -462,6 +487,7 @@ public class EntityCat extends EntityTameableAnimal { public b(EntityCat entitycat) { this.a = entitycat; @@ -684,34 +950,19 @@ index 675083e3952779e43bf8cc3175ad70458a79e49c..0e6552d77adb95c94cb06b6f9289c4c1 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityCaveSpider.java b/src/main/java/net/minecraft/server/EntityCaveSpider.java -index 776f3d25a6eeb5e97667dd06c062d1045d1afa81..2e1f2dec17e7761b6534f29bbec813d135250e4f 100644 ---- a/src/main/java/net/minecraft/server/EntityCaveSpider.java -+++ b/src/main/java/net/minecraft/server/EntityCaveSpider.java -@@ -8,6 +8,18 @@ public class EntityCaveSpider extends EntitySpider { - super(entitytypes, world); - } +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +index 600d6ebdf554dbaa8ca46a22a12d8b4e3255d987..5c744f1eac19e144c39a2c146d312f0547d6e589 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +@@ -2,6 +2,7 @@ package net.minecraft.world.entity.animal; -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.caveSpiderRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.caveSpiderRidableInWater; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder m() { - return EntitySpider.eK().a(GenericAttributes.MAX_HEALTH, 12.0D); - } -diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index 8fb5d5c75e79a81ab46af3fbb96ebc41804113c4..ee59a9f272a9caebec8f2329e1e4b22ddd27a0f9 100644 ---- a/src/main/java/net/minecraft/server/EntityChicken.java -+++ b/src/main/java/net/minecraft/server/EntityChicken.java -@@ -18,6 +18,16 @@ public class EntityChicken extends EntityAnimal { + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -54,6 +55,16 @@ public class EntityChicken extends EntityAnimal { } // Purpur start @@ -728,7 +979,7 @@ index 8fb5d5c75e79a81ab46af3fbb96ebc41804113c4..ee59a9f272a9caebec8f2329e1e4b22d @Override protected void initAttributes() { if (world.purpurConfig.chickenRetaliate) { -@@ -29,6 +39,7 @@ public class EntityChicken extends EntityAnimal { +@@ -65,6 +76,7 @@ public class EntityChicken extends EntityAnimal { @Override protected void initPathfinder() { this.goalSelector.a(0, new PathfinderGoalFloat(this)); @@ -736,7 +987,7 @@ index 8fb5d5c75e79a81ab46af3fbb96ebc41804113c4..ee59a9f272a9caebec8f2329e1e4b22d //this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D)); // Purpur - moved down this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, EntityChicken.bv)); -@@ -39,6 +50,7 @@ public class EntityChicken extends EntityAnimal { +@@ -75,6 +87,7 @@ public class EntityChicken extends EntityAnimal { // Purpur start if (world.purpurConfig.chickenRetaliate) { this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, false)); @@ -744,11 +995,11 @@ index 8fb5d5c75e79a81ab46af3fbb96ebc41804113c4..ee59a9f272a9caebec8f2329e1e4b22d this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this)); } else { this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.4D)); -diff --git a/src/main/java/net/minecraft/server/EntityCod.java b/src/main/java/net/minecraft/server/EntityCod.java -index 9a99af6e9cec9679af07ab6017f9beb427fa88ad..039fae4c29648afa85ea1b27d82cfe51c4165315 100644 ---- a/src/main/java/net/minecraft/server/EntityCod.java -+++ b/src/main/java/net/minecraft/server/EntityCod.java -@@ -6,6 +6,18 @@ public class EntityCod extends EntityFishSchool { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCod.java b/src/main/java/net/minecraft/world/entity/animal/EntityCod.java +index aac7992a30a0b69cb34097aeb0fe021f54a3cdac..897e0d5ca44a0c475634f08e7d4fcf129ee197ab 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCod.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCod.java +@@ -14,6 +14,18 @@ public class EntityCod extends EntityFishSchool { super(entitytypes, world); } @@ -767,27 +1018,19 @@ index 9a99af6e9cec9679af07ab6017f9beb427fa88ad..039fae4c29648afa85ea1b27d82cfe51 @Override protected ItemStack eK() { return new ItemStack(Items.COD_BUCKET); -diff --git a/src/main/java/net/minecraft/server/EntityComplexPart.java b/src/main/java/net/minecraft/server/EntityComplexPart.java -index c1b1bd123e7a18d37fd55cacc29ebca32030e5f0..26ff230ef774999bfe37b3327a7cf711799cbf2f 100644 ---- a/src/main/java/net/minecraft/server/EntityComplexPart.java -+++ b/src/main/java/net/minecraft/server/EntityComplexPart.java -@@ -47,4 +47,11 @@ public class EntityComplexPart extends Entity { - public EntitySize a(EntityPose entitypose) { - return this.d; - } -+ -+ // Purpur start -+ @Override -+ public EnumInteractionResult a(EntityHuman entityhuman, EnumHand enumhand) { -+ return owner.isAlive() ? owner.tryRide(entityhuman, enumhand) : EnumInteractionResult.PASS; -+ } -+ // Purpur end - } -diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f14a28fe2e 100644 ---- a/src/main/java/net/minecraft/server/EntityCow.java -+++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -11,9 +11,22 @@ public class EntityCow extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +index 962dde5fcc617bc39b7d06a1e295370b9d60696c..cad256514c7df92847522c8d7ddf45ebe02658c4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +@@ -2,6 +2,7 @@ package net.minecraft.world.entity.animal; + + import net.minecraft.core.BlockPosition; + import net.minecraft.core.particles.Particles; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -43,9 +44,22 @@ public class EntityCow extends EntityAnimal { super(entitytypes, world); } @@ -810,7 +1053,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D)); this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); if (world.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur -@@ -55,6 +68,7 @@ public class EntityCow extends EntityAnimal { +@@ -87,6 +101,7 @@ public class EntityCow extends EntityAnimal { @Override public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { @@ -818,7 +1061,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 ItemStack itemstack = entityhuman.b(enumhand); if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) { -@@ -62,7 +76,7 @@ public class EntityCow extends EntityAnimal { +@@ -94,7 +109,7 @@ public class EntityCow extends EntityAnimal { org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET, enumhand); // Paper - add enumHand if (event.isCancelled()) { @@ -827,7 +1070,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 } // CraftBukkit end -@@ -73,7 +87,7 @@ public class EntityCow extends EntityAnimal { +@@ -105,7 +120,7 @@ public class EntityCow extends EntityAnimal { return EnumInteractionResult.a(this.world.isClientSide); // Purpur start - feed mushroom to change to mooshroom } else if (world.purpurConfig.cowFeedMushrooms > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) { @@ -836,7 +1079,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 // Purpur end } else { return super.b(entityhuman, enumhand); -@@ -96,7 +110,7 @@ public class EntityCow extends EntityAnimal { +@@ -128,7 +143,7 @@ public class EntityCow extends EntityAnimal { } } @@ -845,7 +1088,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 world.broadcastEntityEffect(this, (byte) 18); // hearts playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F); if (incrementFeedCount(itemstack) < world.purpurConfig.cowFeedMushrooms) { -@@ -107,7 +121,7 @@ public class EntityCow extends EntityAnimal { +@@ -139,7 +154,7 @@ public class EntityCow extends EntityAnimal { } EntityMushroomCow mooshroom = EntityTypes.MOOSHROOM.create(world); if (mooshroom == null) { @@ -854,7 +1097,7 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 } if (itemstack.getItem() == Blocks.BROWN_MUSHROOM.getItem()) { mooshroom.setVariant(EntityMushroomCow.Type.BROWN); -@@ -126,10 +140,10 @@ public class EntityCow extends EntityAnimal { +@@ -158,10 +173,10 @@ public class EntityCow extends EntityAnimal { mooshroom.setCustomName(this.getCustomName()); } if (CraftEventFactory.callEntityTransformEvent(this, mooshroom, org.bukkit.event.entity.EntityTransformEvent.TransformReason.INFECTION).isCancelled()) { @@ -867,129 +1110,19 @@ index cfb009c811bd2908d38da1b0007cb7aaed4e42c3..1219b0aa9c62bc9a1bda45cc9e9a27f1 } this.world.addEntity(mooshroom); this.die(); -diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 36bf307985624a3567eb1196e034470bd7002e1e..7e5ede0f644a6e303be36ab0915d346a02760daa 100644 ---- a/src/main/java/net/minecraft/server/EntityCreeper.java -+++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -19,12 +19,27 @@ public class EntityCreeper extends EntityMonster { - public int maxFuseTicks = 30; - public int explosionRadius = 3; - private int bs; -+ // Purpur start -+ private int spacebarCharge = 0; -+ private int prevSpacebarCharge = 0; -+ private int powerToggleDelay = 0; -+ // Purpur end - - public EntityCreeper(EntityTypes entitytypes, World world) { - super(entitytypes, world); - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.creeperRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.creeperRidableInWater; -+ } -+ - @Override - public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) { - double chance = worldaccess.getMinecraftWorld().purpurConfig.creeperChargedChance; -@@ -33,18 +48,69 @@ public class EntityCreeper extends EntityMonster { - } - return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); - } -+ -+ @Override -+ protected void mobTick() { -+ if (powerToggleDelay > 0) { -+ powerToggleDelay--; -+ } -+ if (hasRider()) { -+ if (getRider().getForward() != 0 || getRider().getStrafe() != 0) { -+ spacebarCharge = 0; -+ setIgnited(false); -+ } -+ if (spacebarCharge == prevSpacebarCharge) { -+ spacebarCharge = 0; -+ } -+ prevSpacebarCharge = spacebarCharge; -+ } -+ super.mobTick(); -+ } -+ -+ @Override -+ public void onMount(EntityHuman entityhuman) { -+ super.onMount(entityhuman); -+ setIgnited(false); -+ } -+ -+ @Override -+ public boolean onSpacebar() { -+ if (powerToggleDelay > 0) { -+ return true; // just toggled power, do not jump or ignite -+ } -+ spacebarCharge++; -+ if (spacebarCharge > maxFuseTicks - 2) { -+ spacebarCharge = 0; -+ if (getRider().getBukkitEntity().hasPermission("allow.powered.creeper")) { -+ powerToggleDelay = 20; -+ setPowered(!isPowered()); -+ setIgnited(false); -+ return true; -+ } -+ } -+ if (!isIgnited()) { -+ if (hasRider() && getRider().getForward() == 0 && getRider().getStrafe() == 0 && -+ getRider().getBukkitEntity().hasPermission("allow.special.creeper")) { -+ setIgnited(true); -+ return true; -+ } -+ } -+ return getForward() == 0 && getStrafe() == 0; // do not jump if standing still -+ } - // Purpur end - - @Override - protected void initPathfinder() { - this.goalSelector.a(1, new PathfinderGoalFloat(this)); - this.goalSelector.a(2, new PathfinderGoalSwell(this)); -+ this.goalSelector.a(3, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); - this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityCat.class, 6.0F, 1.0D, 1.2D)); - this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D)); - this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); - } -@@ -175,6 +241,7 @@ public class EntityCreeper extends EntityMonster { - return (Integer) this.datawatcher.get(EntityCreeper.b); - } - -+ public void setSwellDirection(int i) { a(i); } // Purpur - OBFHELPER - public void a(int i) { - this.datawatcher.set(EntityCreeper.b, i); - } -@@ -275,6 +342,7 @@ public class EntityCreeper extends EntityMonster { - com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited); - if (event.callEvent()) { - this.datawatcher.set(EntityCreeper.d, event.isIgnited()); -+ if (!event.isIgnited()) setSwellDirection(-1); // Purpur - } - } - // Paper end -diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java -index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341ad5340db9 100644 ---- a/src/main/java/net/minecraft/server/EntityDolphin.java -+++ b/src/main/java/net/minecraft/server/EntityDolphin.java -@@ -17,6 +17,7 @@ public class EntityDolphin extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +index e0a9b931c26dbd4e7739d09ae45e1cee72ab210c..880c3aaf4e684209879dc921480619e7c61ee4a0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +@@ -16,6 +16,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.ResourceKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -81,6 +82,7 @@ public class EntityDolphin extends EntityWaterAnimal { public static final Predicate b = (entityitem) -> { return !entityitem.p() && entityitem.isAlive() && entityitem.isInWater(); }; @@ -997,7 +1130,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a public EntityDolphin(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -25,6 +26,45 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -89,6 +91,45 @@ public class EntityDolphin extends EntityWaterAnimal { this.setCanPickupLoot(true); } @@ -1043,7 +1176,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a @Nullable @Override public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { -@@ -99,6 +139,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -163,6 +204,7 @@ public class EntityDolphin extends EntityWaterAnimal { protected void initPathfinder() { this.goalSelector.a(0, new PathfinderGoalBreath(this)); this.goalSelector.a(0, new PathfinderGoalWater(this)); @@ -1051,7 +1184,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a this.goalSelector.a(1, new EntityDolphin.b(this)); this.goalSelector.a(2, new EntityDolphin.c(this, 4.0D)); this.goalSelector.a(4, new PathfinderGoalRandomSwim(this, 1.0D, 10)); -@@ -109,6 +150,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -173,6 +215,7 @@ public class EntityDolphin extends EntityWaterAnimal { this.goalSelector.a(8, new EntityDolphin.d()); this.goalSelector.a(8, new PathfinderGoalFollowBoat(this)); this.goalSelector.a(9, new PathfinderGoalAvoidTarget<>(this, EntityGuardian.class, 8.0F, 1.0D, 1.0D)); @@ -1059,7 +1192,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a(new Class[0])); // CraftBukkit - decompile error } -@@ -160,7 +202,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -224,7 +267,7 @@ public class EntityDolphin extends EntityWaterAnimal { @Override protected boolean n(Entity entity) { @@ -1068,7 +1201,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a } @Override -@@ -195,6 +237,9 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -259,6 +302,9 @@ public class EntityDolphin extends EntityWaterAnimal { @Override public void tick() { super.tick(); @@ -1078,7 +1211,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a if (this.isNoAI()) { this.setAirTicks(this.bH()); } else { -@@ -468,7 +513,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -532,7 +578,7 @@ public class EntityDolphin extends EntityWaterAnimal { private int b; @@ -1087,7 +1220,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a @Override public boolean a() { -@@ -536,7 +581,7 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -600,7 +646,7 @@ public class EntityDolphin extends EntityWaterAnimal { } } @@ -1096,7 +1229,7 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a private final EntityDolphin i; -@@ -546,7 +591,20 @@ public class EntityDolphin extends EntityWaterAnimal { +@@ -610,7 +656,20 @@ public class EntityDolphin extends EntityWaterAnimal { } @Override @@ -1118,371 +1251,19 @@ index 664f9693368852bfb06a7a3bd0862a10cbc81747..9d5d143a997b74e0777bb79bf14d341a if (this.i.isInWater()) { this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); } -diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 1a102816921fa3b40f6d364bb826db4459f68eb2..125eab60f2b4657e52a71eddf7586c574945252e 100644 ---- a/src/main/java/net/minecraft/server/EntityDrowned.java -+++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -22,6 +22,16 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.drownedRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.drownedRidableInWater; -+ } -+ - @Override - public boolean jockeyOnlyBaby() { - return world.purpurConfig.drownedJockeyOnlyBaby; -@@ -219,7 +229,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - this.d = flag; - } - -- static class d extends ControllerMove { -+ static class d extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur - - private final EntityDrowned i; - -@@ -229,7 +239,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - } - - @Override -- public void a() { -+ public void tick() { // Purpur - EntityLiving entityliving = this.i.getGoalTarget(); - - if (this.i.eW() && this.i.isInWater()) { -@@ -262,7 +272,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - this.i.setMot(this.i.getMot().add(0.0D, -0.008D, 0.0D)); - } - -- super.a(); -+ super.tick(); // Purpur - } - - } -@@ -401,6 +411,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - this.a = entitydrowned; - this.b = d0; - this.c = i; -+ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - swim up - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index de025a48c7ca08d8ae71d2d9239121dc4a86a339..81e63fe1b8252e2b5abcbf9051190cd0214b534c 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -46,6 +46,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - private final int[] bK = new int[24]; - private final Path bL = new Path(); - private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() -+ private boolean hadRider; // Purpur - - public EntityEnderDragon(EntityTypes entitytypes, World world) { - super(EntityTypes.ENDER_DRAGON, world); -@@ -60,8 +61,44 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - } - - this.bG = new DragonControllerManager(this); -+ // Purpur start -+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlying(this) { -+ @Override -+ public void tick() { -+ // dragon doesn't use the controller. do nothing -+ } -+ }; -+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { -+ @Override -+ public void tick() { -+ // dragon doesn't use the controller. do nothing -+ } -+ -+ @Override -+ public void tick(EntityHuman rider) { -+ setYawPitch(rider.yaw - 180F, rider.pitch * 0.5F); -+ } -+ }; -+ // Purpur end -+ } -+ -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.enderDragonRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.enderDragonRidableInWater; - } - -+ @Override -+ public double getMaxY() { -+ return world.purpurConfig.enderDragonMaxY; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder m() { - return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 200.0D); - } -@@ -94,6 +131,37 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - - @Override - public void movementTick() { -+ // Purpur start -+ boolean hasRider = getRider() != null; -+ if (hasRider) { -+ if (!hadRider) { -+ hadRider = true; -+ noclip = false; -+ this.size = EntitySize.b(4.0F, 2.0F); -+ } -+ -+ // dragon doesn't use controllers, so must tick manually -+ moveController.a(); -+ lookController.a(); -+ -+ moveRelative((float) getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.1F, new Vec3D(-getStrafe(), getVertical(), -getForward())); -+ Vec3D mot = getMot(); -+ setMot(mot); -+ move(EnumMoveType.PLAYER, mot); -+ -+ mot = mot.multiply(0.9F, 0.9F, 0.9F); -+ setMot(mot); -+ -+ // control wing flap speed on client -+ getDragonControllerManager().setControllerPhase(mot.getX() * mot.getX() + mot.getZ() * mot.getZ() < 0.005F ? DragonControllerPhase.HOVER : DragonControllerPhase.HOLDING_PATTERN); -+ } else if (hadRider) { -+ hadRider = false; -+ noclip = true; -+ this.size = EntitySize.b(16.0F, 8.0F); -+ getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); // HoldingPattern -+ } -+ // Purpur end -+ - float f; - float f1; - -@@ -115,6 +183,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - - this.bp = this.bq; - if (this.dl()) { -+ if (hasRider) ejectPassengers(); // Purpur - f = (this.random.nextFloat() - 0.5F) * 8.0F; - f1 = (this.random.nextFloat() - 0.5F) * 4.0F; - float f2 = (this.random.nextFloat() - 0.5F) * 8.0F; -@@ -126,9 +195,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - - f1 = 0.2F / (MathHelper.sqrt(c(vec3d)) * 10.0F + 1.0F); - f1 *= (float) Math.pow(2.0D, vec3d.y); -- if (this.bG.a().a()) { -+ if (!hasRider && this.bG.a().a()) { // Purpur - this.bq += 0.1F; -- } else if (this.br) { -+ } else if (!hasRider && this.br) { // Purpur - this.bq += f1 * 0.5F; - } else { - this.bq += f1; -@@ -172,7 +241,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - } - - this.bG.a().b(); -- } else { -+ } else if (!hasRider) { // Purpur - IDragonController idragoncontroller = this.bG.a(); - - idragoncontroller.c(); -@@ -239,7 +308,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - this.a(this.bz, (double) (f11 * 0.5F), 0.0D, (double) (-f12 * 0.5F)); - this.a(this.bD, (double) (f12 * 4.5F), 2.0D, (double) (f11 * 4.5F)); - this.a(this.bE, (double) (f12 * -4.5F), 2.0D, (double) (f11 * -4.5F)); -- if (!this.world.isClientSide && this.hurtTicks == 0) { -+ if (!hasRider && !this.world.isClientSide && this.hurtTicks == 0) { // Purpur - this.a(this.world.getEntities(this, this.bD.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); - this.a(this.world.getEntities(this, this.bE.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); - this.b(this.world.getEntities(this, this.bo.getBoundingBox().g(1.0D), IEntitySelector.e)); -@@ -282,7 +351,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - } - - if (!this.world.isClientSide) { -- this.br = this.b(this.bo.getBoundingBox()) | this.b(this.by.getBoundingBox()) | this.b(this.bz.getBoundingBox()); -+ this.br = !hasRider && this.b(this.bo.getBoundingBox()) | this.b(this.by.getBoundingBox()) | this.b(this.bz.getBoundingBox()); // Purpur - if (this.bF != null) { - this.bF.b(this); - } -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index e3364032669b473c799b759f5f89468b7584d9f5..995849212c25568d3aa28ada78babf8b8e669960 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -30,9 +30,22 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - this.a(PathType.WATER, -1.0F); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.endermanRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.endermanRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new EntityEnderman.a(this)); - this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F)); -@@ -40,6 +53,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); - this.goalSelector.a(10, new EntityEnderman.PathfinderGoalEndermanPlaceBlock(this)); - this.goalSelector.a(11, new EntityEnderman.PathfinderGoalEndermanPickupBlock(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new EntityEnderman.PathfinderGoalPlayerWhoLookedAtTarget(this, this::a_)); - this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityEndermite.class, 10, true, false, EntityEnderman.bq)); -@@ -220,7 +234,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - - @Override - protected void mobTick() { -- if (this.world.isDay() && this.ticksLived >= this.bs + 600) { -+ if (!hasRider() && this.world.isDay() && this.ticksLived >= this.bs + 600) { // Purpur - no random teleporting - float f = this.aR(); - - if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper -@@ -322,6 +336,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - if (this.isInvulnerable(damagesource)) { - return false; - } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height -+ } else if (hasRider()) { return super.damageEntity(damagesource, f); // Purpur - no teleporting on damage - } else if (damagesource instanceof EntityDamageSourceIndirect) { - if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start - for (int i = 0; i < 64; ++i) { -@@ -366,6 +381,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - - public PathfinderGoalEndermanPickupBlock(EntityEnderman entityenderman) { - this.enderman = entityenderman; -+ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - } - - @Override -@@ -408,6 +424,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - - public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { - this.a = entityenderman; -+ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEndermite.java b/src/main/java/net/minecraft/server/EntityEndermite.java -index fcebf36312c95df876652d18cf27bf1cc6589226..7eef7f523a17434b38492006526920a955fc9120 100644 ---- a/src/main/java/net/minecraft/server/EntityEndermite.java -+++ b/src/main/java/net/minecraft/server/EntityEndermite.java -@@ -12,14 +12,28 @@ public class EntityEndermite extends EntityMonster { - this.f = 3; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.endermiteRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.endermiteRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - this.goalSelector.a(1, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(3, new PathfinderGoalRandomStrollLand(this, 1.0D)); - this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); -- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur -+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - } - -diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index f40fbef32f2fc1f37f2065ad598f013766cf12f2..c75dc75611991028e9de6db7c57304e913251a6b 100644 ---- a/src/main/java/net/minecraft/server/EntityEvoker.java -+++ b/src/main/java/net/minecraft/server/EntityEvoker.java -@@ -12,10 +12,23 @@ public class EntityEvoker extends EntityIllagerWizard { - this.f = 10; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.evokerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.evokerRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new EntityEvoker.b()); - this.goalSelector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 0.6D, 1.0D)); - this.goalSelector.a(4, new EntityEvoker.c()); -@@ -24,6 +37,7 @@ public class EntityEvoker extends EntityIllagerWizard { - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Paper - decompile fix - this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); -@@ -104,6 +118,7 @@ public class EntityEvoker extends EntityIllagerWizard { - - public d() { - super(); -+ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - wolololo spell - } - - @Override -@@ -182,6 +197,7 @@ public class EntityEvoker extends EntityIllagerWizard { - private c() { - super(); - this.e = (new PathfinderTargetCondition()).a(16.0D).c().e().a().b(); -+ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - summon spell - } - - @Override -@@ -238,6 +254,7 @@ public class EntityEvoker extends EntityIllagerWizard { - - private a() { - super(); -+ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - attack with spell - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityFish.java b/src/main/java/net/minecraft/server/EntityFish.java -index 9b84564401e30a7a2aafae023a1eb3b2eda3f112..668f9d61b72cf0d8e7bb0d1cd985ae653a587466 100644 ---- a/src/main/java/net/minecraft/server/EntityFish.java -+++ b/src/main/java/net/minecraft/server/EntityFish.java -@@ -70,13 +70,12 @@ public abstract class EntityFish extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFish.java b/src/main/java/net/minecraft/world/entity/animal/EntityFish.java +index e28f84be745647960c936c7208a87713dfa75682..e1e4ea73f42a09ac20d36a58f4d7232d4e1a2f08 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFish.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFish.java +@@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -108,13 +109,12 @@ public abstract class EntityFish extends EntityWaterAnimal { @Override protected void initPathfinder() { super.initPathfinder(); @@ -1502,7 +1283,7 @@ index 9b84564401e30a7a2aafae023a1eb3b2eda3f112..668f9d61b72cf0d8e7bb0d1cd985ae65 } @Override -@@ -87,7 +86,7 @@ public abstract class EntityFish extends EntityWaterAnimal { +@@ -125,7 +125,7 @@ public abstract class EntityFish extends EntityWaterAnimal { @Override public void g(Vec3D vec3d) { if (this.doAITick() && this.isInWater()) { @@ -1511,7 +1292,7 @@ index 9b84564401e30a7a2aafae023a1eb3b2eda3f112..668f9d61b72cf0d8e7bb0d1cd985ae65 this.move(EnumMoveType.SELF, this.getMot()); this.setMot(this.getMot().a(0.9D)); if (this.getGoalTarget() == null) { -@@ -161,9 +160,9 @@ public abstract class EntityFish extends EntityWaterAnimal { +@@ -199,9 +199,9 @@ public abstract class EntityFish extends EntityWaterAnimal { @Override protected void b(BlockPosition blockposition, IBlockData iblockdata) {} @@ -1523,7 +1304,7 @@ index 9b84564401e30a7a2aafae023a1eb3b2eda3f112..668f9d61b72cf0d8e7bb0d1cd985ae65 a(EntityFish entityfish) { super(entityfish); -@@ -171,7 +170,15 @@ public abstract class EntityFish extends EntityWaterAnimal { +@@ -209,7 +209,15 @@ public abstract class EntityFish extends EntityWaterAnimal { } @Override @@ -1540,11 +1321,11 @@ index 9b84564401e30a7a2aafae023a1eb3b2eda3f112..668f9d61b72cf0d8e7bb0d1cd985ae65 if (this.i.a((Tag) TagsFluid.WATER)) { this.i.setMot(this.i.getMot().add(0.0D, 0.005D, 0.0D)); } -diff --git a/src/main/java/net/minecraft/server/EntityFishSchool.java b/src/main/java/net/minecraft/server/EntityFishSchool.java -index 08372b72262f2ef6e6c95f34e889e04faf731329..6a8e15f01606024aba43d57d270e09db307a9c3f 100644 ---- a/src/main/java/net/minecraft/server/EntityFishSchool.java -+++ b/src/main/java/net/minecraft/server/EntityFishSchool.java -@@ -16,7 +16,7 @@ public abstract class EntityFishSchool extends EntityFish { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFishSchool.java b/src/main/java/net/minecraft/world/entity/animal/EntityFishSchool.java +index 21780f5dbcd4384649f08161f0812202ee94c96d..a03b0ed0a3f74ccb7572e1c4fa8e345a9e9bc49f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFishSchool.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFishSchool.java +@@ -25,7 +25,7 @@ public abstract class EntityFishSchool extends EntityFish { @Override protected void initPathfinder() { super.initPathfinder(); @@ -1553,11 +1334,19 @@ index 08372b72262f2ef6e6c95f34e889e04faf731329..6a8e15f01606024aba43d57d270e09db } @Override -diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb2116110516717460284e 100644 ---- a/src/main/java/net/minecraft/server/EntityFox.java -+++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -55,6 +55,39 @@ public class EntityFox extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +index cea46348c0876e168376061fbaf258048e9358cb..0c1151b598aa681e63ddaac29e4a589f917fd03b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +@@ -21,6 +21,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.ResourceKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; +@@ -127,6 +128,39 @@ public class EntityFox extends EntityAnimal { this.setCanPickupLoot(true); } @@ -1597,7 +1386,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 @Override protected void initDatawatcher() { super.initDatawatcher(); -@@ -74,6 +107,7 @@ public class EntityFox extends EntityAnimal { +@@ -146,6 +180,7 @@ public class EntityFox extends EntityAnimal { return entityliving instanceof EntityFishSchool; }); this.goalSelector.a(0, new EntityFox.g()); @@ -1605,7 +1394,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 this.goalSelector.a(1, new EntityFox.b()); this.goalSelector.a(2, new EntityFox.n(2.2D)); this.goalSelector.a(3, new EntityFox.e(1.0D)); -@@ -99,6 +133,7 @@ public class EntityFox extends EntityAnimal { +@@ -171,6 +206,7 @@ public class EntityFox extends EntityAnimal { this.goalSelector.a(11, new EntityFox.p()); this.goalSelector.a(12, new EntityFox.j(this, EntityHuman.class, 24.0F)); this.goalSelector.a(13, new EntityFox.r()); @@ -1613,7 +1402,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> { return EntityFox.bt.test(entityliving) && !this.c(entityliving.getUniqueID()); })); -@@ -386,6 +421,7 @@ public class EntityFox extends EntityAnimal { +@@ -458,6 +494,7 @@ public class EntityFox extends EntityAnimal { return itemstack1.isEmpty() || this.bD > 0 && item.isFood() && !itemstack1.getItem().isFood(); } @@ -1621,7 +1410,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 private void m(ItemStack itemstack) { if (!itemstack.isEmpty() && !this.world.isClientSide) { EntityItem entityitem = new EntityItem(this.world, this.locX() + this.getLookDirection().x, this.locY() + 1.0D, this.locZ() + this.getLookDirection().z, itemstack); -@@ -481,6 +517,7 @@ public class EntityFox extends EntityAnimal { +@@ -553,6 +590,7 @@ public class EntityFox extends EntityAnimal { return this.t(16); } @@ -1629,7 +1418,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 public void u(boolean flag) { this.d(16, flag); } -@@ -523,6 +560,7 @@ public class EntityFox extends EntityAnimal { +@@ -595,6 +633,7 @@ public class EntityFox extends EntityAnimal { this.setSleeping(false); } @@ -1637,7 +1426,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 private void fd() { this.w(false); this.setCrouching(false); -@@ -688,16 +726,16 @@ public class EntityFox extends EntityAnimal { +@@ -760,16 +799,16 @@ public class EntityFox extends EntityAnimal { } } @@ -1657,7 +1446,7 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 } } -@@ -1367,16 +1405,16 @@ public class EntityFox extends EntityAnimal { +@@ -1439,16 +1478,16 @@ public class EntityFox extends EntityAnimal { } } @@ -1677,636 +1466,19 @@ index 8845afd83d47902d5192ec1a9146b6f20c5667d3..f5defe4713c6be7d32fb211611051671 } } -diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java -index a67611c4f9271c116a795ee598412f25396fee88..216506a7b1f97b776ecd4e24f5b2afaf5b79ec2d 100644 ---- a/src/main/java/net/minecraft/server/EntityGhast.java -+++ b/src/main/java/net/minecraft/server/EntityGhast.java -@@ -14,11 +14,42 @@ public class EntityGhast extends EntityFlying implements IMonster { - this.moveController = new EntityGhast.ControllerGhast(this); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.ghastRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.ghastRidableInWater; -+ } -+ -+ @Override -+ public double getMaxY() { -+ return world.purpurConfig.ghastMaxY; -+ } -+ -+ @Override -+ public void g(Vec3D vec3d) { -+ super.g(vec3d); -+ if (hasRider() && !onGround) { -+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); -+ setSpeed(speed); -+ Vec3D mot = getMot(); -+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); -+ setMot(mot.a(0.9D)); -+ } -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(5, new EntityGhast.PathfinderGoalGhastIdleMove(this)); - this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastMoveTowardsTarget(this)); - this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastAttackTarget(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> { - return Math.abs(entityliving.locY() - this.locY()) <= 4.0D; - })); -@@ -56,7 +87,7 @@ public class EntityGhast extends EntityFlying implements IMonster { - } - - public static AttributeProvider.Builder eJ() { -- return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 10.0D).a(GenericAttributes.FOLLOW_RANGE, 100.0D); -+ return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 10.0D).a(GenericAttributes.FOLLOW_RANGE, 100.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur - } - - @Override -@@ -255,7 +286,7 @@ public class EntityGhast extends EntityFlying implements IMonster { - } - } - -- static class ControllerGhast extends ControllerMove { -+ static class ControllerGhast extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur - - private final EntityGhast i; - private int j; -@@ -266,7 +297,7 @@ public class EntityGhast extends EntityFlying implements IMonster { - } - - @Override -- public void a() { -+ public void tick() { // Purpur - if (this.h == ControllerMove.Operation.MOVE_TO) { - if (this.j-- <= 0) { - this.j += this.i.getRandom().nextInt(5) + 2; -diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java -index 565c938d879940d8e12fe320ea8524d2cf679c1f..5e99767f45f7ba7db80f5b51810689e059b5cef5 100644 ---- a/src/main/java/net/minecraft/server/EntityGiantZombie.java -+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java -@@ -11,16 +11,28 @@ public class EntityGiantZombie extends EntityMonster { - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.giantRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.giantRidableInWater; -+ } -+ - @Override - protected void initPathfinder() { - if (world.purpurConfig.giantHaveAI) { - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D)); - this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); - this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D)); - if (world.purpurConfig.giantHaveHostileAI) { - this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class)); - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false)); -diff --git a/src/main/java/net/minecraft/server/EntityGuardian.java b/src/main/java/net/minecraft/server/EntityGuardian.java -index 27ec46c0b2e7df985ed4c68a973db18f81caac89..0a7f51a2a1cb10438c9364faf3e4adc6322fc787 100644 ---- a/src/main/java/net/minecraft/server/EntityGuardian.java -+++ b/src/main/java/net/minecraft/server/EntityGuardian.java -@@ -24,15 +24,36 @@ public class EntityGuardian extends EntityMonster { - this.f = 10; - this.a(PathType.WATER, 0.0F); - this.moveController = new EntityGuardian.ControllerMoveGuardian(this); -+ // Purpur start -+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { -+ @Override -+ public void setYawPitch(float yaw, float pitch) { -+ super.setYawPitch(yaw, pitch * 0.35F); -+ } -+ }; -+ // Purpur end - this.bo = this.random.nextFloat(); - this.bp = this.bo; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.guardianRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return true; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - PathfinderGoalMoveTowardsRestriction pathfindergoalmovetowardsrestriction = new PathfinderGoalMoveTowardsRestriction(this, 1.0D); - - this.goalRandomStroll = new PathfinderGoalRandomStroll(this, 1.0D, 80); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(4, new EntityGuardian.PathfinderGoalGuardianAttack(this)); - this.goalSelector.a(5, pathfindergoalmovetowardsrestriction); - this.goalSelector.a(7, this.goalRandomStroll); -@@ -41,6 +62,7 @@ public class EntityGuardian extends EntityMonster { - this.goalSelector.a(9, new PathfinderGoalRandomLookaround(this)); - this.goalRandomStroll.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); - pathfindergoalmovetowardsrestriction.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityLiving.class, 10, true, false, new EntityGuardian.EntitySelectorGuardianTargetHumanSquid(this))); - } - -@@ -74,6 +96,7 @@ public class EntityGuardian extends EntityMonster { - return (Boolean) this.datawatcher.get(EntityGuardian.b); - } - -+ private void setMovingFlag(boolean movingFlag) { t(movingFlag); } // Purpur - OBFHELPER - private void t(boolean flag) { - this.datawatcher.set(EntityGuardian.b, flag); - } -@@ -288,7 +311,7 @@ public class EntityGuardian extends EntityMonster { - @Override - public void g(Vec3D vec3d) { - if (this.doAITick() && this.isInWater()) { -- this.a(0.1F, vec3d); -+ this.a(hasRider() ? getSpeed() : 0.1F, vec3d); // Purpur - this.move(EnumMoveType.SELF, this.getMot()); - this.setMot(this.getMot().a(0.9D)); - if (!this.eN() && this.getGoalTarget() == null) { -@@ -300,17 +323,26 @@ public class EntityGuardian extends EntityMonster { - - } - -- static class ControllerMoveGuardian extends ControllerMove { -+ static class ControllerMoveGuardian extends net.pl3x.purpur.controller.ControllerMoveWASDWater { // Purpur - -- private final EntityGuardian i; -+ private final EntityGuardian i; private EntityGuardian getGuardian() { return i; } // Purpur - OBFHELPER - - public ControllerMoveGuardian(EntityGuardian entityguardian) { - super(entityguardian); - this.i = entityguardian; - } - -+ // Purpur start -+ @Override -+ public void tick(EntityHuman rider) { -+ super.tick(rider); -+ getGuardian().setMot(getGuardian().getMot().add(0.0D, 0.005D, 0.0D)); -+ getGuardian().setMovingFlag(getGuardian().getForward() > 0.0F); // control tail speed -+ } -+ // Purpur end -+ - @Override -- public void a() { -+ public void tick() { // Purpur - if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().m()) { - Vec3D vec3d = new Vec3D(this.b - this.i.locX(), this.c - this.i.locY(), this.d - this.i.locZ()); - double d0 = vec3d.f(); -diff --git a/src/main/java/net/minecraft/server/EntityGuardianElder.java b/src/main/java/net/minecraft/server/EntityGuardianElder.java -index b691e844953bcc2853a806a3bbf9cb7338e98266..f6f882746940c9e049106aa9b41591ba27a608ce 100644 ---- a/src/main/java/net/minecraft/server/EntityGuardianElder.java -+++ b/src/main/java/net/minecraft/server/EntityGuardianElder.java -@@ -16,6 +16,18 @@ public class EntityGuardianElder extends EntityGuardian { - - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.elderGuardianRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return true; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder m() { - return EntityGuardian.eM().a(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).a(GenericAttributes.ATTACK_DAMAGE, 8.0D).a(GenericAttributes.MAX_HEALTH, 80.0D); - } -diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index f6797925365836b6c2d3d2c48c746a4d58e28bf3..548ff4449faca0abdf72487276fe49207bacfe17 100644 ---- a/src/main/java/net/minecraft/server/EntityHoglin.java -+++ b/src/main/java/net/minecraft/server/EntityHoglin.java -@@ -13,13 +13,25 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - public int conversionTicks = 0; - public boolean cannotBeHunted = false; - protected static final ImmutableList>> bo = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m); -- protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); -+ protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED); // Purpur - decompile error - - public EntityHoglin(EntityTypes entitytypes, World world) { - super(entitytypes, world); - this.f = 5; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.hoglinRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.hoglinRidableInWater; -+ } -+ // Purpur end -+ - @Override - public boolean a(EntityHuman entityhuman) { - return !this.isLeashed(); -@@ -77,13 +89,14 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - - @Override - public BehaviorController getBehaviorController() { -- return super.getBehaviorController(); -+ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - - @Override - protected void mobTick() { - this.world.getMethodProfiler().enter("hoglinBrain"); -- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); -+ if (getRider() == null) // Purpur - only use brain if no rider -+ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error - this.world.getMethodProfiler().exit(); - HoglinAI.a(this); - if (this.isConverting()) { -@@ -259,7 +272,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - - @Override - protected SoundEffect getSoundAmbient() { -- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null); -+ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Purpur - decompile error - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index f958751b16abcc36910bb0b655ff2360459e2e4c..4ffc61acdff8c51dc9b111e3024c828fb5386118 100644 ---- a/src/main/java/net/minecraft/server/EntityHorse.java -+++ b/src/main/java/net/minecraft/server/EntityHorse.java -@@ -12,6 +12,13 @@ public class EntityHorse extends EntityHorseAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.horseRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void eK() { - this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue((double) this.fp()); -diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index 784819d252d94e8040a87f53431fcf2c7a19d1a7..8fde406273bbea0b9d2dea2362cf6372b7a5c9ae 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java -+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -40,12 +40,27 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven - - protected EntityHorseAbstract(EntityTypes entitytypes, World world) { - super(entitytypes, world); -+ this.moveController = new ControllerMove(this); // Purpur - use vanilla controller -+ this.lookController = new ControllerLook(this); // Purpur - use vanilla controller - this.G = 1.0F; - this.loadChest(); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return false; // vanilla handles -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return false; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur - this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.2D)); - this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D)); - this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D, EntityHorseAbstract.class)); -@@ -53,6 +68,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven - this.goalSelector.a(6, new PathfinderGoalRandomStrollLand(this, 0.7D)); - this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur - this.eV(); - } - -diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -index 767d18d5a0417813c514d0341b318d6321f6f7a5..cb8aee5691ff4ecaa6ae60f1637b1852d3b6c162 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java -+++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -@@ -8,6 +8,13 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.donkeyRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected SoundEffect getSoundAmbient() { - super.getSoundAmbient(); -diff --git a/src/main/java/net/minecraft/server/EntityHorseMule.java b/src/main/java/net/minecraft/server/EntityHorseMule.java -index 3dd4d4f0f35e2b12686e1a257250934e5678e397..243aeb736e350418e9476819bbfec0e7ab59f92f 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseMule.java -+++ b/src/main/java/net/minecraft/server/EntityHorseMule.java -@@ -8,6 +8,12 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.muleRidableInWater; -+ } -+ // Purpur end - @Override - protected SoundEffect getSoundAmbient() { - super.getSoundAmbient(); -diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index a53d335f3af9df80bec3f94f81fb5ff0e0e5ebb5..e2c6a5807a4554a7eebb148e40f1f8a1d979df5e 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -@@ -12,6 +12,18 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.skeletonHorseRidableInWater; -+ } -+ -+ @Override -+ public boolean isTamed() { -+ return true; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder eL() { - return fi().a(GenericAttributes.MAX_HEALTH, 15.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); - } -@@ -22,7 +34,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - } - - @Override -- protected void eV() {} -+ protected void eV() { if (world.purpurConfig.skeletonHorseCanSwim) goalSelector.a(0, new PathfinderGoalFloat(this)); } // Purpur - - @Override - protected SoundEffect getSoundAmbient() { -@@ -117,7 +129,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - - @Override - public boolean bt() { -- return true; -+ return super.bt(); // Purpur - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java -index 0e98173607c810e0e74552a2ba8febf292357c39..559ba50977147b8e2a0e7c1e7dc281faabd7f292 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseZombie.java -+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java -@@ -8,6 +8,18 @@ public class EntityHorseZombie extends EntityHorseAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.zombieHorseRidableInWater; -+ } -+ -+ @Override -+ public boolean isTamed() { -+ return true; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder eL() { - return fi().a(GenericAttributes.MAX_HEALTH, 15.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); - } -@@ -79,5 +91,5 @@ public class EntityHorseZombie extends EntityHorseAbstract { - } - - @Override -- protected void eV() {} -+ protected void eV() { if (world.purpurConfig.zombieHorseCanSwim) goalSelector.a(0, new PathfinderGoalFloat(this)); } // Purpur - } -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ab2ad054ce8d896e38ab4eb6ed38d8ea73d42954..3a7dc584bd2b88415a238f9c0cb7f85968fb8dfb 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2155,4 +2155,15 @@ public abstract class EntityHuman extends EntityLiving { - return this.g; - } - } -+ -+ // Purpur start -+ @Override -+ public boolean processClick(EnumHand hand) { -+ Entity vehicle = getRootVehicle(); -+ if (vehicle != null && vehicle.getRider() == this) { -+ return vehicle.onClick(hand); -+ } -+ return false; -+ } -+ // Purpur end - } -diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index c57bf5091430709778dc21d70c8a32819c9d6639..b0a5c36d1132e2558a1fefbd9f8dd26448400086 100644 ---- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -@@ -20,6 +20,16 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.illusionerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.illusionerRidableInWater; -+ } -+ - @Override - protected void initAttributes() { - this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.illusionerMovementSpeed); -@@ -32,6 +42,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan - protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new EntityIllagerWizard.b()); - this.goalSelector.a(4, new EntityIllagerIllusioner.b()); - this.goalSelector.a(5, new EntityIllagerIllusioner.a()); -@@ -39,6 +50,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error - this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); - this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index ee005e482396f8ff7e46a7ca981c843a76bdda71..b64278a8e349467305b75b2180a4a423ed49d7e4 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -30,7 +30,7 @@ public abstract class EntityInsentient extends EntityLiving { - protected int f; - protected ControllerLook lookController; - protected ControllerMove moveController; -- protected ControllerJump bi; -+ protected ControllerJump bi; public ControllerJump getJumpController() { return bi; } // Purpur - OBFHELPER - private final EntityAIBodyControl c; - protected NavigationAbstract navigation; - public PathfinderGoalSelector goalSelector; -@@ -68,8 +68,8 @@ public abstract class EntityInsentient extends EntityLiving { - this.bA = -1.0F; - this.goalSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); - this.targetSelector = new PathfinderGoalSelector(world.getMethodProfilerSupplier()); -- this.lookController = new ControllerLook(this); -- this.moveController = new ControllerMove(this); -+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this); // Purpur -+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this); // Purpur - this.bi = new ControllerJump(this); - this.c = this.r(); - this.navigation = this.b(world); -@@ -258,10 +258,10 @@ public abstract class EntityInsentient extends EntityLiving { - // Purpur start - private void incrementTicksSinceLastInteraction() { - ++ticksSinceLastInteraction; -- //if (hasRider()) { -- // ticksSinceLastInteraction = 0; -- // return; -- //} -+ if (hasRider()) { -+ ticksSinceLastInteraction = 0; -+ return; -+ } - if (world.purpurConfig.entityLifeSpan <= 0) { - return; // feature disabled - } -@@ -556,14 +556,17 @@ public abstract class EntityInsentient extends EntityLiving { - return super.dp(); - } - -+ public void setForwardSpeed(float speed) { this.t(speed); } // Purpur - OBFHELPER - public void t(float f) { - this.aT = f; - } - -+ public void setVerticalSpeed(float speed) { this.u(speed); } // Purpur - OBFHELPER - public void u(float f) { - this.aS = f; - } - -+ public void setStrafeSpeed(float speed) { this.v(speed); } // Purpur - OBFHELPER - public void v(float f) { - this.aR = f; - } -@@ -1253,7 +1256,7 @@ public abstract class EntityInsentient extends EntityLiving { - protected void a(EntityHuman entityhuman, EntityInsentient entityinsentient) {} - - protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { -- return EnumInteractionResult.PASS; -+ return tryRide(entityhuman, enumhand); // Purpur - } - - public boolean ev() { -@@ -1634,4 +1637,54 @@ public abstract class EntityInsentient extends EntityLiving { - this.unleash(true, event.isDropLeash()); - // Paper end - } -+ -+ // Purpur start -+ public double getMaxY() { -+ return world.getHeight(); -+ } -+ -+ public EnumInteractionResult tryRide(EntityHuman entityhuman, EnumHand enumhand) { -+ if (!isRidable()) { -+ return EnumInteractionResult.PASS; -+ } -+ if (enumhand != EnumHand.MAIN_HAND) { -+ return EnumInteractionResult.PASS; -+ } -+ if (entityhuman.isSneaking()) { -+ return EnumInteractionResult.PASS; -+ } -+ if (!entityhuman.getItemInHand(enumhand).isEmpty()) { -+ return EnumInteractionResult.PASS; -+ } -+ if (!passengers.isEmpty() || entityhuman.isPassenger()) { -+ return EnumInteractionResult.PASS; -+ } -+ if (this instanceof EntityTameableAnimal) { -+ EntityTameableAnimal tameable = (EntityTameableAnimal) this; -+ if (tameable.isTamed() && !tameable.isOwner(entityhuman)) { -+ return EnumInteractionResult.PASS; -+ } -+ if (!tameable.isTamed() && !world.purpurConfig.untamedTamablesAreRidable) { -+ return EnumInteractionResult.PASS; -+ } -+ } -+ if (this instanceof EntityAgeable) { -+ EntityAgeable ageable = (EntityAgeable) this; -+ if (ageable.isBaby() && !world.purpurConfig.babiesAreRidable) { -+ return EnumInteractionResult.PASS; -+ } -+ } -+ if (!entityhuman.getBukkitEntity().hasPermission("allow.ride." + getEntityType().getName())) { -+ entityhuman.sendMessage(net.pl3x.purpur.PurpurConfig.cannotRideMob); -+ return EnumInteractionResult.PASS; -+ } -+ entityhuman.yaw = this.yaw; -+ entityhuman.pitch = this.pitch; -+ if (entityhuman.startRiding(this)) { -+ return EnumInteractionResult.SUCCESS; -+ } else { -+ return EnumInteractionResult.PASS; -+ } -+ } -+ // Purpur end - } -diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java -index bdff2368836dca230a6622a205d5772834afc6ee..9ee03b233b71d1b4b85a9a5e1f0ea9feb55dfe43 100644 ---- a/src/main/java/net/minecraft/server/EntityIronGolem.java -+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java -@@ -22,9 +22,22 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +index 62cff5faafa076d05ebc59ad5c4fb020bea0509e..23e614f0c3cf1178acff8e72e0441c42c658e76b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +@@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -69,9 +70,22 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { this.G = 1.0F; } @@ -2329,7 +1501,7 @@ index bdff2368836dca230a6622a205d5772834afc6ee..9ee03b233b71d1b4b85a9a5e1f0ea9fe this.goalSelector.a(1, new PathfinderGoalMeleeAttack(this, 1.0D, true)); this.goalSelector.a(2, new PathfinderGoalMoveTowardsTarget(this, 0.9D, 32.0F)); this.goalSelector.a(2, new PathfinderGoalStrollVillage(this, 0.6D, false)); -@@ -32,6 +45,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { +@@ -79,6 +93,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { this.goalSelector.a(5, new PathfinderGoalOfferFlower(this)); this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); @@ -2337,7 +1509,7 @@ index bdff2368836dca230a6622a205d5772834afc6ee..9ee03b233b71d1b4b85a9a5e1f0ea9fe this.targetSelector.a(1, new PathfinderGoalDefendVillage(this)); this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_)); -@@ -201,13 +215,13 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { +@@ -248,13 +263,13 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { Item item = itemstack.getItem(); if (item != Items.IRON_INGOT) { @@ -2353,213 +1525,11 @@ index bdff2368836dca230a6622a205d5772834afc6ee..9ee03b233b71d1b4b85a9a5e1f0ea9fe } else { float f1 = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F; -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d..af2b6bb559d78dd912eee02281f5446f31e55eae 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -463,7 +463,7 @@ public abstract class EntityLiving extends Entity { - - @Override - public boolean bt() { -- return false; -+ return isRidableInWater(); // Purpur - } - - protected void cU() { -@@ -2202,7 +2202,7 @@ public abstract class EntityLiving extends Entity { - return 0.42F * this.getBlockJumpFactor(); - } - -- protected void jump() { -+ public void jump() { // Purpur - protected -> public - float f = this.dJ(); - - if (this.hasEffect(MobEffects.JUMP)) { -@@ -2451,10 +2451,12 @@ public abstract class EntityLiving extends Entity { - return this.onGround ? this.dN() * (0.21600002F / (f * f * f)) : this.aE; - } - -+ public float getSpeed() { return dN(); } // Purpur - OBFHELPER - public float dN() { - return this.bu; - } - -+ public void setSpeed(float speed) { q(speed); } // Purpur - OBFHELPER - public void q(float f) { - this.bu = f; - } -@@ -2853,6 +2855,20 @@ public abstract class EntityLiving extends Entity { - } - } - // Paper end -+ // Purpur start -+ if (hasRider() && ((WorldServer) world).hasRidableMoveEvent && this instanceof EntityInsentient) { -+ if (lastX != locX() || lastY != locY() || lastZ != locZ() || lastYaw != yaw || lastPitch != pitch) { -+ Location from = new Location(world.getWorld(), lastX, lastY, lastZ, lastYaw, lastPitch); -+ Location to = new Location (world.getWorld(), locX(), locY(), locZ(), yaw, pitch); -+ net.pl3x.purpur.event.entity.RidableMoveEvent event = new net.pl3x.purpur.event.entity.RidableMoveEvent((org.bukkit.entity.Mob) getBukkitLivingEntity(), (Player) getRider().getBukkitEntity(), from, to.clone()); -+ if (!event.callEvent()) { -+ setLocation(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch()); -+ } else if (!to.equals(event.getTo())) { -+ setLocation(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch()); -+ } -+ } -+ } -+ // Purpur end - if (!this.world.isClientSide && this.dO() && this.aG()) { - this.damageEntity(DamageSource.DROWN, 1.0F); - } -diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index e61f53816cbf09e775762403d97e9c591fb405a6..1099277868f92fdaf4b0ec3a982f26f20ead7369 100644 ---- a/src/main/java/net/minecraft/server/EntityLlama.java -+++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -18,7 +18,46 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - - public EntityLlama(EntityTypes entitytypes, World world) { - super(entitytypes, world); -+ // Purpur start -+ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this) { -+ @Override -+ public void a() { // tick -+ if (entity.hasRider() && hasSaddle()) { -+ tick(entity.getRider()); -+ } else { -+ tick(); -+ } -+ } -+ }; -+ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { -+ @Override -+ public void a() { // tick -+ if (entity.hasRider() && hasSaddle()) { -+ tick(entity.getRider()); -+ } else { -+ tick(); -+ } -+ } -+ }; -+ // Purpur end -+ } -+ -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.llamaRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.llamaRidableInWater; -+ } -+ -+ @Override -+ public boolean hasSaddle() { -+ return super.hasSaddle() || (isTamed() && getColor() != null); - } -+ // Purpur end - - public void setStrength(int i) { - this.datawatcher.set(EntityLlama.bx, Math.max(1, Math.min(5, i))); -@@ -66,6 +105,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - @Override - protected void initPathfinder() { - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur - this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D)); - this.goalSelector.a(2, new PathfinderGoalLlamaFollow(this, 2.0999999046325684D)); - this.goalSelector.a(3, new PathfinderGoalArrowAttack(this, 1.25D, 40, 20.0F)); -@@ -75,6 +115,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - this.goalSelector.a(6, new PathfinderGoalRandomStrollLand(this, 0.7D)); - this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur - this.targetSelector.a(1, new EntityLlama.c(this)); - this.targetSelector.a(2, new EntityLlama.a(this)); - } -@@ -312,7 +353,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - } - - @Nullable -- public EnumColor fy() { -+ public EnumColor fy() { return getColor(); } public EnumColor getColor() { // Purpur - OBFHELPER - int i = (Integer) this.datawatcher.get(EntityLlama.by); - - return i == -1 ? null : EnumColor.fromColorIndex(i); -diff --git a/src/main/java/net/minecraft/server/EntityLlamaTrader.java b/src/main/java/net/minecraft/server/EntityLlamaTrader.java -index 7d30e5c2378a2b8c540d1a1a13ec0ae97367bb9a..b6aae5cdee1f8bb842ab8e06c47fb497576b464f 100644 ---- a/src/main/java/net/minecraft/server/EntityLlamaTrader.java -+++ b/src/main/java/net/minecraft/server/EntityLlamaTrader.java -@@ -11,6 +11,23 @@ public class EntityLlamaTrader extends EntityLlama { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.llamaTraderRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.llamaTraderRidableInWater; -+ } -+ -+ @Override -+ public boolean hasSaddle() { -+ return super.hasSaddle() || isTamed(); -+ } -+ // Purpur end -+ - @Override - protected EntityLlama fz() { - return (EntityLlama) EntityTypes.TRADER_LLAMA.a(this.world); -diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java -index 874dd39825b41f4e2b366446359920989961f084..cd28463e2bf944d94c121c8f8d6e37221754c168 100644 ---- a/src/main/java/net/minecraft/server/EntityMagmaCube.java -+++ b/src/main/java/net/minecraft/server/EntityMagmaCube.java -@@ -8,6 +8,23 @@ public class EntityMagmaCube extends EntitySlime { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.magmaCubeRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.magmaCubeRidableInWater; -+ } -+ -+ @Override -+ public float getJumpHeight() { -+ return 0.42F * this.getBlockJumpFactor(); // from EntityLiving -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder m() { - return EntityMonster.eR().a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); - } -@@ -58,11 +75,12 @@ public class EntityMagmaCube extends EntitySlime { - } - - @Override -- protected void jump() { -+ public void jump() { // Purpur - protected -> public - Vec3D vec3d = this.getMot(); - - this.setMot(vec3d.x, (double) (this.dJ() + (float) this.getSize() * 0.1F), vec3d.z); - this.impulse = true; -+ this.actualJump = false; // Purpur - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 91cfe60f764a573e3724b48a9ae02e806c1e4fb8..e38d165fefb4d552ded2198536a6663a5688070d 100644 ---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java -+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -21,6 +21,18 @@ public class EntityMushroomCow extends EntityCow implements IShearable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +index d28d4d2c1eff2c130f49c2bce3c19da212dba5dc..815e907e8db721f2a6f0f831b69c44a9573b5c9b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +@@ -57,6 +57,18 @@ public class EntityMushroomCow extends EntityCow implements IShearable { super(entitytypes, world); } @@ -2578,7 +1548,7 @@ index 91cfe60f764a573e3724b48a9ae02e806c1e4fb8..e38d165fefb4d552ded2198536a6663a @Override public float a(BlockPosition blockposition, IWorldReader iworldreader) { return iworldreader.getType(blockposition.down()).a(Blocks.MYCELIUM) ? 10.0F : iworldreader.y(blockposition) - 0.5F; -@@ -82,7 +94,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { +@@ -118,7 +130,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { } else if (itemstack.getItem() == Items.SHEARS && this.canShear()) { // CraftBukkit start if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) { @@ -2587,7 +1557,7 @@ index 91cfe60f764a573e3724b48a9ae02e806c1e4fb8..e38d165fefb4d552ded2198536a6663a } // CraftBukkit end this.shear(SoundCategory.PLAYERS); -@@ -102,7 +114,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { +@@ -138,7 +150,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { Optional> optional = this.l(itemstack); if (!optional.isPresent()) { @@ -2596,11 +1566,19 @@ index 91cfe60f764a573e3724b48a9ae02e806c1e4fb8..e38d165fefb4d552ded2198536a6663a } Pair pair = (Pair) optional.get(); -diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 7bd3fea6e0e478337c7f6400a941675eebba517b..2f8275cd6b3cde0d3f949219f67ba7f0e0031dc3 100644 ---- a/src/main/java/net/minecraft/server/EntityOcelot.java -+++ b/src/main/java/net/minecraft/server/EntityOcelot.java -@@ -16,6 +16,18 @@ public class EntityOcelot extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +index f3e9c73f28584bcccd6f82d8974eabe4b4a892fa..d7938ff0dca305f1d47fdfdbc57648892debe367 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +@@ -10,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -63,6 +64,18 @@ public class EntityOcelot extends EntityAnimal { this.eL(); } @@ -2619,7 +1597,7 @@ index 7bd3fea6e0e478337c7f6400a941675eebba517b..2f8275cd6b3cde0d3f949219f67ba7f0 private boolean isTrusting() { return (Boolean) this.datawatcher.get(EntityOcelot.bp); } -@@ -47,12 +59,14 @@ public class EntityOcelot extends EntityAnimal { +@@ -94,12 +107,14 @@ public class EntityOcelot extends EntityAnimal { protected void initPathfinder() { this.br = new EntityOcelot.b(this, 0.6D, EntityOcelot.bo, true); this.goalSelector.a(1, new PathfinderGoalFloat(this)); @@ -2634,11 +1612,19 @@ index 7bd3fea6e0e478337c7f6400a941675eebba517b..2f8275cd6b3cde0d3f949219f67ba7f0 this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityChicken.class, false)); this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, false, false, EntityTurtle.bo)); } -diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java -index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf61476d2b 100644 ---- a/src/main/java/net/minecraft/server/EntityPanda.java -+++ b/src/main/java/net/minecraft/server/EntityPanda.java -@@ -46,6 +46,27 @@ public class EntityPanda extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +index 711b322007a0973ff0aebf3c25efbae8fc7741d0..0d912399e1975d9c0d5525f5b89049f40e7efcc0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +@@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -101,6 +102,27 @@ public class EntityPanda extends EntityAnimal { } @@ -2666,7 +1652,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf @Override public boolean e(ItemStack itemstack) { EnumItemSlot enumitemslot = EntityInsentient.j(itemstack); -@@ -69,6 +90,7 @@ public class EntityPanda extends EntityAnimal { +@@ -124,6 +146,7 @@ public class EntityPanda extends EntityAnimal { return this.w(8); } @@ -2674,7 +1660,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf public void t(boolean flag) { this.d(8, flag); } -@@ -77,6 +99,7 @@ public class EntityPanda extends EntityAnimal { +@@ -132,6 +155,7 @@ public class EntityPanda extends EntityAnimal { return this.w(16); } @@ -2682,7 +1668,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf public void u(boolean flag) { this.d(16, flag); } -@@ -93,6 +116,7 @@ public class EntityPanda extends EntityAnimal { +@@ -148,6 +172,7 @@ public class EntityPanda extends EntityAnimal { return (Integer) this.datawatcher.get(EntityPanda.br); } @@ -2690,7 +1676,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf private void v(int i) { this.datawatcher.set(EntityPanda.br, i); } -@@ -201,6 +225,7 @@ public class EntityPanda extends EntityAnimal { +@@ -256,6 +281,7 @@ public class EntityPanda extends EntityAnimal { @Override protected void initPathfinder() { this.goalSelector.a(0, new PathfinderGoalFloat(this)); @@ -2698,7 +1684,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf this.goalSelector.a(2, new EntityPanda.i(this, 2.0D)); this.goalSelector.a(2, new EntityPanda.d(this, 1.0D)); this.goalSelector.a(3, new EntityPanda.b(this, 1.2000000476837158D, true)); -@@ -216,6 +241,7 @@ public class EntityPanda extends EntityAnimal { +@@ -271,6 +297,7 @@ public class EntityPanda extends EntityAnimal { this.goalSelector.a(12, new EntityPanda.j(this)); this.goalSelector.a(13, new PathfinderGoalFollowParent(this, 1.25D)); this.goalSelector.a(14, new PathfinderGoalRandomStrollLand(this, 1.0D)); @@ -2706,7 +1692,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf this.targetSelector.a(1, (new EntityPanda.e(this, new Class[0])).a(new Class[0])); } -@@ -536,7 +562,7 @@ public class EntityPanda extends EntityAnimal { +@@ -591,7 +618,7 @@ public class EntityPanda extends EntityAnimal { ItemStack itemstack = entityhuman.b(enumhand); if (this.ff()) { @@ -2715,7 +1701,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } else if (this.eN()) { this.u(false); return EnumInteractionResult.a(this.world.isClientSide); -@@ -553,7 +579,7 @@ public class EntityPanda extends EntityAnimal { +@@ -608,7 +635,7 @@ public class EntityPanda extends EntityAnimal { this.g(entityhuman); } else { if (this.world.isClientSide || this.eM() || this.isInWater()) { @@ -2724,7 +1710,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } this.ft(); -@@ -570,7 +596,7 @@ public class EntityPanda extends EntityAnimal { +@@ -625,7 +652,7 @@ public class EntityPanda extends EntityAnimal { return EnumInteractionResult.SUCCESS; } else { @@ -2733,7 +1719,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } } -@@ -683,6 +709,7 @@ public class EntityPanda extends EntityAnimal { +@@ -738,6 +765,7 @@ public class EntityPanda extends EntityAnimal { public f(EntityPanda entitypanda) { this.a = entitypanda; @@ -2741,7 +1727,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } @Override -@@ -846,6 +873,7 @@ public class EntityPanda extends EntityAnimal { +@@ -901,6 +929,7 @@ public class EntityPanda extends EntityAnimal { public l(EntityPanda entitypanda) { this.a = entitypanda; @@ -2749,7 +1735,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } @Override -@@ -975,7 +1003,7 @@ public class EntityPanda extends EntityAnimal { +@@ -1030,7 +1059,7 @@ public class EntityPanda extends EntityAnimal { } } @@ -2758,7 +1744,7 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf private final EntityPanda i; -@@ -985,9 +1013,9 @@ public class EntityPanda extends EntityAnimal { +@@ -1040,9 +1069,9 @@ public class EntityPanda extends EntityAnimal { } @Override @@ -2770,11 +1756,27 @@ index b36cc95168c6e6fbf668ebe15c1fa10b54e570d3..eafae5516b9b5d51aa943796557926cf } } } -diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java -index 0af6c9395b5d98e6bfa162f651d0e8cb89035afd..e402d4a77b57b8b12b7575a9793c30d7acfa7fb0 100644 ---- a/src/main/java/net/minecraft/server/EntityParrot.java -+++ b/src/main/java/net/minecraft/server/EntityParrot.java -@@ -65,12 +65,58 @@ public class EntityParrot extends EntityPerchable implements EntityBird { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +index 699dd0ac1f8d0d340ab1a560106336fc7cc95d5b..5c26eea7e3e93dc7bcd8b86519e84db58b70cecb 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +@@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -38,6 +39,7 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; +@@ -119,12 +121,58 @@ public class EntityParrot extends EntityPerchable implements EntityBird { public EntityParrot(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -2834,7 +1836,7 @@ index 0af6c9395b5d98e6bfa162f651d0e8cb89035afd..e402d4a77b57b8b12b7575a9793c30d7 @Nullable @Override public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { -@@ -89,8 +135,10 @@ public class EntityParrot extends EntityPerchable implements EntityBird { +@@ -143,8 +191,10 @@ public class EntityParrot extends EntityPerchable implements EntityBird { @Override protected void initPathfinder() { @@ -2846,183 +1848,19 @@ index 0af6c9395b5d98e6bfa162f651d0e8cb89035afd..e402d4a77b57b8b12b7575a9793c30d7 this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); this.goalSelector.a(2, new PathfinderGoalSit(this)); this.goalSelector.a(2, new PathfinderGoalFollowOwner(this, 1.0D, 5.0F, 1.0F, true)); -diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index bdfe073dcd255a7359127f9ae3a962642be5526d..c70281fddcbe5a97a1eb176def99cdf31de37579 100644 ---- a/src/main/java/net/minecraft/server/EntityPhantom.java -+++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -25,6 +25,59 @@ public class EntityPhantom extends EntityFlying implements IMonster { - this.lookController = new EntityPhantom.f(this); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.phantomRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.phantomRidableInWater; -+ } -+ -+ @Override -+ public double getMaxY() { -+ return world.purpurConfig.phantomMaxY; -+ } -+ -+ @Override -+ public void g(Vec3D vec3d) { -+ super.g(vec3d); -+ if (hasRider() && !onGround) { -+ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); -+ setSpeed(speed); -+ Vec3D mot = getMot(); -+ move(EnumMoveType.SELF, mot.multiply(speed, speed, speed)); -+ setMot(mot.a(0.9D)); -+ } -+ } -+ -+ public static AttributeProvider.Builder defaultAttributes() { -+ return EntityMonster.eR().a(GenericAttributes.FLYING_SPEED, 3.0D); -+ } -+ -+ @Override -+ public boolean onSpacebar() { -+ if (hasRider() && getRider().getBukkitEntity().hasPermission("allow.special.phantom")) { -+ shoot(); -+ } -+ return false; -+ } -+ -+ public boolean shoot() { -+ org.bukkit.Location loc = ((org.bukkit.entity.LivingEntity) getBukkitEntity()).getEyeLocation(); -+ loc.setPitch(-loc.getPitch()); -+ org.bukkit.util.Vector target = loc.getDirection().normalize().multiply(100).add(loc.toVector()); -+ -+ net.pl3x.purpur.entity.PhantomFlames flames = new net.pl3x.purpur.entity.PhantomFlames(world, this); -+ flames.canGrief = world.purpurConfig.phantomAllowGriefing; -+ flames.shoot(target.getX() - locX(), target.getY() - locY(), target.getZ() - locZ(), 1.0F, 5.0F); -+ world.addEntity(flames); -+ return true; -+ } -+ // Purpur end -+ - @Override - protected EntityAIBodyControl r() { - return new EntityPhantom.d(this); -@@ -33,6 +86,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - @Override - protected void initPathfinder() { - // Purpur start -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); - if (world.purpurConfig.phantomOrbitCrystalRadius > 0) { - this.goalSelector.a(1, new FindCrystalGoal(this)); - this.goalSelector.a(2, new OrbitCrystalGoal(this)); -@@ -40,6 +94,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - this.goalSelector.a(3, new EntityPhantom.c()); // PickAttackGoal - this.goalSelector.a(4, new EntityPhantom.i()); // SweepAttackGoal - this.goalSelector.a(5, new EntityPhantom.e()); // OrbitPointGoal -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); - this.targetSelector.a(1, new EntityPhantom.b()); // AttackPlayer Goal - // Purpur end - } -@@ -126,7 +181,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - - @Override - public void movementTick() { -- if (this.isAlive() && ((world.purpurConfig.phantomBurnInDaylight && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Purpur -+ if (this.isAlive() && !hasRider() && ((world.purpurConfig.phantomBurnInDaylight && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Purpur - this.setOnFire(8); - } - -@@ -368,7 +423,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - - @Override - public boolean a() { -- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag -+ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag - if (this.c > 0) { - --this.c; - return false; -@@ -397,7 +452,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - - @Override - public boolean b() { -- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag -+ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag - EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); - - return entityliving != null ? EntityPhantom.this.a(entityliving, PathfinderTargetCondition.a) : false; -@@ -412,7 +467,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - - @Override - public boolean a() { -- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag -+ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag - EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); - - return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false; -@@ -610,14 +665,23 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } - } - -- class f extends ControllerLook { -+ class f extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur - - public f(EntityInsentient entityinsentient) { - super(entityinsentient); - } - - @Override -- public void a() {} -+ // Purpur start -+ public void tick(EntityHuman rider) { -+ setYawPitch(rider.yaw, -rider.pitch * 0.75F); -+ } -+ -+ @Override -+ public void tick() { -+ // do nothing -+ } -+ // Purpur end - } - - class d extends EntityAIBodyControl { -@@ -633,7 +697,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } - } - -- class g extends ControllerMove { -+ class g extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur - - private float j = 0.1F; - -@@ -642,7 +706,19 @@ public class EntityPhantom extends EntityFlying implements IMonster { - } - - @Override -- public void a() { -+ // Purpur start -+ public void tick(EntityHuman rider) { -+ if (!EntityPhantom.this.onGround) { -+ // phantom is always in motion when flying -+ // TODO - FIX THIS -+ // rider.setForward(1.0F); -+ } -+ super.tick(rider); -+ } -+ -+ @Override -+ public void tick() { -+ // Purpur end - if (EntityPhantom.this.positionChanged) { - EntityPhantom.this.yaw += 180.0F; - this.j = 0.1F; -diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 6ea3e4ffc3f42f4282adf3554944f24d92ca2079..bf7ecd7a7d805cc8f1314a348d7b13f848da46b5 100644 ---- a/src/main/java/net/minecraft/server/EntityPig.java -+++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -19,9 +19,22 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +index 1a540e41e6161d011ca4ed30c68ae9df4567b8db..cef69f99d7bc9b6605b9654c50f43a1ebc1a8509 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -66,9 +67,22 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { this.saddleStorage = new SaddleStorage(this.datawatcher, EntityPig.bp, EntityPig.bo); } @@ -3045,179 +1883,19 @@ index 6ea3e4ffc3f42f4282adf3554944f24d92ca2079..bf7ecd7a7d805cc8f1314a348d7b13f8 this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); this.goalSelector.a(3, new PathfinderGoalBreed(this, 1.0D)); this.goalSelector.a(4, new PathfinderGoalTempt(this, 1.2D, RecipeItemStack.a(Items.CARROT_ON_A_STICK), false)); -diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java -index 32b75f710b12efbcecec2c8d72d4d8cb725870fe..3327dbbf87d8f43cbc7cd728df2f4c6a33dae40d 100644 ---- a/src/main/java/net/minecraft/server/EntityPigZombie.java -+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java -@@ -22,6 +22,16 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.zombifiedPiglinRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.zombifiedPiglinRidableInWater; -+ } -+ - @Override - public boolean jockeyOnlyBaby() { - return world.purpurConfig.zombifiedPiglinJockeyOnlyBaby; -diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java -index ca7f9dc54ed2e58f521613b5d8027494bd20edd2..334e0f73e67ef2db7e680874faf0646995d9de8a 100644 ---- a/src/main/java/net/minecraft/server/EntityPiglin.java -+++ b/src/main/java/net/minecraft/server/EntityPiglin.java -@@ -25,6 +25,18 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - this.f = 5; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.piglinRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.piglinRidableInWater; -+ } -+ // Purpur end -+ - @Override - public void saveData(NBTTagCompound nbttagcompound) { - super.saveData(nbttagcompound); -@@ -143,7 +155,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - - @Override - public BehaviorController getBehaviorController() { -- return super.getBehaviorController(); -+ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - - @Override -@@ -202,7 +214,8 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - @Override - protected void mobTick() { - this.world.getMethodProfiler().enter("piglinBrain"); -- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); -+ if (getRider() == null) // Purpur - only use brain if no rider -+ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error - this.world.getMethodProfiler().exit(); - PiglinAI.b(this); - super.mobTick(); -@@ -341,7 +354,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - - @Override - protected SoundEffect getSoundAmbient() { -- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse((Object) null); -+ return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // Purpur - decompile error - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityPiglinBrute.java b/src/main/java/net/minecraft/server/EntityPiglinBrute.java -index 3e9a4af09d0a4af89584ce26428c38f59ff1ff11..f6b170811159544dc10b91226e4e54b349472c46 100644 ---- a/src/main/java/net/minecraft/server/EntityPiglinBrute.java -+++ b/src/main/java/net/minecraft/server/EntityPiglinBrute.java -@@ -15,6 +15,18 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { - this.f = 20; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.piglinBruteRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.piglinBruteRidableInWater; -+ } -+ // Purpur end -+ - public static AttributeProvider.Builder eS() { - return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 50.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.3499999940395355D).a(GenericAttributes.ATTACK_DAMAGE, 7.0D); - } -@@ -44,7 +56,7 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { - - @Override - public BehaviorController getBehaviorController() { -- return super.getBehaviorController(); -+ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - - @Override -@@ -60,7 +72,8 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { - @Override - protected void mobTick() { - this.world.getMethodProfiler().enter("piglinBruteBrain"); -- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); -+ if (getRider() == null) // Purpur - only use brain if no rider -+ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error - this.world.getMethodProfiler().exit(); - PiglinBruteAI.b(this); - PiglinBruteAI.c(this); -diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java -index a3a428da99574c485fcf2b8c7944e0d8354146ee..cf7de0127166f6175a6246062c8664e64959edeb 100644 ---- a/src/main/java/net/minecraft/server/EntityPillager.java -+++ b/src/main/java/net/minecraft/server/EntityPillager.java -@@ -13,15 +13,29 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.pillagerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.pillagerRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(2, new EntityRaider.a(this, 10.0F)); - this.goalSelector.a(3, new PathfinderGoalCrossbowAttack<>(this, 1.0D, 8.0F)); - this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 15.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 15.0F)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error - 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 2aef37c4602d9c3ec12a2b5deade36801c171be0..04879594b5157d2e0ed7c464bcea52fa937fa68f 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -512,6 +512,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - } - - this.advancementDataPlayer.b(this); -+ -+ // Purpur start -+ if (this.world.purpurConfig.useNightVisionWhenRiding && this.getVehicle() != null && this.getVehicle().getRider() == this && world.getTime() % 100 == 0) { // 5 seconds -+ MobEffect nightVision = this.getEffect(MobEffects.NIGHT_VISION); -+ if (nightVision == null || nightVision.getDuration() <= 300) { // 15 seconds -+ this.addEffect(new MobEffect(MobEffects.NIGHT_VISION, 400, 0)); // 20 seconds -+ } -+ } -+ // Purpur end - } - - public void playerTick() { -diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9f9120cc7 100644 ---- a/src/main/java/net/minecraft/server/EntityPolarBear.java -+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java -@@ -18,12 +18,34 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +index f25f5ced218555af0d62844a78842cfc7599d608..e686491a469573a3fc466c46be1b7430ff02ba53 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +@@ -14,6 +14,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.ResourceKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -66,12 +67,34 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { private static final IntRange bs = TimeRange.a(20, 39); private int bt; private UUID bu; @@ -3252,7 +1930,7 @@ index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9 @Override public boolean mate(EntityAnimal entityanimal) { if (entityanimal == this) { -@@ -61,6 +83,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -109,6 +132,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { protected void initPathfinder() { super.initPathfinder(); this.goalSelector.a(0, new PathfinderGoalFloat(this)); @@ -3260,7 +1938,7 @@ index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9 this.goalSelector.a(1, new EntityPolarBear.c()); this.goalSelector.a(1, new EntityPolarBear.d()); // Purpur start -@@ -73,6 +96,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -121,6 +145,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D)); this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this)); @@ -3268,7 +1946,7 @@ index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9 this.targetSelector.a(1, new EntityPolarBear.b()); this.targetSelector.a(2, new EntityPolarBear.a()); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_)); -@@ -185,6 +209,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -233,6 +258,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { this.a((WorldServer) this.world, true); } @@ -3280,7 +1958,7 @@ index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9 } @Override -@@ -218,6 +247,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +@@ -266,6 +296,7 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { public void setStanding(boolean standing) { t(standing); } // Purpur - OBFHELPER public void t(boolean flag) { this.datawatcher.set(EntityPolarBear.bo, flag); @@ -3288,11 +1966,11 @@ index 99f0bd8f82520778d469ec51745034e6ebd3238a..3d649843f565d2c8820b525c199bd2b9 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityPufferFish.java b/src/main/java/net/minecraft/server/EntityPufferFish.java -index 330ec38d09636232250d97baad0cef7a9305d614..16a4df27c557e2d4a0fd4f48317307b884c2688c 100644 ---- a/src/main/java/net/minecraft/server/EntityPufferFish.java -+++ b/src/main/java/net/minecraft/server/EntityPufferFish.java -@@ -17,6 +17,18 @@ public class EntityPufferFish extends EntityFish { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java b/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java +index e9f20d387ccdacfbb1a48dc31e2a6cd4843a0d7b..38fe79872b4b7f4ad4a030fbdf505efbc0352fc0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java +@@ -39,6 +39,18 @@ public class EntityPufferFish extends EntityFish { super(entitytypes, world); } @@ -3311,7 +1989,7 @@ index 330ec38d09636232250d97baad0cef7a9305d614..16a4df27c557e2d4a0fd4f48317307b8 @Override protected void initDatawatcher() { super.initDatawatcher(); -@@ -60,7 +72,7 @@ public class EntityPufferFish extends EntityFish { +@@ -82,7 +94,7 @@ public class EntityPufferFish extends EntityFish { @Override protected void initPathfinder() { super.initPathfinder(); @@ -3320,11 +1998,19 @@ index 330ec38d09636232250d97baad0cef7a9305d614..16a4df27c557e2d4a0fd4f48317307b8 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9cd0201c7 100644 ---- a/src/main/java/net/minecraft/server/EntityRabbit.java -+++ b/src/main/java/net/minecraft/server/EntityRabbit.java -@@ -20,6 +20,18 @@ public class EntityRabbit extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +index 180fc927074dc683ad4d482a00dd4e04ff7923d0..fff6bcff9d44c7d49cd2d0c334ea702531c74ea1 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +@@ -10,6 +10,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -75,6 +76,18 @@ public class EntityRabbit extends EntityAnimal { this.initializePathFinderGoals(); // CraftBukkit - moved code } @@ -3343,7 +2029,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 // CraftBukkit start - code from constructor public void initializePathFinderGoals(){ this.i(0.0D); -@@ -28,7 +40,8 @@ public class EntityRabbit extends EntityAnimal { +@@ -83,7 +96,8 @@ public class EntityRabbit extends EntityAnimal { @Override public void initPathfinder() { @@ -3353,7 +2039,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 this.goalSelector.a(1, new EntityRabbit.PathfinderGoalRabbitPanic(this, 2.2D)); this.goalSelector.a(2, new PathfinderGoalBreed(this, 0.8D)); this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, RecipeItemStack.a(Items.CARROT, Items.GOLDEN_CARROT, Blocks.DANDELION), false)); -@@ -41,7 +54,15 @@ public class EntityRabbit extends EntityAnimal { +@@ -96,7 +110,15 @@ public class EntityRabbit extends EntityAnimal { } @Override @@ -3370,7 +2056,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 if (!this.positionChanged && (!this.moveController.b() || this.moveController.e() <= this.locY() + 0.5D)) { PathEntity pathentity = this.navigation.k(); -@@ -60,7 +81,7 @@ public class EntityRabbit extends EntityAnimal { +@@ -115,7 +137,7 @@ public class EntityRabbit extends EntityAnimal { } @Override @@ -3379,7 +2065,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 super.jump(); double d0 = this.moveController.c(); -@@ -92,6 +113,7 @@ public class EntityRabbit extends EntityAnimal { +@@ -147,6 +169,7 @@ public class EntityRabbit extends EntityAnimal { } @@ -3387,7 +2073,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 public void eK() { this.setJumping(true); this.br = 10; -@@ -106,6 +128,13 @@ public class EntityRabbit extends EntityAnimal { +@@ -161,6 +184,13 @@ public class EntityRabbit extends EntityAnimal { @Override public void mobTick() { @@ -3401,7 +2087,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 if (this.bt > 0) { --this.bt; } -@@ -156,6 +185,39 @@ public class EntityRabbit extends EntityAnimal { +@@ -211,6 +241,39 @@ public class EntityRabbit extends EntityAnimal { this.bs = this.onGround; } @@ -3441,7 +2127,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 @Override public boolean aO() { return false; -@@ -485,7 +547,7 @@ public class EntityRabbit extends EntityAnimal { +@@ -540,7 +603,7 @@ public class EntityRabbit extends EntityAnimal { } } @@ -3450,7 +2136,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 private final EntityRabbit i; private double j; -@@ -496,14 +558,14 @@ public class EntityRabbit extends EntityAnimal { +@@ -551,14 +614,14 @@ public class EntityRabbit extends EntityAnimal { } @Override @@ -3467,7 +2153,7 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 } @Override -@@ -530,14 +592,17 @@ public class EntityRabbit extends EntityAnimal { +@@ -585,14 +648,17 @@ public class EntityRabbit extends EntityAnimal { this.c = entityrabbit; } @@ -3485,62 +2171,11 @@ index f17608730fca96af4f9779863a8c25723a3bd5cf..95f4592944a53aab0ff9843ae8e7c9b9 public void a(boolean flag) { this.d = flag; } -diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java -index e78f158d9c682c60d42c17e0f171d492552e4079..9d0a462bfc56994ee35478cc9e565123620a9f08 100644 ---- a/src/main/java/net/minecraft/server/EntityRavager.java -+++ b/src/main/java/net/minecraft/server/EntityRavager.java -@@ -20,14 +20,37 @@ public class EntityRavager extends EntityRaider { - this.f = 20; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.ravagerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.ravagerRidableInWater; -+ } -+ -+ @Override -+ public void onMount(EntityHuman entityhuman) { -+ super.onMount(entityhuman); -+ getNavigation().stopPathfinding(); -+ -+ double speed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue(); -+ getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(speed); -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(4, new EntityRavager.a()); - this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D)); - this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(2, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); -@@ -99,7 +122,7 @@ public class EntityRavager extends EntityRaider { - @Override - public void movementTick() { - super.movementTick(); -- if (this.isAlive()) { -+ if (this.isAlive() && !hasRider()) { - if (this.isFrozen()) { - this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.0D); - } else { -diff --git a/src/main/java/net/minecraft/server/EntitySalmon.java b/src/main/java/net/minecraft/server/EntitySalmon.java -index 51ec63413306cf9dcd685870ccbd4e5440ab2e7a..6dfcee2c9b658c2c9ee1179e412389934c066d48 100644 ---- a/src/main/java/net/minecraft/server/EntitySalmon.java -+++ b/src/main/java/net/minecraft/server/EntitySalmon.java -@@ -6,6 +6,18 @@ public class EntitySalmon extends EntityFishSchool { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java b/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java +index ca125342f189d5db95ebd04043a2d11e5fbfd3fd..bf565671c167162b3d935447961f0d44ed4a2779 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java +@@ -14,6 +14,18 @@ public class EntitySalmon extends EntityFishSchool { super(entitytypes, world); } @@ -3559,11 +2194,19 @@ index 51ec63413306cf9dcd685870ccbd4e5440ab2e7a..6dfcee2c9b658c2c9ee1179e41238993 @Override public int eN() { return 5; -diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index 2908e9cc47947daad19391d38da3c2a300f67fe5..a151d4295c02930687a23212647de60cce5405ca 100644 ---- a/src/main/java/net/minecraft/server/EntitySheep.java -+++ b/src/main/java/net/minecraft/server/EntitySheep.java -@@ -56,10 +56,23 @@ public class EntitySheep extends EntityAnimal implements IShearable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +index 88bed962bc17242ee6a9c93b7e0fec8bc578b35f..8f3296031f220dd7bb3ae9fe2443e479954ebad3 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +@@ -14,6 +14,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -110,10 +111,23 @@ public class EntitySheep extends EntityAnimal implements IShearable { super(entitytypes, world); } @@ -3587,295 +2230,19 @@ index 2908e9cc47947daad19391d38da3c2a300f67fe5..a151d4295c02930687a23212647de60c this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.1D, RecipeItemStack.a(Items.WHEAT), false)); -diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java -index 49f6ee064fa7b79c7a9fd7a3344ed2334ce1f9f6..11a6b939ebb51cdda907531d30b7beb3a8562673 100644 ---- a/src/main/java/net/minecraft/server/EntityShulker.java -+++ b/src/main/java/net/minecraft/server/EntityShulker.java -@@ -30,12 +30,26 @@ public class EntityShulker extends EntityGolem implements IMonster { - this.f = 5; - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.shulkerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.shulkerRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(4, new EntityShulker.a()); - this.goalSelector.a(7, new EntityShulker.e()); - this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error - this.targetSelector.a(2, new EntityShulker.d(this)); - this.targetSelector.a(3, new EntityShulker.c(this)); -@@ -519,7 +533,7 @@ public class EntityShulker extends EntityGolem implements IMonster { - - private int b; - -- private e() {} -+ private e() { this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); } // Purpur - peek - - @Override - public boolean a() { -diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index 28b490cc14f5881eb83acfbd6f30f9163ffe1926..ad428e090089a461283445022b33313520585ac5 100644 ---- a/src/main/java/net/minecraft/server/EntitySilverfish.java -+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java -@@ -11,13 +11,27 @@ public class EntitySilverfish extends EntityMonster { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.silverfishRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.silverfishRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - this.b = new EntitySilverfish.PathfinderGoalSilverfishWakeOthers(this); - this.goalSelector.a(1, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(3, this.b); - this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false)); - this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - } -@@ -177,6 +191,7 @@ public class EntitySilverfish extends EntityMonster { - - public PathfinderGoalSilverfishWakeOthers(EntitySilverfish entitysilverfish) { - this.silverfish = entitysilverfish; -+ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - } - - public void g() { -diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java -index 7c39bec8314a3db63a90ccc9f040b82d754705e2..3f130e03bf8b235360385fd169d4886ffcfa626a 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeleton.java -+++ b/src/main/java/net/minecraft/server/EntitySkeleton.java -@@ -6,6 +6,18 @@ public class EntitySkeleton extends EntitySkeletonAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.skeletonRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.skeletonRidableInWater; -+ } -+ // Purpur end -+ - @Override - 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 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 - - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(2, new PathfinderGoalRestrictSun(this)); - this.goalSelector.a(3, new PathfinderGoalFleeSun(this, 1.0D)); - this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityWolf.class, 6.0F, 1.0D, 1.2D)); - this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); - this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); -diff --git a/src/main/java/net/minecraft/server/EntitySkeletonStray.java b/src/main/java/net/minecraft/server/EntitySkeletonStray.java -index f985caada082eff6183d7bc9868b1782f9529eaf..d123fb82b635d5271bea9b238554a3011858eeae 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeletonStray.java -+++ b/src/main/java/net/minecraft/server/EntitySkeletonStray.java -@@ -8,6 +8,18 @@ public class EntitySkeletonStray extends EntitySkeletonAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.strayRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.strayRidableInWater; -+ } -+ // Purpur end -+ - public static boolean a(EntityTypes entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { - return b(entitytypes, worldaccess, enummobspawn, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || worldaccess.e(blockposition)); - } -diff --git a/src/main/java/net/minecraft/server/EntitySkeletonWither.java b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -index c872be77a6cd767520d5412b38ec4ed4fa87ac2f..96cb080d940db22330598a8806726088b79a53c1 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeletonWither.java -+++ b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -@@ -9,6 +9,18 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { - this.a(PathType.LAVA, 8.0F); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.witherSkeletonRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.witherSkeletonRidableInWater; -+ } -+ // Purpur end -+ - @Override - 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 80fab9290479f876fd78997c1bd55fe6b00aac45..7f3d57a9399f60465fae27f03fc57df625f5016d 100644 ---- a/src/main/java/net/minecraft/server/EntitySlime.java -+++ b/src/main/java/net/minecraft/server/EntitySlime.java -@@ -35,12 +35,45 @@ public class EntitySlime extends EntityInsentient implements IMonster { - this.moveController = new EntitySlime.ControllerMoveSlime(this); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.slimeRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.slimeRidableInWater; -+ } -+ -+ protected boolean actualJump; -+ -+ @Override -+ public float getJumpHeight() { -+ float height = super.getJumpHeight(); -+ return hasRider() && actualJump ? height * 1.5F : height; -+ } -+ -+ @Override -+ public boolean onSpacebar() { -+ if (onGround && hasRider()) { -+ actualJump = true; -+ if (getRider().getForward() == 0 || getRider().getStrafe() == 0) { -+ jump(); // jump() here if not moving -+ } -+ } -+ return true; // do not jump() in wasd controller, let vanilla controller handle -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new EntitySlime.PathfinderGoalSlimeRandomJump(this)); - this.goalSelector.a(2, new EntitySlime.PathfinderGoalSlimeNearestPlayer(this)); - this.goalSelector.a(3, new EntitySlime.PathfinderGoalSlimeRandomDirection(this)); - this.goalSelector.a(5, new EntitySlime.PathfinderGoalSlimeIdle(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> { - return Math.abs(entityliving.locY() - this.locY()) <= 4.0D; - })); -@@ -326,11 +359,12 @@ public class EntitySlime extends EntityInsentient implements IMonster { - } - - @Override -- protected void jump() { -+ public void jump() { // Purpur - protected -> public - Vec3D vec3d = this.getMot(); - - this.setMot(vec3d.x, (double) this.dJ(), vec3d.z); - this.impulse = true; -+ this.actualJump = false; // Purpur - } - - @Nullable -@@ -499,10 +533,10 @@ public class EntitySlime extends EntityInsentient implements IMonster { - // Paper end - } - -- static class ControllerMoveSlime extends ControllerMove { -+ static class ControllerMoveSlime extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur - - private float i; -- private int j; -+ private int j; private int getJumpDelay() { return j; } private void setJumpDelay(int delay) { j = delay; } // Purpur - OBFHELPER - private final EntitySlime k; - private boolean l; - -@@ -524,15 +558,27 @@ public class EntitySlime extends EntityInsentient implements IMonster { - - @Override - public void a() { -+ // Purpur start -+ if (entity.hasRider()) { -+ tick(entity.getRider()); -+ if (entity.getForward() != 0 || entity.getStrafe() != 0) { -+ if (getJumpDelay() > 10) { -+ setJumpDelay(6); -+ } -+ } else { -+ setJumpDelay(20); -+ } -+ } else { -+ // Purpur end - this.a.yaw = this.a(this.a.yaw, this.i, 90.0F); - this.a.aC = this.a.yaw; - this.a.aA = this.a.yaw; -- if (this.h != ControllerMove.Operation.MOVE_TO) { -+ } if (!entity.hasRider() && this.h != ControllerMove.Operation.MOVE_TO) { // Purpur - this.a.t(0.0F); - } else { - this.h = ControllerMove.Operation.WAIT; - if (this.a.isOnGround()) { -- this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED))); -+ this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED) * (entity.hasRider() && (entity.getRider().getForward() != 0 || entity.getRider().getStrafe() != 0) ? 2.0D : 1.0D))); // Purpur - if (this.j-- <= 0) { - this.j = this.k.eJ(); - if (this.l) { -@@ -549,7 +595,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { - this.a.q(0.0F); - } - } else { -- this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED))); -+ this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED) * (entity.hasRider() && (entity.getRider().getForward() != 0 || entity.getRider().getStrafe() != 0) ? 2.0D : 1.0D))); // Purpur - } - - } -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index c39f3c06eb199a24f32a5c581e877073b580502c..e370de0ade49ac81d746588bf0991101eba0ce2d 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -14,12 +14,26 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index 44119f52a4f169ffcea53fb69393bfedfd1a62a7..cfcf67e99ae345f77a55771e6a25bdcdb4a9740a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -6,6 +6,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -50,12 +51,26 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt super(entitytypes, world); } @@ -3902,7 +2269,7 @@ index c39f3c06eb199a24f32a5c581e877073b580502c..e370de0ade49ac81d746588bf0991101 this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 10, true, false, (entityliving) -> { return entityliving instanceof IMonster; })); -@@ -71,6 +85,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +@@ -107,6 +122,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt return; } @@ -3910,7 +2277,7 @@ index c39f3c06eb199a24f32a5c581e877073b580502c..e370de0ade49ac81d746588bf0991101 IBlockData iblockdata = Blocks.SNOW.getBlockData(); for (int l = 0; l < 4; ++l) { -@@ -113,7 +128,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +@@ -149,7 +165,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt if (itemstack.getItem() == Items.SHEARS && this.canShear()) { // CraftBukkit start if (!CraftEventFactory.handlePlayerShearEntityEvent(entityhuman, this, itemstack, enumhand)) { @@ -3919,7 +2286,7 @@ index c39f3c06eb199a24f32a5c581e877073b580502c..e370de0ade49ac81d746588bf0991101 } // CraftBukkit end this.shear(SoundCategory.PLAYERS); -@@ -133,7 +148,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +@@ -169,7 +185,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt return EnumInteractionResult.SUCCESS; // Purpur end } else { @@ -3928,44 +2295,27 @@ index c39f3c06eb199a24f32a5c581e877073b580502c..e370de0ade49ac81d746588bf0991101 } } -diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java -index bf68efd52f607ae353d6f84d4896926e16740523..92d74137877d096970bf9d1b4fc91beabb862b9d 100644 ---- a/src/main/java/net/minecraft/server/EntitySpider.java -+++ b/src/main/java/net/minecraft/server/EntitySpider.java -@@ -11,14 +11,28 @@ public class EntitySpider extends EntityMonster { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.spiderRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.spiderRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - this.goalSelector.a(1, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(3, new PathfinderGoalLeapAtTarget(this, 0.4F)); - this.goalSelector.a(4, new EntitySpider.PathfinderGoalSpiderMeleeAttack(this)); - this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D)); - this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); - this.targetSelector.a(2, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityHuman.class)); - this.targetSelector.a(3, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityIronGolem.class)); -diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 148e4b158734f136832e5c17bdc69634c0f294aa..70b952f10a2af547f58069977ee135469d02f84d 100644 ---- a/src/main/java/net/minecraft/server/EntitySquid.java -+++ b/src/main/java/net/minecraft/server/EntitySquid.java -@@ -26,17 +26,38 @@ public class EntitySquid extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +index 081929990a8208f643d298a885acc4ddfa401bfb..10e228a36b213a87e17f26a633adfca18a006e94 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +@@ -3,6 +3,7 @@ package net.minecraft.world.entity.animal; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.particles.Particles; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -22,6 +23,7 @@ import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; ++import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.state.IBlockData; +@@ -53,17 +55,38 @@ public class EntitySquid extends EntityWaterAnimal { } // Purpur start @@ -4005,7 +2355,7 @@ index 148e4b158734f136832e5c17bdc69634c0f294aa..70b952f10a2af547f58069977ee13546 } public static AttributeProvider.Builder m() { -@@ -181,6 +202,7 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -208,6 +231,7 @@ public class EntitySquid extends EntityWaterAnimal { return blockposition.getY() > generatoraccess.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && blockposition.getY() < maxHeight; // Spigot // Paper } @@ -4013,7 +2363,7 @@ index 148e4b158734f136832e5c17bdc69634c0f294aa..70b952f10a2af547f58069977ee13546 public void a(float f, float f1, float f2) { this.bw = f; this.bx = f1; -@@ -252,7 +274,7 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -279,7 +303,7 @@ public class EntitySquid extends EntityWaterAnimal { class PathfinderGoalSquid extends PathfinderGoal { @@ -4022,7 +2372,7 @@ index 148e4b158734f136832e5c17bdc69634c0f294aa..70b952f10a2af547f58069977ee13546 public PathfinderGoalSquid(EntitySquid entitysquid) { this.b = entitysquid; -@@ -265,6 +287,38 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -292,6 +316,38 @@ public class EntitySquid extends EntityWaterAnimal { @Override public void e() { @@ -4061,63 +2411,11 @@ index 148e4b158734f136832e5c17bdc69634c0f294aa..70b952f10a2af547f58069977ee13546 int i = this.b.dd(); if (i > 100) { -diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java -index f35203a5074f520f617f7756bbbc9eecdda08937..56b72132595db5bc9addf31aecde5c13c5fd44c2 100644 ---- a/src/main/java/net/minecraft/server/EntityStrider.java -+++ b/src/main/java/net/minecraft/server/EntityStrider.java -@@ -28,6 +28,18 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab - this.a(PathType.DAMAGE_FIRE, 0.0F); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.striderRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.striderRidableInWater; -+ } -+ // Purpur end -+ - public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i(); - -@@ -89,6 +101,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab - @Override - protected void initPathfinder() { - this.bv = new PathfinderGoalPanic(this, 1.65D); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, this.bv); - this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); - this.bu = new PathfinderGoalTempt(this, 1.4D, false, EntityStrider.bp); -@@ -368,7 +381,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab - if (!enuminteractionresult.a()) { - ItemStack itemstack = entityhuman.b(enumhand); - -- return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : EnumInteractionResult.PASS; -+ return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : tryRide(entityhuman, enumhand); // Purpur - } else { - if (flag && !this.isSilent()) { - this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_STRIDER_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); -diff --git a/src/main/java/net/minecraft/server/EntityTameableAnimal.java b/src/main/java/net/minecraft/server/EntityTameableAnimal.java -index 9e008d56bb88550f399008095734436a5ab768c7..8f227678dc4ab1b7369a0c76173b3f695a570620 100644 ---- a/src/main/java/net/minecraft/server/EntityTameableAnimal.java -+++ b/src/main/java/net/minecraft/server/EntityTameableAnimal.java -@@ -130,6 +130,7 @@ public abstract class EntityTameableAnimal extends EntityAnimal { - return this.i(entityliving) ? false : super.c(entityliving); - } - -+ public boolean isOwner(EntityLiving entityLiving) { return i(entityLiving); } // Purpur - OBFHELPER - public boolean i(EntityLiving entityliving) { - return entityliving == this.getOwner(); - } -diff --git a/src/main/java/net/minecraft/server/EntityTropicalFish.java b/src/main/java/net/minecraft/server/EntityTropicalFish.java -index 495c28ccb86a5645459c9265c90dfffb6972d604..2c9df356e685ea6f71653023fadcf7e287dcd46e 100644 ---- a/src/main/java/net/minecraft/server/EntityTropicalFish.java -+++ b/src/main/java/net/minecraft/server/EntityTropicalFish.java -@@ -19,6 +19,18 @@ public class EntityTropicalFish extends EntityFishSchool { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java b/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java +index 29f6835da58c73a99fe620d6de7d86fede6ac893..478e55475ccc1410a442f4e30a1cbc08f479dbda 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java +@@ -37,6 +37,18 @@ public class EntityTropicalFish extends EntityFishSchool { super(entitytypes, world); } @@ -4136,11 +2434,19 @@ index 495c28ccb86a5645459c9265c90dfffb6972d604..2c9df356e685ea6f71653023fadcf7e2 @Override protected void initDatawatcher() { super.initDatawatcher(); -diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 4ad393bc99881d813e2b349fb929fc8e69631723..2b34e6cf3b86319bd2875d92b63902889fec32a8 100644 ---- a/src/main/java/net/minecraft/server/EntityTurtle.java -+++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -27,6 +27,18 @@ public class EntityTurtle extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +index ecec8a3c4d4b5d491f79ad60d7ce5a118f30b3db..28d6e673f55fc8fae40dff4a96ac2c2b5eeab9d6 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +@@ -15,6 +15,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.MCUtil; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; +@@ -90,6 +91,18 @@ public class EntityTurtle extends EntityAnimal { this.G = 1.0F; } @@ -4159,7 +2465,7 @@ index 4ad393bc99881d813e2b349fb929fc8e69631723..2b34e6cf3b86319bd2875d92b6390288 public void setHomePos(BlockPosition blockposition) { this.datawatcher.set(EntityTurtle.bp, blockposition.immutableCopy()); // Paper - called with mutablepos... } -@@ -135,12 +147,13 @@ public class EntityTurtle extends EntityAnimal { +@@ -198,12 +211,13 @@ public class EntityTurtle extends EntityAnimal { @Override protected void initPathfinder() { @@ -4179,7 +2485,7 @@ index 4ad393bc99881d813e2b349fb929fc8e69631723..2b34e6cf3b86319bd2875d92b6390288 this.goalSelector.a(7, new EntityTurtle.j(this, 1.0D)); this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); this.goalSelector.a(9, new EntityTurtle.h(this, 1.0D, 100)); -@@ -323,13 +336,15 @@ public class EntityTurtle extends EntityAnimal { +@@ -386,13 +400,15 @@ public class EntityTurtle extends EntityAnimal { } } @@ -4198,7 +2504,7 @@ index 4ad393bc99881d813e2b349fb929fc8e69631723..2b34e6cf3b86319bd2875d92b6390288 } private void g() { -@@ -349,7 +364,18 @@ public class EntityTurtle extends EntityAnimal { +@@ -412,7 +428,18 @@ public class EntityTurtle extends EntityAnimal { } @Override @@ -4218,261 +2524,586 @@ index 4ad393bc99881d813e2b349fb929fc8e69631723..2b34e6cf3b86319bd2875d92b6390288 this.g(); if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().m()) { double d0 = this.b - this.i.locX(); -diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index 9a33866e7529e1636c228bab01205737bc678b47..9336fbbd46c7c6ac11adf8e4cc2735f81c9ed639 100644 ---- a/src/main/java/net/minecraft/server/EntityVex.java -+++ b/src/main/java/net/minecraft/server/EntityVex.java -@@ -18,6 +18,45 @@ public class EntityVex extends EntityMonster { - this.f = 3; +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index b44b1544f401c1a5127bed3239bfd60420d17329..3fbd8f9122d7a5ac23af4d872f877030644ef86a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -91,9 +92,27 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + this.setTamed(false); } + // Purpur start + @Override + public boolean isRidable() { -+ return world.purpurConfig.vexRidable; ++ return world.purpurConfig.wolfRidable; + } + + @Override + public boolean isRidableInWater() { -+ return world.purpurConfig.vexRidableInWater; ++ return world.purpurConfig.wolfRidableInWater; + } + -+ @Override -+ public double getMaxY() { -+ return world.purpurConfig.vexMaxY; -+ } -+ -+ @Override -+ public void g(Vec3D vec3d) { -+ super.g(vec3d); -+ if (hasRider()) { -+ float speed; -+ if (onGround) { -+ speed = (float) getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.1F; -+ } else { -+ speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); -+ } -+ setSpeed(speed); -+ Vec3D mot = getMot(); -+ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); -+ setMot(mot.a(0.9D)); -+ } -+ } -+ -+ @Override -+ public boolean b(float f, float f1) { -+ return false; // no fall damage please -+ } -+ // Purpur end -+ - @Override - public void move(EnumMoveType enummovetype, Vec3D vec3d) { - super.move(enummovetype, vec3d); -@@ -26,7 +65,7 @@ public class EntityVex extends EntityMonster { - - @Override - public void tick() { -- this.noclip = true; -+ this.noclip = !hasRider(); // Purpur - super.tick(); - this.noclip = false; - this.setNoGravity(true); -@@ -41,17 +80,19 @@ public class EntityVex extends EntityMonster { - protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(4, new EntityVex.a()); - this.goalSelector.a(8, new EntityVex.d()); - this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error - this.targetSelector.a(2, new EntityVex.b(this)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - } - - public static AttributeProvider.Builder m() { -- return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 14.0D).a(GenericAttributes.ATTACK_DAMAGE, 4.0D); -+ return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 14.0D).a(GenericAttributes.ATTACK_DAMAGE, 4.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur - } - - @Override -@@ -283,14 +324,14 @@ public class EntityVex extends EntityMonster { - } - } - -- class c extends ControllerMove { -+ class c extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur - - public c(EntityVex entityvex) { - super(entityvex); - } - - @Override -- public void a() { -+ public void tick() { // Purpur - if (this.h == ControllerMove.Operation.MOVE_TO) { - Vec3D vec3d = new Vec3D(this.b - EntityVex.this.locX(), this.c - EntityVex.this.locY(), this.d - EntityVex.this.locZ()); - double d0 = vec3d.f(); -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 762f1acf435c6e7b6d695fc1b2120de0116f46da..15e052cb844df310c62d8a5695e8da6c633d94b6 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -73,8 +73,19 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - } - - // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.villagerRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.villagerRidableInWater; -+ } -+ - @Override - protected void initPathfinder() { -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS)); - } - -@@ -239,7 +250,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - if (itemstack.getItem() != Items.VILLAGER_SPAWN_EGG && this.isAlive() && !this.eN() && !this.isSleeping()) { - if (this.isBaby()) { - this.fk(); -- return EnumInteractionResult.a(this.world.isClientSide); -+ return super.b(entityhuman, enumhand); // Purpur - } else { - boolean flag = this.getOffers().isEmpty(); - -@@ -252,8 +263,9 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - } - - if (flag) { -- return EnumInteractionResult.a(this.world.isClientSide); -+ return tryRide(entityhuman, enumhand); // Purpur - } else { -+ if (world.purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(entityhuman, enumhand); // Purpur - if (!this.world.isClientSide && !this.trades.isEmpty()) { - this.h(entityhuman); - } -diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index 432956d9d5f2706014d67232b88e6b86011484f3..b9418fac0a05d4bb5f8f215a5704bba332e3f7cb 100644 ---- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java -+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -@@ -25,6 +25,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { - @Override - protected void initPathfinder() { - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(0, new PathfinderGoalUseItem<>(this, PotionUtil.a(new ItemStack(Items.POTION), Potions.INVISIBILITY), SoundEffects.ENTITY_WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { - return this.world.isNight() && !entityvillagertrader.isInvisible(); - })); -@@ -50,6 +51,16 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { - } - - // Purpur - start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.villagerTraderRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.villagerTraderRidableInWater; -+ } -+ - @Override - public boolean a(EntityHuman entityhuman) { - return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed(); -@@ -77,8 +88,9 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { - } - - if (this.getOffers().isEmpty()) { -- return EnumInteractionResult.a(this.world.isClientSide); -+ return tryRide(entityhuman, enumhand); // Purpur - } else { -+ if (world.purpurConfig.villagerTraderRidable && itemstack.isEmpty()) return tryRide(entityhuman, enumhand); // Purpur - if (!this.world.isClientSide) { - this.setTradingPlayer(entityhuman); - this.openTrade(entityhuman, this.getScoreboardDisplayName(), 1); -diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 23b350f793539672b6990327ed52e9bb3bdbf54e..f1bc6a4199d788215c2e7d5a835211d16603a6d9 100644 ---- a/src/main/java/net/minecraft/server/EntityVindicator.java -+++ b/src/main/java/net/minecraft/server/EntityVindicator.java -@@ -18,14 +18,28 @@ public class EntityVindicator extends EntityIllagerAbstract { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.vindicatorRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.vindicatorRidableInWater; ++ public void onMount(EntityHuman entityhuman) { ++ super.onMount(entityhuman); ++ setSitting(false); + } + // Purpur end + @Override protected void initPathfinder() { - super.initPathfinder(); - this.goalSelector.a(0, new PathfinderGoalFloat(this)); -+ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(1, new EntityVindicator.a(this)); - this.goalSelector.a(2, new EntityIllagerAbstract.b(this)); - this.goalSelector.a(3, new EntityRaider.a(this, 10.0F)); - this.goalSelector.a(4, new EntityVindicator.c(this)); -+ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Paper - decompile fix - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); -diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index ca3c5150bcfe2a92b49ad5a27c23dd37a7054fbb..323d79a99402b0f6952b4fb873170069f3428953 100644 ---- a/src/main/java/net/minecraft/server/EntityWitch.java -+++ b/src/main/java/net/minecraft/server/EntityWitch.java -@@ -24,6 +24,18 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { - super(entitytypes, world); - } - -+ // Purpur start -+ @Override -+ public boolean isRidable() { -+ return world.purpurConfig.witchRidable; -+ } -+ -+ @Override -+ public boolean isRidableInWater() { -+ return world.purpurConfig.witchRidableInWater; -+ } -+ // Purpur end -+ - @Override - protected void initPathfinder() { - super.initPathfinder(); -@@ -32,10 +44,12 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { - }); - this.bs = new PathfinderGoalNearestAttackableTargetWitch<>(this, EntityHuman.class, 10, true, false, (Predicate) null); this.goalSelector.a(1, new PathfinderGoalFloat(this)); + this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, 1.0D, 60, 10.0F)); - this.goalSelector.a(2, new PathfinderGoalRandomStrollLand(this, 1.0D)); - this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(3, new PathfinderGoalRandomLookaround(this)); + this.goalSelector.a(2, new PathfinderGoalSit(this)); + this.goalSelector.a(3, new EntityWolf.a<>(this, EntityLlama.class, 24.0F, 1.5D, 1.5D)); + this.goalSelector.a(4, new PathfinderGoalLeapAtTarget(this, 0.4F)); +@@ -104,6 +123,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + this.goalSelector.a(9, new PathfinderGoalBeg(this, 8.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(10, new PathfinderGoalRandomLookaround(this)); + this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})); - this.targetSelector.a(2, this.br); - this.targetSelector.a(3, this.bs); -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465dfc017cec 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -32,6 +32,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + this.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(this)); + this.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(this)); + this.targetSelector.a(3, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +index 48f67652a0a6797e217ce1f6040b5dc0f7a74938..650f13b1133e4c61f71b36f3f91a9d2913996435 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +@@ -41,6 +41,13 @@ public class EntityHorse extends EntityHorseAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.horseRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void eK() { + this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue((double) this.fp()); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +index cb6e2053d1315b65812e7bff8a17988b5b8ab0e4..d4556fa190c754406d0c65baae941fb23af3f81f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +@@ -14,6 +14,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHorseHasRider; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.server.players.NameReferencingFileConverter; +@@ -43,6 +44,8 @@ import net.minecraft.world.entity.IJumpable; + import net.minecraft.world.entity.ISaddleable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.control.ControllerLook; ++import net.minecraft.world.entity.ai.control.ControllerMove; + import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowParent; +@@ -101,12 +104,27 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + + protected EntityHorseAbstract(EntityTypes entitytypes, World world) { + super(entitytypes, world); ++ this.moveController = new ControllerMove(this); // Purpur - use vanilla controller ++ this.lookController = new ControllerLook(this); // Purpur - use vanilla controller + this.G = 1.0F; + this.loadChest(); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return false; // vanilla handles ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return false; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur + this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.2D)); + this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D)); + this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D, EntityHorseAbstract.class)); +@@ -114,6 +132,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven + this.goalSelector.a(6, new PathfinderGoalRandomStrollLand(this, 0.7D)); + this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur + this.eV(); + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +index d9c87411f5c636bee3f28b724abf665826788be4..50700bf85a296b87fe3155651f869e2bbdb0875d 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +@@ -16,6 +16,13 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.donkeyRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected SoundEffect getSoundAmbient() { + super.getSoundAmbient(); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +index 7a5c14c1e80bde623473a39acb01b78b79d593e4..b6385a23050296611dbc8864b92d2cdd8321a1d0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +@@ -15,6 +15,12 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.muleRidableInWater; ++ } ++ // Purpur end + @Override + protected SoundEffect getSoundAmbient() { + super.getSoundAmbient(); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +index da5365372e89b847d626e52c5541544467f14702..d21399fbb6ddc4f26a7509ce547f8c4ad6458089 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +@@ -17,6 +17,7 @@ import net.minecraft.world.entity.EnumMonsterType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; +@@ -32,6 +33,18 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.skeletonHorseRidableInWater; ++ } ++ ++ @Override ++ public boolean isTamed() { ++ return true; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder eL() { + return fi().a(GenericAttributes.MAX_HEALTH, 15.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); + } +@@ -42,7 +55,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + } + + @Override +- protected void eV() {} ++ protected void eV() { if (world.purpurConfig.skeletonHorseCanSwim) goalSelector.a(0, new PathfinderGoalFloat(this)); } // Purpur + + @Override + protected SoundEffect getSoundAmbient() { +@@ -137,7 +150,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + + @Override + public boolean bt() { +- return true; ++ return super.bt(); // Purpur + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +index 2e448a40dbf2fa5b4df4493f14738210615bab38..d57e7c02268e5d8a00b0b5897fa03dcee10cd2e0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +@@ -13,6 +13,7 @@ import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMonsterType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; +@@ -24,6 +25,18 @@ public class EntityHorseZombie extends EntityHorseAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.zombieHorseRidableInWater; ++ } ++ ++ @Override ++ public boolean isTamed() { ++ return true; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder eL() { + return fi().a(GenericAttributes.MAX_HEALTH, 15.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); + } +@@ -95,5 +108,5 @@ public class EntityHorseZombie extends EntityHorseAbstract { + } + + @Override +- protected void eV() {} ++ protected void eV() { if (world.purpurConfig.zombieHorseCanSwim) goalSelector.a(0, new PathfinderGoalFloat(this)); } // Purpur + } +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +index 1c6435bf2cd870b795f87368057d8dfc1e1c938a..d1bd7b9a6a8cfb6b609db4229b2f42a40b8b484f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +@@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHorseHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -68,7 +69,46 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + + public EntityLlama(EntityTypes entitytypes, World world) { + super(entitytypes, world); ++ // Purpur start ++ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASD(this) { ++ @Override ++ public void a() { // tick ++ if (entity.hasRider() && hasSaddle()) { ++ tick(entity.getRider()); ++ } else { ++ tick(); ++ } ++ } ++ }; ++ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { ++ @Override ++ public void a() { // tick ++ if (entity.hasRider() && hasSaddle()) { ++ tick(entity.getRider()); ++ } else { ++ tick(); ++ } ++ } ++ }; ++ // Purpur end ++ } ++ ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.llamaRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.llamaRidableInWater; ++ } ++ ++ @Override ++ public boolean hasSaddle() { ++ return super.hasSaddle() || (isTamed() && getColor() != null); + } ++ // Purpur end + + public void setStrength(int i) { + this.datawatcher.set(EntityLlama.bx, Math.max(1, Math.min(5, i))); +@@ -116,6 +156,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + @Override + protected void initPathfinder() { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur + this.goalSelector.a(1, new PathfinderGoalTame(this, 1.2D)); + this.goalSelector.a(2, new PathfinderGoalLlamaFollow(this, 2.0999999046325684D)); + this.goalSelector.a(3, new PathfinderGoalArrowAttack(this, 1.25D, 40, 20.0F)); +@@ -125,6 +166,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + this.goalSelector.a(6, new PathfinderGoalRandomStrollLand(this, 0.7D)); + this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHorseHasRider(this)); // Purpur + this.targetSelector.a(1, new EntityLlama.c(this)); + this.targetSelector.a(2, new EntityLlama.a(this)); + } +@@ -362,7 +404,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + } + + @Nullable +- public EnumColor fy() { ++ public EnumColor fy() { return getColor(); } public EnumColor getColor() { // Purpur - OBFHELPER + int i = (Integer) this.datawatcher.get(EntityLlama.by); + + return i == -1 ? null : EnumColor.fromColorIndex(i); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java +index f761e37f7329342f01f04df5602573a51c0aca4e..0fb651bcde1109b0eb30b60226d3512648dceb41 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java +@@ -27,6 +27,23 @@ public class EntityLlamaTrader extends EntityLlama { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.llamaTraderRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.llamaTraderRidableInWater; ++ } ++ ++ @Override ++ public boolean hasSaddle() { ++ return super.hasSaddle() || isTamed(); ++ } ++ // Purpur end ++ + @Override + protected EntityLlama fz() { + return (EntityLlama) EntityTypes.TRADER_LLAMA.a(this.world); +diff --git a/src/main/java/net/minecraft/world/entity/boss/EntityComplexPart.java b/src/main/java/net/minecraft/world/entity/boss/EntityComplexPart.java +index f1065c2a37835d760fb57194f7edfd029f426b48..3f2065e2939be54639f44501f7aa8ee5500dfc84 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/EntityComplexPart.java ++++ b/src/main/java/net/minecraft/world/entity/boss/EntityComplexPart.java +@@ -2,11 +2,14 @@ package net.minecraft.world.entity.boss; + + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.protocol.Packet; ++import net.minecraft.world.EnumHand; ++import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; ++import net.minecraft.world.entity.player.EntityHuman; + + public class EntityComplexPart extends Entity { + +@@ -55,4 +58,11 @@ public class EntityComplexPart extends Entity { + public EntitySize a(EntityPose entitypose) { + return this.d; + } ++ ++ // Purpur start ++ @Override ++ public EnumInteractionResult a(EntityHuman entityhuman, EnumHand enumhand) { ++ return owner.isAlive() ? owner.tryRide(entityhuman, enumhand) : EnumInteractionResult.PASS; ++ } ++ // Purpur end + } +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index 3fff101637708a1a12f9a457bd3512ae94a8f884..7f583c6c15f0191219eb911d901ea28d86c11489 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -23,6 +23,7 @@ import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.IEntitySelector; +@@ -95,6 +96,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + private final int[] bK = new int[24]; + private final Path bL = new Path(); + private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() ++ private boolean hadRider; // Purpur + + public EntityEnderDragon(EntityTypes entitytypes, World world) { + super(EntityTypes.ENDER_DRAGON, world); +@@ -109,8 +111,44 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + } + + this.bG = new DragonControllerManager(this); ++ // Purpur start ++ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlying(this) { ++ @Override ++ public void tick() { ++ // dragon doesn't use the controller. do nothing ++ } ++ }; ++ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { ++ @Override ++ public void tick() { ++ // dragon doesn't use the controller. do nothing ++ } ++ ++ @Override ++ public void tick(EntityHuman rider) { ++ setYawPitch(rider.yaw - 180F, rider.pitch * 0.5F); ++ } ++ }; ++ // Purpur end ++ } ++ ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.enderDragonRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.enderDragonRidableInWater; + } + ++ @Override ++ public double getMaxY() { ++ return world.purpurConfig.enderDragonMaxY; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder m() { + return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 200.0D); + } +@@ -143,6 +181,37 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + + @Override + public void movementTick() { ++ // Purpur start ++ boolean hasRider = getRider() != null; ++ if (hasRider) { ++ if (!hadRider) { ++ hadRider = true; ++ noclip = false; ++ this.size = EntitySize.b(4.0F, 2.0F); ++ } ++ ++ // dragon doesn't use controllers, so must tick manually ++ moveController.a(); ++ lookController.a(); ++ ++ moveRelative((float) getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.1F, new Vec3D(-getStrafe(), getVertical(), -getForward())); ++ Vec3D mot = getMot(); ++ setMot(mot); ++ move(EnumMoveType.PLAYER, mot); ++ ++ mot = mot.multiply(0.9F, 0.9F, 0.9F); ++ setMot(mot); ++ ++ // control wing flap speed on client ++ getDragonControllerManager().setControllerPhase(mot.getX() * mot.getX() + mot.getZ() * mot.getZ() < 0.005F ? DragonControllerPhase.HOVER : DragonControllerPhase.HOLDING_PATTERN); ++ } else if (hadRider) { ++ hadRider = false; ++ noclip = true; ++ this.size = EntitySize.b(16.0F, 8.0F); ++ getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); // HoldingPattern ++ } ++ // Purpur end ++ + float f; + float f1; + +@@ -164,6 +233,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + + this.bp = this.bq; + if (this.dl()) { ++ if (hasRider) ejectPassengers(); // Purpur + f = (this.random.nextFloat() - 0.5F) * 8.0F; + f1 = (this.random.nextFloat() - 0.5F) * 4.0F; + float f2 = (this.random.nextFloat() - 0.5F) * 8.0F; +@@ -175,9 +245,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + + f1 = 0.2F / (MathHelper.sqrt(c(vec3d)) * 10.0F + 1.0F); + f1 *= (float) Math.pow(2.0D, vec3d.y); +- if (this.bG.a().a()) { ++ if (!hasRider && this.bG.a().a()) { // Purpur + this.bq += 0.1F; +- } else if (this.br) { ++ } else if (!hasRider && this.br) { // Purpur + this.bq += f1 * 0.5F; + } else { + this.bq += f1; +@@ -221,7 +291,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + } + + this.bG.a().b(); +- } else { ++ } else if (!hasRider) { // Purpur + IDragonController idragoncontroller = this.bG.a(); + + idragoncontroller.c(); +@@ -288,7 +358,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + this.a(this.bz, (double) (f11 * 0.5F), 0.0D, (double) (-f12 * 0.5F)); + this.a(this.bD, (double) (f12 * 4.5F), 2.0D, (double) (f11 * 4.5F)); + this.a(this.bE, (double) (f12 * -4.5F), 2.0D, (double) (f11 * -4.5F)); +- if (!this.world.isClientSide && this.hurtTicks == 0) { ++ if (!hasRider && !this.world.isClientSide && this.hurtTicks == 0) { // Purpur + this.a(this.world.getEntities(this, this.bD.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); + this.a(this.world.getEntities(this, this.bE.getBoundingBox().grow(4.0D, 2.0D, 4.0D).d(0.0D, -2.0D, 0.0D), IEntitySelector.e)); + this.b(this.world.getEntities(this, this.bo.getBoundingBox().g(1.0D), IEntitySelector.e)); +@@ -331,7 +401,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + } + + if (!this.world.isClientSide) { +- this.br = this.b(this.bo.getBoundingBox()) | this.b(this.by.getBoundingBox()) | this.b(this.bz.getBoundingBox()); ++ this.br = !hasRider && this.b(this.bo.getBoundingBox()) | this.b(this.by.getBoundingBox()) | this.b(this.bz.getBoundingBox()); // Purpur + if (this.bF != null) { + this.bF.b(this); + } +diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +index 930fc752ec0a988b17bc556cd428161638a14f27..4c0a555cdb5bc34c73040b9533beaee56cbce70a 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java ++++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +@@ -12,6 +12,7 @@ import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.BossBattleServer; + import net.minecraft.server.level.EntityPlayer; + import net.minecraft.sounds.SoundEffect; +@@ -20,6 +21,7 @@ import net.minecraft.tags.TagsBlock; + import net.minecraft.util.MathHelper; + import net.minecraft.world.BossBattle; + import net.minecraft.world.EnumDifficulty; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.effect.MobEffect; + import net.minecraft.world.effect.MobEffects; +@@ -28,6 +30,7 @@ import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMonsterType; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; +@@ -48,8 +51,12 @@ import net.minecraft.world.item.Items; + import net.minecraft.world.level.Explosion; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.IMaterial; ++import net.minecraft.world.level.RayTrace; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.phys.MovingObjectPosition; ++import net.minecraft.world.phys.MovingObjectPositionBlock; ++import net.minecraft.world.phys.MovingObjectPositionEntity; + import net.minecraft.world.phys.Vec3D; + + // CraftBukkit start +@@ -82,6 +89,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { return entityliving.getMonsterType() != EnumMonsterType.UNDEAD && entityliving.ei(); }; private static final PathfinderTargetCondition bz = (new PathfinderTargetCondition()).a(20.0D).a(EntityWither.by); @@ -4480,7 +3111,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d // Paper start private boolean canPortal = false; -@@ -44,15 +45,122 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -94,15 +102,122 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.setHealth(this.getMaxHealth()); this.getNavigation().d(true); this.f = 50; @@ -4604,7 +3235,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); if(this.world.paperConfig.fixWitherTargetingBug) this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 0, false, false, null)); // Paper - Fix MC-29274 this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 0, false, false, EntityWither.by)); -@@ -195,6 +303,16 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -245,6 +360,16 @@ public class EntityWither extends EntityMonster implements IRangedEntity { @Override protected void mobTick() { @@ -4621,7 +3252,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d int i; if (this.getInvul() > 0) { -@@ -378,7 +496,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -428,7 +553,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.bossBattle.removePlayer(entityplayer); } @@ -4630,7 +3261,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d if (i <= 0) { return this.locX(); } else { -@@ -389,11 +507,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -439,11 +564,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } @@ -4644,7 +3275,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d if (i <= 0) { return this.locZ(); } else { -@@ -517,7 +635,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -567,7 +692,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } public static AttributeProvider.Builder eK() { @@ -4653,7 +3284,7 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d } public int getInvul() { -@@ -529,11 +647,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -579,11 +704,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } public int getHeadTarget(int i) { @@ -4667,28 +3298,408 @@ index 3230c5454ccc39a2e3c89fdf8ca015cf7a15f380..e7c558e268f77cc6451b3a8fe502465d } public final boolean isPowered() { return this.S_(); } // Paper - OBFHELPER -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index dcbb34313fedb21e180a0b76610a787e6419d404..9ae7168595dd66860e09ef87f946b18b010e54b1 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -33,9 +33,27 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable - this.setTamed(false); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +index 88a4dcf9feaa5f66da1394c139b795582c00a8ac..9a109ed062e5abedaad295383aca6441321da276 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +@@ -5,6 +5,7 @@ import net.minecraft.core.particles.Particles; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; +@@ -12,6 +13,7 @@ import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; +@@ -35,6 +37,7 @@ public class EntityBlaze extends EntityMonster { + + public EntityBlaze(EntityTypes entitytypes, World world) { + super(entitytypes, world); ++ this.moveController = new net.pl3x.purpur.controller.ControllerMoveWASDFlyingWithSpacebar(this, 0.3F); // Purpur + this.a(PathType.WATER, -1.0F); + this.a(PathType.LAVA, 8.0F); + this.a(PathType.DANGER_FIRE, 0.0F); +@@ -42,19 +45,50 @@ public class EntityBlaze extends EntityMonster { + this.f = 10; } + // Purpur start + @Override + public boolean isRidable() { -+ return world.purpurConfig.wolfRidable; ++ return world.purpurConfig.blazeRidable; + } + + @Override + public boolean isRidableInWater() { -+ return world.purpurConfig.wolfRidableInWater; ++ return world.purpurConfig.blazeRidableInWater; + } + ++ @Override ++ public double getMaxY() { ++ return world.purpurConfig.blazeMaxY; ++ } ++ ++ @Override ++ public void g(Vec3D vec3d) { ++ super.g(vec3d); ++ if (hasRider() && !onGround) { ++ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); ++ setSpeed(speed); ++ Vec3D mot = getMot(); ++ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); ++ setMot(mot.a(0.9D)); ++ } ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(4, new EntityBlaze.PathfinderGoalBlazeFireball(this)); + this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D)); + this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F)); + this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur ++ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + } + + public static AttributeProvider.Builder m() { +- return EntityMonster.eR().a(GenericAttributes.ATTACK_DAMAGE, 6.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.23000000417232513D).a(GenericAttributes.FOLLOW_RANGE, 48.0D); ++ return EntityMonster.eR().a(GenericAttributes.ATTACK_DAMAGE, 6.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.23000000417232513D).a(GenericAttributes.FOLLOW_RANGE, 48.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur + } + + @Override +@@ -109,6 +143,14 @@ public class EntityBlaze extends EntityMonster { + + @Override + protected void mobTick() { ++ // Purpur start ++ if (hasRider()) { ++ Vec3D mot = getMot(); ++ setMot(mot.x, getVertical() > 0 ? 0.07D : -0.07D, mot.z); ++ return; ++ } ++ // Purpur end ++ + --this.c; + if (this.c <= 0) { + this.c = 100; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java b/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java +index 65d0027186f19f10292ea64976ebb93c12b98394..27baf5cde99d8f25b1e7583c30339fcc71a3786f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java +@@ -24,6 +24,18 @@ public class EntityCaveSpider extends EntitySpider { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.caveSpiderRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.caveSpiderRidableInWater; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder m() { + return EntitySpider.eK().a(GenericAttributes.MAX_HEALTH, 12.0D); + } +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +index f1ff9a323eaa636b21e64860d2a83a2ba6c164ea..e29bba9143f027077c1051d61296df219cd45861 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +@@ -6,6 +6,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -58,12 +59,27 @@ public class EntityCreeper extends EntityMonster { + public int maxFuseTicks = 30; + public int explosionRadius = 3; + private int bs; ++ // Purpur start ++ private int spacebarCharge = 0; ++ private int prevSpacebarCharge = 0; ++ private int powerToggleDelay = 0; ++ // Purpur end + + public EntityCreeper(EntityTypes entitytypes, World world) { + super(entitytypes, world); + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.creeperRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.creeperRidableInWater; ++ } ++ + @Override + public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) { + double chance = worldaccess.getMinecraftWorld().purpurConfig.creeperChargedChance; +@@ -72,18 +88,69 @@ public class EntityCreeper extends EntityMonster { + } + return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); + } ++ ++ @Override ++ protected void mobTick() { ++ if (powerToggleDelay > 0) { ++ powerToggleDelay--; ++ } ++ if (hasRider()) { ++ if (getRider().getForward() != 0 || getRider().getStrafe() != 0) { ++ spacebarCharge = 0; ++ setIgnited(false); ++ } ++ if (spacebarCharge == prevSpacebarCharge) { ++ spacebarCharge = 0; ++ } ++ prevSpacebarCharge = spacebarCharge; ++ } ++ super.mobTick(); ++ } ++ ++ @Override + public void onMount(EntityHuman entityhuman) { + super.onMount(entityhuman); -+ setSitting(false); ++ setIgnited(false); ++ } ++ ++ @Override ++ public boolean onSpacebar() { ++ if (powerToggleDelay > 0) { ++ return true; // just toggled power, do not jump or ignite ++ } ++ spacebarCharge++; ++ if (spacebarCharge > maxFuseTicks - 2) { ++ spacebarCharge = 0; ++ if (getRider().getBukkitEntity().hasPermission("allow.powered.creeper")) { ++ powerToggleDelay = 20; ++ setPowered(!isPowered()); ++ setIgnited(false); ++ return true; ++ } ++ } ++ if (!isIgnited()) { ++ if (hasRider() && getRider().getForward() == 0 && getRider().getStrafe() == 0 && ++ getRider().getBukkitEntity().hasPermission("allow.special.creeper")) { ++ setIgnited(true); ++ return true; ++ } ++ } ++ return getForward() == 0 && getStrafe() == 0; // do not jump if standing still ++ } + // Purpur end + + @Override + protected void initPathfinder() { + this.goalSelector.a(1, new PathfinderGoalFloat(this)); + this.goalSelector.a(2, new PathfinderGoalSwell(this)); ++ this.goalSelector.a(3, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); + this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityCat.class, 6.0F, 1.0D, 1.2D)); + this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false)); + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); + } +@@ -214,6 +281,7 @@ public class EntityCreeper extends EntityMonster { + return (Integer) this.datawatcher.get(EntityCreeper.b); + } + ++ public void setSwellDirection(int i) { a(i); } // Purpur - OBFHELPER + public void a(int i) { + this.datawatcher.set(EntityCreeper.b, i); + } +@@ -314,6 +382,7 @@ public class EntityCreeper extends EntityMonster { + com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited); + if (event.callEvent()) { + this.datawatcher.set(EntityCreeper.d, event.isIgnited()); ++ if (!event.isIgnited()) setSwellDirection(-1); // Purpur + } + } + // Paper end +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +index ea776755767f29e49de2792afa30f79420d0fa4c..1d4039d61a2c77a38a31947010cee26f41c0becd 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +@@ -73,6 +73,16 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.drownedRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.drownedRidableInWater; ++ } ++ + @Override + public boolean jockeyOnlyBaby() { + return world.purpurConfig.drownedJockeyOnlyBaby; +@@ -270,7 +280,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + this.d = flag; + } + +- static class d extends ControllerMove { ++ static class d extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur + + private final EntityDrowned i; + +@@ -280,7 +290,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + } + + @Override +- public void a() { ++ public void tick() { // Purpur + EntityLiving entityliving = this.i.getGoalTarget(); + + if (this.i.eW() && this.i.isInWater()) { +@@ -313,7 +323,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + this.i.setMot(this.i.getMot().add(0.0D, -0.008D, 0.0D)); + } + +- super.a(); ++ super.tick(); // Purpur + } + + } +@@ -452,6 +462,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + this.a = entitydrowned; + this.b = d0; + this.c = i; ++ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - swim up + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 52aa47036acee2ec21ae2d6f4df634ecbf04b3b0..03fa2cfc1d5bc27e03e9979b3f33d88362c19066 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -85,9 +86,22 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + this.a(PathType.WATER, -1.0F); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.endermanRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.endermanRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new EntityEnderman.a(this)); + this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); + this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D, 0.0F)); +@@ -95,6 +109,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); + this.goalSelector.a(10, new EntityEnderman.PathfinderGoalEndermanPlaceBlock(this)); + this.goalSelector.a(11, new EntityEnderman.PathfinderGoalEndermanPickupBlock(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new EntityEnderman.PathfinderGoalPlayerWhoLookedAtTarget(this, this::a_)); + this.targetSelector.a(2, new PathfinderGoalHurtByTarget(this, new Class[0])); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityEndermite.class, 10, true, false, EntityEnderman.bq)); +@@ -275,7 +290,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + @Override + protected void mobTick() { +- if (this.world.isDay() && this.ticksLived >= this.bs + 600) { ++ if (!hasRider() && this.world.isDay() && this.ticksLived >= this.bs + 600) { // Purpur - no random teleporting + float f = this.aR(); + + if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper +@@ -384,6 +399,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (this.isInvulnerable(damagesource)) { + return false; + } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height ++ } else if (hasRider()) { return super.damageEntity(damagesource, f); // Purpur - no teleporting on damage + } else if (damagesource instanceof EntityDamageSourceIndirect) { + if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start + for (int i = 0; i < 64; ++i) { +@@ -428,6 +444,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + public PathfinderGoalEndermanPickupBlock(EntityEnderman entityenderman) { + this.enderman = entityenderman; ++ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur + } + + @Override +@@ -470,6 +487,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { + this.a = entityenderman; ++ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java b/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java +index 906ac1f861241a184819b4b113abe56625ff5e60..1c87bea9de812e57f8ccd3c9aa85330af87ed240 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java +@@ -4,6 +4,7 @@ import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.particles.Particles; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.damagesource.DamageSource; +@@ -36,14 +37,28 @@ public class EntityEndermite extends EntityMonster { + this.f = 3; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.endermiteRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.endermiteRidableInWater; + } + // Purpur end + @@ -4696,22 +3707,1353 @@ index dcbb34313fedb21e180a0b76610a787e6419d404..9ae7168595dd66860e09ef87f946b18b protected void initPathfinder() { this.goalSelector.a(1, new PathfinderGoalFloat(this)); + this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur - this.goalSelector.a(2, new PathfinderGoalSit(this)); - this.goalSelector.a(3, new EntityWolf.a<>(this, EntityLlama.class, 24.0F, 1.5D, 1.5D)); - this.goalSelector.a(4, new PathfinderGoalLeapAtTarget(this, 0.4F)); -@@ -46,6 +64,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable - this.goalSelector.a(9, new PathfinderGoalBeg(this, 8.0F)); - this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); - this.goalSelector.a(10, new PathfinderGoalRandomLookaround(this)); + this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); + this.goalSelector.a(3, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); +- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a()); + this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur - this.targetSelector.a(1, new PathfinderGoalOwnerHurtByTarget(this)); - this.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(this)); - this.targetSelector.a(3, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error -diff --git a/src/main/java/net/minecraft/server/EntityZoglin.java b/src/main/java/net/minecraft/server/EntityZoglin.java -index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b7e881889 100644 ---- a/src/main/java/net/minecraft/server/EntityZoglin.java -+++ b/src/main/java/net/minecraft/server/EntityZoglin.java -@@ -21,6 +21,18 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { ++ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // Purpur - decompile error + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +index 2aa6b6ca93c25c59ad224348aad1bb34d9bbc6a3..55607910183155080e3d96296421438d17f19c8f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +@@ -5,6 +5,7 @@ import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -19,6 +20,7 @@ import net.minecraft.world.entity.EnumMonsterType; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer; +@@ -47,10 +49,23 @@ public class EntityEvoker extends EntityIllagerWizard { + this.f = 10; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.evokerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.evokerRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new EntityEvoker.b()); + this.goalSelector.a(2, new PathfinderGoalAvoidTarget<>(this, EntityHuman.class, 8.0F, 0.6D, 1.0D)); + this.goalSelector.a(4, new EntityEvoker.c()); +@@ -59,6 +74,7 @@ public class EntityEvoker extends EntityIllagerWizard { + this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); + this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Paper - decompile fix + this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); + this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); +@@ -139,6 +155,7 @@ public class EntityEvoker extends EntityIllagerWizard { + + public d() { + super(); ++ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - wolololo spell + } + + @Override +@@ -217,6 +234,7 @@ public class EntityEvoker extends EntityIllagerWizard { + private c() { + super(); + this.e = (new PathfinderTargetCondition()).a(16.0D).c().e().a().b(); ++ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - summon spell + } + + @Override +@@ -273,6 +291,7 @@ public class EntityEvoker extends EntityIllagerWizard { + + private a() { + super(); ++ this.a(java.util.EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur - attack with spell + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +index a3e3f6e07674c54c2d2a02661ce4342b43aafe44..8784647f512d280ee0a092ecd406321268359314 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +@@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -21,6 +22,7 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.control.ControllerMove; +@@ -44,11 +46,42 @@ public class EntityGhast extends EntityFlying implements IMonster { + this.moveController = new EntityGhast.ControllerGhast(this); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.ghastRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.ghastRidableInWater; ++ } ++ ++ @Override ++ public double getMaxY() { ++ return world.purpurConfig.ghastMaxY; ++ } ++ ++ @Override ++ public void g(Vec3D vec3d) { ++ super.g(vec3d); ++ if (hasRider() && !onGround) { ++ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); ++ setSpeed(speed); ++ Vec3D mot = getMot(); ++ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); ++ setMot(mot.a(0.9D)); ++ } ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(5, new EntityGhast.PathfinderGoalGhastIdleMove(this)); + this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastMoveTowardsTarget(this)); + this.goalSelector.a(7, new EntityGhast.PathfinderGoalGhastAttackTarget(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> { + return Math.abs(entityliving.locY() - this.locY()) <= 4.0D; + })); +@@ -86,7 +119,7 @@ public class EntityGhast extends EntityFlying implements IMonster { + } + + public static AttributeProvider.Builder eJ() { +- return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 10.0D).a(GenericAttributes.FOLLOW_RANGE, 100.0D); ++ return EntityInsentient.p().a(GenericAttributes.MAX_HEALTH, 10.0D).a(GenericAttributes.FOLLOW_RANGE, 100.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur + } + + @Override +@@ -285,7 +318,7 @@ public class EntityGhast extends EntityFlying implements IMonster { + } + } + +- static class ControllerGhast extends ControllerMove { ++ static class ControllerGhast extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur + + private final EntityGhast i; + private int j; +@@ -296,7 +329,7 @@ public class EntityGhast extends EntityFlying implements IMonster { + } + + @Override +- public void a() { ++ public void tick() { // Purpur + if (this.h == ControllerMove.Operation.MOVE_TO) { + if (this.j-- <= 0) { + this.j += this.i.getRandom().nextInt(5) + 2; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +index a188a89143cb1b0243dacdec33c446ca4120219f..7395fa90198a9138b2c33273d8f3540355300029 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java +@@ -2,6 +2,7 @@ package net.minecraft.world.entity.monster; + + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.world.DifficultyDamageScaler; + import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.entity.EntityPose; +@@ -41,16 +42,28 @@ public class EntityGiantZombie extends EntityMonster { + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.giantRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.giantRidableInWater; ++ } ++ + @Override + protected void initPathfinder() { + if (world.purpurConfig.giantHaveAI) { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); + this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D)); + if (world.purpurConfig.giantHaveHostileAI) { + this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java b/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java +index d53e2a9d27f9976d1fd8ea30b88a0da089aec7b6..6980b6988549b37a33d204a6e84c9e81d384a57a 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java +@@ -9,6 +9,7 @@ import net.minecraft.core.particles.Particles; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.tags.Tag; +@@ -63,15 +64,36 @@ public class EntityGuardian extends EntityMonster { + this.f = 10; + this.a(PathType.WATER, 0.0F); + this.moveController = new EntityGuardian.ControllerMoveGuardian(this); ++ // Purpur start ++ this.lookController = new net.pl3x.purpur.controller.ControllerLookWASD(this) { ++ @Override ++ public void setYawPitch(float yaw, float pitch) { ++ super.setYawPitch(yaw, pitch * 0.35F); ++ } ++ }; ++ // Purpur end + this.bo = this.random.nextFloat(); + this.bp = this.bo; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.guardianRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return true; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + PathfinderGoalMoveTowardsRestriction pathfindergoalmovetowardsrestriction = new PathfinderGoalMoveTowardsRestriction(this, 1.0D); + + this.goalRandomStroll = new PathfinderGoalRandomStroll(this, 1.0D, 80); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(4, new EntityGuardian.PathfinderGoalGuardianAttack(this)); + this.goalSelector.a(5, pathfindergoalmovetowardsrestriction); + this.goalSelector.a(7, this.goalRandomStroll); +@@ -80,6 +102,7 @@ public class EntityGuardian extends EntityMonster { + this.goalSelector.a(9, new PathfinderGoalRandomLookaround(this)); + this.goalRandomStroll.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); + pathfindergoalmovetowardsrestriction.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityLiving.class, 10, true, false, new EntityGuardian.EntitySelectorGuardianTargetHumanSquid(this))); + } + +@@ -113,6 +136,7 @@ public class EntityGuardian extends EntityMonster { + return (Boolean) this.datawatcher.get(EntityGuardian.b); + } + ++ private void setMovingFlag(boolean movingFlag) { t(movingFlag); } // Purpur - OBFHELPER + private void t(boolean flag) { + this.datawatcher.set(EntityGuardian.b, flag); + } +@@ -327,7 +351,7 @@ public class EntityGuardian extends EntityMonster { + @Override + public void g(Vec3D vec3d) { + if (this.doAITick() && this.isInWater()) { +- this.a(0.1F, vec3d); ++ this.a(hasRider() ? getSpeed() : 0.1F, vec3d); // Purpur + this.move(EnumMoveType.SELF, this.getMot()); + this.setMot(this.getMot().a(0.9D)); + if (!this.eN() && this.getGoalTarget() == null) { +@@ -339,17 +363,26 @@ public class EntityGuardian extends EntityMonster { + + } + +- static class ControllerMoveGuardian extends ControllerMove { ++ static class ControllerMoveGuardian extends net.pl3x.purpur.controller.ControllerMoveWASDWater { // Purpur + +- private final EntityGuardian i; ++ private final EntityGuardian i; private EntityGuardian getGuardian() { return i; } // Purpur - OBFHELPER + + public ControllerMoveGuardian(EntityGuardian entityguardian) { + super(entityguardian); + this.i = entityguardian; + } + ++ // Purpur start ++ @Override ++ public void tick(EntityHuman rider) { ++ super.tick(rider); ++ getGuardian().setMot(getGuardian().getMot().add(0.0D, 0.005D, 0.0D)); ++ getGuardian().setMovingFlag(getGuardian().getForward() > 0.0F); // control tail speed ++ } ++ // Purpur end ++ + @Override +- public void a() { ++ public void tick() { // Purpur + if (this.h == ControllerMove.Operation.MOVE_TO && !this.i.getNavigation().m()) { + Vec3D vec3d = new Vec3D(this.b - this.i.locX(), this.c - this.i.locY(), this.d - this.i.locZ()); + double d0 = vec3d.f(); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java +index 9bd6f5d988c1e50e1bb729c407178b9cbcc62115..16b8606be2835dccdfa75f29827be4b88aaa1810 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java +@@ -30,6 +30,18 @@ public class EntityGuardianElder extends EntityGuardian { + + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.elderGuardianRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return true; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder m() { + return EntityGuardian.eM().a(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).a(GenericAttributes.ATTACK_DAMAGE, 8.0D).a(GenericAttributes.MAX_HEALTH, 80.0D); + } +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java +index cb092bee9d6827d4b0276bfa9b033cf7ca86ead4..5186d9957c94be359da5b08fd821e9471c159f03 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java +@@ -3,6 +3,7 @@ package net.minecraft.world.entity.monster; + import javax.annotation.Nullable; + import net.minecraft.core.particles.Particles; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; +@@ -57,6 +58,16 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.illusionerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.illusionerRidableInWater; ++ } ++ + @Override + protected void initAttributes() { + this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.illusionerMovementSpeed); +@@ -69,6 +80,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new EntityIllagerWizard.b()); + this.goalSelector.a(4, new EntityIllagerIllusioner.b()); + this.goalSelector.a(5, new EntityIllagerIllusioner.a()); +@@ -76,6 +88,7 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan + this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); + this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error + this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); + this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java b/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java +index fe80e93b00f3bb2f297c6528c3951313fa3c08c7..15ed51a2746c09538a425fce25fa25f2619b7033 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java +@@ -29,6 +29,23 @@ public class EntityMagmaCube extends EntitySlime { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.magmaCubeRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.magmaCubeRidableInWater; ++ } ++ ++ @Override ++ public float getJumpHeight() { ++ return 0.42F * this.getBlockJumpFactor(); // from EntityLiving ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder m() { + return EntityMonster.eR().a(GenericAttributes.MOVEMENT_SPEED, 0.20000000298023224D); + } +@@ -79,11 +96,12 @@ public class EntityMagmaCube extends EntitySlime { + } + + @Override +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + Vec3D vec3d = this.getMot(); + + this.setMot(vec3d.x, (double) (this.dJ() + (float) this.getSize() * 0.1F), vec3d.z); + this.impulse = true; ++ this.actualJump = false; // Purpur + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index 07ede7b75a65a5815f1ae1ebf03ec0fdb4621afb..a836839b17cbda8ac269f032b141ba448e3bab8c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -13,6 +13,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.level.WorldServer; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -29,11 +30,11 @@ import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.EnumMonsterType; ++import net.minecraft.world.entity.EnumMoveType; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.IEntitySelector; ++import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; +-import net.minecraft.world.entity.ai.control.ControllerLook; +-import net.minecraft.world.entity.ai.control.ControllerMove; + import net.minecraft.world.entity.ai.control.EntityAIBodyControl; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition; +@@ -68,6 +69,59 @@ public class EntityPhantom extends EntityFlying implements IMonster { + this.lookController = new EntityPhantom.f(this); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.phantomRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.phantomRidableInWater; ++ } ++ ++ @Override ++ public double getMaxY() { ++ return world.purpurConfig.phantomMaxY; ++ } ++ ++ @Override ++ public void g(Vec3D vec3d) { ++ super.g(vec3d); ++ if (hasRider() && !onGround) { ++ float speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); ++ setSpeed(speed); ++ Vec3D mot = getMot(); ++ move(EnumMoveType.SELF, mot.multiply(speed, speed, speed)); ++ setMot(mot.a(0.9D)); ++ } ++ } ++ ++ public static AttributeProvider.Builder defaultAttributes() { ++ return EntityMonster.eR().a(GenericAttributes.FLYING_SPEED, 3.0D); ++ } ++ ++ @Override ++ public boolean onSpacebar() { ++ if (hasRider() && getRider().getBukkitEntity().hasPermission("allow.special.phantom")) { ++ shoot(); ++ } ++ return false; ++ } ++ ++ public boolean shoot() { ++ org.bukkit.Location loc = ((org.bukkit.entity.LivingEntity) getBukkitEntity()).getEyeLocation(); ++ loc.setPitch(-loc.getPitch()); ++ org.bukkit.util.Vector target = loc.getDirection().normalize().multiply(100).add(loc.toVector()); ++ ++ net.pl3x.purpur.entity.PhantomFlames flames = new net.pl3x.purpur.entity.PhantomFlames(world, this); ++ flames.canGrief = world.purpurConfig.phantomAllowGriefing; ++ flames.shoot(target.getX() - locX(), target.getY() - locY(), target.getZ() - locZ(), 1.0F, 5.0F); ++ world.addEntity(flames); ++ return true; ++ } ++ // Purpur end ++ + @Override + protected EntityAIBodyControl r() { + return new EntityPhantom.d(this); +@@ -76,6 +130,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + @Override + protected void initPathfinder() { + // Purpur start ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); + if (world.purpurConfig.phantomOrbitCrystalRadius > 0) { + this.goalSelector.a(1, new FindCrystalGoal(this)); + this.goalSelector.a(2, new OrbitCrystalGoal(this)); +@@ -83,6 +138,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + this.goalSelector.a(3, new EntityPhantom.c()); // PickAttackGoal + this.goalSelector.a(4, new EntityPhantom.i()); // SweepAttackGoal + this.goalSelector.a(5, new EntityPhantom.e()); // OrbitPointGoal ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); + this.targetSelector.a(1, new EntityPhantom.b()); // AttackPlayer Goal + // Purpur end + } +@@ -169,7 +225,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public void movementTick() { +- if (this.isAlive() && ((world.purpurConfig.phantomBurnInDaylight && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Purpur ++ if (this.isAlive() && !hasRider() && ((world.purpurConfig.phantomBurnInDaylight && this.isInDaylight()) || (world.purpurConfig.phantomBurnInLight > 0 && world.getLightLevel(new BlockPosition(this)) >= world.purpurConfig.phantomBurnInLight))) { // Purpur + this.setOnFire(8); + } + +@@ -412,7 +468,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public boolean a() { +- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag ++ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag + if (this.c > 0) { + --this.c; + return false; +@@ -441,7 +497,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public boolean b() { +- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag ++ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag + EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); + + return entityliving != null ? EntityPhantom.this.a(entityliving, PathfinderTargetCondition.a) : false; +@@ -456,7 +512,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + + @Override + public boolean a() { +- if (isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag ++ if (getRider() != null || isCirclingCrystal()) return false; // Purpur - pathfinder does not have a flag + EntityLiving entityliving = EntityPhantom.this.getGoalTarget(); + + return entityliving != null ? EntityPhantom.this.a(EntityPhantom.this.getGoalTarget(), PathfinderTargetCondition.a) : false; +@@ -654,14 +710,23 @@ public class EntityPhantom extends EntityFlying implements IMonster { + } + } + +- class f extends ControllerLook { ++ class f extends net.pl3x.purpur.controller.ControllerLookWASD { // Purpur + + public f(EntityInsentient entityinsentient) { + super(entityinsentient); + } + + @Override +- public void a() {} ++ // Purpur start ++ public void tick(EntityHuman rider) { ++ setYawPitch(rider.yaw, -rider.pitch * 0.75F); ++ } ++ ++ @Override ++ public void tick() { ++ // do nothing ++ } ++ // Purpur end + } + + class d extends EntityAIBodyControl { +@@ -677,7 +742,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { + } + } + +- class g extends ControllerMove { ++ class g extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur + + private float j = 0.1F; + +@@ -686,7 +751,19 @@ public class EntityPhantom extends EntityFlying implements IMonster { + } + + @Override +- public void a() { ++ // Purpur start ++ public void tick(EntityHuman rider) { ++ if (!EntityPhantom.this.onGround) { ++ // phantom is always in motion when flying ++ // TODO - FIX THIS ++ // rider.setForward(1.0F); ++ } ++ super.tick(rider); ++ } ++ ++ @Override ++ public void tick() { ++ // Purpur end + if (EntityPhantom.this.positionChanged) { + EntityPhantom.this.yaw += 180.0F; + this.j = 0.1F; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +index af00a4245ca39f208810d1ec758e512cbf5648f3..816a2bd7438f66a5d7ff761b8fcf8b42483561c7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +@@ -56,6 +56,16 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.zombifiedPiglinRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.zombifiedPiglinRidableInWater; ++ } ++ + @Override + public boolean jockeyOnlyBaby() { + return world.purpurConfig.zombifiedPiglinJockeyOnlyBaby; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java b/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java +index ea105fb86553f5212d616c976eaf2a16bf5b6561..2a4ac6e608650d56cc2b564e715b7b685e7f3f62 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java +@@ -9,6 +9,7 @@ import net.minecraft.nbt.NBTTagList; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.DifficultyDamageScaler; +@@ -61,15 +62,29 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.pillagerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.pillagerRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(2, new EntityRaider.a(this, 10.0F)); + this.goalSelector.a(3, new PathfinderGoalCrossbowAttack<>(this, 1.0D, 8.0F)); + this.goalSelector.a(8, new PathfinderGoalRandomStroll(this, 0.6D)); + this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 15.0F, 1.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 15.0F)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error + 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/world/entity/monster/EntityRavager.java b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +index 16d5cae64887b82e67eeb61ccb714e6125ff0c09..dc1ca7b334e89b4d0be775b6f6e6f4222ea02dcc 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +@@ -7,6 +7,7 @@ import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.particles.Particles; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.tags.Tag; +@@ -61,14 +62,37 @@ public class EntityRavager extends EntityRaider { + this.f = 20; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.ravagerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.ravagerRidableInWater; ++ } ++ ++ @Override ++ public void onMount(EntityHuman entityhuman) { ++ super.onMount(entityhuman); ++ getNavigation().stopPathfinding(); ++ ++ double speed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue(); ++ getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(speed); ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(4, new EntityRavager.a()); + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.4D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(2, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); +@@ -140,7 +164,7 @@ public class EntityRavager extends EntityRaider { + @Override + public void movementTick() { + super.movementTick(); +- if (this.isAlive()) { ++ if (this.isAlive() && !hasRider()) { + if (this.isFrozen()) { + this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.0D); + } else { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java b/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java +index bfecaa56c3d93436d71082f1398e0ceb12336e38..0294ab119407dc45a40c8444fb5a91e154017234 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java +@@ -12,6 +12,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -71,12 +72,26 @@ public class EntityShulker extends EntityGolem implements IMonster { + this.f = 5; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.shulkerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.shulkerRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(4, new EntityShulker.a()); + this.goalSelector.a(7, new EntityShulker.e()); + this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error + this.targetSelector.a(2, new EntityShulker.d(this)); + this.targetSelector.a(3, new EntityShulker.c(this)); +@@ -560,7 +575,7 @@ public class EntityShulker extends EntityGolem implements IMonster { + + private int b; + +- private e() {} ++ private e() { this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); } // Purpur - peek + + @Override + public boolean a() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +index e1fcb1be102822e87eaf7757fbd64a516b2f58ac..c0601af022d85c7b03463f0df975d713c0366b2c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +@@ -4,6 +4,7 @@ import java.util.EnumSet; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.damagesource.DamageSource; +@@ -38,13 +39,27 @@ public class EntitySilverfish extends EntityMonster { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.silverfishRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.silverfishRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + this.b = new EntitySilverfish.PathfinderGoalSilverfishWakeOthers(this); + this.goalSelector.a(1, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(3, this.b); + this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, false)); + this.goalSelector.a(5, new EntitySilverfish.PathfinderGoalSilverfishHideInBlock(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + } +@@ -204,6 +219,7 @@ public class EntitySilverfish extends EntityMonster { + + public PathfinderGoalSilverfishWakeOthers(EntitySilverfish entitysilverfish) { + this.silverfish = entitysilverfish; ++ this.a(EnumSet.of(PathfinderGoal.Type.UNKNOWN_BEHAVIOR)); // Purpur + } + + public void g() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java +index 342bc9b586ef835e865d6f84bf66f1069ab10f00..0b8517d4e83d14ddf8b6d1f1cf4c538f9e4cc68f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java +@@ -15,6 +15,18 @@ public class EntitySkeleton extends EntitySkeletonAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.skeletonRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.skeletonRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected SoundEffect getSoundAmbient() { + return SoundEffects.ENTITY_SKELETON_AMBIENT; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java +index 06d50b22ede102556fdb3e2a6f1424f7ff13f120..7ec60987229927e5fe7164f1d4eae8222832e920 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java +@@ -5,6 +5,7 @@ import java.time.temporal.ChronoField; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; +@@ -70,12 +71,14 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(2, new PathfinderGoalRestrictSun(this)); + this.goalSelector.a(3, new PathfinderGoalFleeSun(this, 1.0D)); + this.goalSelector.a(3, new PathfinderGoalAvoidTarget<>(this, EntityWolf.class, 6.0F, 1.0D, 1.2D)); + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java +index 8481b8fffed3f1f60e2e72e115e79e9ae1aaa635..8484000a1b0d9c252d6fab205b1e316e3f6f33bd 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java +@@ -21,6 +21,18 @@ public class EntitySkeletonStray extends EntitySkeletonAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.strayRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.strayRidableInWater; ++ } ++ // Purpur end ++ + public static boolean a(EntityTypes entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { + return b(entitytypes, worldaccess, enummobspawn, blockposition, random) && (enummobspawn == EnumMobSpawn.SPAWNER || worldaccess.e(blockposition)); + } +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +index a90ac635ef7aef5289d21f948db7b170b23160d3..cb52c4e63ac487d55dc16accca6976f44f904112 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +@@ -34,6 +34,18 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { + this.a(PathType.LAVA, 8.0F); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.witherSkeletonRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.witherSkeletonRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityPiglinAbstract.class, true)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java +index 0af0b232ff1b6f1d58cf3fb543d32bd108be0af7..0cbe3032fd3b048b0eb8ec3d8592a662c69c9e30 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java +@@ -14,6 +14,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.resources.MinecraftKey; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; +@@ -74,12 +75,45 @@ public class EntitySlime extends EntityInsentient implements IMonster { + this.moveController = new EntitySlime.ControllerMoveSlime(this); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.slimeRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.slimeRidableInWater; ++ } ++ ++ protected boolean actualJump; ++ ++ @Override ++ public float getJumpHeight() { ++ float height = super.getJumpHeight(); ++ return hasRider() && actualJump ? height * 1.5F : height; ++ } ++ ++ @Override ++ public boolean onSpacebar() { ++ if (onGround && hasRider()) { ++ actualJump = true; ++ if (getRider().getForward() == 0 || getRider().getStrafe() == 0) { ++ jump(); // jump() here if not moving ++ } ++ } ++ return true; // do not jump() in wasd controller, let vanilla controller handle ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new EntitySlime.PathfinderGoalSlimeRandomJump(this)); + this.goalSelector.a(2, new EntitySlime.PathfinderGoalSlimeNearestPlayer(this)); + this.goalSelector.a(3, new EntitySlime.PathfinderGoalSlimeRandomDirection(this)); + this.goalSelector.a(5, new EntitySlime.PathfinderGoalSlimeIdle(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, (entityliving) -> { + return Math.abs(entityliving.locY() - this.locY()) <= 4.0D; + })); +@@ -365,11 +399,12 @@ public class EntitySlime extends EntityInsentient implements IMonster { + } + + @Override +- protected void jump() { ++ public void jump() { // Purpur - protected -> public + Vec3D vec3d = this.getMot(); + + this.setMot(vec3d.x, (double) this.dJ(), vec3d.z); + this.impulse = true; ++ this.actualJump = false; // Purpur + } + + @Nullable +@@ -538,10 +573,10 @@ public class EntitySlime extends EntityInsentient implements IMonster { + // Paper end + } + +- static class ControllerMoveSlime extends ControllerMove { ++ static class ControllerMoveSlime extends net.pl3x.purpur.controller.ControllerMoveWASD { // Purpur + + private float i; +- private int j; ++ private int j; private int getJumpDelay() { return j; } private void setJumpDelay(int delay) { j = delay; } // Purpur - OBFHELPER + private final EntitySlime k; + private boolean l; + +@@ -563,15 +598,27 @@ public class EntitySlime extends EntityInsentient implements IMonster { + + @Override + public void a() { ++ // Purpur start ++ if (entity.hasRider()) { ++ tick(entity.getRider()); ++ if (entity.getForward() != 0 || entity.getStrafe() != 0) { ++ if (getJumpDelay() > 10) { ++ setJumpDelay(6); ++ } ++ } else { ++ setJumpDelay(20); ++ } ++ } else { ++ // Purpur end + this.a.yaw = this.a(this.a.yaw, this.i, 90.0F); + this.a.aC = this.a.yaw; + this.a.aA = this.a.yaw; +- if (this.h != ControllerMove.Operation.MOVE_TO) { ++ } if (!entity.hasRider() && this.h != ControllerMove.Operation.MOVE_TO) { // Purpur + this.a.t(0.0F); + } else { + this.h = ControllerMove.Operation.WAIT; + if (this.a.isOnGround()) { +- this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED))); ++ this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED) * (entity.hasRider() && (entity.getRider().getForward() != 0 || entity.getRider().getStrafe() != 0) ? 2.0D : 1.0D))); // Purpur + if (this.j-- <= 0) { + this.j = this.k.eJ(); + if (this.l) { +@@ -588,7 +635,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + this.a.q(0.0F); + } + } else { +- this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED))); ++ this.a.q((float) (this.e * this.a.b(GenericAttributes.MOVEMENT_SPEED) * (entity.hasRider() && (entity.getRider().getForward() != 0 || entity.getRider().getStrafe() != 0) ? 2.0D : 1.0D))); // Purpur + } + + } +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java b/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java +index c7b443623f3dd90741e52216199d8ed90bcea6b3..fbf7c31f57f6dbfac997480eb7db55efc15ef4cc 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java +@@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.DifficultyDamageScaler; +@@ -50,14 +51,28 @@ public class EntitySpider extends EntityMonster { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.spiderRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.spiderRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + this.goalSelector.a(1, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(3, new PathfinderGoalLeapAtTarget(this, 0.4F)); + this.goalSelector.a(4, new EntitySpider.PathfinderGoalSpiderMeleeAttack(this)); + this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 0.8D)); + this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); + this.targetSelector.a(2, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityHuman.class)); + this.targetSelector.a(3, new EntitySpider.PathfinderGoalSpiderNearestAttackableTarget<>(this, EntityIronGolem.class)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +index 5ce50c6fe788fbd6db95f6406bacbf218b7e691c..14dda6743ed9e6f4880bc560f7ba8892d8e84afe 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +@@ -13,6 +13,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -94,6 +95,18 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + this.a(PathType.DAMAGE_FIRE, 0.0F); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.striderRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.striderRidableInWater; ++ } ++ // Purpur end ++ + public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.i(); + +@@ -155,6 +168,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + @Override + protected void initPathfinder() { + this.bv = new PathfinderGoalPanic(this, 1.65D); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, this.bv); + this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D)); + this.bu = new PathfinderGoalTempt(this, 1.4D, false, EntityStrider.bp); +@@ -434,7 +448,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + if (!enuminteractionresult.a()) { + ItemStack itemstack = entityhuman.b(enumhand); + +- return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : EnumInteractionResult.PASS; ++ return itemstack.getItem() == Items.SADDLE ? itemstack.a(entityhuman, (EntityLiving) this, enumhand) : tryRide(entityhuman, enumhand); // Purpur + } else { + if (flag && !this.isSilent()) { + this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_STRIDER_EAT, this.getSoundCategory(), 1.0F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVex.java b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java +index 9645d052069957311478a1ceca42ad52f7a9aa0b..4301ece0a04f3f2b4d198a684d0ca314deef2aef 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityVex.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java +@@ -7,6 +7,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.MathHelper; +@@ -54,6 +55,45 @@ public class EntityVex extends EntityMonster { + this.f = 3; + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.vexRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.vexRidableInWater; ++ } ++ ++ @Override ++ public double getMaxY() { ++ return world.purpurConfig.vexMaxY; ++ } ++ ++ @Override ++ public void g(Vec3D vec3d) { ++ super.g(vec3d); ++ if (hasRider()) { ++ float speed; ++ if (onGround) { ++ speed = (float) getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue() * 0.1F; ++ } else { ++ speed = (float) getAttributeInstance(GenericAttributes.FLYING_SPEED).getValue(); ++ } ++ setSpeed(speed); ++ Vec3D mot = getMot(); ++ move(EnumMoveType.SELF, mot.multiply(speed, 1.0, speed)); ++ setMot(mot.a(0.9D)); ++ } ++ } ++ ++ @Override ++ public boolean b(float f, float f1) { ++ return false; // no fall damage please ++ } ++ // Purpur end ++ + @Override + public void move(EnumMoveType enummovetype, Vec3D vec3d) { + super.move(enummovetype, vec3d); +@@ -62,7 +102,7 @@ public class EntityVex extends EntityMonster { + + @Override + public void tick() { +- this.noclip = true; ++ this.noclip = !hasRider(); // Purpur + super.tick(); + this.noclip = false; + this.setNoGravity(true); +@@ -77,17 +117,19 @@ public class EntityVex extends EntityMonster { + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(4, new EntityVex.a()); + this.goalSelector.a(8, new EntityVex.d()); + this.goalSelector.a(9, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 3.0F, 1.0F)); + this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // CraftBukkit - decompile error + this.targetSelector.a(2, new EntityVex.b(this)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + } + + public static AttributeProvider.Builder m() { +- return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 14.0D).a(GenericAttributes.ATTACK_DAMAGE, 4.0D); ++ return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 14.0D).a(GenericAttributes.ATTACK_DAMAGE, 4.0D).a(GenericAttributes.FLYING_SPEED, 0.6D); // Purpur + } + + @Override +@@ -319,14 +361,14 @@ public class EntityVex extends EntityMonster { + } + } + +- class c extends ControllerMove { ++ class c extends net.pl3x.purpur.controller.ControllerMoveWASDFlying { // Purpur + + public c(EntityVex entityvex) { + super(entityvex); + } + + @Override +- public void a() { ++ public void tick() { // Purpur + if (this.h == ControllerMove.Operation.MOVE_TO) { + Vec3D vec3d = new Vec3D(this.b - EntityVex.this.locX(), this.c - EntityVex.this.locY(), this.d - EntityVex.this.locZ()); + double d0 = vec3d.f(); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +index fe84d6d2b74b6ae00c4c66682107296a40b69adc..28d345e87f45fa839bc3bd758f79f34aba546db7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +@@ -8,6 +8,7 @@ import javax.annotation.Nullable; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.ChatMessage; + import net.minecraft.network.chat.IChatBaseComponent; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -59,14 +60,28 @@ public class EntityVindicator extends EntityIllagerAbstract { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.vindicatorRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.vindicatorRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + super.initPathfinder(); + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new EntityVindicator.a(this)); + this.goalSelector.a(2, new EntityIllagerAbstract.b(this)); + this.goalSelector.a(3, new EntityRaider.a(this, 10.0F)); + this.goalSelector.a(4, new EntityVindicator.c(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})).a(new Class[0])); // Paper - decompile fix + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java b/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java +index 63fb08e7b4290353e5148d1acb58f091dc5b08be..c4663c5b02363bd1499ce1f3b50027f8aa7c68e7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java +@@ -2,6 +2,7 @@ package net.minecraft.world.entity.monster; + + // Paper start + import com.destroystokyo.paper.event.entity.WitchReadyPotionEvent; ++import net.minecraft.server.PathfinderGoalHasRider; + import org.bukkit.craftbukkit.inventory.CraftItemStack; + import org.bukkit.entity.Witch; + // Paper end +@@ -63,6 +64,18 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + super(entitytypes, world); + } + ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.witchRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.witchRidableInWater; ++ } ++ // Purpur end ++ + @Override + protected void initPathfinder() { + super.initPathfinder(); +@@ -71,10 +84,12 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { + }); + this.bs = new PathfinderGoalNearestAttackableTargetWitch<>(this, EntityHuman.class, 10, true, false, (Predicate) null); + this.goalSelector.a(1, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(2, new PathfinderGoalArrowAttack(this, 1.0D, 60, 10.0F)); + this.goalSelector.a(2, new PathfinderGoalRandomStrollLand(this, 1.0D)); + this.goalSelector.a(3, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(3, new PathfinderGoalRandomLookaround(this)); ++ this.targetSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[]{EntityRaider.class})); + this.targetSelector.a(2, this.br); + this.targetSelector.a(3, this.bs); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java b/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java +index aed585e2c1c88a4d09318c6be7ebe7168eac3631..c5b1ce9268d6e6f3ec26eda4b5d8e7ae2a2ea672 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java +@@ -62,6 +62,18 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { this.f = 5; } @@ -4730,7 +5072,7 @@ index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b @Override protected BehaviorController.b cK() { return BehaviorController.a((Collection) EntityZoglin.c, (Collection) EntityZoglin.b); -@@ -52,10 +64,10 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { +@@ -93,10 +105,10 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { } private Optional eO() { @@ -4743,7 +5085,7 @@ index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b EntityTypes entitytypes = entityliving.getEntityType(); return entitytypes != EntityTypes.ZOGLIN && entitytypes != EntityTypes.CREEPER && IEntitySelector.f.test(entityliving); -@@ -140,14 +152,14 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { +@@ -181,14 +193,14 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { @Override public BehaviorController getBehaviorController() { @@ -4761,7 +5103,7 @@ index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b if (activity1 == Activity.FLIGHT && activity != Activity.FLIGHT) { this.eN(); -@@ -159,7 +171,8 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { +@@ -200,7 +212,8 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { @Override protected void mobTick() { this.world.getMethodProfiler().enter("zoglinBrain"); @@ -4771,11 +5113,19 @@ index e76e6ebde73b93dc06e76b71cdf6371c3654160a..d92fe8013fb3b43cb7eabdf1c624291b this.world.getMethodProfiler().exit(); this.eL(); } -diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 291748b3436c18653fa959cfd8c92240aa17508c..2076fe3e467c16bb400a75f9ea82f5b0773126be 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 { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +index 5ac950614fc90d02a568bb38f71faee124584c16..901fe8d224130c67bad00636b065bc798859a18e 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +@@ -16,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundCategory; + import net.minecraft.sounds.SoundEffect; +@@ -108,6 +109,16 @@ public class EntityZombie extends EntityMonster { } // Purpur start @@ -4792,7 +5142,7 @@ index 291748b3436c18653fa959cfd8c92240aa17508c..2076fe3e467c16bb400a75f9ea82f5b0 public boolean jockeyOnlyBaby() { return world.purpurConfig.zombieJockeyOnlyBaby; } -@@ -61,9 +71,11 @@ public class EntityZombie extends EntityMonster { +@@ -123,9 +134,11 @@ public class EntityZombie extends EntityMonster { @Override protected void initPathfinder() { @@ -4804,11 +5154,11 @@ index 291748b3436c18653fa959cfd8c92240aa17508c..2076fe3e467c16bb400a75f9ea82f5b0 this.m(); } -diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java -index ce6d79780197eb9300130036a8ed84648a17f9cf..02b0ae550a0ed33b5b43beedf3b1405985c58c13 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieHusk.java -+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java -@@ -9,6 +9,16 @@ public class EntityZombieHusk extends EntityZombie { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +index 5d3e5873f19aaf8389eb5525693b9378ea9f94ee..ad801fc394fbb83cf280ee96f962e7f311615d72 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +@@ -23,6 +23,16 @@ public class EntityZombieHusk extends EntityZombie { } // Purpur start @@ -4825,11 +5175,11 @@ index ce6d79780197eb9300130036a8ed84648a17f9cf..02b0ae550a0ed33b5b43beedf3b14059 @Override public boolean jockeyOnlyBaby() { return world.purpurConfig.huskJockeyOnlyBaby; -diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 5a71381c9f1832710001b6bfa63d6815c3cd1ab0..5b6ed77fb2b92b5bf701de436c8d7235bfe82685 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieVillager.java -+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java -@@ -29,6 +29,16 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +index 167ea96ec4072a9415a2ae9d7a0db118bfb94e19..6b2fd555122ba1af0adae3e479540e0da767a99d 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +@@ -71,6 +71,16 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo } // Purpur start @@ -4846,23 +5196,235 @@ index 5a71381c9f1832710001b6bfa63d6815c3cd1ab0..5b6ed77fb2b92b5bf701de436c8d7235 @Override public boolean jockeyOnlyBaby() { return world.purpurConfig.zombieVillagerJockeyOnlyBaby; -diff --git a/src/main/java/net/minecraft/server/GeneratorAccess.java b/src/main/java/net/minecraft/server/GeneratorAccess.java -index cbc0b8bc854ab1b0ba95fa0a2041385f440718d9..89d64ea0d1e61dfce622df026209af129efd5773 100644 ---- a/src/main/java/net/minecraft/server/GeneratorAccess.java -+++ b/src/main/java/net/minecraft/server/GeneratorAccess.java -@@ -37,6 +37,7 @@ public interface GeneratorAccess extends ICombinedAccess, IWorldTime { +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +index 9aa4850e021076fde306eea7eec104c31086c57f..64253428ef66145d07f74f8d0e5bdeb5aa5fe02b 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +@@ -61,6 +61,18 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + this.f = 5; + } - void addParticle(ParticleParam particleparam, double d0, double d1, double d2, double d3, double d4, double d5); ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.hoglinRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.hoglinRidableInWater; ++ } ++ // Purpur end ++ + @Override + public boolean a(EntityHuman entityhuman) { + return !this.isLeashed(); +@@ -127,6 +139,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + // Airplane - dynamic tick + if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("hoglinBrain"); ++ if (getRider() == null) // Purpur - only use brain if no rider + this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error + this.world.getMethodProfiler().exit(); + HoglinAI.a(this); +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +index 48acef830eb1d919499e9b79dc6a9af4bdf8a17b..8c6f5273ed2ab4ec63b7854e290f790b2eca8c2f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +@@ -70,6 +70,18 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + this.f = 5; + } -+ default void playEvent(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j) { a(entityhuman, i, blockposition, j); } // Purpur - OBFHELPER - void a(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j); ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.piglinRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.piglinRidableInWater; ++ } ++ // Purpur end ++ + @Override + public void saveData(NBTTagCompound nbttagcompound) { + super.saveData(nbttagcompound); +@@ -250,6 +262,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + // Airplane - dynamic tick + if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("piglinBrain"); ++ if (getRider() == null) // Purpur - only use brain if no rider + this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // Airplane - compile error + this.world.getMethodProfiler().exit(); + PiglinAI.b(this); +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java +index 3d85501791fce621335f34bf508becb74b80210d..da2220b08a9cd9c2d7d3fd06702e6690e12f095e 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java +@@ -39,6 +39,18 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { + this.f = 20; + } - default int getHeight() { -diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1..b7e540dfeeabb13227596ecfc6eddabf3cfde537 100644 ---- a/src/main/java/net/minecraft/server/IProjectile.java -+++ b/src/main/java/net/minecraft/server/IProjectile.java -@@ -12,7 +12,7 @@ public abstract class IProjectile extends Entity { ++ // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.piglinBruteRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.piglinBruteRidableInWater; ++ } ++ // Purpur end ++ + public static AttributeProvider.Builder eS() { + return EntityMonster.eR().a(GenericAttributes.MAX_HEALTH, 50.0D).a(GenericAttributes.MOVEMENT_SPEED, 0.3499999940395355D).a(GenericAttributes.ATTACK_DAMAGE, 7.0D); + } +@@ -68,7 +80,7 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { + + @Override + public BehaviorController getBehaviorController() { +- return super.getBehaviorController(); ++ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error + } + + @Override +@@ -84,7 +96,8 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { + @Override + protected void mobTick() { + this.world.getMethodProfiler().enter("piglinBruteBrain"); +- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); ++ if (getRider() == null) // Purpur - only use brain if no rider ++ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error + this.world.getMethodProfiler().exit(); + PiglinBruteAI.b(this); + PiglinBruteAI.c(this); +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index d3032682af94428419daa02f55b6040090d8df73..a0f0d5e0909da5cfe87078d4722b030635cfeadd 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -32,6 +32,7 @@ import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.MCUtil; + import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -145,8 +146,19 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + + // Purpur start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.villagerRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.villagerRidableInWater; ++ } ++ + @Override + protected void initPathfinder() { ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS)); + } + +@@ -317,7 +329,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + if (itemstack.getItem() != Items.VILLAGER_SPAWN_EGG && this.isAlive() && !this.eN() && !this.isSleeping()) { + if (this.isBaby()) { + this.fk(); +- return EnumInteractionResult.a(this.world.isClientSide); ++ return super.b(entityhuman, enumhand); // Purpur + } else { + boolean flag = this.getOffers().isEmpty(); + +@@ -330,8 +342,9 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + + if (flag) { +- return EnumInteractionResult.a(this.world.isClientSide); ++ return tryRide(entityhuman, enumhand); // Purpur + } else { ++ if (world.purpurConfig.villagerRidable && itemstack.isEmpty()) return tryRide(entityhuman, enumhand); // Purpur + if (!this.world.isClientSide && !this.trades.isEmpty()) { + this.h(entityhuman); + } +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +index e0324cdb2d4c85714eaad490a7a5c826b38e6b16..90cbef7fe8803295f82bddd6709fdf303aedcaba 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +@@ -6,6 +6,7 @@ import net.minecraft.core.BlockPosition; + import net.minecraft.core.IPosition; + import net.minecraft.nbt.GameProfileSerializer; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.server.PathfinderGoalHasRider; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -69,6 +70,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + @Override + protected void initPathfinder() { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(0, new PathfinderGoalUseItem<>(this, PotionUtil.a(new ItemStack(Items.POTION), Potions.INVISIBILITY), SoundEffects.ENTITY_WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { + return this.world.isNight() && !entityvillagertrader.isInvisible(); + })); +@@ -94,6 +96,16 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + } + + // Purpur - start ++ @Override ++ public boolean isRidable() { ++ return world.purpurConfig.villagerTraderRidable; ++ } ++ ++ @Override ++ public boolean isRidableInWater() { ++ return world.purpurConfig.villagerTraderRidableInWater; ++ } ++ + @Override + public boolean a(EntityHuman entityhuman) { + return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed(); +@@ -121,8 +133,9 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + } + + if (this.getOffers().isEmpty()) { +- return EnumInteractionResult.a(this.world.isClientSide); ++ return tryRide(entityhuman, enumhand); // Purpur + } else { ++ if (world.purpurConfig.villagerTraderRidable && itemstack.isEmpty()) return tryRide(entityhuman, enumhand); // Purpur + if (!this.world.isClientSide) { + this.setTradingPlayer(entityhuman); + this.openTrade(entityhuman, this.getScoreboardDisplayName(), 1); +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index 2ee7daa155d812af8f84ba646106d801d2fb0fec..1062317c22171bccee78a2db1841e0fd2b3023d7 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -2258,4 +2258,15 @@ public abstract class EntityHuman extends EntityLiving { + return this.g; + } + } ++ ++ // Purpur start ++ @Override ++ public boolean processClick(EnumHand hand) { ++ Entity vehicle = getRootVehicle(); ++ if (vehicle != null && vehicle.getRider() == this) { ++ return vehicle.onClick(hand); ++ } ++ return false; ++ } ++ // Purpur end + } +diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +index 2e2e4ee98619cfbeaecffa1ebae78ccc1d7666ca..3914081629669aea19d50530db996728bbfa607f 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +@@ -24,7 +24,7 @@ public abstract class IProjectile extends Entity { private UUID shooter; private int c; @@ -4871,7 +5433,7 @@ index dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1..b7e540dfeeabb13227596ecfc6eddabf IProjectile(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -74,6 +74,7 @@ public abstract class IProjectile extends Entity { +@@ -86,6 +86,7 @@ public abstract class IProjectile extends Entity { super.tick(); } @@ -4879,7 +5441,7 @@ index dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1..b7e540dfeeabb13227596ecfc6eddabf private boolean h() { Entity entity = this.getShooter(); -@@ -137,7 +138,7 @@ public abstract class IProjectile extends Entity { +@@ -149,7 +150,7 @@ public abstract class IProjectile extends Entity { iblockdata.a(this.world, iblockdata, movingobjectpositionblock, this); } @@ -4888,82 +5450,11 @@ index dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1..b7e540dfeeabb13227596ecfc6eddabf if (!entity.isSpectator() && entity.isAlive() && entity.isInteractable()) { 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 1fa06582ff843e62a8a4701d98b3f5cad8770a73..16a03a92b786da366ecf84b3cc79499654d0a899 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1418,6 +1418,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper - worldserver.hasEntityMoveEvent = EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper -+ worldserver.hasRidableMoveEvent = net.pl3x.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur - TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - - this.methodProfiler.a(() -> { -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java b/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java -new file mode 100644 -index 0000000000000000000000000000000000000000..da18e1235eed1988052fbd761c11f77efd7afc5e ---- /dev/null -+++ b/src/main/java/net/minecraft/server/PathfinderGoalHasRider.java -@@ -0,0 +1,18 @@ -+package net.minecraft.server; -+ -+import java.util.EnumSet; -+ -+public class PathfinderGoalHasRider extends PathfinderGoal { -+ public final EntityInsentient entity; -+ -+ public PathfinderGoalHasRider(EntityInsentient entity) { -+ this.entity = entity; -+ setTypes(EnumSet.of(Type.JUMP, Type.MOVE, Type.LOOK, Type.TARGET, Type.UNKNOWN_BEHAVIOR)); -+ } -+ -+ // shouldExecute -+ @Override -+ public boolean a() { -+ return entity.hasRider(); -+ } -+} -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java -new file mode 100644 -index 0000000000000000000000000000000000000000..44929182dfd7ad847d9657c324f440cbf29abadf ---- /dev/null -+++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseHasRider.java -@@ -0,0 +1,16 @@ -+package net.minecraft.server; -+ -+public class PathfinderGoalHorseHasRider extends PathfinderGoalHasRider { -+ private final EntityHorseAbstract horse; -+ -+ public PathfinderGoalHorseHasRider(EntityHorseAbstract entity) { -+ super(entity); -+ this.horse = entity; -+ } -+ -+ // shouldExecute -+ @Override -+ public boolean a() { -+ return super.a() && horse.hasSaddle(); -+ } -+} -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 48d032ed74effcfd66e1ab01548913964bca4d19..7be03bb416a5723ce65411ba5d0b967040e8033c 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2307,6 +2307,8 @@ public class PlayerConnection implements PacketListenerPlayIn { - } - this.server.getPluginManager().callEvent(event); - -+ player.processClick(enumhand); // Purpur -+ - // Fish bucket - SPIGOT-4048 - if ((entity instanceof EntityFish && origItem != null && origItem.getItem() == Items.WATER_BUCKET) && (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem)) { - this.sendPacket(new PacketPlayOutSpawnEntityLiving((EntityFish) entity)); -diff --git a/src/main/java/net/minecraft/server/ProjectileHelper.java b/src/main/java/net/minecraft/server/ProjectileHelper.java -index b2c64b31440389db5abe2322f7e31b328f590f6c..515ba50aec81497d27297e4b6c642e86b7de53ca 100644 ---- a/src/main/java/net/minecraft/server/ProjectileHelper.java -+++ b/src/main/java/net/minecraft/server/ProjectileHelper.java -@@ -7,6 +7,7 @@ import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/entity/projectile/ProjectileHelper.java b/src/main/java/net/minecraft/world/entity/projectile/ProjectileHelper.java +index 75889ac851d1c2b26c0b57bea6b75c1b65c2309f..80834537eba8bd33a0688e19d0aa9b963de4398a 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/ProjectileHelper.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/ProjectileHelper.java +@@ -21,6 +21,7 @@ import net.minecraft.world.phys.Vec3D; public final class ProjectileHelper { @@ -4971,39 +5462,23 @@ index b2c64b31440389db5abe2322f7e31b328f590f6c..515ba50aec81497d27297e4b6c642e86 public static MovingObjectPosition a(Entity entity, Predicate predicate) { Vec3D vec3d = entity.getMot(); World world = entity.world; -diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java -index 7190316a38e6b4edf5501bfedbb12be79e990797..4469fdc932d725b8e6fa4f8e3ec15c22a88ca5e7 100644 ---- a/src/main/java/net/minecraft/server/Vec3D.java -+++ b/src/main/java/net/minecraft/server/Vec3D.java -@@ -45,6 +45,7 @@ public class Vec3D implements IPosition { - return new Vec3D(vec3d.x - this.x, vec3d.y - this.y, vec3d.z - this.z); - } +diff --git a/src/main/java/net/minecraft/world/level/GeneratorAccess.java b/src/main/java/net/minecraft/world/level/GeneratorAccess.java +index 96efd974f1eb9c1e7c70e576e51ed69e15aacb99..fc86ef53c48503139667f7703019a07c40814fd4 100644 +--- a/src/main/java/net/minecraft/world/level/GeneratorAccess.java ++++ b/src/main/java/net/minecraft/world/level/GeneratorAccess.java +@@ -48,6 +48,7 @@ public interface GeneratorAccess extends ICombinedAccess, IWorldTime { -+ public Vec3D normalize() { return d(); } // Purpur - OBFHELPER - public Vec3D d() { - double d0 = (double) MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + void addParticle(ParticleParam particleparam, double d0, double d1, double d2, double d3, double d4, double d5); -@@ -104,6 +105,7 @@ public class Vec3D implements IPosition { - return d3 * d3 + d4 * d4 + d5 * d5; - } ++ default void playEvent(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j) { a(entityhuman, i, blockposition, j); } // Purpur - OBFHELPER + void a(@Nullable EntityHuman entityhuman, int i, BlockPosition blockposition, int j); -+ public Vec3D scale(double scale) { return a(scale); } // Purpur - OBFHELPER - public Vec3D a(double d0) { - return this.d(d0, d0, d0); - } -@@ -112,6 +114,7 @@ public class Vec3D implements IPosition { - return this.d(vec3d.x, vec3d.y, vec3d.z); - } - -+ public Vec3D multiply (double x, double y, double z) { return d(x, y, z); } // Purpur - OBFHELPER - public Vec3D d(double d0, double d1, double d2) { - 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 d86a23c6febc638080c0d26857839918db22ce93..af46e9ccfcc24e8222fdd49d66c3ba2057633021 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1681,5 +1681,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + default int getHeight() { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 4a445520b9b103a32dd281dc6bef5a47df8dee5f..31fdccfde1512c4b603f24d906c4b9700c0c07f6 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1833,5 +1833,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean isTheEnd() { return getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END; } @@ -5014,23 +5489,39 @@ index d86a23c6febc638080c0d26857839918db22ce93..af46e9ccfcc24e8222fdd49d66c3ba20 + } // Purpur end } -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index af7c9562cb7eac9d1e985d5337c8d127d875bcfb..ee74d3a9bb6938c83509fa09840a1c243d03c389 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -102,6 +102,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - public final UUID uuid; - boolean hasPhysicsEvent = true; // Paper - boolean hasEntityMoveEvent = false; // Paper -+ boolean hasRidableMoveEvent = false; // Purpur - private static Throwable getAddToWorldStackTrace(Entity entity) { - return new Throwable(entity + " Added to world at " + new java.util.Date()); +diff --git a/src/main/java/net/minecraft/world/phys/Vec3D.java b/src/main/java/net/minecraft/world/phys/Vec3D.java +index a19a26a88f247d359354902efeece9923f3e0e0b..1119f60890784d953c2cd4e0078af4d04d10d557 100644 +--- a/src/main/java/net/minecraft/world/phys/Vec3D.java ++++ b/src/main/java/net/minecraft/world/phys/Vec3D.java +@@ -50,6 +50,7 @@ public class Vec3D implements IPosition { + return new Vec3D(vec3d.x - this.x, vec3d.y - this.y, vec3d.z - this.z); + } + ++ public Vec3D normalize() { return d(); } // Purpur - OBFHELPER + public Vec3D d() { + double d0 = (double) MathHelper.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + +@@ -109,6 +110,7 @@ public class Vec3D implements IPosition { + return d3 * d3 + d4 * d4 + d5 * d5; + } + ++ public Vec3D scale(double scale) { return a(scale); } // Purpur - OBFHELPER + public Vec3D a(double d0) { + return this.d(d0, d0, d0); + } +@@ -117,6 +119,7 @@ public class Vec3D implements IPosition { + return this.d(vec3d.x, vec3d.y, vec3d.z); + } + ++ public Vec3D multiply (double x, double y, double z) { return d(x, y, z); } // Purpur - OBFHELPER + public Vec3D d(double d0, double d1, double d2) { + return new Vec3D(this.x * d0, this.y * d1, this.z * d2); } diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index c314a8c9a921a95cea43b748e2037521d948e1e7..59f3122aab9940cb3c3c1efb2664ab0835656d48 100644 +index bfae3043ef6bf402011045bd9682117aa3021468..2e9cec2d70ab4af5603552ebf8f0c0fa52ccfbe5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -136,11 +136,13 @@ public class PurpurConfig { +@@ -137,11 +137,13 @@ public class PurpurConfig { public static String afkBroadcastBack = "ยงeยงo%s is no longer AFK"; public static String afkTabListPrefix = "[AFK] "; public static String pingCommandOutput = "ยงa%s's ping is %sms"; @@ -5045,7 +5536,7 @@ index c314a8c9a921a95cea43b748e2037521d948e1e7..59f3122aab9940cb3c3c1efb2664ab08 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 637cac2758a44e72794953b9fbca2accb7d86b6a..d8b5e091047210a8eff45e493f07d30ffa6d9f81 100644 +index 4f5b815f22a906d8438c82204d24417e5d1cc66c..8b0afe5ef5d82bf9171a91521681e3ff4e61dffc 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 { @@ -5700,17 +6191,17 @@ index 637cac2758a44e72794953b9fbca2accb7d86b6a..d8b5e091047210a8eff45e493f07d30f zombieVillagerJockeyTryExistingChickens = getBoolean("mobs.zombie_villager.jockey.try-existing-chickens", zombieVillagerJockeyTryExistingChickens); diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..868c1ce1952193cba5ff0ce35e9d607478df7a53 +index 0000000000000000000000000000000000000000..292821f039d99a03ba4daeb3a941616ef5f6287e --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerLookWASD.java @@ -0,0 +1,76 @@ +package net.pl3x.purpur.controller; + -+import net.minecraft.server.ControllerLook; -+import net.minecraft.server.EntityHuman; -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.PacketPlayOutEntity; ++import net.minecraft.network.protocol.game.PacketPlayOutEntity; ++import net.minecraft.world.entity.ai.control.ControllerLook; ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.util.MathHelper; ++import net.minecraft.world.entity.player.EntityHuman; + +public class ControllerLookWASD extends ControllerLook { + protected final EntityInsentient entity; @@ -5782,17 +6273,17 @@ index 0000000000000000000000000000000000000000..868c1ce1952193cba5ff0ce35e9d6074 +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java new file mode 100644 -index 0000000000000000000000000000000000000000..426688b3a6dc197b41ddc4d1efed0405614f0f3b +index 0000000000000000000000000000000000000000..266e734e8c20d6e414bd4a453118ad75fa4f97e5 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASD.java @@ -0,0 +1,92 @@ +package net.pl3x.purpur.controller; + -+import net.minecraft.server.ControllerMove; -+import net.minecraft.server.Entity; -+import net.minecraft.server.EntityHuman; -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.GenericAttributes; ++import net.minecraft.world.entity.ai.control.ControllerMove; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.player.EntityHuman; +import net.pl3x.purpur.event.entity.RidableSpacebarEvent; + +public class ControllerMoveWASD extends ControllerMove { @@ -5880,15 +6371,15 @@ index 0000000000000000000000000000000000000000..426688b3a6dc197b41ddc4d1efed0405 +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java new file mode 100644 -index 0000000000000000000000000000000000000000..33c51460ab9556e5574c99232e9e3ff843c6ccc9 +index 0000000000000000000000000000000000000000..7737e87048e88b40c0b6b4a1093e2256ae252802 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlying.java @@ -0,0 +1,61 @@ +package net.pl3x.purpur.controller; + -+import net.minecraft.server.EntityHuman; -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.GenericAttributes; ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.player.EntityHuman; + +public class ControllerMoveWASDFlying extends ControllerMoveWASD { + protected final float groundSpeedModifier; @@ -5947,16 +6438,16 @@ index 0000000000000000000000000000000000000000..33c51460ab9556e5574c99232e9e3ff8 +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java new file mode 100644 -index 0000000000000000000000000000000000000000..f7537593619a68eb3898f28034192fab8548655c +index 0000000000000000000000000000000000000000..cdd32aa66b6bd9c01854e3d9baf25757c7e2a707 --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDFlyingWithSpacebar.java @@ -0,0 +1,61 @@ +package net.pl3x.purpur.controller; + -+import net.minecraft.server.EntityHuman; -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.GenericAttributes; -+import net.minecraft.server.Vec3D; ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.phys.Vec3D; + +public class ControllerMoveWASDFlyingWithSpacebar extends ControllerMoveWASDFlying { + public ControllerMoveWASDFlyingWithSpacebar(EntityInsentient entity) { @@ -6014,15 +6505,15 @@ index 0000000000000000000000000000000000000000..f7537593619a68eb3898f28034192fab +} diff --git a/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java new file mode 100644 -index 0000000000000000000000000000000000000000..1b08a0905b296b989e0ef0ea3b15169759b5f2fe +index 0000000000000000000000000000000000000000..aa7eb0b3bd7be8d1992e99bf156dbad167e571aa --- /dev/null +++ b/src/main/java/net/pl3x/purpur/controller/ControllerMoveWASDWater.java @@ -0,0 +1,50 @@ +package net.pl3x.purpur.controller; + -+import net.minecraft.server.EntityHuman; -+import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.GenericAttributes; ++import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.player.EntityHuman; + +public class ControllerMoveWASDWater extends ControllerMoveWASD { + private final double speedModifier; @@ -6070,29 +6561,28 @@ index 0000000000000000000000000000000000000000..1b08a0905b296b989e0ef0ea3b151697 +} diff --git a/src/main/java/net/pl3x/purpur/entity/DolphinSpit.java b/src/main/java/net/pl3x/purpur/entity/DolphinSpit.java new file mode 100644 -index 0000000000000000000000000000000000000000..a01524c6abaec13d7249d7aba6da9e4bc39f8b99 +index 0000000000000000000000000000000000000000..7c7b1cb54bf0d64ae71d50532b61bb648396b2dc --- /dev/null +++ b/src/main/java/net/pl3x/purpur/entity/DolphinSpit.java -@@ -0,0 +1,120 @@ +@@ -0,0 +1,119 @@ +package net.pl3x.purpur.entity; + -+import net.minecraft.server.BlockBase; -+import net.minecraft.server.DamageSource; -+import net.minecraft.server.Entity; -+import net.minecraft.server.EntityDolphin; -+import net.minecraft.server.EntityLiving; -+import net.minecraft.server.EntityLlamaSpit; -+import net.minecraft.server.EntityTypes; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.MovingObjectPosition; -+import net.minecraft.server.MovingObjectPositionBlock; -+import net.minecraft.server.MovingObjectPositionEntity; -+import net.minecraft.server.Particles; -+import net.minecraft.server.ProjectileHelper; -+import net.minecraft.server.Vec3D; -+import net.minecraft.server.World; -+import net.minecraft.server.WorldServer; ++import net.minecraft.world.entity.animal.EntityDolphin; ++import net.minecraft.world.entity.projectile.EntityLlamaSpit; ++import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.util.MathHelper; ++import net.minecraft.world.phys.MovingObjectPosition; ++import net.minecraft.world.phys.MovingObjectPositionBlock; ++import net.minecraft.world.phys.MovingObjectPositionEntity; ++import net.minecraft.core.particles.Particles; ++import net.minecraft.world.entity.projectile.ProjectileHelper; ++import net.minecraft.world.phys.Vec3D; ++import net.minecraft.world.level.World; ++import net.minecraft.server.level.WorldServer; +import org.bukkit.craftbukkit.event.CraftEventFactory; + +public class DolphinSpit extends EntityLlamaSpit { @@ -6196,30 +6686,30 @@ index 0000000000000000000000000000000000000000..a01524c6abaec13d7249d7aba6da9e4b +} diff --git a/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java b/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java new file mode 100644 -index 0000000000000000000000000000000000000000..9a9e46d7ee247f9e43ae5c697f10e4665fd6e4e6 +index 0000000000000000000000000000000000000000..3d83a495cbe08e2f129a583ec2760391edb819ba --- /dev/null +++ b/src/main/java/net/pl3x/purpur/entity/PhantomFlames.java @@ -0,0 +1,140 @@ +package net.pl3x.purpur.entity; + -+import net.minecraft.server.BlockBase; -+import net.minecraft.server.DamageSource; -+import net.minecraft.server.Entity; -+import net.minecraft.server.EntityArmorStand; -+import net.minecraft.server.EntityLiving; -+import net.minecraft.server.EntityLlamaSpit; -+import net.minecraft.server.EntityPhantom; -+import net.minecraft.server.EntityTypes; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.MovingObjectPosition; -+import net.minecraft.server.MovingObjectPositionBlock; -+import net.minecraft.server.MovingObjectPositionEntity; -+import net.minecraft.server.Particles; -+import net.minecraft.server.ProjectileHelper; -+import net.minecraft.server.Vec3D; -+import net.minecraft.server.World; -+import net.minecraft.server.WorldServer; ++import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.decoration.EntityArmorStand; ++import net.minecraft.world.entity.monster.EntityPhantom; ++import net.minecraft.world.entity.projectile.EntityLlamaSpit; ++import net.minecraft.world.level.block.state.BlockBase; ++import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.util.MathHelper; ++import net.minecraft.world.phys.MovingObjectPosition; ++import net.minecraft.world.phys.MovingObjectPositionBlock; ++import net.minecraft.world.phys.MovingObjectPositionEntity; ++import net.minecraft.core.particles.Particles; ++import net.minecraft.world.entity.projectile.ProjectileHelper; ++import net.minecraft.world.phys.Vec3D; ++import net.minecraft.world.level.World; ++import net.minecraft.server.level.WorldServer; +import org.bukkit.craftbukkit.event.CraftEventFactory; + +public class PhantomFlames extends EntityLlamaSpit { @@ -6341,10 +6831,10 @@ index 0000000000000000000000000000000000000000..9a9e46d7ee247f9e43ae5c697f10e466 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2af3bee540ee25ea32a7548fd0d64dea16a0a268..5471422d23d261a06c67f9374cae933430ec03a0 100644 +index dee4d12a49468d38f077784b219199f0070786f2..c524a0994f1c9ef1d0534403efa4e4481955b2f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1174,4 +1174,26 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1175,4 +1175,26 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isTicking(); } // Paper end @@ -6372,10 +6862,10 @@ index 2af3bee540ee25ea32a7548fd0d64dea16a0a268..5471422d23d261a06c67f9374cae9334 + // 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 82e36ba35c0bd4d5b3e13281bad1a0664c25c6e0..c4d0082bb0d310ad16de36df03dd99225c5cadb0 100644 +index 926440e846eff2c1aaa262aa2b3975b7dd225332..9a6c4f292940b1cef2f4ef87c2e47d82ba5cb60f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -528,6 +528,18 @@ public class CraftEventFactory { +@@ -530,6 +530,18 @@ public class CraftEventFactory { } craftServer.getPluginManager().callEvent(event); @@ -6394,7 +6884,7 @@ index 82e36ba35c0bd4d5b3e13281bad1a0664c25c6e0..c4d0082bb0d310ad16de36df03dd9922 return event; } -@@ -928,6 +940,7 @@ public class CraftEventFactory { +@@ -930,6 +942,7 @@ public class CraftEventFactory { damageCause = DamageCause.ENTITY_EXPLOSION; } event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions); @@ -6402,7 +6892,7 @@ index 82e36ba35c0bd4d5b3e13281bad1a0664c25c6e0..c4d0082bb0d310ad16de36df03dd9922 } event.setCancelled(cancelled); -@@ -1012,6 +1025,7 @@ public class CraftEventFactory { +@@ -1014,6 +1027,7 @@ public class CraftEventFactory { if (!event.isCancelled()) { event.getEntity().setLastDamageCause(event); } @@ -6410,7 +6900,7 @@ index 82e36ba35c0bd4d5b3e13281bad1a0664c25c6e0..c4d0082bb0d310ad16de36df03dd9922 return event; } -@@ -1061,6 +1075,7 @@ public class CraftEventFactory { +@@ -1063,6 +1077,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions); diff --git a/patches/Purpur/patches/server/0102-Use-configured-height-for-nether-surface-builders.patch b/patches/Purpur/patches/server/0102-Use-configured-height-for-nether-surface-builders.patch index fb5a5fb7..a1b1edd8 100644 --- a/patches/Purpur/patches/server/0102-Use-configured-height-for-nether-surface-builders.patch +++ b/patches/Purpur/patches/server/0102-Use-configured-height-for-nether-surface-builders.patch @@ -4,11 +4,11 @@ Date: Sat, 15 Aug 2020 06:51:46 -0500 Subject: [PATCH] Use configured height for nether surface builders -diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java -index 462f0b2baea4207d7d82f2d4e043a5a7999a1f42..f418a71ca8ec5e1417778d33c9020dc002a611cc 100644 ---- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java -+++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java -@@ -35,7 +35,7 @@ public abstract class WorldGenSurfaceNetherAbstract extends WorldGenSurface { @@ -42,10 +42,10 @@ index 6ef81aeb4c63bc6c23163796dbd977602ca2f540..9ea3c30b679da4e77b86d96d0cc47673 private final GeneratorAccess b; private final EnumDirection.EnumAxis c; diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index 59f3122aab9940cb3c3c1efb2664ab0835656d48..a5febd7671ae1818edb18955d5e8176303c92c93 100644 +index 2e9cec2d70ab4af5603552ebf8f0c0fa52ccfbe5..c61595aa6e42a4cc096bda9126d23c465f8bd3de 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -179,6 +179,7 @@ public class PurpurConfig { +@@ -180,6 +180,7 @@ public class PurpurConfig { public static boolean barrelSixRows = false; public static boolean enderChestSixRows = false; public static boolean enderChestPermissionRows = false; @@ -53,7 +53,7 @@ index 59f3122aab9940cb3c3c1efb2664ab0835656d48..a5febd7671ae1818edb18955d5e81763 private static void blockSettings() { if (version < 3) { boolean oldValue = getBoolean("settings.barrel.packed-barrels", true); -@@ -193,6 +194,7 @@ public class PurpurConfig { +@@ -194,6 +195,7 @@ public class PurpurConfig { enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows); InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); diff --git a/patches/Purpur/patches/server/0104-Entities-can-use-portals-configuration.patch b/patches/Purpur/patches/server/0104-Entities-can-use-portals-configuration.patch index 665fccbe..739bcc60 100644 --- a/patches/Purpur/patches/server/0104-Entities-can-use-portals-configuration.patch +++ b/patches/Purpur/patches/server/0104-Entities-can-use-portals-configuration.patch @@ -4,11 +4,11 @@ Date: Mon, 17 Aug 2020 19:32:05 -0500 Subject: [PATCH] Entities can use portals configuration -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 8be2b1ed66c3a72d2b752881b16b8a402cce2768..fb78ae9c89b035fdac213b7294f94d425a7f57f4 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2427,7 +2427,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index d1bbf4127a2e0836bedb33a81e3fd18a8e8eb962..4b4c6477122c51871ce98f34c6e5874048eaa227 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2523,7 +2523,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne public void d(BlockPosition blockposition) { if (this.ai()) { this.resetPortalCooldown(); @@ -17,7 +17,7 @@ index 8be2b1ed66c3a72d2b752881b16b8a402cce2768..fb78ae9c89b035fdac213b7294f94d42 if (!this.world.isClientSide && !blockposition.equals(this.ac)) { this.ac = blockposition.immutableCopy(); } -@@ -3007,7 +3007,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3103,7 +3103,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } public boolean canPortal() { @@ -27,7 +27,7 @@ index 8be2b1ed66c3a72d2b752881b16b8a402cce2768..fb78ae9c89b035fdac213b7294f94d42 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 d8b5e091047210a8eff45e493f07d30ffa6d9f81..cf4ac765fdbaf961e913ca028edc084373eba978 100644 +index 8b0afe5ef5d82bf9171a91521681e3ff4e61dffc..c7c33906466a28f65a6f8252a959a6651bd1074e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -158,6 +158,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0105-LivingEntity-broadcastItemBreak.patch b/patches/Purpur/patches/server/0105-LivingEntity-broadcastItemBreak.patch index 75d1de0e..209b879f 100644 --- a/patches/Purpur/patches/server/0105-LivingEntity-broadcastItemBreak.patch +++ b/patches/Purpur/patches/server/0105-LivingEntity-broadcastItemBreak.patch @@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity#broadcastItemBreak diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 84aeffac2c2c12d98e9cec05314668a93bb5ed91..6a15b0d5e8446ab2a5e5bd11020a4f812b6c7877 100644 +index b5040de9885556561416bf3282476f3b33925a62..f0631331afc16576a21310f5575b56ae7663f399 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -844,5 +844,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -854,5 +854,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void setSafeFallDistance(float safeFallDistance) { getHandle().safeFallDistance = safeFallDistance; } diff --git a/patches/Purpur/patches/server/0106-Customizable-wither-health-and-healing.patch b/patches/Purpur/patches/server/0106-Customizable-wither-health-and-healing.patch index 92ccea45..15d977e1 100644 --- a/patches/Purpur/patches/server/0106-Customizable-wither-health-and-healing.patch +++ b/patches/Purpur/patches/server/0106-Customizable-wither-health-and-healing.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Customizable wither health and healing Adds the ability to customize the health of the wither, as well as the amount that it heals, and how often. -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index e7c558e268f77cc6451b3a8fe502465dfc017cec..9b9eeb14776c09415823e0d5e313e44e51deb43a 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -150,6 +150,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +index 4c0a555cdb5bc34c73040b9533beaee56cbce70a..beb4d59faf4bd7501468b2eaa0e866613625e963 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java ++++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +@@ -207,6 +207,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { skull.setPositionRaw(headX, headY, headZ); world.addEntity(skull); } @@ -21,7 +21,7 @@ index e7c558e268f77cc6451b3a8fe502465dfc017cec..9b9eeb14776c09415823e0d5e313e44e // Purpur end @Override -@@ -354,7 +359,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -411,7 +416,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.setInvul(i); if (this.ticksLived % 10 == 0) { @@ -30,7 +30,7 @@ index e7c558e268f77cc6451b3a8fe502465dfc017cec..9b9eeb14776c09415823e0d5e313e44e } } else { -@@ -463,8 +468,10 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -520,8 +525,10 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } @@ -44,7 +44,7 @@ index e7c558e268f77cc6451b3a8fe502465dfc017cec..9b9eeb14776c09415823e0d5e313e44e //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 cf4ac765fdbaf961e913ca028edc084373eba978..94a870113dc45201379c1efc7e83162c303573df 100644 +index c7c33906466a28f65a6f8252a959a6651bd1074e..3e1b97a4003cea3af511ed9b7f13f8a5373f9a20 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -921,10 +921,21 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0107-Allow-toggling-special-MobSpawners-per-world.patch b/patches/Purpur/patches/server/0107-Allow-toggling-special-MobSpawners-per-world.patch index 49559d95..84a39152 100644 --- a/patches/Purpur/patches/server/0107-Allow-toggling-special-MobSpawners-per-world.patch +++ b/patches/Purpur/patches/server/0107-Allow-toggling-special-MobSpawners-per-world.patch @@ -5,47 +5,37 @@ Subject: [PATCH] Allow toggling special MobSpawners per world In vanilla, these are all hardcoded on for world type 0 (overworld) and hardcoded off for every other world type. Default config behaviour matches this. -diff --git a/src/main/java/net/minecraft/server/MobSpawnerTrader.java b/src/main/java/net/minecraft/server/MobSpawnerTrader.java -index 341af7474690b929cfa3e35cd464bbbbacb6685e..ad00ff2bd525768e4f06631d16b912c61c8eee28 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerTrader.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerTrader.java -@@ -132,7 +132,17 @@ public class MobSpawnerTrader implements MobSpawner { - int k = blockposition.getX() + this.a.nextInt(i * 2) - i; - int l = blockposition.getZ() + this.a.nextInt(i * 2) - i; - int i1 = iworldreader.a(HeightMap.Type.WORLD_SURFACE, k, l); -- BlockPosition blockposition2 = new BlockPosition(k, i1, l); -+ // Purpur start - allow traders to spawn below nether roof -+ BlockPosition.MutableBlockPosition blockposition2 = new BlockPosition.MutableBlockPosition(k, i1, l); -+ if (iworldreader.getDimensionManager().hasCeiling()) { -+ do { -+ blockposition2.c(EnumDirection.DOWN); -+ } while (!iworldreader.getType(blockposition2).isAir()); -+ do { -+ blockposition2.c(EnumDirection.DOWN); -+ } while (iworldreader.getType(blockposition2).isAir() && blockposition2.getY() > 0); -+ } -+ // Purpur end - - 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 af46e9ccfcc24e8222fdd49d66c3ba2057633021..452dbbf572ad38716c81ae90873884076c1abc6f 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -187,7 +187,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper - this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config -- this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur -+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig(((WorldDataServer) worlddatamutable).getName(), env); // Purpur - this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray - this.generator = gen; - this.world = new CraftWorld((WorldServer) this, gen, env); -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ee74d3a9bb6938c83509fa09840a1c243d03c389..baeca1fcb81c9f83e488a23be3cf66de3af65ba1 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -436,7 +436,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index e601109b264f5dcd22c5181f77f4c548b0906398..7cae36eac98d3d13cd2dbde0d0828f4e52d9395f 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -92,6 +92,7 @@ import net.minecraft.world.entity.EnumCreatureType; + import net.minecraft.world.entity.ReputationHandler; + import net.minecraft.world.entity.ai.navigation.NavigationAbstract; + import net.minecraft.world.entity.ai.village.ReputationEvent; ++import net.minecraft.world.entity.ai.village.VillageSiege; + import net.minecraft.world.entity.ai.village.poi.VillagePlace; + import net.minecraft.world.entity.ai.village.poi.VillagePlaceType; + import net.minecraft.world.entity.animal.EntityAnimal; +@@ -101,6 +102,8 @@ import net.minecraft.world.entity.animal.horse.EntityHorseSkeleton; + import net.minecraft.world.entity.boss.EntityComplexPart; + import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; + import net.minecraft.world.entity.item.EntityItem; ++import net.minecraft.world.entity.npc.MobSpawnerCat; ++import net.minecraft.world.entity.npc.MobSpawnerTrader; + import net.minecraft.world.entity.npc.NPC; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.raid.PersistentRaid; +@@ -133,6 +136,8 @@ import net.minecraft.world.level.chunk.storage.RegionFile; + import net.minecraft.world.level.dimension.DimensionManager; + import net.minecraft.world.level.dimension.end.EnderDragonBattle; + import net.minecraft.world.level.levelgen.HeightMap; ++import net.minecraft.world.level.levelgen.MobSpawnerPatrol; ++import net.minecraft.world.level.levelgen.MobSpawnerPhantom; + import net.minecraft.world.level.levelgen.feature.StructureGenerator; + import net.minecraft.world.level.levelgen.structure.StructureBoundingBox; + import net.minecraft.world.level.levelgen.structure.StructureStart; +@@ -550,7 +555,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.L = new ObjectLinkedOpenHashSet(); this.Q = flag1; this.server = minecraftserver; @@ -71,16 +61,60 @@ index ee74d3a9bb6938c83509fa09840a1c243d03c389..baeca1fcb81c9f83e488a23be3cf66de // CraftBukkit start this.worldDataServer = (WorldDataServer) iworlddataserver; worldDataServer.world = this; +diff --git a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerTrader.java b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerTrader.java +index 7c8a2151be8a0f48cba1c15d231d5dbdb500b4d6..361771fc4fcf16b1b013c550734019535cef2924 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/MobSpawnerTrader.java ++++ b/src/main/java/net/minecraft/world/entity/npc/MobSpawnerTrader.java +@@ -5,6 +5,7 @@ import java.util.Optional; + import java.util.Random; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; ++import net.minecraft.core.EnumDirection; + import net.minecraft.nbt.NBTTagCompound; + import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.server.level.EntityPlayer; +@@ -153,7 +154,17 @@ public class MobSpawnerTrader implements MobSpawner { + int k = blockposition.getX() + this.a.nextInt(i * 2) - i; + int l = blockposition.getZ() + this.a.nextInt(i * 2) - i; + int i1 = iworldreader.a(HeightMap.Type.WORLD_SURFACE, k, l); +- BlockPosition blockposition2 = new BlockPosition(k, i1, l); ++ // Purpur start - allow traders to spawn below nether roof ++ BlockPosition.MutableBlockPosition blockposition2 = new BlockPosition.MutableBlockPosition(k, i1, l); ++ if (iworldreader.getDimensionManager().hasCeiling()) { ++ do { ++ blockposition2.c(EnumDirection.DOWN); ++ } while (!iworldreader.getType(blockposition2).isAir()); ++ do { ++ blockposition2.c(EnumDirection.DOWN); ++ } while (iworldreader.getType(blockposition2).isAir() && blockposition2.getY() > 0); ++ } ++ // Purpur end + + if (SpawnerCreature.a(EntityPositionTypes.Surface.ON_GROUND, iworldreader, blockposition2, EntityTypes.WANDERING_TRADER)) { + blockposition1 = blockposition2; +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 31fdccfde1512c4b603f24d906c4b9700c0c07f6..6d7a1c8d2f36277856212a329fb562d8902dfd28 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -250,7 +250,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper + this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config +- this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName())); // Purpur ++ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()), env); // Purpur + this.generator = gen; + this.world = new CraftWorld((WorldServer) this, gen, env); + this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 94a870113dc45201379c1efc7e83162c303573df..c8666ce6bdf2e61dd3ccc7ff6cc0810559ce3f5b 100644 +index 3e1b97a4003cea3af511ed9b7f13f8a5373f9a20..1d144ed296120eccee1001fd1299ead48351cbfa 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; - import net.minecraft.server.Item; - import net.minecraft.server.Items; - import net.minecraft.server.MinecraftKey; -+import org.apache.commons.lang.BooleanUtils; -+import org.bukkit.World.Environment; +@@ -7,6 +7,8 @@ import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.item.Item; + import net.minecraft.world.item.Items; + import net.minecraft.resources.MinecraftKey; ++import org.apache.commons.lang3.BooleanUtils; ++import org.bukkit.World; import org.bukkit.configuration.ConfigurationSection; import java.util.ArrayList; @@ -96,10 +130,10 @@ index 94a870113dc45201379c1efc7e83162c303573df..c8666ce6bdf2e61dd3ccc7ff6cc08105 public class PurpurWorldConfig { private final String worldName; -+ private final Environment environment; ++ private final World.Environment environment; - public PurpurWorldConfig(String worldName) { -+ public PurpurWorldConfig(String worldName, Environment environment) { ++ public PurpurWorldConfig(String worldName, World.Environment environment) { this.worldName = worldName; + this.environment = environment; init(); @@ -129,7 +163,7 @@ index 94a870113dc45201379c1efc7e83162c303573df..c8666ce6bdf2e61dd3ccc7ff6cc08105 + public boolean villageSiegeSpawning; + private void mobSpawnerSettings() { + // values of "default" or null will default to true only if the world environment is normal (aka overworld) -+ Predicate predicate = (bool) -> (bool != null && bool) || (bool == null && environment == Environment.NORMAL); ++ Predicate predicate = (bool) -> (bool != null && bool) || (bool == null && environment == World.Environment.NORMAL); + catSpawning = getBoolean("gameplay-mechanics.mob-spawning.village-cats", predicate); + patrolSpawning = getBoolean("gameplay-mechanics.mob-spawning.raid-patrols", predicate); + phantomSpawning = getBoolean("gameplay-mechanics.mob-spawning.phantoms", predicate); diff --git a/patches/Purpur/patches/server/0108-Raid-cooldown-setting.patch b/patches/Purpur/patches/server/0108-Raid-cooldown-setting.patch index e7504aee..ac3b1f61 100644 --- a/patches/Purpur/patches/server/0108-Raid-cooldown-setting.patch +++ b/patches/Purpur/patches/server/0108-Raid-cooldown-setting.patch @@ -4,11 +4,11 @@ Date: Thu, 27 Aug 2020 13:48:52 -0700 Subject: [PATCH] Raid cooldown setting -diff --git a/src/main/java/net/minecraft/server/PersistentRaid.java b/src/main/java/net/minecraft/server/PersistentRaid.java -index 826dcf9f7eedc3664d66170b97b2a19552a0dc60..807910c60e6cad58b91474b0477e6fc109eaf281 100644 ---- a/src/main/java/net/minecraft/server/PersistentRaid.java -+++ b/src/main/java/net/minecraft/server/PersistentRaid.java -@@ -9,6 +9,7 @@ import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java b/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java +index c939ca087af4588e14669a2d53d7c116dcb59f16..11271762dcf5783c3179de1afc6a882c5330b4dd 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java ++++ b/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java +@@ -27,6 +27,7 @@ import net.minecraft.world.phys.Vec3D; public class PersistentRaid extends PersistentBase { @@ -16,7 +16,7 @@ index 826dcf9f7eedc3664d66170b97b2a19552a0dc60..807910c60e6cad58b91474b0477e6fc1 public final Map raids = Maps.newHashMap(); private final WorldServer b; private int c; -@@ -27,6 +28,17 @@ public class PersistentRaid extends PersistentBase { +@@ -45,6 +46,17 @@ public class PersistentRaid extends PersistentBase { public void a() { ++this.d; @@ -34,7 +34,7 @@ index 826dcf9f7eedc3664d66170b97b2a19552a0dc60..807910c60e6cad58b91474b0477e6fc1 Iterator iterator = this.raids.values().iterator(); while (iterator.hasNext()) { -@@ -110,10 +122,15 @@ public class PersistentRaid extends PersistentBase { +@@ -128,10 +140,15 @@ public class PersistentRaid extends PersistentBase { if (flag) { // CraftBukkit start @@ -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 c8666ce6bdf2e61dd3ccc7ff6cc0810559ce3f5b..1c9db2dc3d5577906aa1ac208aad3c6865040381 100644 +index 1d144ed296120eccee1001fd1299ead48351cbfa..9dcc2f52641e9196487744f4a1e8ae0f312aaff8 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -173,6 +173,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0109-Despawn-rate-config-options-per-projectile-type.patch b/patches/Purpur/patches/server/0109-Despawn-rate-config-options-per-projectile-type.patch index dae4b7be..0e27c10f 100644 --- a/patches/Purpur/patches/server/0109-Despawn-rate-config-options-per-projectile-type.patch +++ b/patches/Purpur/patches/server/0109-Despawn-rate-config-options-per-projectile-type.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Despawn rate config options per projectile type Default values of -1 respect vanilla behaviour. -diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 77ddda8bd5b8a37ed51324e9769da4978173e744..10cbddae4ede09ccec3b9c459c09fa18e2211238 100644 ---- a/src/main/java/net/minecraft/server/EntityArrow.java -+++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -23,7 +23,7 @@ public abstract class EntityArrow extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +index e440d26c920c4efddf958c61bfdfa508273062cc..3ee404effe339a5742926255da6a9c41d1bc9367 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +@@ -61,7 +61,7 @@ public abstract class EntityArrow extends IProjectile { protected int c; public EntityArrow.PickupStatus fromPlayer; public int shake; @@ -18,7 +18,7 @@ index 77ddda8bd5b8a37ed51324e9769da4978173e744..10cbddae4ede09ccec3b9c459c09fa18 private double damage; public int knockbackStrength; private SoundEffect ak; -@@ -257,13 +257,23 @@ public abstract class EntityArrow extends IProjectile { +@@ -295,13 +295,23 @@ public abstract class EntityArrow extends IProjectile { } @@ -47,11 +47,11 @@ index 77ddda8bd5b8a37ed51324e9769da4978173e744..10cbddae4ede09ccec3b9c459c09fa18 } private void A() { -diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java -index 27032abad4f3da1d1b28a3cec49e3fc079deadb9..9d2d5be5eedc60749e276434be9be6ab41f2289d 100644 ---- a/src/main/java/net/minecraft/server/EntityDragonFireball.java -+++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java -@@ -75,4 +75,11 @@ public class EntityDragonFireball extends EntityFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java +index 27853f510e15e40c66da2cb4905c43f5e8f99d3d..98dcfedc8826ebb067438be713549e2cfb19ebb0 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityDragonFireball.java +@@ -87,4 +87,11 @@ public class EntityDragonFireball extends EntityFireball { protected boolean W_() { return false; } @@ -63,11 +63,11 @@ index 27032abad4f3da1d1b28a3cec49e3fc079deadb9..9d2d5be5eedc60749e276434be9be6ab + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java -index edce89169b3ca2894852087b83a6bf035ba43c3f..4951abdfa13d170b7075a0223dd0096d77dec6ea 100644 ---- a/src/main/java/net/minecraft/server/EntityEgg.java -+++ b/src/main/java/net/minecraft/server/EntityEgg.java -@@ -87,4 +87,11 @@ public class EntityEgg extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityEgg.java b/src/main/java/net/minecraft/world/entity/projectile/EntityEgg.java +index dc2e51718395494f60b0376d65d496daf2f76e71..d97511c27ff376b2dd0fbedb227f9a0c337a1264 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityEgg.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityEgg.java +@@ -99,4 +99,11 @@ public class EntityEgg extends EntityProjectileThrowable { protected Item getDefaultItem() { return Items.EGG; } @@ -79,11 +79,11 @@ index edce89169b3ca2894852087b83a6bf035ba43c3f..4951abdfa13d170b7075a0223dd0096d + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java -index e42dd066e76a3d2bc3270774f48bb8c8fd47cc38..44dbe818b19c927098c1e6b2bcb556378be5637c 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderPearl.java -+++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java -@@ -107,4 +107,11 @@ public class EntityEnderPearl extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java b/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java +index efdf5bc4f07231690c680429b3f77bd07970eee0..cf2c691357c41a7e7044f7a719144db2ffab5dbe 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java +@@ -122,4 +122,11 @@ public class EntityEnderPearl extends EntityProjectileThrowable { return super.b(worldserver); } @@ -95,11 +95,11 @@ index e42dd066e76a3d2bc3270774f48bb8c8fd47cc38..44dbe818b19c927098c1e6b2bcb55637 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index d8faa18724baa240fca78a35c362cf661615ec4d..e4c2bf2de6c032332b7557c240bb458297bdd33f 100644 ---- a/src/main/java/net/minecraft/server/EntityFireworks.java -+++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -301,4 +301,11 @@ public class EntityFireworks extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java +index f9a355c847d778a9aad1987882fc816af92450ba..9b4b8b1a0f7654c9c30ca614cac6f485f82db5ef 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java +@@ -325,4 +325,11 @@ public class EntityFireworks extends IProjectile { public Packet P() { return new PacketPlayOutSpawnEntity(this); } @@ -111,11 +111,11 @@ index d8faa18724baa240fca78a35c362cf661615ec4d..e4c2bf2de6c032332b7557c240bb4582 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 9841c7c27cd296a5156ba79ab734d45922bacaf7..f0502c7f5419f637641b48d8c87f5df206e4f922 100644 ---- a/src/main/java/net/minecraft/server/EntityFishingHook.java -+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -579,4 +579,11 @@ public class EntityFishingHook extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java +index dc6d279766ccc83a8f450028a09491b1c88f524c..5a5773209183331d849368c6b300367ac0ebe203 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java +@@ -617,4 +617,11 @@ public class EntityFishingHook extends IProjectile { private HookState() {} } @@ -127,11 +127,11 @@ index 9841c7c27cd296a5156ba79ab734d45922bacaf7..f0502c7f5419f637641b48d8c87f5df2 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java -index b4b0dfbc70f91f74f9792b835ec2f8d5af41c311..d12de20cf4bb2345c616d3cc0b9f50bddb5135ee 100644 ---- a/src/main/java/net/minecraft/server/EntityLargeFireball.java -+++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java -@@ -66,4 +66,11 @@ public class EntityLargeFireball extends EntityFireballFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +index cf2663d9883654f53b327246d85ee63c3990cd71..e860737bacfea0a1d728dbaaf41d62165658ad89 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +@@ -77,4 +77,11 @@ public class EntityLargeFireball extends EntityFireballFireball { } } @@ -143,11 +143,11 @@ index b4b0dfbc70f91f74f9792b835ec2f8d5af41c311..d12de20cf4bb2345c616d3cc0b9f50bd + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityLlamaSpit.java b/src/main/java/net/minecraft/server/EntityLlamaSpit.java -index 480a02a8f6ec7110f9af8f2037fdc09a7a54ef01..aa9afb60808a9988b38cf588ec9f649ee09c728e 100644 ---- a/src/main/java/net/minecraft/server/EntityLlamaSpit.java -+++ b/src/main/java/net/minecraft/server/EntityLlamaSpit.java -@@ -73,4 +73,11 @@ public class EntityLlamaSpit extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java +index 8aef834a6e8fcf5d44986745affb8f27bc3dfd6b..0bfb80331cea6bd2cf85a9475b6416691edd8b0b 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java +@@ -88,4 +88,11 @@ public class EntityLlamaSpit extends IProjectile { public Packet P() { return new PacketPlayOutSpawnEntity(this); } @@ -159,11 +159,11 @@ index 480a02a8f6ec7110f9af8f2037fdc09a7a54ef01..aa9afb60808a9988b38cf588ec9f649e + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java -index b338cb771aa8ba7a810b8129ca04640d115b68ba..dfc0538cc8cb8015fe79978ee360c86127118330 100644 ---- a/src/main/java/net/minecraft/server/EntityPotion.java -+++ b/src/main/java/net/minecraft/server/EntityPotion.java -@@ -241,4 +241,11 @@ public class EntityPotion extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityPotion.java b/src/main/java/net/minecraft/world/entity/projectile/EntityPotion.java +index dbc0afc5fb9e358a3e6d596692f57fb28303c4da..a3344719bcf178df5b63cda6f6a854c2df174fa5 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityPotion.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityPotion.java +@@ -270,4 +270,11 @@ public class EntityPotion extends EntityProjectileThrowable { } } @@ -175,11 +175,11 @@ index b338cb771aa8ba7a810b8129ca04640d115b68ba..dfc0538cc8cb8015fe79978ee360c861 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityShulkerBullet.java b/src/main/java/net/minecraft/server/EntityShulkerBullet.java -index a4d94385ede0303417d676155c2c0b226681cc59..da38bdd6055d06005cfee3e73c32230ad7b480ff 100644 ---- a/src/main/java/net/minecraft/server/EntityShulkerBullet.java -+++ b/src/main/java/net/minecraft/server/EntityShulkerBullet.java -@@ -313,4 +313,11 @@ public class EntityShulkerBullet extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java b/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java +index 1ae528ccd09a6536b3aac320e6218f03c274d6a9..cfc1376bfed9399daa6f27f54780ccf8e05753c6 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java +@@ -337,4 +337,11 @@ public class EntityShulkerBullet extends IProjectile { public Packet P() { return new PacketPlayOutSpawnEntity(this); } @@ -191,11 +191,11 @@ index a4d94385ede0303417d676155c2c0b226681cc59..da38bdd6055d06005cfee3e73c32230a + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntitySmallFireball.java b/src/main/java/net/minecraft/server/EntitySmallFireball.java -index 350e92ac99fe48ba046a51e1db4b977dd9bfc20a..4ed7a20bfed267776628457a4b33178bac7d1972 100644 ---- a/src/main/java/net/minecraft/server/EntitySmallFireball.java -+++ b/src/main/java/net/minecraft/server/EntitySmallFireball.java -@@ -86,4 +86,11 @@ public class EntitySmallFireball extends EntityFireballFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java +index d139c5806e5971e82865c2ce627e87c631e42d7a..bf747cbf6e1ef9ea9d1d41d0441b29a46ce874c0 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java +@@ -100,4 +100,11 @@ public class EntitySmallFireball extends EntityFireballFireball { public boolean damageEntity(DamageSource damagesource, float f) { return false; } @@ -207,11 +207,11 @@ index 350e92ac99fe48ba046a51e1db4b977dd9bfc20a..4ed7a20bfed267776628457a4b33178b + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java -index e44249f59b742d16f08643ee2a83fdcd0bed9590..34a5f481e6ed1357861dca15fb4013ec8484a292 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowball.java -+++ b/src/main/java/net/minecraft/server/EntitySnowball.java -@@ -14,6 +14,12 @@ public class EntitySnowball extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java +index 3ec380ec35fade3bcc61c5f45cee651eb45ae073..0d3b9c81e47eef645335e49a1d6d88db7338aa4b 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java +@@ -25,6 +25,12 @@ public class EntitySnowball extends EntityProjectileThrowable { super(EntityTypes.SNOWBALL, d0, d1, d2, world); } @@ -224,11 +224,11 @@ index e44249f59b742d16f08643ee2a83fdcd0bed9590..34a5f481e6ed1357861dca15fb4013ec @Override protected Item getDefaultItem() { return Items.SNOWBALL; -diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -index 2d3ca8c424f2088027d51066d634c48723e96214..1d32518bd7982f20574d56f2f2ea4142ea1e015d 100644 ---- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -+++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -@@ -51,4 +51,11 @@ public class EntityThrownExpBottle extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java b/src/main/java/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java +index e07353a6b34196e3d275ba482fbef7e4d209c31d..6ef87bd6969603a51f09034ad87b89ab8a25eadb 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java +@@ -61,4 +61,11 @@ public class EntityThrownExpBottle extends EntityProjectileThrowable { } } @@ -240,11 +240,11 @@ index 2d3ca8c424f2088027d51066d634c48723e96214..1d32518bd7982f20574d56f2f2ea4142 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java -index 2c02e114cce1f49b643e75e7ab3c05be716d7dba..4a97a7517dc1a2a25c578d9e168240cc19ab0831 100644 ---- a/src/main/java/net/minecraft/server/EntityWitherSkull.java -+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java -@@ -116,4 +116,11 @@ public class EntityWitherSkull extends EntityFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java +index 021a7e31dc3650c0c404a893374528e6a63dfbad..2fe0e32a1158cccb3060f5a986c9fc41a0237aa8 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java +@@ -137,4 +137,11 @@ public class EntityWitherSkull extends EntityFireball { protected boolean W_() { return false; } @@ -256,11 +256,11 @@ index 2c02e114cce1f49b643e75e7ab3c05be716d7dba..4a97a7517dc1a2a25c578d9e168240cc + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index b7e540dfeeabb13227596ecfc6eddabf3cfde537..56adefabdfbf444e87129715f107c6d3aafe4ca7 100644 ---- a/src/main/java/net/minecraft/server/IProjectile.java -+++ b/src/main/java/net/minecraft/server/IProjectile.java -@@ -13,11 +13,25 @@ public abstract class IProjectile extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +index 3914081629669aea19d50530db996728bbfa607f..62fa5be9090c8789e91bf9b9f614e74a4a6babdd 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +@@ -25,11 +25,25 @@ public abstract class IProjectile extends Entity { private UUID shooter; private int c; private boolean d; public boolean leftOwner() { return d; } public void setLeftOwner(boolean leftOwner) { this.d = leftOwner; } // Purpur - OBFHELPER @@ -286,7 +286,7 @@ index b7e540dfeeabb13227596ecfc6eddabf3cfde537..56adefabdfbf444e87129715f107c6d3 public void setShooter(@Nullable Entity entity) { if (entity != null) { this.shooter = entity.getUniqueID(); -@@ -72,6 +86,12 @@ public abstract class IProjectile extends Entity { +@@ -84,6 +98,12 @@ public abstract class IProjectile extends Entity { } super.tick(); @@ -300,7 +300,7 @@ index b7e540dfeeabb13227596ecfc6eddabf3cfde537..56adefabdfbf444e87129715f107c6d3 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 1c9db2dc3d5577906aa1ac208aad3c6865040381..c9884c382e3e16db0d4c1b7d0d804aafbd6a3fa8 100644 +index 9dcc2f52641e9196487744f4a1e8ae0f312aaff8..43b11c9e8af513002318e11ed58a3f2afa1c7a89 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -165,6 +165,35 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0110-Add-option-to-disable-zombie-aggressiveness-towards-.patch b/patches/Purpur/patches/server/0110-Add-option-to-disable-zombie-aggressiveness-towards-.patch index d44ee205..01573bd6 100644 --- a/patches/Purpur/patches/server/0110-Add-option-to-disable-zombie-aggressiveness-towards-.patch +++ b/patches/Purpur/patches/server/0110-Add-option-to-disable-zombie-aggressiveness-towards-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to disable zombie aggressiveness towards villagers diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -index 89b56de7567ae54be75e0735b712e4dd713f1bf4..ded483ace0e93b695a5078391582c1654b6d139a 100644 +index f62d0ee49ebda2b0c7a136562b24ee038502d048..995ccf9abfd91780168091da95c9af758f177b98 100644 --- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -131,6 +131,10 @@ public class MobGoalHelper { +@@ -305,6 +305,10 @@ public class MobGoalHelper { deobfuscationMap.put("wither_a", "wither_do_nothing"); deobfuscationMap.put("wolf_a", "wolf_avoid_entity"); deobfuscationMap.put("zombie_a", "zombie_attack_turtle_egg"); @@ -20,11 +20,11 @@ index 89b56de7567ae54be75e0735b712e4dd713f1bf4..ded483ace0e93b695a5078391582c165 ignored.add("selector_1"); ignored.add("selector_2"); -diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 125eab60f2b4657e52a71eddf7586c574945252e..638efc67d66001ee085957d4698f51a7daac77fc 100644 ---- a/src/main/java/net/minecraft/server/EntityDrowned.java -+++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -58,7 +58,18 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +index 1d4039d61a2c77a38a31947010cee26f41c0becd..93946f4e3cad07e20189a44ce512682b4cbc163b 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +@@ -109,7 +109,18 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D)); this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class)); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::i)); @@ -44,11 +44,11 @@ index 125eab60f2b4657e52a71eddf7586c574945252e..638efc67d66001ee085957d4698f51a7 this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); 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 2076fe3e467c16bb400a75f9ea82f5b0773126be..e4de6e2f8b72c0ede3ad34666a5dfde5c5363b56 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 { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +index 901fe8d224130c67bad00636b065bc798859a18e..88264b7b2c21a377f4b0dd857065e40165f0acde 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +@@ -148,7 +148,18 @@ public class EntityZombie extends EntityMonster { this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D)); this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(EntityPigZombie.class)); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); @@ -69,7 +69,7 @@ index 2076fe3e467c16bb400a75f9ea82f5b0773126be..e4de6e2f8b72c0ede3ad34666a5dfde5 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 c9884c382e3e16db0d4c1b7d0d804aafbd6a3fa8..6d0d43e77bbf6f792257eb368e572b1bfade3266 100644 +index 43b11c9e8af513002318e11ed58a3f2afa1c7a89..22aa4709d1db75eb901a6145b75689bd766bf10b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1023,12 +1023,14 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0111-Persistent-TileEntity-Lore-and-DisplayName.patch b/patches/Purpur/patches/server/0111-Persistent-TileEntity-Lore-and-DisplayName.patch index 6fdf68dc..43a3360e 100644 --- a/patches/Purpur/patches/server/0111-Persistent-TileEntity-Lore-and-DisplayName.patch +++ b/patches/Purpur/patches/server/0111-Persistent-TileEntity-Lore-and-DisplayName.patch @@ -6,11 +6,81 @@ Subject: [PATCH] Persistent TileEntity Lore and DisplayName Makes it so that when a TileEntity is placed in the world and then broken, the dropped ItemStack retains any original custom display name/lore. -diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971c7b4f27c 100644 ---- a/src/main/java/net/minecraft/server/Block.java -+++ b/src/main/java/net/minecraft/server/Block.java -@@ -207,7 +207,7 @@ public class Block extends BlockBase implements IMaterial { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java +index 9c01ec42342cf0420bf5215604c24fbc89c1361b..3de0f21648ca60bdfcbc078bca896d51bf84e207 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java +@@ -15,6 +15,7 @@ import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.IMaterial; +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +index 01839c7319e175477ded7001e00e5937734ff516..e5cda8c040c93639211dacbf5b0c7cd6a9df9e6d 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +@@ -34,6 +34,7 @@ import net.minecraft.world.entity.animal.EntityAnimal; + import net.minecraft.world.entity.animal.EntityWaterAnimal; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.Item; ++import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.IMaterial; +diff --git a/src/main/java/net/minecraft/world/item/ItemBlock.java b/src/main/java/net/minecraft/world/item/ItemBlock.java +index 59d52c252b2e59923b8e513dd4d2e1ec9ce34dc7..4be1c8ee85f411a8b01be50b8cc3dc3835f80a2e 100644 +--- a/src/main/java/net/minecraft/world/item/ItemBlock.java ++++ b/src/main/java/net/minecraft/world/item/ItemBlock.java +@@ -119,7 +119,24 @@ public class ItemBlock extends Item { + } + + protected boolean a(BlockPosition blockposition, World world, @Nullable EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) { +- return a(world, entityhuman, blockposition, itemstack); ++ // Purpur start ++ boolean handled = a(world, entityhuman, blockposition, itemstack); ++ if (world.purpurConfig.persistentTileEntityDisplayNames && itemstack.hasTag()) { ++ NBTTagCompound display = itemstack.getSubTag("display"); ++ if (display != null) { ++ TileEntity tile = world.getTileEntity(blockposition); ++ if (tile != null) { ++ if (display.hasKeyOfType("Name", 8)) { ++ tile.setPersistentDisplayName(display.getString("Name")); ++ } ++ if (display.hasKeyOfType("Lore", 9)) { ++ tile.setPersistentLore(display.getList("Lore", 8)); ++ } ++ } ++ } ++ } ++ return handled; ++ // Purpur end + } + + @Nullable +diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java +index 97eb81338207c93125bea082256384946a8305bb..eecb17e887bf0d1680a5fb5198a8b4246c14e548 100644 +--- a/src/main/java/net/minecraft/world/level/block/Block.java ++++ b/src/main/java/net/minecraft/world/level/block/Block.java +@@ -15,10 +15,15 @@ import net.minecraft.core.EnumDirection; + import net.minecraft.core.IRegistry; + import net.minecraft.core.NonNullList; + import net.minecraft.core.RegistryBlockID; ++import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.nbt.NBTTagList; ++import net.minecraft.nbt.NBTTagString; ++import net.minecraft.network.chat.IChatBaseComponent; + import net.minecraft.server.level.WorldServer; + import net.minecraft.stats.StatisticList; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsBlock; ++import net.minecraft.world.INamableTileEntity; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityLiving; +@@ -248,7 +253,7 @@ public class Block extends BlockBase implements IMaterial { public static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) { if (generatoraccess instanceof WorldServer) { a(iblockdata, (WorldServer) generatoraccess, blockposition, tileentity).forEach((itemstack) -> { @@ -19,7 +89,7 @@ index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971 }); iblockdata.dropNaturally((WorldServer) generatoraccess, blockposition, ItemStack.b); } -@@ -216,14 +216,56 @@ public class Block extends BlockBase implements IMaterial { +@@ -257,14 +262,56 @@ public class Block extends BlockBase implements IMaterial { public static void dropItems(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity, Entity entity, ItemStack itemstack) { if (world instanceof WorldServer) { @@ -78,41 +148,20 @@ index d3026d8911c73e23315a545b9eb0753306c0e825..2c8d7024879392f37e53dfb72cc07971 public static void a(World world, BlockPosition blockposition, ItemStack itemstack) { dropItem(world, blockposition, itemstack); } public static void dropItem(World world, BlockPosition blockposition, ItemStack itemstack) { // Paper - OBFHELPER if (!world.isClientSide && !itemstack.isEmpty() && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) { float f = 0.5F; -diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index ae2ad70699347e169d941266ec3ad1af4c9b3786..e4aea92040b58a5c87258ac6fd735f21709a45a3 100644 ---- a/src/main/java/net/minecraft/server/ItemBlock.java -+++ b/src/main/java/net/minecraft/server/ItemBlock.java -@@ -97,7 +97,24 @@ public class ItemBlock extends Item { - } - - protected boolean a(BlockPosition blockposition, World world, @Nullable EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) { -- return a(world, entityhuman, blockposition, itemstack); -+ // Purpur start -+ boolean handled = a(world, entityhuman, blockposition, itemstack); -+ if (world.purpurConfig.persistentTileEntityDisplayNames && itemstack.hasTag()) { -+ NBTTagCompound display = itemstack.getSubTag("display"); -+ if (display != null) { -+ TileEntity tile = world.getTileEntity(blockposition); -+ if (tile != null) { -+ if (display.hasKeyOfType("Name", 8)) { -+ tile.setPersistentDisplayName(display.getString("Name")); -+ } -+ if (display.hasKeyOfType("Lore", 9)) { -+ tile.setPersistentLore(display.getList("Lore", 8)); -+ } -+ } -+ } -+ } -+ return handled; -+ // Purpur end - } - - @Nullable -diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a00850185 100644 ---- a/src/main/java/net/minecraft/server/TileEntity.java -+++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -93,9 +93,25 @@ public abstract class TileEntity implements KeyedObject { // Paper +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java +index f1e586754396439dfb70a4d63e3b8b34fb36ebf4..8a049d3de8937a6c8afe178ccd134e2511fb3baf 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntity.java +@@ -5,6 +5,8 @@ import net.minecraft.CrashReportSystemDetails; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.IRegistry; + import net.minecraft.nbt.NBTTagCompound; ++import net.minecraft.nbt.NBTTagList; ++import net.minecraft.nbt.NBTTagString; + import net.minecraft.network.protocol.game.PacketPlayOutTileEntityData; + import net.minecraft.resources.MinecraftKey; + import net.minecraft.world.level.World; +@@ -104,9 +106,25 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { / this.persistentDataContainer.putAll((NBTTagCompound) persistentDataTag); } // CraftBukkit end @@ -138,7 +187,7 @@ index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a return this.b(nbttagcompound); } -@@ -256,4 +272,25 @@ public abstract class TileEntity implements KeyedObject { // Paper +@@ -267,4 +285,25 @@ public abstract class TileEntity implements net.minecraft.server.KeyedObject { / return null; } // CraftBukkit end @@ -165,7 +214,7 @@ index 060c1206e4b5da6be50fff605894fb2a46f57c1b..c0d465749093b1a18bd5179eb28ae06a + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 6d0d43e77bbf6f792257eb368e572b1bfade3266..4515c95a195ab962513ddc6868f9cdfd47f61d68 100644 +index 22aa4709d1db75eb901a6145b75689bd766bf10b..4843d4a0794e05386d6cdf05a7059598291aafe7 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -200,6 +200,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0112-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch b/patches/Purpur/patches/server/0112-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch index 3cb20473..2e1d8f60 100644 --- a/patches/Purpur/patches/server/0112-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch +++ b/patches/Purpur/patches/server/0112-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch @@ -4,11 +4,11 @@ Date: Sat, 3 Oct 2020 17:40:52 -0500 Subject: [PATCH] Add predicate to recipe's ExactChoice ingredient -diff --git a/src/main/java/net/minecraft/server/RecipeItemStack.java b/src/main/java/net/minecraft/server/RecipeItemStack.java -index 0f96abd0ca78e9c78306fed69684dee71be37703..f6d92949409b66d5d0c578e010aebd058903c6fa 100644 ---- a/src/main/java/net/minecraft/server/RecipeItemStack.java -+++ b/src/main/java/net/minecraft/server/RecipeItemStack.java -@@ -26,6 +26,7 @@ public final class RecipeItemStack implements Predicate { +diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeItemStack.java b/src/main/java/net/minecraft/world/item/crafting/RecipeItemStack.java +index 63274908bc7552321a4db3d4e0eec0f55ee34786..c7f6dc5a933873a6118a5674e4ce04cfa1664f60 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/RecipeItemStack.java ++++ b/src/main/java/net/minecraft/world/item/crafting/RecipeItemStack.java +@@ -36,6 +36,7 @@ public final class RecipeItemStack implements Predicate { public ItemStack[] choices; private IntList d; public boolean exact; // CraftBukkit @@ -16,7 +16,7 @@ index 0f96abd0ca78e9c78306fed69684dee71be37703..f6d92949409b66d5d0c578e010aebd05 public RecipeItemStack(Stream stream) { this.b = (RecipeItemStack.Provider[]) stream.toArray((i) -> { -@@ -52,6 +53,12 @@ public final class RecipeItemStack implements Predicate { +@@ -62,6 +63,12 @@ public final class RecipeItemStack implements Predicate { if (this.choices.length == 0) { return itemstack.isEmpty(); } else { @@ -30,12 +30,12 @@ index 0f96abd0ca78e9c78306fed69684dee71be37703..f6d92949409b66d5d0c578e010aebd05 int i = aitemstack.length; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -index ef29599a89bc630899c65df9a7004f836787d95e..18413e6327458c6d60d2a0ca8167fc5d75389934 100644 +index b7e8c3798628229be56289818caa3024014640d6..43c50c2c54444c67e4a875be4880afe97c32412c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java @@ -22,6 +22,7 @@ public interface CraftRecipe extends Recipe { } else if (bukkit instanceof RecipeChoice.ExactChoice) { - stack = new RecipeItemStack(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> new net.minecraft.server.RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(mat)))); + stack = new RecipeItemStack(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> new net.minecraft.world.item.crafting.RecipeItemStack.StackProvider(CraftItemStack.asNMSCopy(mat)))); stack.exact = true; + stack.predicate = ((RecipeChoice.ExactChoice) bukkit).getPredicate(); // Purpur } else { diff --git a/patches/Purpur/patches/server/0113-Flying-squids-Oh-my.patch b/patches/Purpur/patches/server/0113-Flying-squids-Oh-my.patch index cc82d948..f2b5e6f1 100644 --- a/patches/Purpur/patches/server/0113-Flying-squids-Oh-my.patch +++ b/patches/Purpur/patches/server/0113-Flying-squids-Oh-my.patch @@ -4,11 +4,11 @@ Date: Sun, 4 Oct 2020 12:00:42 -0500 Subject: [PATCH] Flying squids! Oh my! -diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 70b952f10a2af547f58069977ee135469d02f84d..cee226501690e1c00983a01ac82bc7384f233c3c 100644 ---- a/src/main/java/net/minecraft/server/EntitySquid.java -+++ b/src/main/java/net/minecraft/server/EntitySquid.java -@@ -51,6 +51,11 @@ public class EntitySquid extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +index 10e228a36b213a87e17f26a633adfca18a006e94..07b1db0e1fff1beffe464a3984716d5d84ea1873 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +@@ -80,6 +80,11 @@ public class EntitySquid extends EntityWaterAnimal { vector.setX(cos * x - sine * z); vector.setZ(sine * x + cos * z); } @@ -20,7 +20,7 @@ index 70b952f10a2af547f58069977ee135469d02f84d..cee226501690e1c00983a01ac82bc738 // Purpur end @Override -@@ -116,6 +121,7 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -145,6 +150,7 @@ public class EntitySquid extends EntityWaterAnimal { } if (this.aH()) { @@ -28,7 +28,7 @@ index 70b952f10a2af547f58069977ee135469d02f84d..cee226501690e1c00983a01ac82bc738 if (this.bp < 3.1415927F) { float f = this.bp / 3.1415927F; -@@ -323,7 +329,7 @@ public class EntitySquid extends EntityWaterAnimal { +@@ -352,7 +358,7 @@ public class EntitySquid extends EntityWaterAnimal { if (i > 100) { this.b.a(0.0F, 0.0F, 0.0F); @@ -38,7 +38,7 @@ 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 4515c95a195ab962513ddc6868f9cdfd47f61d68..39f25fe85d8d2c8cd48ba0f5988b1839d3d331aa 100644 +index 4843d4a0794e05386d6cdf05a7059598291aafe7..a9f3cec879329101794afa3561bcff63a6db22bf 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -879,10 +879,12 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0114-Infinity-bow-settings.patch b/patches/Purpur/patches/server/0114-Infinity-bow-settings.patch index e7a9d8a2..f332d798 100644 --- a/patches/Purpur/patches/server/0114-Infinity-bow-settings.patch +++ b/patches/Purpur/patches/server/0114-Infinity-bow-settings.patch @@ -4,11 +4,11 @@ Date: Sun, 4 Oct 2020 19:08:53 -0500 Subject: [PATCH] Infinity bow settings -diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index dd6a93dc78a4589f2c65d1738c432def1285f3e2..8241f3dafa5852bed7a3967e7260b36f47198dba 100644 ---- a/src/main/java/net/minecraft/server/ItemBow.java -+++ b/src/main/java/net/minecraft/server/ItemBow.java -@@ -24,7 +24,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { +diff --git a/src/main/java/net/minecraft/world/item/ItemBow.java b/src/main/java/net/minecraft/world/item/ItemBow.java +index 015f4d71f35a9d512814389b6e6cab74c0daf116..c7e20b25b4d09463fa54c66e62208e90515013e2 100644 +--- a/src/main/java/net/minecraft/world/item/ItemBow.java ++++ b/src/main/java/net/minecraft/world/item/ItemBow.java +@@ -35,7 +35,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { float f = a(j); if ((double) f >= 0.1D) { @@ -17,7 +17,7 @@ index dd6a93dc78a4589f2c65d1738c432def1285f3e2..8241f3dafa5852bed7a3967e7260b36f if (!world.isClientSide) { ItemArrow itemarrow = (ItemArrow) ((ItemArrow) (itemstack1.getItem() instanceof ItemArrow ? itemstack1.getItem() : Items.ARROW)); -@@ -85,6 +85,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { +@@ -96,6 +96,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { entityhuman.inventory.f(itemstack1); } } @@ -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 39f25fe85d8d2c8cd48ba0f5988b1839d3d331aa..3d6e1eb623b66d9157ca33f64483e857e3b6b39e 100644 +index a9f3cec879329101794afa3561bcff63a6db22bf..bc4caba06f469f700c89e96f1e70c7b2948329ad 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -165,6 +165,15 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0115-Stonecutter-damage.patch b/patches/Purpur/patches/server/0115-Stonecutter-damage.patch index a5bdec3e..6f392516 100644 --- a/patches/Purpur/patches/server/0115-Stonecutter-damage.patch +++ b/patches/Purpur/patches/server/0115-Stonecutter-damage.patch @@ -4,11 +4,21 @@ Date: Mon, 5 Oct 2020 12:15:14 -0500 Subject: [PATCH] Stonecutter damage -diff --git a/src/main/java/net/minecraft/server/BlockStonecutter.java b/src/main/java/net/minecraft/server/BlockStonecutter.java -index 3e57abd33ee61d78f6d895ec710adb5e5983d42c..08ba9e1c4e916ee09df1bd397b8fc36b4780b9b5 100644 ---- a/src/main/java/net/minecraft/server/BlockStonecutter.java -+++ b/src/main/java/net/minecraft/server/BlockStonecutter.java -@@ -71,4 +71,16 @@ public class BlockStonecutter extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockStonecutter.java b/src/main/java/net/minecraft/world/level/block/BlockStonecutter.java +index 54c9586cd7f8c9691a1c7ded9c9c96b0f316b0b6..988204918854e982e334eb2417b83914b58cbcf6 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockStonecutter.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockStonecutter.java +@@ -10,6 +10,9 @@ import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.ITileInventory; + import net.minecraft.world.TileInventory; ++import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.inventory.ContainerAccess; + import net.minecraft.world.inventory.ContainerStonecutter; +@@ -94,4 +97,16 @@ public class BlockStonecutter extends Block { public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) { return false; } @@ -25,11 +35,11 @@ index 3e57abd33ee61d78f6d895ec710adb5e5983d42c..08ba9e1c4e916ee09df1bd397b8fc36b + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 33804e68931e8b4145b896eedeab79bde78779f2..fabadcd7a21b0e4ad0e2eeadcd8926dfad6c4b7a 100644 ---- a/src/main/java/net/minecraft/server/PathfinderNormal.java -+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java -@@ -480,7 +480,7 @@ public class PathfinderNormal extends PathfinderAbstract { +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java +index 7b92a54cfb64fb77af99e6bf66eacbdb9e769dc1..9d08094165cf18d99116b5c721fff888f3cb42e2 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java +@@ -503,7 +503,7 @@ public class PathfinderNormal extends PathfinderAbstract { return iblockdata.neighbourOverridePathType = PathType.DANGER_CACTUS; // Tuinity - reduce pathfinder branching } @@ -39,7 +49,7 @@ index 33804e68931e8b4145b896eedeab79bde78779f2..fabadcd7a21b0e4ad0e2eeadcd8926df } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 3d6e1eb623b66d9157ca33f64483e857e3b6b39e..95d14d82d6f8bce762ef70645f0f8eae3093914c 100644 +index bc4caba06f469f700c89e96f1e70c7b2948329ad..fdd44288c3d962df02cb65a5de5ac75d3dd4c5b9 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -383,6 +383,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0116-Configurable-daylight-cycle.patch b/patches/Purpur/patches/server/0116-Configurable-daylight-cycle.patch index 2855c643..acedfc0f 100644 --- a/patches/Purpur/patches/server/0116-Configurable-daylight-cycle.patch +++ b/patches/Purpur/patches/server/0116-Configurable-daylight-cycle.patch @@ -4,11 +4,11 @@ Date: Sat, 10 Oct 2020 14:29:55 -0500 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 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; +diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutUpdateTime.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutUpdateTime.java +index 3086ee023685781d94e2fb99fc8dff5264f01165..74c1047305cac5673e274096709c757ede4605f4 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutUpdateTime.java ++++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutUpdateTime.java +@@ -7,7 +7,7 @@ import net.minecraft.network.protocol.Packet; public class PacketPlayOutUpdateTime implements Packet { private long a; private final void setWorldAge(final long age) { this.a = age; } private final long getWorldAge() { return this.a; } // Paper - OBFHELPER @@ -17,11 +17,19 @@ index 1b9b43ee696575d986c25cafec07d863acb951a7..e837db171545ceacbc84a2b360cf0d95 public PacketPlayOutUpdateTime() {} -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index baeca1fcb81c9f83e488a23be3cf66de3af65ba1..877ba68edec7b8b444ea7cd849fdcb337cfbc60d 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -94,6 +94,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 7cae36eac98d3d13cd2dbde0d0828f4e52d9395f..6f3d76b5e0d2fffdf59a07fbdf865a35e1860f90 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -64,6 +64,7 @@ import net.minecraft.network.protocol.game.PacketPlayOutExplosion; + import net.minecraft.network.protocol.game.PacketPlayOutGameStateChange; + import net.minecraft.network.protocol.game.PacketPlayOutNamedSoundEffect; + import net.minecraft.network.protocol.game.PacketPlayOutSpawnPosition; ++import net.minecraft.network.protocol.game.PacketPlayOutUpdateTime; + import net.minecraft.network.protocol.game.PacketPlayOutWorldEvent; + import net.minecraft.network.protocol.game.PacketPlayOutWorldParticles; + import net.minecraft.resources.MinecraftKey; +@@ -213,6 +214,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private final EnderDragonBattle dragonBattle; private final StructureManager structureManager; private final boolean Q; @@ -29,7 +37,7 @@ index baeca1fcb81c9f83e488a23be3cf66de3af65ba1..877ba68edec7b8b444ea7cd849fdcb33 // CraftBukkit start -@@ -485,6 +486,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -604,6 +606,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.getServer().addWorld(this.getWorld()); // CraftBukkit this.asyncChunkTaskManager = new com.destroystokyo.paper.io.chunk.ChunkTaskManager(this); // Paper @@ -37,7 +45,7 @@ index baeca1fcb81c9f83e488a23be3cf66de3af65ba1..877ba68edec7b8b444ea7cd849fdcb33 } // Tuinity start - optimise collision -@@ -1069,7 +1071,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1189,7 +1192,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.nextTickListBlock.nextTick(); // Paper this.nextTickListFluid.nextTick(); // Paper this.worldDataServer.u().a(this.server, i); @@ -60,7 +68,7 @@ index baeca1fcb81c9f83e488a23be3cf66de3af65ba1..877ba68edec7b8b444ea7cd849fdcb33 this.setDayTime(this.worldData.getDayTime() + 1L); } -@@ -1078,6 +1094,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1198,6 +1215,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { public void setDayTime(long i) { this.worldDataServer.setDayTime(i); @@ -74,7 +82,7 @@ index baeca1fcb81c9f83e488a23be3cf66de3af65ba1..877ba68edec7b8b444ea7cd849fdcb33 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 95d14d82d6f8bce762ef70645f0f8eae3093914c..0b58a2e99a2f89d450d7980eb4837172e8a10dba 100644 +index fdd44288c3d962df02cb65a5de5ac75d3dd4c5b9..ae1202142600a15566c4c3d77487ff65c1f06087 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/Purpur/patches/server/0117-Allow-infinite-and-mending-enchantments-together.patch b/patches/Purpur/patches/server/0117-Allow-infinite-and-mending-enchantments-together.patch index 30dc5086..a451c246 100644 --- a/patches/Purpur/patches/server/0117-Allow-infinite-and-mending-enchantments-together.patch +++ b/patches/Purpur/patches/server/0117-Allow-infinite-and-mending-enchantments-together.patch @@ -4,11 +4,11 @@ Date: Tue, 13 Oct 2020 20:04:33 -0500 Subject: [PATCH] Allow infinite and mending enchantments together -diff --git a/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java b/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java -index 408cfa460920f74e0394ab27101ecb12cceb9c43..3d4e34f7070a48c436284ba7744a94aeacbb7651 100644 ---- a/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java -+++ b/src/main/java/net/minecraft/server/EnchantmentInfiniteArrows.java -@@ -23,6 +23,6 @@ public class EnchantmentInfiniteArrows extends Enchantment { +diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentInfiniteArrows.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentInfiniteArrows.java +index bf9d6d0e593951aa5abc9aef6cf4803430ea18e5..29bebbccf8dd6ff8976d1bfdb4c2ddcfc9de57dc 100644 +--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentInfiniteArrows.java ++++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentInfiniteArrows.java +@@ -25,6 +25,6 @@ public class EnchantmentInfiniteArrows extends Enchantment { @Override public boolean a(Enchantment enchantment) { @@ -17,10 +17,10 @@ index 408cfa460920f74e0394ab27101ecb12cceb9c43..3d4e34f7070a48c436284ba7744a94ae } } diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index a5febd7671ae1818edb18955d5e8176303c92c93..a20d7ac486a915fae2c6c7d42aa07d44f42438db 100644 +index c61595aa6e42a4cc096bda9126d23c465f8bd3de..44d3b46fc9fa9852187bacc71beeecaf53040c11 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -197,6 +197,16 @@ public class PurpurConfig { +@@ -198,6 +198,16 @@ public class PurpurConfig { cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame); } diff --git a/patches/Purpur/patches/server/0118-Infinite-fuel-furnace.patch b/patches/Purpur/patches/server/0118-Infinite-fuel-furnace.patch index b18d6d13..c088f8ec 100644 --- a/patches/Purpur/patches/server/0118-Infinite-fuel-furnace.patch +++ b/patches/Purpur/patches/server/0118-Infinite-fuel-furnace.patch @@ -4,11 +4,27 @@ Date: Mon, 19 Oct 2020 15:14:01 -0500 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 935c7f111a7d7b9cc7c8e384d43e7ab6092cfc5f..48359a7e79b64026e38e7cd17505d8944106e089 100644 ---- a/src/main/java/net/minecraft/server/TileEntityFurnace.java -+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -279,6 +279,22 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java +index 1997139fb87dc1947acfdf02e1f116577c3fa943..cd7bcedf8474dcb565b5b1157e167706c031a7f1 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java +@@ -12,6 +12,7 @@ import java.util.Map; + import javax.annotation.Nullable; + import net.minecraft.SharedConstants; + import net.minecraft.SystemUtils; ++import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; + import net.minecraft.core.NonNullList; + import net.minecraft.nbt.NBTTagCompound; +@@ -38,6 +39,7 @@ import net.minecraft.world.level.World; + import net.minecraft.world.level.block.BlockFurnace; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.material.Fluid; + import net.minecraft.world.phys.Vec3D; + + // CraftBukkit start +@@ -308,6 +310,22 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I if (!this.world.isClientSide) { ItemStack itemstack = (ItemStack) this.items.get(1); @@ -31,7 +47,7 @@ index 935c7f111a7d7b9cc7c8e384d43e7ab6092cfc5f..48359a7e79b64026e38e7cd17505d894 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); -@@ -332,6 +348,8 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -361,6 +379,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,7 +57,7 @@ index 935c7f111a7d7b9cc7c8e384d43e7ab6092cfc5f..48359a7e79b64026e38e7cd17505d894 if (flag1) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 0b58a2e99a2f89d450d7980eb4837172e8a10dba..0cae636df21d73f88acc4dbbf7563cf8a44c5a58 100644 +index ae1202142600a15566c4c3d77487ff65c1f06087..c9a6261e988c85874d24ed78890e668637aaf6d6 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -351,6 +351,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0119-Arrows-should-not-reset-despawn-counter.patch b/patches/Purpur/patches/server/0119-Arrows-should-not-reset-despawn-counter.patch index 29ecb9e8..7074af8b 100644 --- a/patches/Purpur/patches/server/0119-Arrows-should-not-reset-despawn-counter.patch +++ b/patches/Purpur/patches/server/0119-Arrows-should-not-reset-despawn-counter.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Arrows should not reset despawn counter This prevents keeping arrows alive indefinitely (such as when the block the arrow is stuck in gets removed, like a piston head going up/down) -diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 10cbddae4ede09ccec3b9c459c09fa18e2211238..ed662d59384a718a56149ea24f01115f62c30d91 100644 ---- a/src/main/java/net/minecraft/server/EntityArrow.java -+++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -245,7 +245,7 @@ public abstract class EntityArrow extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +index 3ee404effe339a5742926255da6a9c41d1bc9367..6f0a306449844dc50426202262219d0e952459cc 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +@@ -283,7 +283,7 @@ public abstract class EntityArrow extends IProjectile { Vec3D vec3d = this.getMot(); this.setMot(vec3d.d((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F))); diff --git a/patches/Purpur/patches/server/0120-Add-tablist-suffix-option-for-afk.patch b/patches/Purpur/patches/server/0120-Add-tablist-suffix-option-for-afk.patch index 257423a3..66282d79 100644 --- a/patches/Purpur/patches/server/0120-Add-tablist-suffix-option-for-afk.patch +++ b/patches/Purpur/patches/server/0120-Add-tablist-suffix-option-for-afk.patch @@ -4,11 +4,11 @@ Date: Thu, 12 Nov 2020 11:02:50 +0100 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 04879594b5157d2e0ed7c464bcea52fa937fa68f..78abdcdc9e6eee80ee88454e5020ad26d7abe3fd 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1991,7 +1991,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index e1a6e4a359eb2aa484d479fde398473c349a63ba..9ec4008f2195908130410d2c36fb5bf21b26b991 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -2122,7 +2122,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } if (world.purpurConfig.idleTimeoutUpdateTabList) { @@ -22,10 +22,10 @@ index 04879594b5157d2e0ed7c464bcea52fa937fa68f..78abdcdc9e6eee80ee88454e5020ad26 ((WorldServer) world).everyoneSleeping(); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index a20d7ac486a915fae2c6c7d42aa07d44f42438db..767715963a79b06c8a0988b65bc589dc9c351138 100644 +index 44d3b46fc9fa9852187bacc71beeecaf53040c11..cc354e420befd531a8c1e778fd97e9b7c4c26f90 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -135,12 +135,14 @@ public class PurpurConfig { +@@ -136,12 +136,14 @@ public class PurpurConfig { public static String afkBroadcastAway = "ยงeยงo%s is now AFK"; public static String afkBroadcastBack = "ยงeยงo%s is no longer AFK"; public static String afkTabListPrefix = "[AFK] "; diff --git a/patches/Purpur/patches/server/0121-Ability-to-re-add-farmland-mechanics-from-Alpha.patch b/patches/Purpur/patches/server/0121-Ability-to-re-add-farmland-mechanics-from-Alpha.patch index b7361f01..377a4b73 100644 --- a/patches/Purpur/patches/server/0121-Ability-to-re-add-farmland-mechanics-from-Alpha.patch +++ b/patches/Purpur/patches/server/0121-Ability-to-re-add-farmland-mechanics-from-Alpha.patch @@ -4,11 +4,11 @@ Date: Sat, 14 Nov 2020 08:06:20 -0800 Subject: [PATCH] Ability to re-add farmland mechanics from Alpha -diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java -index 8dd48669c29dd51ed4d535dad0b0319f4bb2250c..099e0d3df219408ebe2a741a02e53eb9f7def28e 100644 ---- a/src/main/java/net/minecraft/server/BlockSoil.java -+++ b/src/main/java/net/minecraft/server/BlockSoil.java -@@ -90,6 +90,14 @@ public class BlockSoil extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +index 2bbaa2fb426869223a9b2f07406496c1b0daff3f..3e8893bf76b8ffda4c595c81086556ea929beaa4 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +@@ -113,6 +113,14 @@ public class BlockSoil extends Block { return; } @@ -24,7 +24,7 @@ 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 0cae636df21d73f88acc4dbbf7563cf8a44c5a58..9f8d9b65b151149720ce2d69299ddd0bbe0045d1 100644 +index c9a6261e988c85874d24ed78890e668637aaf6d6..f774572a14c0d997aabeab902dca9764a5f1411e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -347,8 +347,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0122-Add-adjustable-breeding-cooldown-to-config.patch b/patches/Purpur/patches/server/0122-Add-adjustable-breeding-cooldown-to-config.patch index 78d1ef4b..7432680d 100644 --- a/patches/Purpur/patches/server/0122-Add-adjustable-breeding-cooldown-to-config.patch +++ b/patches/Purpur/patches/server/0122-Add-adjustable-breeding-cooldown-to-config.patch @@ -4,11 +4,11 @@ Date: Fri, 13 Nov 2020 17:52:40 +0100 Subject: [PATCH] Add adjustable breeding cooldown to config -diff --git a/src/main/java/net/minecraft/server/EntityAnimal.java b/src/main/java/net/minecraft/server/EntityAnimal.java -index b290218e506d5e4ddd1af17f91de19a588bbcfbd..cf9be4be18e913e49e9150358c66138b64319ed8 100644 ---- a/src/main/java/net/minecraft/server/EntityAnimal.java -+++ b/src/main/java/net/minecraft/server/EntityAnimal.java -@@ -121,7 +121,7 @@ public abstract class EntityAnimal extends EntityAgeable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java b/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java +index 28dd42921961c6a47f2d85a5f93b8298f2c228d3..6ae5fafd379863bf23df3580d3dbc7a5ba63b545 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java +@@ -145,7 +145,7 @@ public abstract class EntityAnimal extends EntityAgeable { if (this.k(itemstack)) { int i = this.getAge(); @@ -17,7 +17,7 @@ index b290218e506d5e4ddd1af17f91de19a588bbcfbd..cf9be4be18e913e49e9150358c66138b this.a(entityhuman, itemstack); this.g(entityhuman); return EnumInteractionResult.SUCCESS; -@@ -213,6 +213,14 @@ public abstract class EntityAnimal extends EntityAgeable { +@@ -237,6 +237,14 @@ public abstract class EntityAnimal extends EntityAgeable { if (entityplayer == null && entityanimal.getBreedCause() != null) { entityplayer = entityanimal.getBreedCause(); } @@ -32,11 +32,19 @@ index b290218e506d5e4ddd1af17f91de19a588bbcfbd..cf9be4be18e913e49e9150358c66138b // CraftBukkit start - call EntityBreedEvent 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 452dbbf572ad38716c81ae90873884076c1abc6f..abd415f02d8b4c28602b6c4aefc0914b5a83165b 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 { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 6d7a1c8d2f36277856212a329fb562d8902dfd28..f0588f5728e476185467d1f4e50b8647df6788dd 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -41,6 +41,7 @@ import net.minecraft.world.DifficultyDamageScaler; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.animal.EntityAnimal; + import net.minecraft.world.entity.decoration.EntityArmorStand; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; +@@ -166,6 +167,48 @@ public abstract class World implements GeneratorAccess, AutoCloseable { private int tileTickPosition; public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here @@ -51,11 +59,11 @@ index 452dbbf572ad38716c81ae90873884076c1abc6f..abd415f02d8b4c28602b6c4aefc0914b + this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); + } + -+ boolean hasBreedingCooldown(java.util.UUID player, Class animalType) { ++ public boolean hasBreedingCooldown(java.util.UUID player, Class animalType) { // Purpur + return this.playerBreedingCooldowns.getIfPresent(new BreedingCooldownPair(player, animalType)) != null; + } + -+ void addBreedingCooldown(java.util.UUID player, Class animalType) { ++ public void addBreedingCooldown(java.util.UUID player, Class animalType) { + this.playerBreedingCooldowns.put(new BreedingCooldownPair(player, animalType), new Object()); + } + @@ -85,16 +93,16 @@ index 452dbbf572ad38716c81ae90873884076c1abc6f..abd415f02d8b4c28602b6c4aefc0914b public CraftWorld getWorld() { return this.world; -@@ -188,6 +230,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper - this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config - this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig(((WorldDataServer) worlddatamutable).getName(), env); // Purpur -+ this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur +@@ -251,6 +294,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray + this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config + this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()), env); // Purpur ++ this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); + this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9f8d9b65b151149720ce2d69299ddd0bbe0045d1..84b2b8618162f81369dac9e8341374447d9b1737 100644 +index f774572a14c0d997aabeab902dca9764a5f1411e..23b4593ff14b7a74839f199b1b1056214a6943a0 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -220,6 +220,7 @@ public class PurpurWorldConfig { @@ -114,7 +122,7 @@ index 9f8d9b65b151149720ce2d69299ddd0bbe0045d1..84b2b8618162f81369dac9e834137444 public boolean catSpawning; diff --git a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java -index 4904be939c7a4b1d1583fd7b6232c930b79caba6..860d07cd686e0a6e3eebf2deaf6bcecc1fb9dfd2 100644 +index 536955124afaec5c8a070249c7432cb99bf43d67..0c35b1dd5147cf86c7ee743b98528e8f4bc0b5e9 100644 --- a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java +++ b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java @@ -49,6 +49,7 @@ public class PurpurCommand extends Command { diff --git a/patches/Purpur/patches/server/0123-Make-entity-breeding-times-configurable.patch b/patches/Purpur/patches/server/0123-Make-entity-breeding-times-configurable.patch index cc35052d..ef55ae9f 100644 --- a/patches/Purpur/patches/server/0123-Make-entity-breeding-times-configurable.patch +++ b/patches/Purpur/patches/server/0123-Make-entity-breeding-times-configurable.patch @@ -4,11 +4,11 @@ Date: Sun, 15 Nov 2020 02:18:15 -0800 Subject: [PATCH] Make entity breeding times configurable -diff --git a/src/main/java/net/minecraft/server/BehaviorMakeLove.java b/src/main/java/net/minecraft/server/BehaviorMakeLove.java -index 7bdcc7bb26a1f7c8fc2562016af8598b9a7b4de3..d22b1742e2bf9c390590851de45b2e66f1444b47 100644 ---- a/src/main/java/net/minecraft/server/BehaviorMakeLove.java -+++ b/src/main/java/net/minecraft/server/BehaviorMakeLove.java -@@ -102,8 +102,10 @@ public class BehaviorMakeLove extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java +index a68428554b93f4aba9f0cb0b3af03985896830b7..c1e8b9562eb37cee3d47034b93d4ef0c998eb52f 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorMakeLove.java +@@ -115,8 +115,10 @@ public class BehaviorMakeLove extends Behavior { if (entityvillager2 == null) { return Optional.empty(); } else { @@ -21,19 +21,19 @@ index 7bdcc7bb26a1f7c8fc2562016af8598b9a7b4de3..d22b1742e2bf9c390590851de45b2e66 entityvillager2.setAgeRaw(-24000); entityvillager2.setPositionRotation(entityvillager.locX(), entityvillager.locY(), entityvillager.locZ(), 0.0F, 0.0F); worldserver.addAllEntities(entityvillager2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason -diff --git a/src/main/java/net/minecraft/server/EntityAnimal.java b/src/main/java/net/minecraft/server/EntityAnimal.java -index cf9be4be18e913e49e9150358c66138b64319ed8..c1d2b12418464203c1da8af8da61a9cc9305bb65 100644 ---- a/src/main/java/net/minecraft/server/EntityAnimal.java -+++ b/src/main/java/net/minecraft/server/EntityAnimal.java -@@ -14,6 +14,7 @@ public abstract class EntityAnimal extends EntityAgeable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java b/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java +index 6ae5fafd379863bf23df3580d3dbc7a5ba63b545..38a4072a5df3abd3d1d9929f6402b3edfdd6c197 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityAnimal.java +@@ -38,6 +38,7 @@ public abstract class EntityAnimal extends EntityAgeable { public int loveTicks; public UUID breedCause; public ItemStack breedItem; // CraftBukkit - Add breedItem variable -+ abstract int getPurpurBreedTime(); // Purpur ++ public abstract int getPurpurBreedTime(); // Purpur protected EntityAnimal(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -235,8 +236,10 @@ public abstract class EntityAnimal extends EntityAgeable { +@@ -259,8 +260,10 @@ public abstract class EntityAnimal extends EntityAgeable { CriterionTriggers.o.a(entityplayer, this, entityanimal, entityageable); } @@ -46,87 +46,87 @@ index cf9be4be18e913e49e9150358c66138b64319ed8..c1d2b12418464203c1da8af8da61a9cc this.resetLove(); entityanimal.resetLove(); entityageable.setBaby(true); -diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index d8354ec4d19fc3fbddc2551ee217acb137482e63..ded4e10f5082fb5aa25368d9035affba287c3345 100644 ---- a/src/main/java/net/minecraft/server/EntityBee.java -+++ b/src/main/java/net/minecraft/server/EntityBee.java -@@ -100,6 +100,11 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +index 0c6d3dae70eeea844a31f9edf54410db13e0b04b..9e40fd6585592ccd1deff1d8319c57660474c053 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +@@ -176,6 +176,11 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB setMot(mot.a(0.9D)); } } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.beeBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 0e6552d77adb95c94cb06b6f9289c4c12e6955bb..437a7b8ffb40c461f1778d91591fa6c4dcf36834 100644 ---- a/src/main/java/net/minecraft/server/EntityCat.java -+++ b/src/main/java/net/minecraft/server/EntityCat.java -@@ -58,6 +58,11 @@ public class EntityCat extends EntityTameableAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +index 3efb010d0e045d14051a33bd7465669e415c26bd..079b95ef465f7155f426a2c87a4a50f8369d0a18 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +@@ -122,6 +122,11 @@ public class EntityCat extends EntityTameableAnimal { setSleepingWithOwner(false); setHeadDown(false); } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.catBreedingTicks; + } // Purpur end public MinecraftKey eU() { -diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index ee59a9f272a9caebec8f2329e1e4b22ddd27a0f9..2e1dc047459889aea85a79eaa04e8fe1a80e5b9e 100644 ---- a/src/main/java/net/minecraft/server/EntityChicken.java -+++ b/src/main/java/net/minecraft/server/EntityChicken.java -@@ -34,6 +34,11 @@ public class EntityChicken extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +index 5c744f1eac19e144c39a2c146d312f0547d6e589..ab54e809f735cea7d84366d2bc205351f8992bef 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +@@ -71,6 +71,11 @@ public class EntityChicken extends EntityAnimal { this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D); } } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.chickenBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 1219b0aa9c62bc9a1bda45cc9e9a27f14a28fe2e..63497ca0266073dc0a16b7dc22641d08c3eaf400 100644 ---- a/src/main/java/net/minecraft/server/EntityCow.java -+++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -21,6 +21,11 @@ public class EntityCow extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +index cad256514c7df92847522c8d7ddf45ebe02658c4..93589a2b86e6663d93f6b536b853996c08db549a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +@@ -54,6 +54,11 @@ public class EntityCow extends EntityAnimal { public boolean isRidableInWater() { return world.purpurConfig.cowRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.cowBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index f5defe4713c6be7d32fb2116110516717460284e..b5f036af81ddd3c1b0e388a28383f0b6a63d128c 100644 ---- a/src/main/java/net/minecraft/server/EntityFox.java -+++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -86,6 +86,11 @@ public class EntityFox extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +index 0c1151b598aa681e63ddaac29e4a589f917fd03b..7bf546a1b2a80179962ed08a35d86f0a28eda3c2 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +@@ -159,6 +159,11 @@ public class EntityFox extends EntityAnimal { super.onDismount(entityhuman); setCanPickupLoot(true); } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.foxBreedingTicks; + } // Purpur end @Override -@@ -1300,8 +1305,10 @@ public class EntityFox extends EntityAnimal { +@@ -1373,8 +1378,10 @@ public class EntityFox extends EntityAnimal { CriterionTriggers.o.a(entityplayer2, this.animal, this.partner, (EntityAgeable) entityfox); } @@ -139,296 +139,296 @@ index f5defe4713c6be7d32fb2116110516717460284e..b5f036af81ddd3c1b0e388a28383f0b6 this.animal.resetLove(); this.partner.resetLove(); entityfox.setAgeRaw(-24000); -diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index 548ff4449faca0abdf72487276fe49207bacfe17..a1578aade4a535144b5e40277c902f2e9ab9e940 100644 ---- a/src/main/java/net/minecraft/server/EntityHoglin.java -+++ b/src/main/java/net/minecraft/server/EntityHoglin.java -@@ -30,6 +30,11 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - public boolean isRidableInWater() { - return world.purpurConfig.hoglinRidableInWater; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.hoglinBreedingTicks; -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 4ffc61acdff8c51dc9b111e3024c828fb5386118..669bce5d9806c80bddc247fe103ff20dc6aaa8a5 100644 ---- a/src/main/java/net/minecraft/server/EntityHorse.java -+++ b/src/main/java/net/minecraft/server/EntityHorse.java -@@ -17,6 +17,11 @@ public class EntityHorse extends EntityHorseAbstract { - public boolean isRidableInWater() { - return world.purpurConfig.horseRidableInWater; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.horseBreedingTicks; -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -index cb8aee5691ff4ecaa6ae60f1637b1852d3b6c162..f6421bb45c5e6adf39fdc085efe2b2f500b76c0c 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java -+++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -@@ -13,6 +13,11 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { - public boolean isRidableInWater() { - return world.purpurConfig.donkeyRidableInWater; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.donkeyBreedingTicks; -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseMule.java b/src/main/java/net/minecraft/server/EntityHorseMule.java -index 243aeb736e350418e9476819bbfec0e7ab59f92f..30cbc505d2b0f4d3247edfd271de8daab023eb2a 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseMule.java -+++ b/src/main/java/net/minecraft/server/EntityHorseMule.java -@@ -13,6 +13,11 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { - public boolean isRidableInWater() { - return world.purpurConfig.muleRidableInWater; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.muleBreedingTicks; -+ } - // Purpur end - @Override - protected SoundEffect getSoundAmbient() { -diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index e2c6a5807a4554a7eebb148e40f1f8a1d979df5e..408db52cacbdfbca8af0a6a8e913b0128a3f5a76 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -@@ -22,6 +22,11 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - public boolean isTamed() { - return true; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return 6000; -+ } - // Purpur end - - public static AttributeProvider.Builder eL() { -diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java -index 559ba50977147b8e2a0e7c1e7dc281faabd7f292..2121a6c979ba2ea7cb596ca6081750d2f8c7df9f 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseZombie.java -+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java -@@ -18,6 +18,11 @@ public class EntityHorseZombie extends EntityHorseAbstract { - public boolean isTamed() { - return true; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return 6000; -+ } - // Purpur end - - public static AttributeProvider.Builder eL() { -diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 1099277868f92fdaf4b0ec3a982f26f20ead7369..3bc6e6df9e0107debe5b15f5f7aad97ad336f304 100644 ---- a/src/main/java/net/minecraft/server/EntityLlama.java -+++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -57,6 +57,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - public boolean hasSaddle() { - return super.hasSaddle() || (isTamed() && getColor() != null); - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.llamaBreedingTicks; -+ } - // Purpur end - - public void setStrength(int i) { -diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index e38d165fefb4d552ded2198536a6663a5688070d..46d031ef3cebfe30e07840ef1c9d60a97a24cd1b 100644 ---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java -+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -31,6 +31,11 @@ public class EntityMushroomCow extends EntityCow implements IShearable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +index 815e907e8db721f2a6f0f831b69c44a9573b5c9b..ab4a8ee6e1912f230cbf3353eb42c3bc8a9db58e 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +@@ -67,6 +67,11 @@ public class EntityMushroomCow extends EntityCow implements IShearable { public boolean isRidableInWater() { return world.purpurConfig.mooshroomRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.mooshroomBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 2f8275cd6b3cde0d3f949219f67ba7f0e0031dc3..a5be10dfb0de08b0d97265278b1f11ad1e94b821 100644 ---- a/src/main/java/net/minecraft/server/EntityOcelot.java -+++ b/src/main/java/net/minecraft/server/EntityOcelot.java -@@ -26,6 +26,11 @@ public class EntityOcelot extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +index d7938ff0dca305f1d47fdfdbc57648892debe367..cff2ff5a8beef739f0515832e072e7e390ac388f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +@@ -74,6 +74,11 @@ public class EntityOcelot extends EntityAnimal { public boolean isRidableInWater() { return world.purpurConfig.ocelotRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.ocelotBreedingTicks; + } // Purpur end private boolean isTrusting() { -diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java -index eafae5516b9b5d51aa943796557926cf61476d2b..c70180fddb829419b9cc5188766e9130f9b8a94a 100644 ---- a/src/main/java/net/minecraft/server/EntityPanda.java -+++ b/src/main/java/net/minecraft/server/EntityPanda.java -@@ -65,6 +65,11 @@ public class EntityPanda extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +index 0d912399e1975d9c0d5525f5b89049f40e7efcc0..e6952c0a8d90eb4b133c517d97299f2c3db7e329 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +@@ -121,6 +121,11 @@ public class EntityPanda extends EntityAnimal { this.setEating(false); this.setLayingOnBack(false); } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.pandaBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java -index e402d4a77b57b8b12b7575a9793c30d7acfa7fb0..398e92bf7053c411bd98626efe4261e15256d3ee 100644 ---- a/src/main/java/net/minecraft/server/EntityParrot.java -+++ b/src/main/java/net/minecraft/server/EntityParrot.java -@@ -115,6 +115,11 @@ public class EntityParrot extends EntityPerchable implements EntityBird { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +index 5c26eea7e3e93dc7bcd8b86519e84db58b70cecb..5463e1779422ff19499727a000fdfbbfc38809a8 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +@@ -171,6 +171,11 @@ public class EntityParrot extends EntityPerchable implements EntityBird { setMot(mot.a(0.9D)); } } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return 6000; + } // Purpur end @Nullable -diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index bf7ecd7a7d805cc8f1314a348d7b13f848da46b5..eae841eeac75a35a9dc5a53c57538ac5264ece68 100644 ---- a/src/main/java/net/minecraft/server/EntityPig.java -+++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -29,6 +29,11 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +index cef69f99d7bc9b6605b9654c50f43a1ebc1a8509..5aa8806063186bec36b38adc51e2ea82bf6ff21a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +@@ -77,6 +77,11 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { public boolean isRidableInWater() { return world.purpurConfig.pigRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.pigBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index 3d649843f565d2c8820b525c199bd2b9f9120cc7..40395dd7ea515e51a189d014a3274d15dc1d8ee6 100644 ---- a/src/main/java/net/minecraft/server/EntityPolarBear.java -+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java -@@ -67,6 +67,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +index e686491a469573a3fc466c46be1b7430ff02ba53..2306abb72ea76a52fd6f27648c4815ad99f8f005 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +@@ -116,6 +116,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { return this.isInLove() && polarbear.isInLove(); } } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.polarBearBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index 95f4592944a53aab0ff9843ae8e7c9b9cd0201c7..b7f4d61f0038d865ef9ee3c14f6dc146f8de5ac4 100644 ---- a/src/main/java/net/minecraft/server/EntityRabbit.java -+++ b/src/main/java/net/minecraft/server/EntityRabbit.java -@@ -30,6 +30,11 @@ public class EntityRabbit extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +index fff6bcff9d44c7d49cd2d0c334ea702531c74ea1..0b706404895b69fbca79502a327ec20b47ed99f0 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +@@ -86,6 +86,11 @@ public class EntityRabbit extends EntityAnimal { public boolean isRidableInWater() { return world.purpurConfig.rabbitRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.rabbitBreedingTicks; + } // Purpur end // CraftBukkit start - code from constructor -diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index a151d4295c02930687a23212647de60cce5405ca..32130c0681501e3e5a47b199f0bb39daac416ed3 100644 ---- a/src/main/java/net/minecraft/server/EntitySheep.java -+++ b/src/main/java/net/minecraft/server/EntitySheep.java -@@ -66,6 +66,11 @@ public class EntitySheep extends EntityAnimal implements IShearable { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +index 8f3296031f220dd7bb3ae9fe2443e479954ebad3..ff6fc821085e4430a3b1008140b0b7fcacc59d2e 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +@@ -121,6 +121,11 @@ public class EntitySheep extends EntityAnimal implements IShearable { public boolean isRidableInWater() { return world.purpurConfig.sheepRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.sheepBreedingTicks; + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java -index 56b72132595db5bc9addf31aecde5c13c5fd44c2..5c960365901b6ebd74134dac2e90c6aa81d33351 100644 ---- a/src/main/java/net/minecraft/server/EntityStrider.java -+++ b/src/main/java/net/minecraft/server/EntityStrider.java -@@ -38,6 +38,11 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab - public boolean isRidableInWater() { - return world.purpurConfig.striderRidableInWater; - } -+ -+ @Override -+ int getPurpurBreedTime() { -+ return this.world.purpurConfig.striderBreedingTicks; -+ } - // Purpur end - - public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { -diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 2b34e6cf3b86319bd2875d92b63902889fec32a8..067f7f28b02b388d56b93b1ed8274799757196e6 100644 ---- a/src/main/java/net/minecraft/server/EntityTurtle.java -+++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -37,6 +37,11 @@ public class EntityTurtle extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +index 28d6e673f55fc8fae40dff4a96ac2c2b5eeab9d6..a16f586934f24e599d00bf793f06d3f9134ed29d 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +@@ -101,6 +101,11 @@ public class EntityTurtle extends EntityAnimal { public boolean isRidableInWater() { return world.purpurConfig.turtleRidableInWater; } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.turtleBreedingTicks; + } // Purpur end public void setHomePos(BlockPosition blockposition) { -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 9ae7168595dd66860e09ef87f946b18b010e54b1..6c25f667eecdf345289a0dbf885c9d71c6a26958 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -48,6 +48,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index 3fbd8f9122d7a5ac23af4d872f877030644ef86a..dd3c7ad7701ad18ccaf86d73fde7051090ed3d57 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -107,6 +107,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable super.onMount(entityhuman); setSitting(false); } + + @Override -+ int getPurpurBreedTime() { ++ public int getPurpurBreedTime() { + return this.world.purpurConfig.wolfBreedingTicks; + } // Purpur end + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +index 650f13b1133e4c61f71b36f3f91a9d2913996435..c830bf6e5e38f5ebacc07673c3d67e4157c8c2b5 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +@@ -46,6 +46,11 @@ public class EntityHorse extends EntityHorseAbstract { + public boolean isRidableInWater() { + return world.purpurConfig.horseRidableInWater; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.horseBreedingTicks; ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +index 50700bf85a296b87fe3155651f869e2bbdb0875d..3b44394dcba8e9905aca46e6e585ee6d7a87de44 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +@@ -21,6 +21,11 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { + public boolean isRidableInWater() { + return world.purpurConfig.donkeyRidableInWater; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.donkeyBreedingTicks; ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +index b6385a23050296611dbc8864b92d2cdd8321a1d0..0536112357e0321dbb902331467b847894a4c11b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +@@ -20,6 +20,11 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { + public boolean isRidableInWater() { + return world.purpurConfig.muleRidableInWater; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.muleBreedingTicks; ++ } + // Purpur end + @Override + protected SoundEffect getSoundAmbient() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +index d21399fbb6ddc4f26a7509ce547f8c4ad6458089..28c6e3745c61d0670bf7f3a324169472250e25f4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +@@ -43,6 +43,11 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + public boolean isTamed() { + return true; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return 6000; ++ } + // Purpur end + + public static AttributeProvider.Builder eL() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +index d57e7c02268e5d8a00b0b5897fa03dcee10cd2e0..c776f18722d1aa73f53da66ef6b37564eeaddd2a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +@@ -35,6 +35,11 @@ public class EntityHorseZombie extends EntityHorseAbstract { + public boolean isTamed() { + return true; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return 6000; ++ } + // Purpur end + + public static AttributeProvider.Builder eL() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +index d1bd7b9a6a8cfb6b609db4229b2f42a40b8b484f..b3d51abc9bad9cad6fdc5dbdc2bf09d43a565f98 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +@@ -108,6 +108,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public boolean hasSaddle() { + return super.hasSaddle() || (isTamed() && getColor() != null); + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.llamaBreedingTicks; ++ } + // Purpur end + + public void setStrength(int i) { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +index 14dda6743ed9e6f4880bc560f7ba8892d8e84afe..cba66a08feceeeaf7c123da595fc7b12c5749783 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +@@ -105,6 +105,11 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + public boolean isRidableInWater() { + return world.purpurConfig.striderRidableInWater; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.striderBreedingTicks; ++ } + // Purpur end + + public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +index 64253428ef66145d07f74f8d0e5bdeb5aa5fe02b..828d01abe8202a246ce07c1c652a17cbc829d904 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +@@ -71,6 +71,11 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + public boolean isRidableInWater() { + return world.purpurConfig.hoglinRidableInWater; + } ++ ++ @Override ++ public int getPurpurBreedTime() { ++ return this.world.purpurConfig.hoglinBreedingTicks; ++ } + // Purpur end + @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 84b2b8618162f81369dac9e8341374447d9b1737..abc9b4fc27fdef37e3444cc3d885acab9f4d3f23 100644 +index 23b4593ff14b7a74839f199b1b1056214a6943a0..2d4dea3c432fcf52dffd126f8bd910be03c20b1c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -434,10 +434,12 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0124-Apply-display-names-from-item-forms-of-entities-to-e.patch b/patches/Purpur/patches/server/0124-Apply-display-names-from-item-forms-of-entities-to-e.patch index e23a64a7..9afc3105 100644 --- a/patches/Purpur/patches/server/0124-Apply-display-names-from-item-forms-of-entities-to-e.patch +++ b/patches/Purpur/patches/server/0124-Apply-display-names-from-item-forms-of-entities-to-e.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Apply display names from item forms of entities to entities and vice versa -diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 9e37bf25689691f9640b294c482978e8e3b6e627..759a8f95038778aead2f33a65a2d8f2d6b26a765 100644 ---- a/src/main/java/net/minecraft/server/EntityArmorStand.java -+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -553,7 +553,13 @@ public class EntityArmorStand extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +index 89d3734489b65245e815376edf4e2d9baea1563a..43dc0925887e2e9e86445cccff57be7994ca0d58 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +@@ -588,7 +588,13 @@ public class EntityArmorStand extends EntityLiving { } private void f(DamageSource damagesource) { @@ -24,30 +24,11 @@ index 9e37bf25689691f9640b294c482978e8e3b6e627..759a8f95038778aead2f33a65a2d8f2d this.g(damagesource); } -diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java -index 05c702bbdb8addea5c69faa0479609e8959945f1..fcb4936e78d56907b0e56d0aaf7f8361513d0a4e 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 { - } - // CraftBukkit end - if (!flag && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { -- this.a((IMaterial) this.g()); -+ // Purpur start -+ final ItemStack boat = new ItemStack(this.getBoatItem()); -+ if (this.world.purpurConfig.persistentDroppableEntityDisplayNames && this.hasCustomName()) { -+ boat.setName(this.getCustomName()); -+ } -+ this.dropItem(boat); -+ // Purpur end - } - - this.die(); -diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java -index 8a95e698d5caa3730954ce1135b0ec37a389dd70..372be937f1cf95775e37931f326f6a77836968f3 100644 ---- a/src/main/java/net/minecraft/server/EntityItemFrame.java -+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java -@@ -199,7 +199,13 @@ public class EntityItemFrame extends EntityHanging { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/EntityItemFrame.java +index 43152a6c70c9433d627a58051101530ddd693307..eb07db442c5a0da73249f4a02be7dacae0ff0e45 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityItemFrame.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityItemFrame.java +@@ -229,7 +229,13 @@ public class EntityItemFrame extends EntityHanging { } if (flag) { @@ -62,11 +43,11 @@ index 8a95e698d5caa3730954ce1135b0ec37a389dd70..372be937f1cf95775e37931f326f6a77 } if (!itemstack.isEmpty()) { -diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java -index 4b7cd7c59fefbd56d38e0301b08d06ce92c9d8a2..d01fc8b11026536be30c8149aca253280524811f 100644 ---- a/src/main/java/net/minecraft/server/EntityPainting.java -+++ b/src/main/java/net/minecraft/server/EntityPainting.java -@@ -92,7 +92,13 @@ public class EntityPainting extends EntityHanging { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java +index 3de0f21648ca60bdfcbc078bca896d51bf84e207..7517e861301e0c329c70aa6f2bf5aa40114b6589 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityPainting.java +@@ -108,7 +108,13 @@ public class EntityPainting extends EntityHanging { } } @@ -81,11 +62,30 @@ index 4b7cd7c59fefbd56d38e0301b08d06ce92c9d8a2..d01fc8b11026536be30c8149aca25328 } } -diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java -index c9a5d3b583076cf8f2f32b12c142beb3f5e22dc0..315faee9e35d27071a62ea1d335dfbe5351582ca 100644 ---- a/src/main/java/net/minecraft/server/ItemArmorStand.java -+++ b/src/main/java/net/minecraft/server/ItemArmorStand.java -@@ -43,6 +43,14 @@ public class ItemArmorStand extends Item { +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +index e5cda8c040c93639211dacbf5b0c7cd6a9df9e6d..9cd1a2a2a8db1d8daf7c712d6bd03fad1b048485 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/EntityBoat.java +@@ -201,7 +201,13 @@ public class EntityBoat extends Entity { + } + // CraftBukkit end + if (!flag && this.world.getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) { +- this.a((IMaterial) this.g()); ++ // Purpur start ++ final ItemStack boat = new ItemStack(this.getBoatItem()); ++ if (this.world.purpurConfig.persistentDroppableEntityDisplayNames && this.hasCustomName()) { ++ boat.setName(this.getCustomName()); ++ } ++ this.dropItem(boat); ++ // Purpur end + } + + this.die(); +diff --git a/src/main/java/net/minecraft/world/item/ItemArmorStand.java b/src/main/java/net/minecraft/world/item/ItemArmorStand.java +index cd46df5485ebfd597ea72360a27872d46174ee19..245d3fe09feb9dc27b097642d40664a9f2377581 100644 +--- a/src/main/java/net/minecraft/world/item/ItemArmorStand.java ++++ b/src/main/java/net/minecraft/world/item/ItemArmorStand.java +@@ -63,6 +63,14 @@ public class ItemArmorStand extends Item { return EnumInteractionResult.FAIL; } // CraftBukkit end @@ -100,11 +100,11 @@ index c9a5d3b583076cf8f2f32b12c142beb3f5e22dc0..315faee9e35d27071a62ea1d335dfbe5 worldserver.addAllEntities(entityarmorstand); // Paper - moved down world.playSound((EntityHuman) null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); } -diff --git a/src/main/java/net/minecraft/server/ItemBoat.java b/src/main/java/net/minecraft/server/ItemBoat.java -index 0580ce55ec945b5bc6ce8c5d0cee13b03ccc7d1a..6183da7ad2a458f4ada288ec82fdaf097d771122 100644 ---- a/src/main/java/net/minecraft/server/ItemBoat.java -+++ b/src/main/java/net/minecraft/server/ItemBoat.java -@@ -52,6 +52,11 @@ public class ItemBoat extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemBoat.java b/src/main/java/net/minecraft/world/item/ItemBoat.java +index 1d812b3e27f87213afc3e441eb20ca984458ce2a..636a8bc76d436fc770b4e05a93f1991210b64230 100644 +--- a/src/main/java/net/minecraft/world/item/ItemBoat.java ++++ b/src/main/java/net/minecraft/world/item/ItemBoat.java +@@ -65,6 +65,11 @@ public class ItemBoat extends Item { entityboat.setType(this.b); entityboat.yaw = entityhuman.yaw; @@ -116,11 +116,11 @@ index 0580ce55ec945b5bc6ce8c5d0cee13b03ccc7d1a..6183da7ad2a458f4ada288ec82fdaf09 if (!world.getCubes(entityboat, entityboat.getBoundingBox().g(-0.1D))) { return InteractionResultWrapper.fail(itemstack); } else { -diff --git a/src/main/java/net/minecraft/server/ItemHanging.java b/src/main/java/net/minecraft/server/ItemHanging.java -index a3eaeeda875d96fe4b047bd6bf993018722c96b9..f2f800087adb0238b4b672b9f6f4c8c4836f2891 100644 ---- a/src/main/java/net/minecraft/server/ItemHanging.java -+++ b/src/main/java/net/minecraft/server/ItemHanging.java -@@ -26,7 +26,7 @@ public class ItemHanging extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemHanging.java b/src/main/java/net/minecraft/world/item/ItemHanging.java +index bbd3bb2d12e500d15485598783d39b0cb63a6d83..8e4c3304779cfccf7d45d4843f9c15bffce8ba07 100644 +--- a/src/main/java/net/minecraft/world/item/ItemHanging.java ++++ b/src/main/java/net/minecraft/world/item/ItemHanging.java +@@ -39,7 +39,7 @@ public class ItemHanging extends Item { return EnumInteractionResult.FAIL; } else { World world = itemactioncontext.getWorld(); @@ -129,7 +129,7 @@ index a3eaeeda875d96fe4b047bd6bf993018722c96b9..f2f800087adb0238b4b672b9f6f4c8c4 if (this.a == EntityTypes.PAINTING) { object = new EntityPainting(world, blockposition1, enumdirection); -@@ -42,6 +42,11 @@ public class ItemHanging extends Item { +@@ -55,6 +55,11 @@ public class ItemHanging extends Item { if (nbttagcompound != null) { EntityTypes.a(world, entityhuman, (Entity) object, nbttagcompound); @@ -141,11 +141,11 @@ index a3eaeeda875d96fe4b047bd6bf993018722c96b9..f2f800087adb0238b4b672b9f6f4c8c4 } if (((EntityHanging) object).survives()) { -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index a4edfb02fd350433020b0f3699726b6127ab9933..3f9062d8eca3ce53c0fb9e9e40330aa4e3296c9a 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -733,6 +733,7 @@ public final class ItemStack { +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 81e2ccfa4f6cf6a4ad9236cf0ce94df8dc3ec5b6..132972755ac74838f3386e0fac5033380b71fce5 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -788,6 +788,7 @@ public final class ItemStack { return this.getItem().h(this); } @@ -154,7 +154,7 @@ index a4edfb02fd350433020b0f3699726b6127ab9933..3f9062d8eca3ce53c0fb9e9e40330aa4 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 abc9b4fc27fdef37e3444cc3d885acab9f4d3f23..7915a0204597a3711c1f177cf504a1c3c603e91e 100644 +index 2d4dea3c432fcf52dffd126f8bd910be03c20b1c..e1af622206f28186e7eebf135f3786c7a771b337 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/Purpur/patches/server/0125-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch b/patches/Purpur/patches/server/0125-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch index e9c06996..5044d12a 100644 --- a/patches/Purpur/patches/server/0125-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch +++ b/patches/Purpur/patches/server/0125-Set-name-visible-when-using-a-Name-Tag-on-an-Armor-S.patch @@ -4,11 +4,19 @@ Date: Tue, 17 Nov 2020 13:12:09 -0800 Subject: [PATCH] Set name visible when using a Name Tag on an Armor Stand -diff --git a/src/main/java/net/minecraft/server/ItemNameTag.java b/src/main/java/net/minecraft/server/ItemNameTag.java -index a34772e329df62d9176b0aa392197e2771c69da4..facaca3622e028e315b822a61ed40ba518de2720 100644 ---- a/src/main/java/net/minecraft/server/ItemNameTag.java -+++ b/src/main/java/net/minecraft/server/ItemNameTag.java -@@ -20,6 +20,11 @@ public class ItemNameTag extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemNameTag.java b/src/main/java/net/minecraft/world/item/ItemNameTag.java +index b9b2b27e534ba87a1aae3c521f393a066a18a199..4f4e9ebb9af4970fe920a540d40dbc56682efd57 100644 +--- a/src/main/java/net/minecraft/world/item/ItemNameTag.java ++++ b/src/main/java/net/minecraft/world/item/ItemNameTag.java +@@ -5,6 +5,7 @@ import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityLiving; ++import net.minecraft.world.entity.decoration.EntityArmorStand; + import net.minecraft.world.entity.player.EntityHuman; + + // Paper start +@@ -27,6 +28,11 @@ public class ItemNameTag extends Item { if (!event.callEvent()) return EnumInteractionResult.PASS; EntityLiving newEntityLiving = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle(); newEntityLiving.setCustomName(event.getName() != null ? PaperAdventure.asVanilla(event.getName()) : null); @@ -21,7 +29,7 @@ index a34772e329df62d9176b0aa392197e2771c69da4..facaca3622e028e315b822a61ed40ba5 ((EntityInsentient) newEntityLiving).setPersistent(); } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 7915a0204597a3711c1f177cf504a1c3c603e91e..9a419e2e591113015bd122202aba2a8aa8494f63 100644 +index e1af622206f28186e7eebf135f3786c7a771b337..43d23f55283ad8a611073bceaea554368775f483 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/Purpur/patches/server/0126-Add-twisting-and-weeping-vines-growth-rates.patch b/patches/Purpur/patches/server/0126-Add-twisting-and-weeping-vines-growth-rates.patch index e2de87ec..14761176 100644 --- a/patches/Purpur/patches/server/0126-Add-twisting-and-weeping-vines-growth-rates.patch +++ b/patches/Purpur/patches/server/0126-Add-twisting-and-weeping-vines-growth-rates.patch @@ -4,11 +4,11 @@ Date: Sun, 22 Nov 2020 06:02:32 -0600 Subject: [PATCH] Add twisting and weeping vines growth rates -diff --git a/src/main/java/net/minecraft/server/BlockGrowingTop.java b/src/main/java/net/minecraft/server/BlockGrowingTop.java -index 7963411be990fed8eb0ffca3eba35d15a9b8d7bd..6c084ad5cda41425eed04465d942f6a73968cd61 100644 ---- a/src/main/java/net/minecraft/server/BlockGrowingTop.java -+++ b/src/main/java/net/minecraft/server/BlockGrowingTop.java -@@ -23,9 +23,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB +diff --git a/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java +index 84bd1fa9edb59b8515685a47783ed5e6abe7333f..546c7877647bac41753a600bd25c630a0510be56 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java +@@ -38,9 +38,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB return (Integer) iblockdata.get(BlockGrowingTop.d) < 25; } @@ -21,11 +21,19 @@ index 7963411be990fed8eb0ffca3eba35d15a9b8d7bd..6c084ad5cda41425eed04465d942f6a7 BlockPosition blockposition1 = blockposition.shift(this.a); if (this.h(worldserver.getType(blockposition1))) { -diff --git a/src/main/java/net/minecraft/server/BlockKelp.java b/src/main/java/net/minecraft/server/BlockKelp.java -index a243aaed58454ae304c988df8a8a090a8236075e..2a7a6e5943f2ff87815c398ffec01bb78d320690 100644 ---- a/src/main/java/net/minecraft/server/BlockKelp.java -+++ b/src/main/java/net/minecraft/server/BlockKelp.java -@@ -53,4 +53,10 @@ public class BlockKelp extends BlockGrowingTop implements IFluidContainer { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockKelp.java b/src/main/java/net/minecraft/world/level/block/BlockKelp.java +index 424b9b3c1263910eb6113f19efc14607dd2bf638..27f1cbe8786d7c37d62193a21baf0a2bdc6f0294 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockKelp.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockKelp.java +@@ -4,6 +4,7 @@ import java.util.Random; + import javax.annotation.Nullable; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsFluid; + import net.minecraft.world.item.context.BlockActionContext; +@@ -66,4 +67,10 @@ public class BlockKelp extends BlockGrowingTop implements IFluidContainer { public Fluid d(IBlockData iblockdata) { return FluidTypes.WATER.a(false); } @@ -36,11 +44,19 @@ index a243aaed58454ae304c988df8a8a090a8236075e..2a7a6e5943f2ff87815c398ffec01bb7 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/BlockTwistingVines.java b/src/main/java/net/minecraft/server/BlockTwistingVines.java -index be381674632c49d7465dd7d52084b52f45194b54..146638111c56ec81ab46b514d45a7cc8aac2b36a 100644 ---- a/src/main/java/net/minecraft/server/BlockTwistingVines.java -+++ b/src/main/java/net/minecraft/server/BlockTwistingVines.java -@@ -24,4 +24,10 @@ public class BlockTwistingVines extends BlockGrowingTop { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java +index 2cfa96f144391e664207ac8e8bdd3f11bfed4dff..3a8d08a1ee8f066cea36e6acff492e5af62993c5 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java +@@ -2,6 +2,7 @@ package net.minecraft.world.level.block; + + import java.util.Random; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.level.block.state.BlockBase; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.shapes.VoxelShape; +@@ -28,4 +29,10 @@ public class BlockTwistingVines extends BlockGrowingTop { protected boolean h(IBlockData iblockdata) { return BlockNetherVinesUtil.a(iblockdata); } @@ -51,11 +67,19 @@ index be381674632c49d7465dd7d52084b52f45194b54..146638111c56ec81ab46b514d45a7cc8 + } + // Purpur end } -diff --git a/src/main/java/net/minecraft/server/BlockWeepingVines.java b/src/main/java/net/minecraft/server/BlockWeepingVines.java -index 23dca1940375d243531fc4a891f04e937ae2f48f..94ffadb91fec65a721cf0c8fa98bad708a2ca269 100644 ---- a/src/main/java/net/minecraft/server/BlockWeepingVines.java -+++ b/src/main/java/net/minecraft/server/BlockWeepingVines.java -@@ -24,4 +24,10 @@ public class BlockWeepingVines extends BlockGrowingTop { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java +index 2552631084926c2fad40b3f21ae479c0e1cfdb77..198bd8857571872ed3f7437529c330dceeb825db 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java +@@ -2,6 +2,7 @@ package net.minecraft.world.level.block; + + import java.util.Random; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.WorldServer; + import net.minecraft.world.level.block.state.BlockBase; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.shapes.VoxelShape; +@@ -28,4 +29,10 @@ public class BlockWeepingVines extends BlockGrowingTop { protected boolean h(IBlockData iblockdata) { return BlockNetherVinesUtil.a(iblockdata); } @@ -67,7 +91,7 @@ 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 9a419e2e591113015bd122202aba2a8aa8494f63..8f59e8412c2d82211274abdc9fc9bb94f117960d 100644 +index 43d23f55283ad8a611073bceaea554368775f483..a7a368a0a4e59800b4ba9191ab24cca9ea636ff0 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -419,6 +419,16 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0127-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch b/patches/Purpur/patches/server/0127-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch index 2391f3b1..4edef9f0 100644 --- a/patches/Purpur/patches/server/0127-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch +++ b/patches/Purpur/patches/server/0127-Kelp-weeping-and-twisting-vines-configurable-max-gro.patch @@ -4,11 +4,11 @@ Date: Sun, 22 Nov 2020 20:13:27 -0600 Subject: [PATCH] Kelp weeping and twisting vines configurable max growth age -diff --git a/src/main/java/net/minecraft/server/BlockGrowingTop.java b/src/main/java/net/minecraft/server/BlockGrowingTop.java -index 6c084ad5cda41425eed04465d942f6a73968cd61..6d49422c3358b06369e1a31ee5580ff4a0057c5f 100644 ---- a/src/main/java/net/minecraft/server/BlockGrowingTop.java -+++ b/src/main/java/net/minecraft/server/BlockGrowingTop.java -@@ -15,7 +15,7 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB +diff --git a/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java +index 546c7877647bac41753a600bd25c630a0510be56..3d6a1131a138114424b683a81d04478e92d05544 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockGrowingTop.java +@@ -30,7 +30,7 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB @Override public IBlockData a(GeneratorAccess generatoraccess) { @@ -17,7 +17,7 @@ index 6c084ad5cda41425eed04465d942f6a73968cd61..6d49422c3358b06369e1a31ee5580ff4 } @Override -@@ -25,9 +25,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB +@@ -40,9 +40,11 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB public abstract double getGrowthModifier(WorldServer worldserver); // Purpur @@ -30,7 +30,7 @@ index 6c084ad5cda41425eed04465d942f6a73968cd61..6d49422c3358b06369e1a31ee5580ff4 BlockPosition blockposition1 = blockposition.shift(this.a); if (this.h(worldserver.getType(blockposition1))) { -@@ -72,13 +74,13 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB +@@ -87,13 +89,13 @@ public abstract class BlockGrowingTop extends BlockGrowingAbstract implements IB @Override public void a(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) { BlockPosition blockposition1 = blockposition.shift(this.a); @@ -46,11 +46,11 @@ index 6c084ad5cda41425eed04465d942f6a73968cd61..6d49422c3358b06369e1a31ee5580ff4 } } -diff --git a/src/main/java/net/minecraft/server/BlockKelp.java b/src/main/java/net/minecraft/server/BlockKelp.java -index 2a7a6e5943f2ff87815c398ffec01bb78d320690..b35c115e34cf5f7a24cd26ca31c19a63c82e0080 100644 ---- a/src/main/java/net/minecraft/server/BlockKelp.java -+++ b/src/main/java/net/minecraft/server/BlockKelp.java -@@ -58,5 +58,9 @@ public class BlockKelp extends BlockGrowingTop implements IFluidContainer { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockKelp.java b/src/main/java/net/minecraft/world/level/block/BlockKelp.java +index 27f1cbe8786d7c37d62193a21baf0a2bdc6f0294..90ad39d40e4f979126d80c70df292e01e07ed793 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockKelp.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockKelp.java +@@ -72,5 +72,9 @@ public class BlockKelp extends BlockGrowingTop implements IFluidContainer { public double getGrowthModifier(WorldServer worldserver) { return worldserver.spigotConfig.kelpModifier; } @@ -60,11 +60,11 @@ index 2a7a6e5943f2ff87815c398ffec01bb78d320690..b35c115e34cf5f7a24cd26ca31c19a63 + } // Purpur end } -diff --git a/src/main/java/net/minecraft/server/BlockTwistingVines.java b/src/main/java/net/minecraft/server/BlockTwistingVines.java -index 146638111c56ec81ab46b514d45a7cc8aac2b36a..71b9b7183df5702f2753c7372d0c491b2230b365 100644 ---- a/src/main/java/net/minecraft/server/BlockTwistingVines.java -+++ b/src/main/java/net/minecraft/server/BlockTwistingVines.java -@@ -29,5 +29,9 @@ public class BlockTwistingVines extends BlockGrowingTop { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java +index 3a8d08a1ee8f066cea36e6acff492e5af62993c5..d95151d50d2652e5f1b215267c898402f0b28829 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockTwistingVines.java +@@ -34,5 +34,9 @@ public class BlockTwistingVines extends BlockGrowingTop { public double getGrowthModifier(WorldServer worldserver) { return worldserver.purpurConfig.twistingVinesGrowthModifier; } @@ -74,11 +74,11 @@ index 146638111c56ec81ab46b514d45a7cc8aac2b36a..71b9b7183df5702f2753c7372d0c491b + } // Purpur end } -diff --git a/src/main/java/net/minecraft/server/BlockWeepingVines.java b/src/main/java/net/minecraft/server/BlockWeepingVines.java -index 94ffadb91fec65a721cf0c8fa98bad708a2ca269..067df63ab27ecb9fe0a0d012b16efbd546fdfff7 100644 ---- a/src/main/java/net/minecraft/server/BlockWeepingVines.java -+++ b/src/main/java/net/minecraft/server/BlockWeepingVines.java -@@ -29,5 +29,9 @@ public class BlockWeepingVines extends BlockGrowingTop { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java +index 198bd8857571872ed3f7437529c330dceeb825db..a71f97e87ee7210f3246e542dd768403905f7679 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockWeepingVines.java +@@ -34,5 +34,9 @@ public class BlockWeepingVines extends BlockGrowingTop { public double getGrowthModifier(WorldServer worldserver) { return worldserver.purpurConfig.weepingVinesGrowthModifier; } @@ -89,7 +89,7 @@ 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 8f59e8412c2d82211274abdc9fc9bb94f117960d..84172893cb5dd9aa61296d9bfb4cf0ea1ff91e9d 100644 +index a7a368a0a4e59800b4ba9191ab24cca9ea636ff0..27863bdfc41fd27a9dbf9e8f9673fcb65b9dc5a4 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -366,6 +366,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0128-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch b/patches/Purpur/patches/server/0128-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch index a934c9f1..2836a48a 100644 --- a/patches/Purpur/patches/server/0128-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch +++ b/patches/Purpur/patches/server/0128-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch @@ -7,11 +7,11 @@ Subject: [PATCH] Add config for allowing Endermen to despawn even while This should help to reduce the amount of dirt, gravel, grass, and etc. that Endermen like to randomly place all over the world. -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 995849212c25568d3aa28ada78babf8b8e669960..acb2b3ed04ea0bf19335415310ce22cd076dd92a 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -372,7 +372,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 03fa2cfc1d5bc27e03e9979b3f33d88362c19066..18b3f8d1fadd1424327261d92b49977a35c4948c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -435,7 +435,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @Override public boolean isSpecialPersistence() { @@ -21,7 +21,7 @@ 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 84172893cb5dd9aa61296d9bfb4cf0ea1ff91e9d..6c7e898dd42e958553d929b94ce5ddb9542001ee 100644 +index 27863bdfc41fd27a9dbf9e8f9673fcb65b9dc5a4..3a7d060263da6a31f65870833bbb82893700022d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -588,10 +588,12 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0129-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch b/patches/Purpur/patches/server/0129-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch index 587758b0..df2c2a10 100644 --- a/patches/Purpur/patches/server/0129-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch +++ b/patches/Purpur/patches/server/0129-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch @@ -4,11 +4,11 @@ Date: Tue, 24 Nov 2020 04:30:46 -0600 Subject: [PATCH] Add critical hit check to EntityDamagedByEntityEvent -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 3a7dc584bd2b88415a238f9c0cb7f85968fb8dfb..7ce46b53ad9fbaf7baf198557565b2467ab43c09 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -73,6 +73,7 @@ public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index 1062317c22171bccee78a2db1841e0fd2b3023d7..907bfe42bd866188639f7d25150fcde039c1e5f7 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -171,6 +171,7 @@ public abstract class EntityHuman extends EntityLiving { // Paper start public boolean affectsSpawning = true; // Paper end @@ -16,7 +16,7 @@ index 3a7dc584bd2b88415a238f9c0cb7f85968fb8dfb..7ce46b53ad9fbaf7baf198557565b246 // CraftBukkit start public boolean fauxSleeping; -@@ -1066,6 +1067,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1164,6 +1165,7 @@ public abstract class EntityHuman extends EntityLiving { flag2 = flag2 && !world.paperConfig.disablePlayerCrits; // Paper flag2 = flag2 && !this.isSprinting(); if (flag2) { @@ -24,7 +24,7 @@ index 3a7dc584bd2b88415a238f9c0cb7f85968fb8dfb..7ce46b53ad9fbaf7baf198557565b246 f *= 1.5F; } -@@ -1102,6 +1104,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1200,6 +1202,7 @@ public abstract class EntityHuman extends EntityLiving { Vec3D vec3d = entity.getMot(); boolean flag5 = entity.damageEntity(DamageSource.playerAttack(this), f); @@ -33,10 +33,10 @@ index 3a7dc584bd2b88415a238f9c0cb7f85968fb8dfb..7ce46b53ad9fbaf7baf198557565b246 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 c4d0082bb0d310ad16de36df03dd99225c5cadb0..22aaa4efd0f5e89f66abf6a9054b595f52e7129b 100644 +index 9a6c4f292940b1cef2f4ef87c2e47d82ba5cb60f..b068e08e3922536b4de8a54e7d63a1ec943602f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1074,7 +1074,7 @@ public class CraftEventFactory { +@@ -1076,7 +1076,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/Purpur/patches/server/0130-Add-configurable-snowball-damage.patch b/patches/Purpur/patches/server/0130-Add-configurable-snowball-damage.patch index 18bcc048..879506e1 100644 --- a/patches/Purpur/patches/server/0130-Add-configurable-snowball-damage.patch +++ b/patches/Purpur/patches/server/0130-Add-configurable-snowball-damage.patch @@ -4,11 +4,11 @@ Date: Tue, 24 Nov 2020 05:32:02 -0600 Subject: [PATCH] Add configurable snowball damage -diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java -index 34a5f481e6ed1357861dca15fb4013ec8484a292..d7bab4446a5a8eef98c10b1f6eb89de90365dfeb 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowball.java -+++ b/src/main/java/net/minecraft/server/EntitySnowball.java -@@ -29,7 +29,7 @@ public class EntitySnowball extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java +index 0d3b9c81e47eef645335e49a1d6d88db7338aa4b..6bfd3f57e6c04ed426870d6dbf068bf324f22d6e 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySnowball.java +@@ -40,7 +40,7 @@ public class EntitySnowball extends EntityProjectileThrowable { protected void a(MovingObjectPositionEntity movingobjectpositionentity) { super.a(movingobjectpositionentity); Entity entity = movingobjectpositionentity.getEntity(); @@ -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 6c7e898dd42e958553d929b94ce5ddb9542001ee..9dcbce33274f599e4846588afc6d38b8353d6422 100644 +index 3a7d060263da6a31f65870833bbb82893700022d..2b6e29463ec6b1d67a0100c650c218f340f72940 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -214,6 +214,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0131-Zombie-break-door-minimum-difficulty-option.patch b/patches/Purpur/patches/server/0131-Zombie-break-door-minimum-difficulty-option.patch index f2a94693..d3cf1d16 100644 --- a/patches/Purpur/patches/server/0131-Zombie-break-door-minimum-difficulty-option.patch +++ b/patches/Purpur/patches/server/0131-Zombie-break-door-minimum-difficulty-option.patch @@ -4,11 +4,21 @@ Date: Fri, 27 Nov 2020 10:33:33 -0600 Subject: [PATCH] Zombie break door minimum difficulty option -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -index 7488a12926c5ee4adc3bc1fa3973988350381544..23870a271b759a953a095df835e08ea2a09f4218 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -@@ -13,7 +13,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java +index 10ee8a0a717354f50b29e7ebeab0ee2aa7bf42f7..d785066e2a52699c18315f7244d80db6cab0c736 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java +@@ -3,7 +3,9 @@ package net.minecraft.world.entity.ai.goal; + import java.util.function.Predicate; + import net.minecraft.core.IPosition; + import net.minecraft.world.EnumDifficulty; ++import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityInsentient; ++import net.minecraft.world.entity.monster.EntityZombie; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.block.Block; + +@@ -18,7 +20,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { super(entityinsentient); this.b = -1; this.c = -1; @@ -17,7 +27,7 @@ index 7488a12926c5ee4adc3bc1fa3973988350381544..23870a271b759a953a095df835e08ea2 } public PathfinderGoalBreakDoor(EntityInsentient entityinsentient, int i, Predicate predicate) { -@@ -82,4 +82,21 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { +@@ -87,4 +89,21 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { private boolean a(EnumDifficulty enumdifficulty) { return this.g.test(enumdifficulty); } @@ -40,17 +50,17 @@ 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 9dcbce33274f599e4846588afc6d38b8353d6422..4801be1715f70655ee3aed53e5db10ac18dc7a82 100644 +index 2b6e29463ec6b1d67a0100c650c218f340f72940..65de687319e9759630c7114dfe5c70455bb9957a 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; +@@ -1,6 +1,7 @@ + package net.pl3x.purpur; - import net.minecraft.server.Block; - import net.minecraft.server.Blocks; -+import net.minecraft.server.EnumDifficulty; - import net.minecraft.server.Explosion; - import net.minecraft.server.IRegistry; - import net.minecraft.server.Item; + import net.minecraft.core.IRegistry; ++import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.level.Explosion; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.Blocks; @@ -1132,6 +1133,7 @@ public class PurpurWorldConfig { public double zombieJockeyChance = 0.05D; public boolean zombieJockeyTryExistingChickens = true; diff --git a/patches/Purpur/patches/server/0132-Add-demo-command.patch b/patches/Purpur/patches/server/0132-Add-demo-command.patch index 11cbaa41..4ccc5a1a 100644 --- a/patches/Purpur/patches/server/0132-Add-demo-command.patch +++ b/patches/Purpur/patches/server/0132-Add-demo-command.patch @@ -4,11 +4,11 @@ Date: Mon, 30 Nov 2020 03:12:04 -0600 Subject: [PATCH] Add demo command -diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index d080bf58ebc9c1dc9d41fae7d515547bc3f26d54..b5cc099746e9f05ea69bc438bda22a5ac3ebc3c5 100644 ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -107,6 +107,7 @@ public class CommandDispatcher { +diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java +index e8fe4984fdc67536561a1ad08b328a30b30b8717..a551636c2c59e68a5abb1cd5611c1d5c7e36f514 100644 +--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java +@@ -191,6 +191,7 @@ public class CommandDispatcher { CommandIdleTimeout.a(this.b); CommandStop.a(this.b); CommandWhitelist.a(this.b); @@ -16,11 +16,11 @@ index d080bf58ebc9c1dc9d41fae7d515547bc3f26d54..b5cc099746e9f05ea69bc438bda22a5a net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur } -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutGameStateChange.java b/src/main/java/net/minecraft/server/PacketPlayOutGameStateChange.java -index 08cbc787e2bf6587878bdeffa7248e5d23cdcf98..57d39ed441ec7be933f4fce48225f527db7e6a3c 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutGameStateChange.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutGameStateChange.java -@@ -11,7 +11,7 @@ public class PacketPlayOutGameStateChange implements Packet> { +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index e101b1dccec98d5c7b9ee9a2c8aa2e3b911de652..2214b116d1e548eca3c2e70e8b23d7c7913c361d 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -435,9 +435,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> { // note: since the type is not dynamic here, we need to actually copy the old executor code // into two branches. On conflict, just re-copy - no changes were made inside the executor code. if (flush) { @@ -20,7 +20,7 @@ index d93634391501da01cb1afe70fedd5247c654e8fc..53b5063b43e42f09c2ef335251c91d20 } // Paper start -@@ -428,7 +428,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -447,7 +447,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } try { // Paper end @@ -29,7 +29,7 @@ index d93634391501da01cb1afe70fedd5247c654e8fc..53b5063b43e42f09c2ef335251c91d20 if (genericfuturelistener != null) { -@@ -448,12 +448,12 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -467,12 +467,12 @@ public class NetworkManager extends SimpleChannelInboundHandler> { packet.onPacketDispatchFinish(player, null); } // Paper end @@ -45,7 +45,7 @@ index d93634391501da01cb1afe70fedd5247c654e8fc..53b5063b43e42f09c2ef335251c91d20 } // Paper start -@@ -463,7 +463,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -482,7 +482,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } try { // Paper end @@ -54,7 +54,7 @@ index d93634391501da01cb1afe70fedd5247c654e8fc..53b5063b43e42f09c2ef335251c91d20 if (genericfuturelistener != null) { -@@ -483,7 +483,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -502,7 +502,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { packet.onPacketDispatchFinish(player, null); } // Paper end diff --git a/patches/Purpur/patches/server/0135-Changeable-Mob-Left-Handed-Chance.patch b/patches/Purpur/patches/server/0135-Changeable-Mob-Left-Handed-Chance.patch index 122b3d40..e6e20baa 100644 --- a/patches/Purpur/patches/server/0135-Changeable-Mob-Left-Handed-Chance.patch +++ b/patches/Purpur/patches/server/0135-Changeable-Mob-Left-Handed-Chance.patch @@ -4,11 +4,11 @@ Date: Mon, 30 Nov 2020 11:40:11 -0500 Subject: [PATCH] Changeable Mob Left Handed Chance -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index b64278a8e349467305b75b2180a4a423ed49d7e4..08efc5fec023acf68da1b5931a9b5eb8c16e9fc3 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1137,7 +1137,7 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index 8b7f840bb1b24996b40c9bef85f4c1e98e39caec..63d93060b350069040876aaacb91c853d674ea7b 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -1209,7 +1209,7 @@ public abstract class EntityInsentient extends EntityLiving { @Nullable public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).addModifier(new AttributeModifier("Random spawn bonus", this.random.nextGaussian() * 0.05D, AttributeModifier.Operation.MULTIPLY_BASE)); @@ -18,7 +18,7 @@ index b64278a8e349467305b75b2180a4a423ed49d7e4..08efc5fec023acf68da1b5931a9b5eb8 } 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 4801be1715f70655ee3aed53e5db10ac18dc7a82..f9c43a764a609e8c4339868cb0088b3c09ec29f4 100644 +index 65de687319e9759630c7114dfe5c70455bb9957a..6b0b132ce3924722adbd8cb0beb45af446385fe6 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/Purpur/patches/server/0136-Add-boat-fall-damage-config.patch b/patches/Purpur/patches/server/0136-Add-boat-fall-damage-config.patch index 9e9ef844..a03ea82a 100644 --- a/patches/Purpur/patches/server/0136-Add-boat-fall-damage-config.patch +++ b/patches/Purpur/patches/server/0136-Add-boat-fall-damage-config.patch @@ -4,11 +4,19 @@ Date: Mon, 30 Nov 2020 19:36:35 -0600 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 78abdcdc9e6eee80ee88454e5020ad26d7abe3fd..100472ab38414f6d393f86a790837e448c7db381 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1011,7 +1011,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 9ec4008f2195908130410d2c36fb5bf21b26b991..f942c3ab757b768fbd1d459752b7f29094471c56 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -106,6 +106,7 @@ import net.minecraft.world.entity.monster.EntityMonster; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.entity.player.EnumChatVisibility; + import net.minecraft.world.entity.projectile.EntityArrow; ++import net.minecraft.world.entity.vehicle.EntityBoat; + import net.minecraft.world.entity.vehicle.EntityMinecartAbstract; + import net.minecraft.world.inventory.Container; + import net.minecraft.world.inventory.ContainerHorse; +@@ -1142,7 +1143,16 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (this.isInvulnerable(damagesource)) { return false; } else { @@ -27,7 +35,7 @@ index 78abdcdc9e6eee80ee88454e5020ad26d7abe3fd..100472ab38414f6d393f86a790837e44 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 f9c43a764a609e8c4339868cb0088b3c09ec29f4..684a2fa594176a5f456d5f203a47aba15469c727 100644 +index 6b0b132ce3924722adbd8cb0beb45af446385fe6..34feb9f133044232846cd04f10268235d3076501 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -224,6 +224,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0137-Config-migration-disable-saving-projectiles-to-disk-.patch b/patches/Purpur/patches/server/0137-Config-migration-disable-saving-projectiles-to-disk-.patch index 8fc65175..a55beecc 100644 --- a/patches/Purpur/patches/server/0137-Config-migration-disable-saving-projectiles-to-disk-.patch +++ b/patches/Purpur/patches/server/0137-Config-migration-disable-saving-projectiles-to-disk-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Config migration: disable saving projectiles to disk -> diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index fa03879f52f89988d1f43a6cab9e202c88ff6d8d..d25d2e43c2dc3588b98b1d76f84ab10c957f2104 100644 +index d61a0e028135486b86ce1d0984eae3aea45e8a9a..b43d6d08d1eb2d77a4c8288d5c5f2a76efcab8db 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -1,6 +1,7 @@ @@ -15,9 +15,9 @@ index fa03879f52f89988d1f43a6cab9e202c88ff6d8d..d25d2e43c2dc3588b98b1d76f84ab10c import co.aikar.timings.TimingsManager; +import com.destroystokyo.paper.PaperConfig; import com.google.common.base.Throwables; - import net.minecraft.server.EntitySize; - import net.minecraft.server.EntityTypes; -@@ -132,6 +133,17 @@ public class PurpurConfig { + import net.minecraft.locale.LocaleLanguage; + import net.minecraft.server.MinecraftServer; +@@ -133,6 +134,17 @@ public class PurpurConfig { return config.getString(path, config.getString(path)); } @@ -36,16 +36,16 @@ index fa03879f52f89988d1f43a6cab9e202c88ff6d8d..d25d2e43c2dc3588b98b1d76f84ab10c 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 684a2fa594176a5f456d5f203a47aba15469c727..6d64e78e2a06dbc40863b34de6bdb8d019334f7f 100644 +index 34feb9f133044232846cd04f10268235d3076501..15dc2dcbb4bec56efd6e069b1848d6c55a3ffa32 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1,5 +1,6 @@ package net.pl3x.purpur; +import com.destroystokyo.paper.PaperConfig; - import net.minecraft.server.Block; - import net.minecraft.server.Blocks; - import net.minecraft.server.EnumDifficulty; + import net.minecraft.core.IRegistry; + import net.minecraft.world.EnumDifficulty; + import net.minecraft.world.level.Explosion; @@ -84,6 +85,17 @@ public class PurpurWorldConfig { return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path)); } diff --git a/patches/Purpur/patches/server/0138-Snow-Golem-rate-of-fire-config.patch b/patches/Purpur/patches/server/0138-Snow-Golem-rate-of-fire-config.patch index 783ca2f1..a4e70566 100644 --- a/patches/Purpur/patches/server/0138-Snow-Golem-rate-of-fire-config.patch +++ b/patches/Purpur/patches/server/0138-Snow-Golem-rate-of-fire-config.patch @@ -9,11 +9,11 @@ The formula used to determine the amount of ticks between shots is: If min-shoot-interval-ticks and max-shoot-interval-ticks are both set to 0, snow golems won't shoot any snowballs. -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index e370de0ade49ac81d746588bf0991101eba0ce2d..338c78efe43641686be0d6b3a241865ec5fe56bd 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -29,7 +29,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index cfcf67e99ae345f77a55771e6a25bdcdb4a9740a..28b5c22ecfe573ac9d91b74e54ebd3e3c5e6373f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -66,7 +66,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt @Override protected void initPathfinder() { this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur @@ -23,7 +23,7 @@ index e370de0ade49ac81d746588bf0991101eba0ce2d..338c78efe43641686be0d6b3a241865e 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 6d64e78e2a06dbc40863b34de6bdb8d019334f7f..c51cca18eb13a0743d9c7748c58a3669d6178216 100644 +index 15dc2dcbb4bec56efd6e069b1848d6c55a3ffa32..3387b3af053cc6a79e89b6273b9121ca2734b81e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -981,12 +981,20 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0139-PaperPR-Config-option-for-Piglins-guarding-chests.patch b/patches/Purpur/patches/server/0139-PaperPR-Config-option-for-Piglins-guarding-chests.patch index 3f5e7ab5..8e9824b4 100644 --- a/patches/Purpur/patches/server/0139-PaperPR-Config-option-for-Piglins-guarding-chests.patch +++ b/patches/Purpur/patches/server/0139-PaperPR-Config-option-for-Piglins-guarding-chests.patch @@ -5,7 +5,7 @@ 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 fd675585c61387156892b179af593ad640873d45..9f5edd3285bd477a73e18cfe3af51b441b3eeae1 100644 +index 921253a06daa414aed7dc6824effc65db09ea7a5..319e12c843305e62c34b1b6e2fd198d02491ca12 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -704,6 +704,11 @@ public class PaperWorldConfig { @@ -20,11 +20,11 @@ index fd675585c61387156892b179af593ad640873d45..9f5edd3285bd477a73e18cfe3af51b44 public boolean useEigencraftRedstone = false; private void useEigencraftRedstone() { useEigencraftRedstone = this.getBoolean("use-faster-eigencraft-redstone", false); -diff --git a/src/main/java/net/minecraft/server/PiglinAI.java b/src/main/java/net/minecraft/server/PiglinAI.java -index 0407fa1751d89a037da8cb01f5ceef9b9833dd18..df5aafec9a5844a1ae3e948d8a787051a8903bce 100644 ---- a/src/main/java/net/minecraft/server/PiglinAI.java -+++ b/src/main/java/net/minecraft/server/PiglinAI.java -@@ -357,6 +357,7 @@ public class PiglinAI { +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAI.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAI.java +index 490e749db3fc60a06fbb51347491b1ed29f3eaa0..39451d6d7a5b8cb4a29c6b3a4787979d40144cd9 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAI.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAI.java +@@ -419,6 +419,7 @@ public class PiglinAI { } public static void a(EntityHuman entityhuman, boolean flag) { diff --git a/patches/Purpur/patches/server/0140-EMC-Configurable-disable-give-dropping.patch b/patches/Purpur/patches/server/0140-EMC-Configurable-disable-give-dropping.patch index ac23c280..e3311459 100644 --- a/patches/Purpur/patches/server/0140-EMC-Configurable-disable-give-dropping.patch +++ b/patches/Purpur/patches/server/0140-EMC-Configurable-disable-give-dropping.patch @@ -7,11 +7,11 @@ Modified version of a patch by Aikar from EMC. Adds a config option in purpur.yml to disable the /give command from dropping items on the floor when a player's inventory is full. -diff --git a/src/main/java/net/minecraft/server/CommandGive.java b/src/main/java/net/minecraft/server/CommandGive.java -index 1d22c45af884a917e77e02c272fcbae74794200c..7bf90f27fdc48440ef229cca0e100d2c5c0ebef7 100644 ---- a/src/main/java/net/minecraft/server/CommandGive.java -+++ b/src/main/java/net/minecraft/server/CommandGive.java -@@ -35,6 +35,7 @@ public class CommandGive { +diff --git a/src/main/java/net/minecraft/server/commands/CommandGive.java b/src/main/java/net/minecraft/server/commands/CommandGive.java +index 6685bf1757458d908e32d4069f7a8a22a28c28d7..82d663d3b8bbbb020c3467ea93b54729c3053f9e 100644 +--- a/src/main/java/net/minecraft/server/commands/CommandGive.java ++++ b/src/main/java/net/minecraft/server/commands/CommandGive.java +@@ -47,6 +47,7 @@ public class CommandGive { boolean flag = entityplayer.inventory.pickup(itemstack); EntityItem entityitem; @@ -20,10 +20,10 @@ index 1d22c45af884a917e77e02c272fcbae74794200c..7bf90f27fdc48440ef229cca0e100d2c itemstack.setCount(1); entityitem = entityplayer.drop(itemstack, false); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index d25d2e43c2dc3588b98b1d76f84ab10c957f2104..a9c6b2aee5c87981f783b6004b4ffb048df5657d 100644 +index b43d6d08d1eb2d77a4c8288d5c5f2a76efcab8db..3836602aba80a1e23bbec451d6948159b10dd24d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -192,6 +192,11 @@ public class PurpurConfig { +@@ -193,6 +193,11 @@ public class PurpurConfig { useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive); } diff --git a/patches/Purpur/patches/server/0141-Config-migration-climbing-should-not-bypass-cramming.patch b/patches/Purpur/patches/server/0141-Config-migration-climbing-should-not-bypass-cramming.patch index 5077cfd1..d563b070 100644 --- a/patches/Purpur/patches/server/0141-Config-migration-climbing-should-not-bypass-cramming.patch +++ b/patches/Purpur/patches/server/0141-Config-migration-climbing-should-not-bypass-cramming.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Config migration: climbing should not bypass cramming diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index a9c6b2aee5c87981f783b6004b4ffb048df5657d..03d5a9f923597c07d050465e261efe9a8bc935a6 100644 +index 3836602aba80a1e23bbec451d6948159b10dd24d..322cecf1a7316fb8fe00ff538fe3a2dd21708819 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -144,6 +144,17 @@ public class PurpurConfig { +@@ -145,6 +145,17 @@ public class PurpurConfig { } } @@ -28,7 +28,7 @@ index a9c6b2aee5c87981f783b6004b4ffb048df5657d..03d5a9f923597c07d050465e261efe9a 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 c51cca18eb13a0743d9c7748c58a3669d6178216..4b291b6bd8e74a4affd6a6ea7e1ace50d78ff7eb 100644 +index 3387b3af053cc6a79e89b6273b9121ca2734b81e..5ad9b63e50137163ec7bab48560f618f165d676f 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/Purpur/patches/server/0142-Lobotomize-stuck-villagers.patch b/patches/Purpur/patches/server/0142-Lobotomize-stuck-villagers.patch index 59222728..17ea4f7c 100644 --- a/patches/Purpur/patches/server/0142-Lobotomize-stuck-villagers.patch +++ b/patches/Purpur/patches/server/0142-Lobotomize-stuck-villagers.patch @@ -4,11 +4,11 @@ Date: Thu, 3 Dec 2020 17:56:18 -0600 Subject: [PATCH] Lobotomize stuck villagers -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index fb78ae9c89b035fdac213b7294f94d425a7f57f4..1ec8dcfcbacf373682cb46fee354e3cfd6d3f1b5 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -114,7 +114,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 4b4c6477122c51871ce98f34c6e5874048eaa227..904bca540a42204a9856765e333eee6c5de6a960 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -207,7 +207,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne public double lastY; public double lastZ; private Vec3D loc; @@ -17,13 +17,33 @@ index fb78ae9c89b035fdac213b7294f94d425a7f57f4..1ec8dcfcbacf373682cb46fee354e3cf private Vec3D mot; public float yaw; public float pitch; -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 15e052cb844df310c62d8a5695e8da6c633d94b6..a04123b5897a150439846abe5b25a3a13419f00e 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -185,15 +185,37 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +index 48e6a4c588ef39a4bde067d79b96a656c68750ce..ac7bad10697c6fde7d512753992d59710aa1e032 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +@@ -123,6 +123,7 @@ public abstract class NavigationAbstract { } - // Spigot End + + @Nullable ++ public PathEntity calculateDestination(BlockPosition blockposition, int i) { return a(blockposition, i); } // Purpur - OBFHELPER + public PathEntity a(BlockPosition blockposition, int i) { + // Paper start - add target parameter + return this.a(blockposition, null, i); +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index a0f0d5e0909da5cfe87078d4722b030635cfeadd..bc14e242f97f9f6d8e581d12319c95ae5f70f250 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -89,6 +89,7 @@ import net.minecraft.world.level.IWorldReader; + import net.minecraft.world.level.World; + import net.minecraft.world.level.WorldAccess; + import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.pathfinder.PathEntity; + import net.minecraft.world.phys.AxisAlignedBB; + import org.apache.logging.log4j.Logger; + +@@ -260,11 +261,32 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + + private int behaviorTick = 0; + // Purpur start + boolean lobotomized = false; @@ -54,12 +74,15 @@ index 15e052cb844df310c62d8a5695e8da6c633d94b6..a04123b5897a150439846abe5b25a3a1 boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) // Purpur end - if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper +@@ -273,6 +295,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper + } + } + else if (shouldRestock()) doRestock(); // Purpur this.world.getMethodProfiler().exit(); if (this.bF) { this.bF = false; -@@ -325,6 +347,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -404,6 +427,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation return true; } @@ -67,7 +90,7 @@ index 15e052cb844df310c62d8a5695e8da6c633d94b6..a04123b5897a150439846abe5b25a3a1 public void fb() { this.fp(); Iterator iterator = this.getOffers().iterator(); -@@ -359,6 +382,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -438,6 +462,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation return this.bD == 0 || this.bD < 2 && this.world.getTime() > this.bC + 2400L; } @@ -75,20 +98,8 @@ index 15e052cb844df310c62d8a5695e8da6c633d94b6..a04123b5897a150439846abe5b25a3a1 public boolean fc() { long i = this.bC + 12000L; long j = this.world.getTime(); -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 6aec5098d346c1b7498fd8b800154cd31ce08a97..cba6f414d1a673e735f80662620a8bec78cd09ab 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -101,6 +101,7 @@ public abstract class NavigationAbstract { - } - - @Nullable -+ public PathEntity calculateDestination(BlockPosition blockposition, int i) { return a(blockposition, i); } // Purpur - OBFHELPER - public PathEntity a(BlockPosition blockposition, int i) { - // 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 4b291b6bd8e74a4affd6a6ea7e1ace50d78ff7eb..dd8c9cd8e45b49bcee4825abb4e30537ef3dafd4 100644 +index 5ad9b63e50137163ec7bab48560f618f165d676f..b2e4404e05ba304423803779321321292b306255 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1076,6 +1076,8 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0143-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch b/patches/Purpur/patches/server/0143-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch index 681a3d14..a914db5c 100644 --- a/patches/Purpur/patches/server/0143-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch +++ b/patches/Purpur/patches/server/0143-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch @@ -7,11 +7,39 @@ Adds an option so that Villagers with the Cleric profession are able to farm Nether Wart. Reimplemented based on a feature of the carpet-extra mod. -diff --git a/src/main/java/net/minecraft/server/BehaviorFarm.java b/src/main/java/net/minecraft/server/BehaviorFarm.java -index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216bce1818f 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFarm.java -+++ b/src/main/java/net/minecraft/server/BehaviorFarm.java -@@ -12,6 +12,7 @@ public class BehaviorFarm extends Behavior { +diff --git a/src/main/java/net/minecraft/world/IInventory.java b/src/main/java/net/minecraft/world/IInventory.java +index 774ba6a923f7e329f6af5efc17e1c46e87ed2d77..b8c73cd0ba916b7bf166a6d2f6b7ab68cd9c939b 100644 +--- a/src/main/java/net/minecraft/world/IInventory.java ++++ b/src/main/java/net/minecraft/world/IInventory.java +@@ -38,6 +38,7 @@ public interface IInventory extends Clearable { + return true; + } + ++ default int getAmount(Item item) { return this.a(item); } // Purpur - OBFHELPER + default int a(Item item) { + int i = 0; + +@@ -52,6 +53,7 @@ public interface IInventory extends Clearable { + return i; + } + ++ default boolean containsAny(Set itemSet) { return a(itemSet); } // Purpur - OBFHELPER + default boolean a(Set set) { + for (int i = 0; i < this.getSize(); ++i) { + ItemStack itemstack = this.getItem(i); +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java +index 42c70a6c2972ac38e889a6d42fe2d7d4f6017d57..751f2b2f7d0e87212a6bd813d4f85cefd5bb2b50 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFarm.java +@@ -21,6 +21,7 @@ import net.minecraft.world.item.Items; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.BlockCrops; ++import net.minecraft.world.level.block.BlockNetherWart; + import net.minecraft.world.level.block.BlockSoil; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.block.state.IBlockData; +@@ -32,6 +33,7 @@ public class BehaviorFarm extends Behavior { private long c; private int d; private final List e = Lists.newArrayList(); @@ -19,7 +47,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 public BehaviorFarm() { super(ImmutableMap.of(MemoryModuleType.LOOK_TARGET, MemoryStatus.VALUE_ABSENT, MemoryModuleType.WALK_TARGET, MemoryStatus.VALUE_ABSENT, MemoryModuleType.SECONDARY_JOB_SITE, MemoryStatus.VALUE_PRESENT)); -@@ -20,9 +21,14 @@ public class BehaviorFarm extends Behavior { +@@ -40,9 +42,14 @@ public class BehaviorFarm extends Behavior { protected boolean a(WorldServer worldserver, EntityVillager entityvillager) { if (!worldserver.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !worldserver.purpurConfig.villagerFarmingBypassMobGriefing) { // Purpur return false; @@ -35,7 +63,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 BlockPosition.MutableBlockPosition blockposition_mutableblockposition = entityvillager.getChunkCoordinates().i(); this.e.clear(); -@@ -53,6 +59,11 @@ public class BehaviorFarm extends Behavior { +@@ -73,6 +80,11 @@ public class BehaviorFarm extends Behavior { Block block = iblockdata.getBlock(); Block block1 = worldserver.getType(blockposition.down()).getBlock(); @@ -47,7 +75,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 return block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) || iblockdata.isAir() && block1 instanceof BlockSoil; } -@@ -78,7 +89,7 @@ public class BehaviorFarm extends Behavior { +@@ -98,7 +110,7 @@ public class BehaviorFarm extends Behavior { Block block = iblockdata.getBlock(); Block block1 = worldserver.getType(this.farmBlock.down()).getBlock(); @@ -56,7 +84,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 // CraftBukkit start if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.farmBlock, Blocks.AIR.getBlockData()).isCancelled()) { worldserver.a(this.farmBlock, true, entityvillager); -@@ -86,7 +97,7 @@ public class BehaviorFarm extends Behavior { +@@ -106,7 +118,7 @@ public class BehaviorFarm extends Behavior { // CraftBukkit end } @@ -65,7 +93,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 InventorySubcontainer inventorysubcontainer = entityvillager.getInventory(); for (int j = 0; j < inventorysubcontainer.getSize(); ++j) { -@@ -109,6 +120,12 @@ public class BehaviorFarm extends Behavior { +@@ -129,6 +141,12 @@ public class BehaviorFarm extends Behavior { planted = Blocks.BEETROOTS; flag = true; } @@ -78,7 +106,7 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 if (planted != null && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityvillager, this.farmBlock, planted.getBlockData()).isCancelled()) { worldserver.setTypeAndData(this.farmBlock, planted.getBlockData(), 3); -@@ -119,7 +136,7 @@ public class BehaviorFarm extends Behavior { +@@ -139,7 +157,7 @@ public class BehaviorFarm extends Behavior { } if (flag) { @@ -87,11 +115,11 @@ index 0ff202c0d77681f7e0d55d57c69dd0e455336eba..b9c6011c8dcab1a328260871f46d0216 itemstack.subtract(1); if (itemstack.isEmpty()) { inventorysubcontainer.setItem(j, ItemStack.b); -diff --git a/src/main/java/net/minecraft/server/BehaviorTradeVillager.java b/src/main/java/net/minecraft/server/BehaviorTradeVillager.java -index ad26ecd7fe6b6eedc743f2fab687bd0c6a62a46a..6d8b6951c3c07f71dc89131842d815099c62030f 100644 ---- a/src/main/java/net/minecraft/server/BehaviorTradeVillager.java -+++ b/src/main/java/net/minecraft/server/BehaviorTradeVillager.java -@@ -41,6 +41,11 @@ public class BehaviorTradeVillager extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorTradeVillager.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorTradeVillager.java +index 71ea6c43d76bf1abe6b08dadb20ea4708b0ecfc7..c73b4475182541fa8261bec44f1eeeef21c22f42 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorTradeVillager.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorTradeVillager.java +@@ -53,6 +53,11 @@ public class BehaviorTradeVillager extends Behavior { if (entityvillager1.getVillagerData().getProfession() == VillagerProfession.FARMER && entityvillager.getInventory().a(Items.WHEAT) > Items.WHEAT.getMaxStackSize() / 2) { a(entityvillager, ImmutableSet.of(Items.WHEAT), entityvillager1); } @@ -103,7 +131,7 @@ index ad26ecd7fe6b6eedc743f2fab687bd0c6a62a46a..6d8b6951c3c07f71dc89131842d81509 if (!this.b.isEmpty() && entityvillager.getInventory().a(this.b)) { a(entityvillager, this.b, entityvillager1); -@@ -62,6 +67,7 @@ public class BehaviorTradeVillager extends Behavior { +@@ -74,6 +79,7 @@ public class BehaviorTradeVillager extends Behavior { }).collect(Collectors.toSet()); } @@ -111,11 +139,11 @@ index ad26ecd7fe6b6eedc743f2fab687bd0c6a62a46a..6d8b6951c3c07f71dc89131842d81509 private static void a(EntityVillager entityvillager, Set set, EntityLiving entityliving) { InventorySubcontainer inventorysubcontainer = entityvillager.getInventory(); ItemStack itemstack = ItemStack.b; -diff --git a/src/main/java/net/minecraft/server/Behaviors.java b/src/main/java/net/minecraft/server/Behaviors.java -index 2d91869660c36b4cd7bfe887956a26802cce7f8a..e376306bc2555620d1a61af2296f3dd8abc6ce0e 100644 ---- a/src/main/java/net/minecraft/server/Behaviors.java -+++ b/src/main/java/net/minecraft/server/Behaviors.java -@@ -12,10 +12,13 @@ public class Behaviors { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behaviors.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behaviors.java +index df12193e1a2e449193a3feab53fc684a2571ae3a..4a8217862a98488ce71ce577b5fa9d6a0f9c898a 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behaviors.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behaviors.java +@@ -21,10 +21,13 @@ public class Behaviors { return ImmutableList.of(Pair.of(0, new BehaviorSwim(0.8F)), Pair.of(0, new BehaviorInteractDoor()), Pair.of(0, new BehaviorLook(45, 90)), Pair.of(0, new BehaviorPanic()), Pair.of(0, new BehaviorWake()), Pair.of(0, new BehaviorBellAlert()), Pair.of(0, new BehaviorRaid()), Pair.of(0, new BehaviorPositionValidate(villagerprofession.b(), MemoryModuleType.JOB_SITE)), Pair.of(0, new BehaviorPositionValidate(villagerprofession.b(), MemoryModuleType.POTENTIAL_JOB_SITE)), Pair.of(1, new BehavorMove()), Pair.of(2, new BehaviorBetterJob(villagerprofession)), Pair.of(3, new BehaviorInteractPlayer(f)), new Pair[]{Pair.of(5, new BehaviorFindAdmirableItem<>(f, false, 4)), Pair.of(6, new BehaviorFindPosition(villagerprofession.b(), MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, true, Optional.empty())), Pair.of(7, new BehaviorPotentialJobSite(f)), Pair.of(8, new BehaviorLeaveJob(f)), Pair.of(10, new BehaviorFindPosition(VillagePlaceType.r, MemoryModuleType.HOME, false, Optional.of((byte) 14))), Pair.of(10, new BehaviorFindPosition(VillagePlaceType.s, MemoryModuleType.MEETING_POINT, true, Optional.of((byte) 14))), Pair.of(10, new BehaviorCareer()), Pair.of(10, new BehaviorProfession())}); } @@ -132,68 +160,19 @@ index 2d91869660c36b4cd7bfe887956a26802cce7f8a..e376306bc2555620d1a61af2296f3dd8 object = new BehaviorWorkComposter(); } else { object = new BehaviorWork(); -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index a04123b5897a150439846abe5b25a3a13419f00e..9b925bf9b7946eecb16f94d49a9823139c5fd641 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -129,7 +129,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - behaviorcontroller.a(Activity.PLAY, Behaviors.a(0.5F)); - } else { - behaviorcontroller.setSchedule(Schedule.VILLAGER_DEFAULT); -- behaviorcontroller.a(Activity.WORK, Behaviors.b(villagerprofession, 0.5F), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); -+ behaviorcontroller.a(Activity.WORK, Behaviors.createWorkTask(villagerprofession, 0.5F, this.world.purpurConfig.villagerClericsFarmWarts), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); // Purpur - } +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorSecondaryPlaces.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorSecondaryPlaces.java +index 25c10973c74f98224dd1d2ae5e7178b9781374aa..78df1ded72a625c676faf4d704e9e44cec2bc054 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorSecondaryPlaces.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorSecondaryPlaces.java +@@ -11,6 +11,7 @@ import net.minecraft.server.level.WorldServer; + import net.minecraft.world.entity.ai.BehaviorController; + import net.minecraft.world.entity.ai.memory.MemoryModuleType; + import net.minecraft.world.entity.npc.EntityVillager; ++import net.minecraft.world.entity.npc.VillagerProfession; + import net.minecraft.world.level.World; - behaviorcontroller.a(Activity.CORE, Behaviors.a(villagerprofession, 0.5F)); -@@ -843,6 +843,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - @Override - public boolean i(ItemStack itemstack) { - Item item = itemstack.getItem(); -+ // Purpur start -+ if (this.world.purpurConfig.villagerClericsFarmWarts && item.getItem() == Items.NETHER_WART && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) { -+ return true; -+ } -+ // Purpur end - - return (EntityVillager.bs.contains(item) || this.getVillagerData().getProfession().c().contains(item)) && this.getInventory().b(itemstack); - } -@@ -864,6 +869,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - } - - public boolean canPlant() { -+ // Purpur start -+ if (this.world.purpurConfig.villagerClericsFarmWarts && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) { -+ return this.getInventory().containsAny(ImmutableSet.of(Items.NETHER_WART)); -+ } -+ // Purpur end - return this.getInventory().a((Set) ImmutableSet.of(Items.WHEAT_SEEDS, Items.POTATO, Items.CARROT, Items.BEETROOT_SEEDS)); - } - -diff --git a/src/main/java/net/minecraft/server/IInventory.java b/src/main/java/net/minecraft/server/IInventory.java -index 317349bf382ee6671066fd5556ee339179165ff0..26094ed0089982ed60e28d7c110884cff793108d 100644 ---- a/src/main/java/net/minecraft/server/IInventory.java -+++ b/src/main/java/net/minecraft/server/IInventory.java -@@ -32,6 +32,7 @@ public interface IInventory extends Clearable { - return true; - } - -+ default int getAmount(Item item) { return this.a(item); } // Purpur - OBFHELPER - default int a(Item item) { - int i = 0; - -@@ -46,6 +47,7 @@ public interface IInventory extends Clearable { - return i; - } - -+ default boolean containsAny(Set itemSet) { return a(itemSet); } // Purpur - OBFHELPER - default boolean a(Set set) { - for (int i = 0; i < this.getSize(); ++i) { - ItemStack itemstack = this.getItem(i); -diff --git a/src/main/java/net/minecraft/server/SensorSecondaryPlaces.java b/src/main/java/net/minecraft/server/SensorSecondaryPlaces.java -index 24173f0d3a6c2c9a4a564de6cd828bdef9afec90..2d8e3e77710b59967b7b18006194d73761df6c56 100644 ---- a/src/main/java/net/minecraft/server/SensorSecondaryPlaces.java -+++ b/src/main/java/net/minecraft/server/SensorSecondaryPlaces.java -@@ -12,6 +12,13 @@ public class SensorSecondaryPlaces extends Sensor { + public class SensorSecondaryPlaces extends Sensor { +@@ -20,6 +21,13 @@ public class SensorSecondaryPlaces extends Sensor { } protected void a(WorldServer worldserver, EntityVillager entityvillager) { @@ -207,7 +186,7 @@ index 24173f0d3a6c2c9a4a564de6cd828bdef9afec90..2d8e3e77710b59967b7b18006194d737 ResourceKey resourcekey = worldserver.getDimensionKey(); BlockPosition blockposition = entityvillager.getChunkCoordinates(); List list = Lists.newArrayList(); -@@ -29,10 +36,10 @@ public class SensorSecondaryPlaces extends Sensor { +@@ -37,10 +45,10 @@ public class SensorSecondaryPlaces extends Sensor { } } @@ -220,11 +199,48 @@ index 24173f0d3a6c2c9a4a564de6cd828bdef9afec90..2d8e3e77710b59967b7b18006194d737 } else { behaviorcontroller.removeMemory(MemoryModuleType.SECONDARY_JOB_SITE); } -diff --git a/src/main/java/net/minecraft/server/VillagerProfession.java b/src/main/java/net/minecraft/server/VillagerProfession.java -index 3c60da7ac6faebe9d964e893974e42613c59b4c1..6493f220a0cf627e82e5f3f3c85e9934d9a9ebae 100644 ---- a/src/main/java/net/minecraft/server/VillagerProfession.java -+++ b/src/main/java/net/minecraft/server/VillagerProfession.java -@@ -9,7 +9,7 @@ public class VillagerProfession { +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index bc14e242f97f9f6d8e581d12319c95ae5f70f250..77a5be6f5fc51689a74f853b5dfcef5e772e2c84 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -203,7 +203,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + behaviorcontroller.a(Activity.PLAY, Behaviors.a(0.5F)); + } else { + behaviorcontroller.setSchedule(Schedule.VILLAGER_DEFAULT); +- behaviorcontroller.a(Activity.WORK, Behaviors.b(villagerprofession, 0.5F), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); ++ behaviorcontroller.a(Activity.WORK, Behaviors.createWorkTask(villagerprofession, 0.5F, this.world.purpurConfig.villagerClericsFarmWarts), (Set) ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))); // Purpur + } + + behaviorcontroller.a(Activity.CORE, Behaviors.a(villagerprofession, 0.5F)); +@@ -923,6 +923,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + @Override + public boolean i(ItemStack itemstack) { + Item item = itemstack.getItem(); ++ // Purpur start ++ if (this.world.purpurConfig.villagerClericsFarmWarts && item.getItem() == Items.NETHER_WART && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) { ++ return true; ++ } ++ // Purpur end + + return (EntityVillager.bs.contains(item) || this.getVillagerData().getProfession().c().contains(item)) && this.getInventory().b(itemstack); + } +@@ -944,6 +949,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + + public boolean canPlant() { ++ // Purpur start ++ if (this.world.purpurConfig.villagerClericsFarmWarts && this.getVillagerData().getProfession() == VillagerProfession.CLERIC) { ++ return this.getInventory().containsAny(ImmutableSet.of(Items.NETHER_WART)); ++ } ++ // Purpur end + return this.getInventory().a((Set) ImmutableSet.of(Items.WHEAT_SEEDS, Items.POTATO, Items.CARROT, Items.BEETROOT_SEEDS)); + } + +diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java +index 69de7588eebba7557cdaec129f19ec1fc2c675c5..dd9b678481620856fb7eaaa04c3b812c861e892a 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java ++++ b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java +@@ -18,7 +18,7 @@ public class VillagerProfession { public static final VillagerProfession ARMORER = a("armorer", VillagePlaceType.d, SoundEffects.ENTITY_VILLAGER_WORK_ARMORER); public static final VillagerProfession BUTCHER = a("butcher", VillagePlaceType.e, SoundEffects.ENTITY_VILLAGER_WORK_BUTCHER); public static final VillagerProfession CARTOGRAPHER = a("cartographer", VillagePlaceType.f, SoundEffects.ENTITY_VILLAGER_WORK_CARTOGRAPHER); @@ -234,7 +250,7 @@ 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 dd8c9cd8e45b49bcee4825abb4e30537ef3dafd4..12c54e4874d8cd687c1680e9184a3f01fab11b39 100644 +index b2e4404e05ba304423803779321321292b306255..6f0fa3d581fcb1897bc8e591d596a7e1388a667d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1078,6 +1078,8 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0144-Toggle-for-Zombified-Piglin-death-always-counting-as.patch b/patches/Purpur/patches/server/0144-Toggle-for-Zombified-Piglin-death-always-counting-as.patch index 75b428a5..17d122d3 100644 --- a/patches/Purpur/patches/server/0144-Toggle-for-Zombified-Piglin-death-always-counting-as.patch +++ b/patches/Purpur/patches/server/0144-Toggle-for-Zombified-Piglin-death-always-counting-as.patch @@ -12,11 +12,11 @@ to the Piglin being angry, even though the player never hit them. This patch adds a toggle to disable this behavior. -diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java -index 3327dbbf87d8f43cbc7cd728df2f4c6a33dae40d..57f3358b8dfd53f5b1d2e976d64b809f74bc3ce3 100644 ---- a/src/main/java/net/minecraft/server/EntityPigZombie.java -+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java -@@ -95,7 +95,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +index 816a2bd7438f66a5d7ff761b8fcf8b42483561c7..8db9c62093b2f075face65030cb91c24fb6c2dbf 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +@@ -129,7 +129,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { this.eY(); } @@ -25,7 +25,7 @@ index 3327dbbf87d8f43cbc7cd728df2f4c6a33dae40d..57f3358b8dfd53f5b1d2e976d64b809f this.lastDamageByPlayerTime = this.ticksLived; } -@@ -150,7 +150,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +@@ -184,7 +184,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { this.bt = EntityPigZombie.bs.a(this.random); } @@ -35,7 +35,7 @@ index 3327dbbf87d8f43cbc7cd728df2f4c6a33dae40d..57f3358b8dfd53f5b1d2e976d64b809f } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 12c54e4874d8cd687c1680e9184a3f01fab11b39..f7ccf7ce209c047dbfe18539fba6a12ca3765c78 100644 +index 6f0fa3d581fcb1897bc8e591d596a7e1388a667d..6c59bd1a0ab69b382b9482d12987828c734dbbb1 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1210,12 +1210,14 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0145-Spread-out-and-optimise-player-list-ticks.patch b/patches/Purpur/patches/server/0145-Spread-out-and-optimise-player-list-ticks.patch index 6216ea81..a66b4132 100644 --- a/patches/Purpur/patches/server/0145-Spread-out-and-optimise-player-list-ticks.patch +++ b/patches/Purpur/patches/server/0145-Spread-out-and-optimise-player-list-ticks.patch @@ -4,11 +4,11 @@ Date: Mon, 7 Dec 2020 17:52:36 +0000 Subject: [PATCH] Spread out and optimise player list ticks -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f9043744ad0a622c6aa5e5bd3986fb9f60cab4c3..4415d081983d46bcece9b80bad6f3b5cdc624a4e 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -68,7 +68,7 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 54e009ee763a689125eb521f9144951aac53a4c0..fbc8f7746fc92def73c244b3c12da990741d4bd5 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -150,7 +150,7 @@ public abstract class PlayerList { private int viewDistance; private EnumGamemode u; private boolean v; @@ -17,7 +17,7 @@ index f9043744ad0a622c6aa5e5bd3986fb9f60cab4c3..4415d081983d46bcece9b80bad6f3b5c // CraftBukkit start private CraftServer cserver; -@@ -928,22 +928,23 @@ public abstract class PlayerList { +@@ -1012,22 +1012,23 @@ public abstract class PlayerList { } public void tick() { @@ -56,10 +56,10 @@ index f9043744ad0a622c6aa5e5bd3986fb9f60cab4c3..4415d081983d46bcece9b80bad6f3b5c public void sendAll(Packet packet) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8bf29aca4b5aa0d51ed3cda25b37d30e6c986848..7b5ffe92430121eebe2866ac33b37a840eed90f1 100644 +index 1ff48eae5e5b732fbd1e720c55e08a30669bebfa..ca465a53a0c6232f912287704fc63cdcc59a28bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1435,7 +1435,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1444,7 +1444,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public boolean canSee(Player player) { diff --git a/patches/Purpur/patches/server/0146-Configurable-chance-for-wolves-to-spawn-rabid.patch b/patches/Purpur/patches/server/0146-Configurable-chance-for-wolves-to-spawn-rabid.patch index 9097da80..7151225b 100644 --- a/patches/Purpur/patches/server/0146-Configurable-chance-for-wolves-to-spawn-rabid.patch +++ b/patches/Purpur/patches/server/0146-Configurable-chance-for-wolves-to-spawn-rabid.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Configurable chance for wolves to spawn rabid Configurable chance to spawn a wolf that is rabid. Rabid wolves attack all players, mobs, and animals. -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index af2b6bb559d78dd912eee02281f5446f31e55eae..79fde7b4763642dc4941899ab186db9dfab3b574 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2102,6 +2102,7 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 617657ff7f27996ed7d97801dc49c9a39f59a240..f3f528065eb9ee2f385edbaceeeddef39552485c 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2200,6 +2200,7 @@ public abstract class EntityLiving extends Entity { } } @@ -18,11 +18,79 @@ index af2b6bb559d78dd912eee02281f5446f31e55eae..79fde7b4763642dc4941899ab186db9d public void a(EnumHand enumhand, ItemStack itemstack) { if (enumhand == EnumHand.MAIN_HAND) { this.setSlot(EnumItemSlot.MAINHAND, itemstack); -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529dc7953e8 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -14,11 +14,42 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalAvoidTarget.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalAvoidTarget.java +index 5115c56487a12f904ff836355375f66a16098790..35502bd2f7d9cebf5cfe1060e300a5032dbe6a5d 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalAvoidTarget.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalAvoidTarget.java +@@ -17,7 +17,7 @@ public class PathfinderGoalAvoidTarget extends Pathfinde + protected final EntityCreature a; + private final double i; + private final double j; +- protected T b; ++ protected T b; protected T getTarget() { return this.b; } // Purpur - OBFHELPER + protected final float c; + protected PathEntity d; + protected final NavigationAbstract e; +@@ -27,12 +27,7 @@ public class PathfinderGoalAvoidTarget extends Pathfinde + private final PathfinderTargetCondition k; + + public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class oclass, float f, double d0, double d1) { +- Predicate predicate = (entityliving) -> { +- return true; +- }; +- Predicate predicate1 = IEntitySelector.e; +- +- this(entitycreature, oclass, predicate, f, d0, d1, predicate1::test); ++ this(entitycreature, oclass, entityliving -> true, f, d0, d1, IEntitySelector.e::test); // Purpur - decompile fix + } + + public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class oclass, Predicate predicate, float f, double d0, double d1, Predicate predicate1) { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index dd3c7ad7701ad18ccaf86d73fde7051090ed3d57..e8c6aca70db693250224d1c162e3c2684687ea41 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -10,15 +10,19 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.PathfinderGoalHasRider; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.util.IntRange; + import net.minecraft.util.MathHelper; + import net.minecraft.util.TimeRange; ++import net.minecraft.world.DifficultyDamageScaler; + import net.minecraft.world.EnumHand; + import net.minecraft.world.EnumInteractionResult; + import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.effect.MobEffect; ++import net.minecraft.world.effect.MobEffects; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityAgeable; + import net.minecraft.world.entity.EntityInsentient; +@@ -27,9 +31,12 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTameableAnimal; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.IEntityAngerable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; ++import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget; + import net.minecraft.world.entity.ai.goal.PathfinderGoalBeg; + import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed; +@@ -60,6 +67,7 @@ import net.minecraft.world.item.ItemDye; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.World; ++import net.minecraft.world.level.WorldAccess; + import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.Vec3D; + +@@ -73,11 +81,42 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable private static final DataWatcherObject br = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.i); private static final DataWatcherObject bs = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.b); private static final DataWatcherObject bt = DataWatcher.a(EntityWolf.class, DataWatcherRegistry.b); @@ -66,8 +134,8 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 private float bu; private float bv; private boolean bw; -@@ -53,6 +84,37 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable - int getPurpurBreedTime() { +@@ -112,6 +151,37 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + public int getPurpurBreedTime() { return this.world.purpurConfig.wolfBreedingTicks; } + @@ -104,7 +172,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 // Purpur end @Override -@@ -61,6 +123,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -120,6 +190,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable this.goalSelector.a(1, new PathfinderGoalHasRider(this)); // Purpur this.goalSelector.a(2, new PathfinderGoalSit(this)); this.goalSelector.a(3, new EntityWolf.a<>(this, EntityLlama.class, 24.0F, 1.5D, 1.5D)); @@ -112,7 +180,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 this.goalSelector.a(4, new PathfinderGoalLeapAtTarget(this, 0.4F)); this.goalSelector.a(5, new PathfinderGoalMeleeAttack(this, 1.0D, true)); this.goalSelector.a(6, new PathfinderGoalFollowOwner(this, 1.0D, 10.0F, 2.0F, false)); -@@ -74,7 +137,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -133,7 +204,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable this.targetSelector.a(2, new PathfinderGoalOwnerHurtTarget(this)); this.targetSelector.a(3, (new PathfinderGoalHurtByTarget(this, new Class[0])).a(new Class[0])); // CraftBukkit - decompile error this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::a_)); @@ -121,7 +189,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 this.targetSelector.a(6, new PathfinderGoalRandomTargetNonTamed<>(this, EntityTurtle.class, false, EntityTurtle.bo)); this.targetSelector.a(7, new PathfinderGoalNearestAttackableTarget<>(this, EntitySkeletonAbstract.class, false)); this.targetSelector.a(8, new PathfinderGoalUniversalAngerReset<>(this, true)); -@@ -119,6 +182,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -178,6 +249,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); nbttagcompound.setByte("CollarColor", (byte) this.getCollarColor().getColorIndex()); @@ -129,7 +197,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 this.c(nbttagcompound); } -@@ -128,6 +192,10 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -187,6 +259,10 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable if (nbttagcompound.hasKeyOfType("CollarColor", 99)) { this.setCollarColor(EnumColor.fromColorIndex(nbttagcompound.getInt("CollarColor"))); } @@ -140,7 +208,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 this.a((WorldServer) this.world, nbttagcompound); } -@@ -172,6 +240,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -231,6 +307,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable public void tick() { super.tick(); if (this.isAlive()) { @@ -152,7 +220,7 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 this.bv = this.bu; if (this.eY()) { this.bu += (1.0F - this.bu) * 0.4F; -@@ -343,6 +416,20 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -402,6 +483,20 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable return EnumInteractionResult.SUCCESS; } @@ -173,35 +241,8 @@ index 6c25f667eecdf345289a0dbf885c9d71c6a26958..5fe2e9f4bfbdc08690eacd6196e59529 return super.b(entityhuman, enumhand); } -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java -index 9a4819815c7a4bf2fd4a92c4169ace35f2261704..da29898574d30d5fecc5a44ad7b365564fa686e1 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalAvoidTarget.java -@@ -8,7 +8,7 @@ public class PathfinderGoalAvoidTarget extends Pathfinde - protected final EntityCreature a; - private final double i; - private final double j; -- protected T b; -+ protected T b; protected T getTarget() { return this.b; } // Purpur - OBFHELPER - protected final float c; - protected PathEntity d; - protected final NavigationAbstract e; -@@ -18,12 +18,7 @@ public class PathfinderGoalAvoidTarget extends Pathfinde - private final PathfinderTargetCondition k; - - public PathfinderGoalAvoidTarget(EntityCreature entitycreature, Class oclass, float f, double d0, double d1) { -- Predicate predicate = (entityliving) -> { -- return true; -- }; -- Predicate predicate1 = IEntitySelector.e; -- -- this(entitycreature, oclass, predicate, f, d0, d1, predicate1::test); -+ this(entitycreature, oclass, entityliving -> true, f, d0, d1, IEntitySelector.e::test); // Purpur - decompile fix - } - - 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 f7ccf7ce209c047dbfe18539fba6a12ca3765c78..aea3e3ae09d2df797d284104eafb957e8f11a109 100644 +index 6c59bd1a0ab69b382b9482d12987828c734dbbb1..ecedeb10196b05f0d919f744cdf2e9556eff0a8d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1161,10 +1161,14 @@ public class PurpurWorldConfig { @@ -220,7 +261,7 @@ index f7ccf7ce209c047dbfe18539fba6a12ca3765c78..aea3e3ae09d2df797d284104eafb957e } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java -index 5f3314febb2300a9b4f3a7c143cb65811e1d5320..507857ba247d0988e0011d215ea38a3622e78e05 100644 +index dc5ba91ebdef25d633205a65148b62f1853b4da5..71e5b36b7d0bb92ef6e94759318a4a82a19e729a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java @@ -45,4 +45,16 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf { diff --git a/patches/Purpur/patches/server/0147-Configurable-default-wolf-collar-color.patch b/patches/Purpur/patches/server/0147-Configurable-default-wolf-collar-color.patch index 121be503..68ba2835 100644 --- a/patches/Purpur/patches/server/0147-Configurable-default-wolf-collar-color.patch +++ b/patches/Purpur/patches/server/0147-Configurable-default-wolf-collar-color.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Configurable default wolf collar color This allows for the server to set a default collar color when a wolf is tamed. Resets to RED when the value is invalid. -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 5fe2e9f4bfbdc08690eacd6196e59529dc7953e8..fd62dc51258876275adbe02f750fd88107c38a6b 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -115,6 +115,12 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index e8c6aca70db693250224d1c162e3c2684687ea41..e33aadead6e6c5e0a7b39ef95e7aeb0f0092a94e 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -182,6 +182,12 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable this.updatePathfinders(false); return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound); } @@ -24,17 +24,17 @@ 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 aea3e3ae09d2df797d284104eafb957e8f11a109..3790fcea3a556a979eacaf5b03e5ebc4c3a02925 100644 +index ecedeb10196b05f0d919f744cdf2e9556eff0a8d..5c5aa1ab859c836945294cfdb06589639006a307 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; import com.destroystokyo.paper.PaperConfig; - import net.minecraft.server.Block; - import net.minecraft.server.Blocks; -+import net.minecraft.server.EnumColor; - import net.minecraft.server.EnumDifficulty; - import net.minecraft.server.Explosion; - import net.minecraft.server.IRegistry; + import net.minecraft.core.IRegistry; + import net.minecraft.world.EnumDifficulty; ++import net.minecraft.world.item.EnumColor; + import net.minecraft.world.level.Explosion; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.Blocks; @@ -1161,12 +1162,18 @@ public class PurpurWorldConfig { public boolean wolfRidable = false; diff --git a/patches/Purpur/patches/server/0148-Configurable-entity-base-attributes.patch b/patches/Purpur/patches/server/0148-Configurable-entity-base-attributes.patch index 61d7b4e8..17e6b9a6 100644 --- a/patches/Purpur/patches/server/0148-Configurable-entity-base-attributes.patch +++ b/patches/Purpur/patches/server/0148-Configurable-entity-base-attributes.patch @@ -4,11 +4,11 @@ Date: Thu, 10 Dec 2020 16:44:54 -0600 Subject: [PATCH] Configurable entity base attributes -diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java -index 7677f4a2ec8bacadcbc6e68e13f56256f1963552..5ba96d6073d2f30c22c1fa28fdea30857b6f2d59 100644 ---- a/src/main/java/net/minecraft/server/EntityBat.java -+++ b/src/main/java/net/minecraft/server/EntityBat.java -@@ -55,6 +55,18 @@ public class EntityBat extends EntityAmbient { +diff --git a/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java b/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java +index ce40df98f61b9176989c0000d078597d44e996e2..e6c5d21da445c9b66dcca33d9029d1768bbe046a 100644 +--- a/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java ++++ b/src/main/java/net/minecraft/world/entity/ambient/EntityBat.java +@@ -81,6 +81,18 @@ public class EntityBat extends EntityAmbient { setMot(mot.a(0.9D)); } } @@ -27,12 +27,12 @@ index 7677f4a2ec8bacadcbc6e68e13f56256f1963552..5ba96d6073d2f30c22c1fa28fdea3085 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index ded4e10f5082fb5aa25368d9035affba287c3345..bef806bfc60792a990209b57f3cd4b9da0c24acc 100644 ---- a/src/main/java/net/minecraft/server/EntityBee.java -+++ b/src/main/java/net/minecraft/server/EntityBee.java -@@ -105,6 +105,11 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +index 9e40fd6585592ccd1deff1d8319c57660474c053..c39a7a6d7f391debd632a199eeec8ded6189ad76 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +@@ -181,6 +181,11 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + public int getPurpurBreedTime() { return this.world.purpurConfig.beeBreedingTicks; } + @@ -43,28 +43,12 @@ index ded4e10f5082fb5aa25368d9035affba287c3345..bef806bfc60792a990209b57f3cd4b9d // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java -index dcfad16e06450068d5801fc002c9650102dbf995..90b90fa33b39020189a1d4a5826fa3ab720488cd 100644 ---- a/src/main/java/net/minecraft/server/EntityBlaze.java -+++ b/src/main/java/net/minecraft/server/EntityBlaze.java -@@ -45,6 +45,11 @@ public class EntityBlaze extends EntityMonster { - setMot(mot.a(0.9D)); - } - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.blazeMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 437a7b8ffb40c461f1778d91591fa6c4dcf36834..f973408b1f098c8a090401205f809e95fdcf2f62 100644 ---- a/src/main/java/net/minecraft/server/EntityCat.java -+++ b/src/main/java/net/minecraft/server/EntityCat.java -@@ -63,6 +63,11 @@ public class EntityCat extends EntityTameableAnimal { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +index 079b95ef465f7155f426a2c87a4a50f8369d0a18..7143b0801be7877762e41da336ea5e4e57f2e463 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +@@ -127,6 +127,11 @@ public class EntityCat extends EntityTameableAnimal { + public int getPurpurBreedTime() { return this.world.purpurConfig.catBreedingTicks; } + @@ -75,27 +59,11 @@ index 437a7b8ffb40c461f1778d91591fa6c4dcf36834..f973408b1f098c8a090401205f809e95 // Purpur end public MinecraftKey eU() { -diff --git a/src/main/java/net/minecraft/server/EntityCaveSpider.java b/src/main/java/net/minecraft/server/EntityCaveSpider.java -index 2e1f2dec17e7761b6534f29bbec813d135250e4f..adbd665d455dfc1672a5bdf1b3b380d535835cd7 100644 ---- a/src/main/java/net/minecraft/server/EntityCaveSpider.java -+++ b/src/main/java/net/minecraft/server/EntityCaveSpider.java -@@ -18,6 +18,11 @@ public class EntityCaveSpider extends EntitySpider { - public boolean isRidableInWater() { - return world.purpurConfig.caveSpiderRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.caveSpiderMaxHealth); -+ } - // Purpur end - - public static AttributeProvider.Builder m() { -diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index 2e1dc047459889aea85a79eaa04e8fe1a80e5b9e..18aed81061a4033627214a65d38cd9509ed0f8e9 100644 ---- a/src/main/java/net/minecraft/server/EntityChicken.java -+++ b/src/main/java/net/minecraft/server/EntityChicken.java -@@ -33,6 +33,7 @@ public class EntityChicken extends EntityAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +index ab54e809f735cea7d84366d2bc205351f8992bef..51fd3d955c866cc09bb09abe1b6d23caad2d7e85 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityChicken.java +@@ -70,6 +70,7 @@ public class EntityChicken extends EntityAnimal { if (world.purpurConfig.chickenRetaliate) { this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(2.0D); } @@ -103,11 +71,19 @@ index 2e1dc047459889aea85a79eaa04e8fe1a80e5b9e..18aed81061a4033627214a65d38cd950 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityCod.java b/src/main/java/net/minecraft/server/EntityCod.java -index 039fae4c29648afa85ea1b27d82cfe51c4165315..024a5ffa878d6e6749c1dd95e94ec6d65cf1d629 100644 ---- a/src/main/java/net/minecraft/server/EntityCod.java -+++ b/src/main/java/net/minecraft/server/EntityCod.java -@@ -16,6 +16,11 @@ public class EntityCod extends EntityFishSchool { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCod.java b/src/main/java/net/minecraft/world/entity/animal/EntityCod.java +index 897e0d5ca44a0c475634f08e7d4fcf129ee197ab..07c6dc6a1b9af7b9662f4dd4b4a2ddfcbe600c34 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCod.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCod.java +@@ -4,6 +4,7 @@ import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.World; +@@ -24,6 +25,11 @@ public class EntityCod extends EntityFishSchool { public boolean isRidableInWater() { return true; } @@ -119,12 +95,12 @@ index 039fae4c29648afa85ea1b27d82cfe51c4165315..024a5ffa878d6e6749c1dd95e94ec6d6 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 63497ca0266073dc0a16b7dc22641d08c3eaf400..951531d65709ee3064371cbf4b3a9831a47b12aa 100644 ---- a/src/main/java/net/minecraft/server/EntityCow.java -+++ b/src/main/java/net/minecraft/server/EntityCow.java -@@ -26,6 +26,11 @@ public class EntityCow extends EntityAnimal { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +index 93589a2b86e6663d93f6b536b853996c08db549a..2a8c0537fbb68577a3da3f8d07c16e9ca18b224d 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCow.java +@@ -59,6 +59,11 @@ public class EntityCow extends EntityAnimal { + public int getPurpurBreedTime() { return this.world.purpurConfig.cowBreedingTicks; } + @@ -135,27 +111,11 @@ index 63497ca0266073dc0a16b7dc22641d08c3eaf400..951531d65709ee3064371cbf4b3a9831 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 7e5ede0f644a6e303be36ab0915d346a02760daa..523988bcc0607198dfb73afca5932ed6dd82cca1 100644 ---- a/src/main/java/net/minecraft/server/EntityCreeper.java -+++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -97,6 +97,11 @@ public class EntityCreeper extends EntityMonster { - } - return getForward() == 0 && getStrafe() == 0; // do not jump if standing still - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.creeperMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityDolphin.java b/src/main/java/net/minecraft/server/EntityDolphin.java -index 9d5d143a997b74e0777bb79bf14d341ad5340db9..82021ba825d6a36191174acf83d109a5c74f6db8 100644 ---- a/src/main/java/net/minecraft/server/EntityDolphin.java -+++ b/src/main/java/net/minecraft/server/EntityDolphin.java -@@ -63,6 +63,11 @@ public class EntityDolphin extends EntityWaterAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +index 880c3aaf4e684209879dc921480619e7c61ee4a0..6b32b3e4877efa64942838a07af5d48cd4e33a80 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityDolphin.java +@@ -128,6 +128,11 @@ public class EntityDolphin extends EntityWaterAnimal { } return false; } @@ -167,96 +127,12 @@ index 9d5d143a997b74e0777bb79bf14d341ad5340db9..82021ba825d6a36191174acf83d109a5 // Purpur end @Nullable -diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 638efc67d66001ee085957d4698f51a7daac77fc..a766910663e47b05d1e38908b5db7471199993c7 100644 ---- a/src/main/java/net/minecraft/server/EntityDrowned.java -+++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -46,6 +46,15 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { - public boolean jockeyTryExistingChickens() { - return world.purpurConfig.drownedJockeyTryExistingChickens; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.drownedMaxHealth); -+ } -+ -+ protected void generateReinforcementsChance() { -+ this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).setValue(this.random.nextDouble() * this.world.purpurConfig.drownedSpawnReinforcements); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 81e63fe1b8252e2b5abcbf9051190cd0214b534c..75e834caaf7bb64a3d51d793e86aa702f6ccb0ae 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -97,6 +97,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - public double getMaxY() { - return world.purpurConfig.enderDragonMaxY; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.enderDragonMaxHealth); -+ } - // Purpur end - - public static AttributeProvider.Builder m() { -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index acb2b3ed04ea0bf19335415310ce22cd076dd92a..dfe6175ec8107f684ea1567d932d11de06c46372 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -40,6 +40,11 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - public boolean isRidableInWater() { - return world.purpurConfig.endermanRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.endermanMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEndermite.java b/src/main/java/net/minecraft/server/EntityEndermite.java -index 7eef7f523a17434b38492006526920a955fc9120..3f34ebc1c4ac6f6f0b883c3e4c768007c24fc194 100644 ---- a/src/main/java/net/minecraft/server/EntityEndermite.java -+++ b/src/main/java/net/minecraft/server/EntityEndermite.java -@@ -22,6 +22,11 @@ public class EntityEndermite extends EntityMonster { - public boolean isRidableInWater() { - return world.purpurConfig.endermiteRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.endermiteMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index c75dc75611991028e9de6db7c57304e913251a6b..f0ecc6e6ef5843714a6423af5d6619856ef23977 100644 ---- a/src/main/java/net/minecraft/server/EntityEvoker.java -+++ b/src/main/java/net/minecraft/server/EntityEvoker.java -@@ -22,6 +22,11 @@ public class EntityEvoker extends EntityIllagerWizard { - public boolean isRidableInWater() { - return world.purpurConfig.evokerRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.evokerMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index b5f036af81ddd3c1b0e388a28383f0b6a63d128c..7a3fb7a41e987adee675fbfd11f2648cf5de3e53 100644 ---- a/src/main/java/net/minecraft/server/EntityFox.java -+++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -91,6 +91,11 @@ public class EntityFox extends EntityAnimal { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +index 7bf546a1b2a80179962ed08a35d86f0a28eda3c2..b8b0ee65798dc94d707fa64bd53fdda5506331d9 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +@@ -164,6 +164,11 @@ public class EntityFox extends EntityAnimal { + public int getPurpurBreedTime() { return this.world.purpurConfig.foxBreedingTicks; } + @@ -267,76 +143,324 @@ index b5f036af81ddd3c1b0e388a28383f0b6a63d128c..7a3fb7a41e987adee675fbfd11f2648c // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java -index 216506a7b1f97b776ecd4e24f5b2afaf5b79ec2d..2c0148229283f95bed3c8f33cc02a31d6f682191 100644 ---- a/src/main/java/net/minecraft/server/EntityGhast.java -+++ b/src/main/java/net/minecraft/server/EntityGhast.java -@@ -41,6 +41,11 @@ public class EntityGhast extends EntityFlying implements IMonster { - setMot(mot.a(0.9D)); +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +index 23e614f0c3cf1178acff8e72e0441c42c658e76b..9ee82c908008190e31034e614c241fc7a66248e1 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityIronGolem.java +@@ -80,6 +80,11 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { + public boolean isRidableInWater() { + return world.purpurConfig.ironGolemRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ironGolemMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +index ab4a8ee6e1912f230cbf3353eb42c3bc8a9db58e..4b7e21a611d87410805722c30c9ee77212b33348 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityMushroomCow.java +@@ -24,6 +24,7 @@ import net.minecraft.world.entity.EntityLightning; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.IShearable; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.item.EntityItem; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.Item; +@@ -72,6 +73,11 @@ public class EntityMushroomCow extends EntityCow implements IShearable { + public int getPurpurBreedTime() { + return this.world.purpurConfig.mooshroomBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.mooshroomMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +index cff2ff5a8beef739f0515832e072e7e390ac388f..12534673afe0b05868a5f400c9e59c22dfcf12d6 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityOcelot.java +@@ -79,6 +79,11 @@ public class EntityOcelot extends EntityAnimal { + public int getPurpurBreedTime() { + return this.world.purpurConfig.ocelotBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ocelotMaxHealth); ++ } + // Purpur end + + private boolean isTrusting() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +index e6952c0a8d90eb4b133c517d97299f2c3db7e329..94141b8c1ad62e6d187726734d25dd0ee5535618 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPanda.java +@@ -34,6 +34,7 @@ import net.minecraft.world.entity.EnumItemSlot; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.IEntitySelector; ++import net.minecraft.world.entity.ai.attributes.AttributeModifiable; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.control.ControllerMove; +@@ -126,6 +127,12 @@ public class EntityPanda extends EntityAnimal { + public int getPurpurBreedTime() { + return this.world.purpurConfig.pandaBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pandaMaxHealth); ++ updateAttributes(); ++ } + // Purpur end + + @Override +@@ -598,9 +605,12 @@ public class EntityPanda extends EntityAnimal { + return this.random.nextBoolean() ? this.getMainGene() : this.getHiddenGene(); + } + +- public void fg() { ++ public void fg() { updateAttributes(); } public void updateAttributes() { // Purpur - OBFHELPER + if (this.isWeak()) { +- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(10.0D); ++ // Purpur start ++ AttributeModifiable maxHealth = this.getAttributeInstance(GenericAttributes.MAX_HEALTH); ++ maxHealth.setValue(maxHealth.getValue() / 2); ++ // Purpur end } + + if (this.isLazy()) { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +index 5463e1779422ff19499727a000fdfbbfc38809a8..efa4318989893c946e9d7671d0dead6c4a6e315f 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +@@ -176,6 +176,11 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + public int getPurpurBreedTime() { + return 6000; } + + @Override + public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ghastMaxHealth); ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.parrotMaxHealth); ++ } + // Purpur end + + @Nullable +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +index 5aa8806063186bec36b38adc51e2ea82bf6ff21a..8d24855f230a5ca6280f885d5b1c26ecf5b91395 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPig.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPig.java +@@ -82,6 +82,11 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { + public int getPurpurBreedTime() { + return this.world.purpurConfig.pigBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pigMaxHealth); + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityGuardian.java b/src/main/java/net/minecraft/server/EntityGuardian.java -index 0a7f51a2a1cb10438c9364faf3e4adc6322fc787..476f692df79e98779271cc5a395276ab9c755a58 100644 ---- a/src/main/java/net/minecraft/server/EntityGuardian.java -+++ b/src/main/java/net/minecraft/server/EntityGuardian.java -@@ -46,6 +46,11 @@ public class EntityGuardian extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +index 2306abb72ea76a52fd6f27648c4815ad99f8f005..5a496d55b40f98609b0a9aac25929f6b5c0311ba 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPolarBear.java +@@ -121,6 +121,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { + public int getPurpurBreedTime() { + return this.world.purpurConfig.polarBearBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.polarBearMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java b/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java +index 38fe79872b4b7f4ad4a030fbdf505efbc0352fc0..0d32590cf4cfdd95da6aceac5190d42c8e966ce7 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityPufferFish.java +@@ -20,6 +20,7 @@ import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntitySize; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMonsterType; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; +@@ -49,6 +50,11 @@ public class EntityPufferFish extends EntityFish { public boolean isRidableInWater() { return true; } + + @Override + public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.guardianMaxHealth); ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pufferfishMaxHealth); + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityGuardianElder.java b/src/main/java/net/minecraft/server/EntityGuardianElder.java -index f6f882746940c9e049106aa9b41591ba27a608ce..7afba8136f9a809e779d9af8c93cda7c0765c095 100644 ---- a/src/main/java/net/minecraft/server/EntityGuardianElder.java -+++ b/src/main/java/net/minecraft/server/EntityGuardianElder.java -@@ -26,6 +26,11 @@ public class EntityGuardianElder extends EntityGuardian { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +index 0b706404895b69fbca79502a327ec20b47ed99f0..284c52276b2fd816990c23b7b8a9ee50e70ab005 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +@@ -91,6 +91,11 @@ public class EntityRabbit extends EntityAnimal { + public int getPurpurBreedTime() { + return this.world.purpurConfig.rabbitBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.rabbitMaxHealth); ++ } + // Purpur end + + // CraftBukkit start - code from constructor +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java b/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java +index bf565671c167162b3d935447961f0d44ed4a2779..36e60360193cb0cfd8fef03f964e0fa90002f8bc 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySalmon.java +@@ -4,6 +4,7 @@ import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.World; +@@ -24,6 +25,11 @@ public class EntitySalmon extends EntityFishSchool { public boolean isRidableInWater() { return true; } + + @Override + public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.elderGuardianMaxHealth); -+ } - // Purpur end - - public static AttributeProvider.Builder m() { -diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index a1578aade4a535144b5e40277c902f2e9ab9e940..4a3469aca9f9e47d2ea3f3bae6ce77f5f11d6b50 100644 ---- a/src/main/java/net/minecraft/server/EntityHoglin.java -+++ b/src/main/java/net/minecraft/server/EntityHoglin.java -@@ -35,6 +35,11 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - int getPurpurBreedTime() { - return this.world.purpurConfig.hoglinBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.hoglinMaxHealth); ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.salmonMaxHealth); + } // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 669bce5d9806c80bddc247fe103ff20dc6aaa8a5..e78e89d187f923239f23e37d5141e2e69b056360 100644 ---- a/src/main/java/net/minecraft/server/EntityHorse.java -+++ b/src/main/java/net/minecraft/server/EntityHorse.java -@@ -22,6 +22,21 @@ public class EntityHorse extends EntityHorseAbstract { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +index ff6fc821085e4430a3b1008140b0b7fcacc59d2e..365f70117a287fab2fbf63ee8d89a10ac70b2f1b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySheep.java +@@ -126,6 +126,11 @@ public class EntitySheep extends EntityAnimal implements IShearable { + public int getPurpurBreedTime() { + return this.world.purpurConfig.sheepBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.sheepMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index 28b5c22ecfe573ac9d91b74e54ebd3e3c5e6373f..88db8ff8cb415b84ab98cc0550c705d5a472230c 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -61,6 +61,11 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt + public boolean isRidableInWater() { + return world.purpurConfig.snowGolemRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.snowGolemMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +index 07b1db0e1fff1beffe464a3984716d5d84ea1873..2d2a3fc083bff18cdf50b1ef49b198f8253987ec 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySquid.java +@@ -85,6 +85,11 @@ public class EntitySquid extends EntityWaterAnimal { + public boolean isInWater() { + return this.inWater || world.purpurConfig.squidsCanFly; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.squidMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java b/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java +index 478e55475ccc1410a442f4e30a1cbc08f479dbda..7d0982b8756b9e6c12cf4acae765ff651b846250 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityTropicalFish.java +@@ -14,6 +14,7 @@ import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.item.EnumColor; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; +@@ -47,6 +48,11 @@ public class EntityTropicalFish extends EntityFishSchool { + public boolean isRidableInWater() { + return true; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.tropicalFishMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +index a16f586934f24e599d00bf793f06d3f9134ed29d..2da43c75c5767973c43e42af37c0d0d9d3a27859 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityTurtle.java +@@ -106,6 +106,11 @@ public class EntityTurtle extends EntityAnimal { + public int getPurpurBreedTime() { + return this.world.purpurConfig.turtleBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.turtleMaxHealth); ++ } + // Purpur end + + public void setHomePos(BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index e33aadead6e6c5e0a7b39ef95e7aeb0f0092a94e..090903fbc8f6cd1522c7afb358f708f5ae3395f4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -188,6 +188,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + setCollarColor(world.purpurConfig.wolfDefaultCollarColor); + super.tame(entityhuman); + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.wolfMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +index c830bf6e5e38f5ebacc07673c3d67e4157c8c2b5..c6e39fe54cc402869b2e9eaea1830ba1ccc9ffc1 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorse.java +@@ -51,6 +51,21 @@ public class EntityHorse extends EntityHorseAbstract { + public int getPurpurBreedTime() { return this.world.purpurConfig.horseBreedingTicks; } + @@ -357,11 +481,11 @@ index 669bce5d9806c80bddc247fe103ff20dc6aaa8a5..e78e89d187f923239f23e37d5141e2e6 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index 8fde406273bbea0b9d2dea2362cf6372b7a5c9ae..2bed0a08eaad5fee5d5e85ba6cb3d3e8e1be1c2c 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java -+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -@@ -56,6 +56,32 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +index d4556fa190c754406d0c65baae941fb23af3f81f..1d938f324bc08c05b44c72b5a2927016ed599cf2 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java +@@ -120,6 +120,32 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven public boolean isRidableInWater() { return false; } @@ -394,7 +518,7 @@ index 8fde406273bbea0b9d2dea2362cf6372b7a5c9ae..2bed0a08eaad5fee5d5e85ba6cb3d3e8 // Purpur end @Override -@@ -864,15 +890,15 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -928,15 +954,15 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven } @@ -413,7 +537,7 @@ index 8fde406273bbea0b9d2dea2362cf6372b7a5c9ae..2bed0a08eaad5fee5d5e85ba6cb3d3e8 return (0.44999998807907104D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D + this.random.nextDouble() * 0.3D) * 0.25D; } -@@ -995,7 +1021,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven +@@ -1059,7 +1085,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven groupdataentity = new EntityAgeable.a(0.2F); } @@ -422,12 +546,12 @@ index 8fde406273bbea0b9d2dea2362cf6372b7a5c9ae..2bed0a08eaad5fee5d5e85ba6cb3d3e8 return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); } } -diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -index f6421bb45c5e6adf39fdc085efe2b2f500b76c0c..5b7c0e9c6cce440ed54a97803a4275eea497935a 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java -+++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -@@ -18,6 +18,21 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +index 3b44394dcba8e9905aca46e6e585ee6d7a87de44..589986b36c12dd2774a87e1d22aafd6d3052f123 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseDonkey.java +@@ -26,6 +26,21 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { + public int getPurpurBreedTime() { return this.world.purpurConfig.donkeyBreedingTicks; } + @@ -448,12 +572,12 @@ index f6421bb45c5e6adf39fdc085efe2b2f500b76c0c..5b7c0e9c6cce440ed54a97803a4275ee // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityHorseMule.java b/src/main/java/net/minecraft/server/EntityHorseMule.java -index 30cbc505d2b0f4d3247edfd271de8daab023eb2a..a32c5347e4d77f5641e4eb3ea4a6ad63d0258bc3 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseMule.java -+++ b/src/main/java/net/minecraft/server/EntityHorseMule.java -@@ -18,7 +18,23 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +index 0536112357e0321dbb902331467b847894a4c11b..9cc1a371dfbb0305fa47e69665a12a6901224edc 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseMule.java +@@ -25,7 +25,23 @@ public class EntityHorseMule extends EntityHorseChestedAbstract { + public int getPurpurBreedTime() { return this.world.purpurConfig.muleBreedingTicks; } + @@ -476,12 +600,12 @@ index 30cbc505d2b0f4d3247edfd271de8daab023eb2a..a32c5347e4d77f5641e4eb3ea4a6ad63 @Override protected SoundEffect getSoundAmbient() { super.getSoundAmbient(); -diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 408db52cacbdfbca8af0a6a8e913b0128a3f5a76..9eac8f39ddfb598f7dfb90625829e2b10d7ec140 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -+++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -@@ -27,6 +27,21 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +index 28c6e3745c61d0670bf7f3a324169472250e25f4..0fe21fde809aa72305b1145b994a7aafe3f03112 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseSkeleton.java +@@ -48,6 +48,21 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { + public int getPurpurBreedTime() { return 6000; } + @@ -502,12 +626,12 @@ index 408db52cacbdfbca8af0a6a8e913b0128a3f5a76..9eac8f39ddfb598f7dfb90625829e2b1 // Purpur end public static AttributeProvider.Builder eL() { -diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java -index 2121a6c979ba2ea7cb596ca6081750d2f8c7df9f..c2dc8211b05b4ee2a2b42435f866f8e55295162d 100644 ---- a/src/main/java/net/minecraft/server/EntityHorseZombie.java -+++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java -@@ -23,6 +23,21 @@ public class EntityHorseZombie extends EntityHorseAbstract { - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +index c776f18722d1aa73f53da66ef6b37564eeaddd2a..1820c2d225d1fa919de2b1c0593370a8a17b4b6a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseZombie.java +@@ -40,6 +40,21 @@ public class EntityHorseZombie extends EntityHorseAbstract { + public int getPurpurBreedTime() { return 6000; } + @@ -528,28 +652,12 @@ index 2121a6c979ba2ea7cb596ca6081750d2f8c7df9f..c2dc8211b05b4ee2a2b42435f866f8e5 // Purpur end public static AttributeProvider.Builder eL() { -diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java -index 9ee03b233b71d1b4b85a9a5e1f0ea9feb55dfe43..3e224eeb7bdcd0d1c6bd46012366c9d9878dd2a2 100644 ---- a/src/main/java/net/minecraft/server/EntityIronGolem.java -+++ b/src/main/java/net/minecraft/server/EntityIronGolem.java -@@ -32,6 +32,11 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { - public boolean isRidableInWater() { - return world.purpurConfig.ironGolemRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ironGolemMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 3bc6e6df9e0107debe5b15f5f7aad97ad336f304..f46a7cfe832c8cca83738b71882ff0a9819a7f41 100644 ---- a/src/main/java/net/minecraft/server/EntityLlama.java -+++ b/src/main/java/net/minecraft/server/EntityLlama.java -@@ -62,6 +62,21 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +index b3d51abc9bad9cad6fdc5dbdc2bf09d43a565f98..762fed5ba27474951c1962e6f034e8494b1035d6 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +@@ -113,6 +113,21 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + public int getPurpurBreedTime() { return this.world.purpurConfig.llamaBreedingTicks; } + @@ -570,11 +678,11 @@ index 3bc6e6df9e0107debe5b15f5f7aad97ad336f304..f46a7cfe832c8cca83738b71882ff0a9 // Purpur end public void setStrength(int i) { -diff --git a/src/main/java/net/minecraft/server/EntityLlamaTrader.java b/src/main/java/net/minecraft/server/EntityLlamaTrader.java -index b6aae5cdee1f8bb842ab8e06c47fb497576b464f..665de0c28e052d195bb30ca13e1b129245eff11c 100644 ---- a/src/main/java/net/minecraft/server/EntityLlamaTrader.java -+++ b/src/main/java/net/minecraft/server/EntityLlamaTrader.java -@@ -26,6 +26,21 @@ public class EntityLlamaTrader extends EntityLlama { +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java +index 0fb651bcde1109b0eb30b60226d3512648dceb41..73f59982d70093d308c6dc6a9a5693347c2699b7 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlamaTrader.java +@@ -42,6 +42,21 @@ public class EntityLlamaTrader extends EntityLlama { public boolean hasSaddle() { return super.hasSaddle() || isTamed(); } @@ -596,11 +704,191 @@ index b6aae5cdee1f8bb842ab8e06c47fb497576b464f..665de0c28e052d195bb30ca13e1b1292 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java -index cd28463e2bf944d94c121c8f8d6e37221754c168..ac24a9de3b2b24bc8afebf54ea0a947fbdac2157 100644 ---- a/src/main/java/net/minecraft/server/EntityMagmaCube.java -+++ b/src/main/java/net/minecraft/server/EntityMagmaCube.java -@@ -23,6 +23,15 @@ public class EntityMagmaCube extends EntitySlime { +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index 7f583c6c15f0191219eb911d901ea28d86c11489..999a6d17eccd6305c0063e1558abfe70d72c39fe 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -147,6 +147,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + public double getMaxY() { + return world.purpurConfig.enderDragonMaxY; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.enderDragonMaxHealth); ++ } + // Purpur end + + public static AttributeProvider.Builder m() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +index 9a109ed062e5abedaad295383aca6441321da276..45e69d2f8da4c5babfd2e67055cc0a4c6d3baac7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +@@ -72,6 +72,11 @@ public class EntityBlaze extends EntityMonster { + setMot(mot.a(0.9D)); + } + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.blazeMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java b/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java +index 27baf5cde99d8f25b1e7583c30339fcc71a3786f..72b298642f17c13f0f5959034e345a47f1e7ae26 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCaveSpider.java +@@ -34,6 +34,11 @@ public class EntityCaveSpider extends EntitySpider { + public boolean isRidableInWater() { + return world.purpurConfig.caveSpiderRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.caveSpiderMaxHealth); ++ } + // Purpur end + + public static AttributeProvider.Builder m() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +index e29bba9143f027077c1051d61296df219cd45861..6461e09e05f9255a399a6ce65d8fb90789a2fd7f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +@@ -137,6 +137,11 @@ public class EntityCreeper extends EntityMonster { + } + return getForward() == 0 && getStrafe() == 0; // do not jump if standing still + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.creeperMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +index 93946f4e3cad07e20189a44ce512682b4cbc163b..926a38adb52b7d99ce2a9fcc52eb4878a2abdbcf 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityDrowned.java +@@ -97,6 +97,15 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + public boolean jockeyTryExistingChickens() { + return world.purpurConfig.drownedJockeyTryExistingChickens; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.drownedMaxHealth); ++ } ++ ++ protected void generateReinforcementsChance() { ++ this.getAttributeInstance(GenericAttributes.SPAWN_REINFORCEMENTS).setValue(this.random.nextDouble() * this.world.purpurConfig.drownedSpawnReinforcements); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 18b3f8d1fadd1424327261d92b49977a35c4948c..478ac5bfdc69b5c3e24906bb5e0ea1dff81cea98 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -96,6 +96,11 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + public boolean isRidableInWater() { + return world.purpurConfig.endermanRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.endermanMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java b/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java +index 1c87bea9de812e57f8ccd3c9aa85330af87ed240..0e1d60a744fb41d2c31950572720b8899281df47 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEndermite.java +@@ -47,6 +47,11 @@ public class EntityEndermite extends EntityMonster { + public boolean isRidableInWater() { + return world.purpurConfig.endermiteRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.endermiteMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +index 55607910183155080e3d96296421438d17f19c8f..8d7b8d2ac9a7340e2cfd0d1b8963e4e4d97e8bc8 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +@@ -59,6 +59,11 @@ public class EntityEvoker extends EntityIllagerWizard { + public boolean isRidableInWater() { + return world.purpurConfig.evokerRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.evokerMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +index 8784647f512d280ee0a092ecd406321268359314..5c39a9aec865d25a9aa5edcfd3a0fd6d1166cbd1 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +@@ -73,6 +73,11 @@ public class EntityGhast extends EntityFlying implements IMonster { + setMot(mot.a(0.9D)); + } + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ghastMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java b/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java +index 6980b6988549b37a33d204a6e84c9e81d384a57a..248c64ea21de214bfbb2fa39f289382fd4f76202 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGuardian.java +@@ -86,6 +86,11 @@ public class EntityGuardian extends EntityMonster { + public boolean isRidableInWater() { + return true; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.guardianMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java +index 16b8606be2835dccdfa75f29827be4b88aaa1810..b06897c3d9dfc4612b0711eee5f225224e07ae91 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGuardianElder.java +@@ -40,6 +40,11 @@ public class EntityGuardianElder extends EntityGuardian { + public boolean isRidableInWater() { + return true; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.elderGuardianMaxHealth); ++ } + // Purpur end + + public static AttributeProvider.Builder m() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java b/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java +index 15ed51a2746c09538a425fce25fa25f2619b7033..626a207cdb727866cb75f4e53a6880867c1ca195 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityMagmaCube.java +@@ -44,6 +44,15 @@ public class EntityMagmaCube extends EntitySlime { public float getJumpHeight() { return 0.42F * this.getBlockJumpFactor(); // from EntityLiving } @@ -616,91 +904,11 @@ index cd28463e2bf944d94c121c8f8d6e37221754c168..ac24a9de3b2b24bc8afebf54ea0a947f // Purpur end public static AttributeProvider.Builder m() { -diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 46d031ef3cebfe30e07840ef1c9d60a97a24cd1b..c97dac30010c7d574aa7087f3a84581bfc386473 100644 ---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java -+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -36,6 +36,11 @@ public class EntityMushroomCow extends EntityCow implements IShearable { - int getPurpurBreedTime() { - return this.world.purpurConfig.mooshroomBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.mooshroomMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index a5be10dfb0de08b0d97265278b1f11ad1e94b821..b8368cf397c26d06f2827a1a786e1f241b810cce 100644 ---- a/src/main/java/net/minecraft/server/EntityOcelot.java -+++ b/src/main/java/net/minecraft/server/EntityOcelot.java -@@ -31,6 +31,11 @@ public class EntityOcelot extends EntityAnimal { - int getPurpurBreedTime() { - return this.world.purpurConfig.ocelotBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.ocelotMaxHealth); -+ } - // Purpur end - - private boolean isTrusting() { -diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java -index c70180fddb829419b9cc5188766e9130f9b8a94a..d202624853a1a0a0562b62ad5f3792db0916ae03 100644 ---- a/src/main/java/net/minecraft/server/EntityPanda.java -+++ b/src/main/java/net/minecraft/server/EntityPanda.java -@@ -70,6 +70,12 @@ public class EntityPanda extends EntityAnimal { - int getPurpurBreedTime() { - return this.world.purpurConfig.pandaBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pandaMaxHealth); -+ updateAttributes(); -+ } - // Purpur end - - @Override -@@ -542,9 +548,12 @@ public class EntityPanda extends EntityAnimal { - return this.random.nextBoolean() ? this.getMainGene() : this.getHiddenGene(); - } - -- public void fg() { -+ public void fg() { updateAttributes(); } public void updateAttributes() { // Purpur - OBFHELPER - if (this.isWeak()) { -- this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(10.0D); -+ // Purpur start -+ AttributeModifiable maxHealth = this.getAttributeInstance(GenericAttributes.MAX_HEALTH); -+ maxHealth.setValue(maxHealth.getValue() / 2); -+ // Purpur end - } - - if (this.isLazy()) { -diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java -index 398e92bf7053c411bd98626efe4261e15256d3ee..d19f8dda87c97de594ad051a6791d99eec581e95 100644 ---- a/src/main/java/net/minecraft/server/EntityParrot.java -+++ b/src/main/java/net/minecraft/server/EntityParrot.java -@@ -120,6 +120,11 @@ public class EntityParrot extends EntityPerchable implements EntityBird { - int getPurpurBreedTime() { - return 6000; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.parrotMaxHealth); -+ } - // Purpur end - - @Nullable -diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index c70281fddcbe5a97a1eb176def99cdf31de37579..80cc4467d601b653583e387eb4be6f3b739058e6 100644 ---- a/src/main/java/net/minecraft/server/EntityPhantom.java -+++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -76,6 +76,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index a836839b17cbda8ac269f032b141ba448e3bab8c..902b26d609aef8dd46e8875cb7c06f187511e8d5 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -120,6 +120,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { world.addEntity(flames); return true; } @@ -712,27 +920,11 @@ index c70281fddcbe5a97a1eb176def99cdf31de37579..80cc4467d601b653583e387eb4be6f3b // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index eae841eeac75a35a9dc5a53c57538ac5264ece68..9cf07531c674402e3ecc87229638578989340a13 100644 ---- a/src/main/java/net/minecraft/server/EntityPig.java -+++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -34,6 +34,11 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { - int getPurpurBreedTime() { - return this.world.purpurConfig.pigBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pigMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java -index 57f3358b8dfd53f5b1d2e976d64b809f74bc3ce3..4c050c841f9846cc74fef51d5eb69f4cbb737ef1 100644 ---- a/src/main/java/net/minecraft/server/EntityPigZombie.java -+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java -@@ -46,6 +46,15 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +index 8db9c62093b2f075face65030cb91c24fb6c2dbf..736c45bae020158866514bc760c05a929f47c531 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java +@@ -80,6 +80,15 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { public boolean jockeyTryExistingChickens() { return world.purpurConfig.zombifiedPiglinJockeyTryExistingChickens; } @@ -748,7 +940,7 @@ index 57f3358b8dfd53f5b1d2e976d64b809f74bc3ce3..4c050c841f9846cc74fef51d5eb69f4c // Purpur end @Override -@@ -234,7 +243,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { +@@ -268,7 +277,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable { @Override protected void eV() { @@ -757,43 +949,11 @@ index 57f3358b8dfd53f5b1d2e976d64b809f74bc3ce3..4c050c841f9846cc74fef51d5eb69f4c } @Override -diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java -index 334e0f73e67ef2db7e680874faf0646995d9de8a..4849829df1041568a9fcac6d16501fc0606d95da 100644 ---- a/src/main/java/net/minecraft/server/EntityPiglin.java -+++ b/src/main/java/net/minecraft/server/EntityPiglin.java -@@ -35,6 +35,11 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - public boolean isRidableInWater() { - return world.purpurConfig.piglinRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.piglinMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityPiglinBrute.java b/src/main/java/net/minecraft/server/EntityPiglinBrute.java -index f6b170811159544dc10b91226e4e54b349472c46..50e42cd8ccd48efe6251a37762953f7f55d18277 100644 ---- a/src/main/java/net/minecraft/server/EntityPiglinBrute.java -+++ b/src/main/java/net/minecraft/server/EntityPiglinBrute.java -@@ -25,6 +25,11 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { - public boolean isRidableInWater() { - return world.purpurConfig.piglinBruteRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.piglinBruteMaxHealth); -+ } - // Purpur end - - public static AttributeProvider.Builder eS() { -diff --git a/src/main/java/net/minecraft/server/EntityPillager.java b/src/main/java/net/minecraft/server/EntityPillager.java -index cf7de0127166f6175a6246062c8664e64959edeb..99b2d50d3958a9341d01108000f2719d271bdfd5 100644 ---- a/src/main/java/net/minecraft/server/EntityPillager.java -+++ b/src/main/java/net/minecraft/server/EntityPillager.java -@@ -23,6 +23,11 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java b/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java +index 2a4ac6e608650d56cc2b564e715b7b685e7f3f62..43a1a31db5ddfd30b66c63c6b2cceb1dcf62e412 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPillager.java +@@ -72,6 +72,11 @@ public class EntityPillager extends EntityIllagerAbstract implements ICrossbow { public boolean isRidableInWater() { return world.purpurConfig.pillagerRidableInWater; } @@ -805,59 +965,11 @@ index cf7de0127166f6175a6246062c8664e64959edeb..99b2d50d3958a9341d01108000f2719d // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index 40395dd7ea515e51a189d014a3274d15dc1d8ee6..f72a72e6f76c3896a80a75aae255081e2f8bb507 100644 ---- a/src/main/java/net/minecraft/server/EntityPolarBear.java -+++ b/src/main/java/net/minecraft/server/EntityPolarBear.java -@@ -72,6 +72,11 @@ public class EntityPolarBear extends EntityAnimal implements IEntityAngerable { - int getPurpurBreedTime() { - return this.world.purpurConfig.polarBearBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.polarBearMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityPufferFish.java b/src/main/java/net/minecraft/server/EntityPufferFish.java -index 16a4df27c557e2d4a0fd4f48317307b884c2688c..815ba3062e0cbc4400f4dae9f80ce8f6745816f5 100644 ---- a/src/main/java/net/minecraft/server/EntityPufferFish.java -+++ b/src/main/java/net/minecraft/server/EntityPufferFish.java -@@ -27,6 +27,11 @@ public class EntityPufferFish extends EntityFish { - public boolean isRidableInWater() { - return true; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.pufferfishMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index b7f4d61f0038d865ef9ee3c14f6dc146f8de5ac4..0583fc55056a29e7629c76b72800c727401a4a83 100644 ---- a/src/main/java/net/minecraft/server/EntityRabbit.java -+++ b/src/main/java/net/minecraft/server/EntityRabbit.java -@@ -35,6 +35,11 @@ public class EntityRabbit extends EntityAnimal { - int getPurpurBreedTime() { - return this.world.purpurConfig.rabbitBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.rabbitMaxHealth); -+ } - // Purpur end - - // CraftBukkit start - code from constructor -diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java -index 9d0a462bfc56994ee35478cc9e565123620a9f08..820938c76e787fac6c65eb000491232d5b749dee 100644 ---- a/src/main/java/net/minecraft/server/EntityRavager.java -+++ b/src/main/java/net/minecraft/server/EntityRavager.java -@@ -39,6 +39,11 @@ public class EntityRavager extends EntityRaider { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +index dc1ca7b334e89b4d0be775b6f6e6f4222ea02dcc..80c3cd540a46e249e85586e8d7a2f0f6226091fc 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +@@ -81,6 +81,11 @@ public class EntityRavager extends EntityRaider { double speed = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getBaseValue(); getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(speed); } @@ -869,43 +981,11 @@ index 9d0a462bfc56994ee35478cc9e565123620a9f08..820938c76e787fac6c65eb000491232d // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySalmon.java b/src/main/java/net/minecraft/server/EntitySalmon.java -index 6dfcee2c9b658c2c9ee1179e412389934c066d48..475c375bebe2c7211869af28d23db3107b39fe51 100644 ---- a/src/main/java/net/minecraft/server/EntitySalmon.java -+++ b/src/main/java/net/minecraft/server/EntitySalmon.java -@@ -16,6 +16,11 @@ public class EntitySalmon extends EntityFishSchool { - public boolean isRidableInWater() { - return true; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.salmonMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index 32130c0681501e3e5a47b199f0bb39daac416ed3..d9fe8cf00088dba516ea2bfd7e9590d95c7e7939 100644 ---- a/src/main/java/net/minecraft/server/EntitySheep.java -+++ b/src/main/java/net/minecraft/server/EntitySheep.java -@@ -71,6 +71,11 @@ public class EntitySheep extends EntityAnimal implements IShearable { - int getPurpurBreedTime() { - return this.world.purpurConfig.sheepBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.sheepMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java -index 11a6b939ebb51cdda907531d30b7beb3a8562673..3f1cb739709cc16a9f7073ec8fafb448b734a948 100644 ---- a/src/main/java/net/minecraft/server/EntityShulker.java -+++ b/src/main/java/net/minecraft/server/EntityShulker.java -@@ -40,6 +40,11 @@ public class EntityShulker extends EntityGolem implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java b/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java +index 0294ab119407dc45a40c8444fb5a91e154017234..a735ac7644f8fe6924349fbd9e8984f678d0b9c2 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityShulker.java +@@ -82,6 +82,11 @@ public class EntityShulker extends EntityGolem implements IMonster { public boolean isRidableInWater() { return world.purpurConfig.shulkerRidableInWater; } @@ -917,11 +997,11 @@ index 11a6b939ebb51cdda907531d30b7beb3a8562673..3f1cb739709cc16a9f7073ec8fafb448 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index ad428e090089a461283445022b33313520585ac5..6bd00f0b5735d694e370cf85fdbf508c31fc7c27 100644 ---- a/src/main/java/net/minecraft/server/EntitySilverfish.java -+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java -@@ -21,6 +21,11 @@ public class EntitySilverfish extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +index c0601af022d85c7b03463f0df975d713c0366b2c..a0a1e5977a3cbc8e9befd827dd1e15352a2c0c39 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +@@ -49,6 +49,11 @@ public class EntitySilverfish extends EntityMonster { public boolean isRidableInWater() { return world.purpurConfig.silverfishRidableInWater; } @@ -933,11 +1013,19 @@ index ad428e090089a461283445022b33313520585ac5..6bd00f0b5735d694e370cf85fdbf508c // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java -index 3f130e03bf8b235360385fd169d4886ffcfa626a..a78e593cbdfa4a74d07fd53c9481534c856d01e6 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeleton.java -+++ b/src/main/java/net/minecraft/server/EntitySkeleton.java -@@ -16,6 +16,11 @@ public class EntitySkeleton extends EntitySkeletonAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java +index 0b8517d4e83d14ddf8b6d1f1cf4c538f9e4cc68f..8ee51897af1199b9bed05ddf90fe914a7b214b91 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeleton.java +@@ -5,6 +5,7 @@ import net.minecraft.sounds.SoundEffects; + import net.minecraft.world.damagesource.DamageSource; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.IMaterial; + import net.minecraft.world.level.World; +@@ -25,6 +26,11 @@ public class EntitySkeleton extends EntitySkeletonAbstract { public boolean isRidableInWater() { return world.purpurConfig.skeletonRidableInWater; } @@ -949,11 +1037,19 @@ index 3f130e03bf8b235360385fd169d4886ffcfa626a..a78e593cbdfa4a74d07fd53c9481534c // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySkeletonStray.java b/src/main/java/net/minecraft/server/EntitySkeletonStray.java -index d123fb82b635d5271bea9b238554a3011858eeae..e34ab9eda7f610456193bdc0495c2ba478917625 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeletonStray.java -+++ b/src/main/java/net/minecraft/server/EntitySkeletonStray.java -@@ -18,6 +18,11 @@ public class EntitySkeletonStray extends EntitySkeletonAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java +index 8484000a1b0d9c252d6fab205b1e316e3f6f33bd..a75a7785406143325b0364737dd1667aad464018 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonStray.java +@@ -9,6 +9,7 @@ import net.minecraft.world.effect.MobEffect; + import net.minecraft.world.effect.MobEffects; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.projectile.EntityArrow; + import net.minecraft.world.entity.projectile.EntityTippedArrow; + import net.minecraft.world.item.ItemStack; +@@ -31,6 +32,11 @@ public class EntitySkeletonStray extends EntitySkeletonAbstract { public boolean isRidableInWater() { return world.purpurConfig.strayRidableInWater; } @@ -965,11 +1061,11 @@ index d123fb82b635d5271bea9b238554a3011858eeae..e34ab9eda7f610456193bdc0495c2ba4 // Purpur end public static boolean a(EntityTypes entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { -diff --git a/src/main/java/net/minecraft/server/EntitySkeletonWither.java b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -index 96cb080d940db22330598a8806726088b79a53c1..ee7805dccac9c4dcdf4fa83ab8041953dccdc83b 100644 ---- a/src/main/java/net/minecraft/server/EntitySkeletonWither.java -+++ b/src/main/java/net/minecraft/server/EntitySkeletonWither.java -@@ -19,6 +19,11 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +index cb52c4e63ac487d55dc16accca6976f44f904112..62f1808a456f46a6c7fbb5e030d9ed6546676a3d 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySkeletonWither.java +@@ -44,6 +44,11 @@ public class EntitySkeletonWither extends EntitySkeletonAbstract { public boolean isRidableInWater() { return world.purpurConfig.witherSkeletonRidableInWater; } @@ -981,11 +1077,11 @@ index 96cb080d940db22330598a8806726088b79a53c1..ee7805dccac9c4dcdf4fa83ab8041953 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 7f3d57a9399f60465fae27f03fc57df625f5016d..c3737457c521715b640b138dc41863dfba6e4ae8 100644 ---- a/src/main/java/net/minecraft/server/EntitySlime.java -+++ b/src/main/java/net/minecraft/server/EntitySlime.java -@@ -11,6 +11,7 @@ import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent; +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java +index 0cbe3032fd3b048b0eb8ec3d8592a662c69c9e30..b80b426acd8aec61c5e970ca039c8c47bc97f9e4 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySlime.java +@@ -51,6 +51,7 @@ import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent; import com.destroystokyo.paper.event.entity.SlimeSwimEvent; import com.destroystokyo.paper.event.entity.SlimeTargetLivingEntityEvent; import com.destroystokyo.paper.event.entity.SlimeWanderEvent; @@ -993,7 +1089,7 @@ index 7f3d57a9399f60465fae27f03fc57df625f5016d..c3737457c521715b640b138dc41863df import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Slime; // Paper end -@@ -25,6 +26,7 @@ import org.bukkit.event.entity.SlimeSplitEvent; +@@ -65,6 +66,7 @@ import org.bukkit.event.entity.SlimeSplitEvent; public class EntitySlime extends EntityInsentient implements IMonster { private static final DataWatcherObject bo = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.b); @@ -1001,7 +1097,7 @@ index 7f3d57a9399f60465fae27f03fc57df625f5016d..c3737457c521715b640b138dc41863df public float b; public float c; public float d; -@@ -64,6 +66,25 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -104,6 +106,25 @@ public class EntitySlime extends EntityInsentient implements IMonster { } return true; // do not jump() in wasd controller, let vanilla controller handle } @@ -1027,7 +1123,7 @@ index 7f3d57a9399f60465fae27f03fc57df625f5016d..c3737457c521715b640b138dc41863df // Purpur end @Override -@@ -90,7 +111,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { +@@ -130,7 +151,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.datawatcher.set(EntitySlime.bo, i); this.af(); this.updateSize(); @@ -1036,27 +1132,11 @@ index 7f3d57a9399f60465fae27f03fc57df625f5016d..c3737457c521715b640b138dc41863df this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue((double) (0.2F + 0.1F * (float) i)); this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue((double) i); if (flag) { -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index 338c78efe43641686be0d6b3a241865ec5fe56bd..1dd13dfea91a05b1e83b065328092a17d41a605f 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -24,6 +24,11 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt - public boolean isRidableInWater() { - return world.purpurConfig.snowGolemRidableInWater; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.snowGolemMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java -index 92d74137877d096970bf9d1b4fc91beabb862b9d..9001ca50b8d9f77b0d997511b70c39b2712df67a 100644 ---- a/src/main/java/net/minecraft/server/EntitySpider.java -+++ b/src/main/java/net/minecraft/server/EntitySpider.java -@@ -21,6 +21,11 @@ public class EntitySpider extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java b/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java +index fbf7c31f57f6dbfac997480eb7db55efc15ef4cc..9b596aa061aa1d4ddfd66361d5277089c3e18246 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySpider.java +@@ -61,6 +61,11 @@ public class EntitySpider extends EntityMonster { public boolean isRidableInWater() { return world.purpurConfig.spiderRidableInWater; } @@ -1068,28 +1148,12 @@ index 92d74137877d096970bf9d1b4fc91beabb862b9d..9001ca50b8d9f77b0d997511b70c39b2 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index cee226501690e1c00983a01ac82bc7384f233c3c..918cd774bc7e9f84ddbc1e65b4cb4d661eb127a5 100644 ---- a/src/main/java/net/minecraft/server/EntitySquid.java -+++ b/src/main/java/net/minecraft/server/EntitySquid.java -@@ -56,6 +56,11 @@ public class EntitySquid extends EntityWaterAnimal { - public boolean isInWater() { - return this.inWater || world.purpurConfig.squidsCanFly; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.squidMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java -index 5c960365901b6ebd74134dac2e90c6aa81d33351..1bca386b7dea01af88a6c8d8e87ff11a0b21cc7a 100644 ---- a/src/main/java/net/minecraft/server/EntityStrider.java -+++ b/src/main/java/net/minecraft/server/EntityStrider.java -@@ -43,6 +43,11 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab - int getPurpurBreedTime() { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +index cba66a08feceeeaf7c123da595fc7b12c5749783..892aa844a98ae0d192737c6fc6df0a219256a47b 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +@@ -110,6 +110,11 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab + public int getPurpurBreedTime() { return this.world.purpurConfig.striderBreedingTicks; } + @@ -1100,43 +1164,11 @@ index 5c960365901b6ebd74134dac2e90c6aa81d33351..1bca386b7dea01af88a6c8d8e87ff11a // Purpur end public static boolean c(EntityTypes entitytypes, GeneratorAccess generatoraccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { -diff --git a/src/main/java/net/minecraft/server/EntityTropicalFish.java b/src/main/java/net/minecraft/server/EntityTropicalFish.java -index 2c9df356e685ea6f71653023fadcf7e287dcd46e..4bf7b697c18f3d3a1987471571d665ed823c5c77 100644 ---- a/src/main/java/net/minecraft/server/EntityTropicalFish.java -+++ b/src/main/java/net/minecraft/server/EntityTropicalFish.java -@@ -29,6 +29,11 @@ public class EntityTropicalFish extends EntityFishSchool { - public boolean isRidableInWater() { - return true; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.tropicalFishMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 067f7f28b02b388d56b93b1ed8274799757196e6..0233b65a996111af7bdc10e4da2d70e541411c09 100644 ---- a/src/main/java/net/minecraft/server/EntityTurtle.java -+++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -42,6 +42,11 @@ public class EntityTurtle extends EntityAnimal { - int getPurpurBreedTime() { - return this.world.purpurConfig.turtleBreedingTicks; - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.turtleMaxHealth); -+ } - // Purpur end - - public void setHomePos(BlockPosition blockposition) { -diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index 9336fbbd46c7c6ac11adf8e4cc2735f81c9ed639..3fcbfc7cdf78f71d23b2e2b2990c21db6f493f31 100644 ---- a/src/main/java/net/minecraft/server/EntityVex.java -+++ b/src/main/java/net/minecraft/server/EntityVex.java -@@ -55,6 +55,11 @@ public class EntityVex extends EntityMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVex.java b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java +index 4301ece0a04f3f2b4d198a684d0ca314deef2aef..69d47697442fa80fbed08a11bb9e66057d059101 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityVex.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityVex.java +@@ -92,6 +92,11 @@ public class EntityVex extends EntityMonster { public boolean b(float f, float f1) { return false; // no fall damage please } @@ -1148,43 +1180,11 @@ index 9336fbbd46c7c6ac11adf8e4cc2735f81c9ed639..3fcbfc7cdf78f71d23b2e2b2990c21db // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 9b925bf9b7946eecb16f94d49a9823139c5fd641..850dae5f20649854f013c0e530a3325455b5db4a 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -93,6 +93,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - public boolean a(EntityHuman entityhuman) { - return world.purpurConfig.villagerCanBeLeashed && !this.isLeashed(); - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.villagerMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index b9418fac0a05d4bb5f8f215a5704bba332e3f7cb..a37aee151bce19ee74e6eae6b67e522a4b28f5a8 100644 ---- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java -+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -@@ -65,6 +65,11 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { - public boolean a(EntityHuman entityhuman) { - return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed(); - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.villagerTraderMaxHealth); -+ } - // Purpur - end - - @Nullable -diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index f1bc6a4199d788215c2e7d5a835211d16603a6d9..2a137a90828f84de15a7184203c7d0dccc0851b4 100644 ---- a/src/main/java/net/minecraft/server/EntityVindicator.java -+++ b/src/main/java/net/minecraft/server/EntityVindicator.java -@@ -28,6 +28,11 @@ public class EntityVindicator extends EntityIllagerAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +index 28d345e87f45fa839bc3bd758f79f34aba546db7..caaa27248637255ad9e8db20ca839a980e01bfb6 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityVindicator.java +@@ -70,6 +70,11 @@ public class EntityVindicator extends EntityIllagerAbstract { public boolean isRidableInWater() { return world.purpurConfig.vindicatorRidableInWater; } @@ -1196,11 +1196,11 @@ index f1bc6a4199d788215c2e7d5a835211d16603a6d9..2a137a90828f84de15a7184203c7d0dc // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 323d79a99402b0f6952b4fb873170069f3428953..dc846e7bda587a47b1cce9054e587a734179e7fe 100644 ---- a/src/main/java/net/minecraft/server/EntityWitch.java -+++ b/src/main/java/net/minecraft/server/EntityWitch.java -@@ -34,6 +34,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java b/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java +index c4663c5b02363bd1499ce1f3b50027f8aa7c68e7..a119923ee8d8ac00892f594a8af6d392f818b59c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityWitch.java +@@ -74,6 +74,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { public boolean isRidableInWater() { return world.purpurConfig.witchRidableInWater; } @@ -1212,27 +1212,11 @@ index 323d79a99402b0f6952b4fb873170069f3428953..dc846e7bda587a47b1cce9054e587a73 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index fd62dc51258876275adbe02f750fd88107c38a6b..03bcbf7c280476ef0e6fe87e3a96edb75544bddb 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -121,6 +121,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable - setCollarColor(world.purpurConfig.wolfDefaultCollarColor); - super.tame(entityhuman); - } -+ -+ @Override -+ public void initAttributes() { -+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.wolfMaxHealth); -+ } - // Purpur end - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityZoglin.java b/src/main/java/net/minecraft/server/EntityZoglin.java -index d92fe8013fb3b43cb7eabdf1c624291b7e881889..bcc4aa1d3f09e43016d0009cd04dd6b797dcfeca 100644 ---- a/src/main/java/net/minecraft/server/EntityZoglin.java -+++ b/src/main/java/net/minecraft/server/EntityZoglin.java -@@ -31,6 +31,11 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java b/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java +index c5b1ce9268d6e6f3ec26eda4b5d8e7ae2a2ea672..17c96e8eaa5cde028024f5ad4b853e3399a942d5 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZoglin.java +@@ -72,6 +72,11 @@ public class EntityZoglin extends EntityMonster implements IMonster, IOglin { public boolean isRidableInWater() { return world.purpurConfig.zoglinRidableInWater; } @@ -1244,11 +1228,11 @@ index d92fe8013fb3b43cb7eabdf1c624291b7e881889..bcc4aa1d3f09e43016d0009cd04dd6b7 // Purpur end @Override -diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index e4de6e2f8b72c0ede3ad34666a5dfde5c5363b56..c87f05f2d511a135fe67943f96fe41d06882e57b 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 { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +index 88264b7b2c21a377f4b0dd857065e40165f0acde..7112db516e62ca75a445482005c524129b84f54c 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombie.java +@@ -130,6 +130,15 @@ public class EntityZombie extends EntityMonster { public boolean jockeyTryExistingChickens() { return world.purpurConfig.zombieJockeyTryExistingChickens; } @@ -1264,7 +1248,7 @@ index e4de6e2f8b72c0ede3ad34666a5dfde5c5363b56..c87f05f2d511a135fe67943f96fe41d0 // Purpur end @Override -@@ -549,7 +558,7 @@ public class EntityZombie extends EntityMonster { +@@ -612,7 +621,7 @@ public class EntityZombie extends EntityMonster { } protected void eV() { @@ -1273,11 +1257,19 @@ index e4de6e2f8b72c0ede3ad34666a5dfde5c5363b56..c87f05f2d511a135fe67943f96fe41d0 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java -index 02b0ae550a0ed33b5b43beedf3b1405985c58c13..966a14b4122b5ca43832a57fcbc162147f903a21 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieHusk.java -+++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java -@@ -33,6 +33,15 @@ public class EntityZombieHusk extends EntityZombie { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +index ad801fc394fbb83cf280ee96f962e7f311615d72..c060d93d9f3332b514a1400dec14f2035c058e48 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieHusk.java +@@ -11,6 +11,7 @@ import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.EntityTypes; + import net.minecraft.world.entity.EnumMobSpawn; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.World; +@@ -47,6 +48,15 @@ public class EntityZombieHusk extends EntityZombie { public boolean jockeyTryExistingChickens() { return world.purpurConfig.huskJockeyTryExistingChickens; } @@ -1293,11 +1285,19 @@ index 02b0ae550a0ed33b5b43beedf3b1405985c58c13..966a14b4122b5ca43832a57fcbc16214 // Purpur end public static boolean a(EntityTypes entitytypes, WorldAccess worldaccess, EnumMobSpawn enummobspawn, BlockPosition blockposition, Random random) { -diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 5b6ed77fb2b92b5bf701de436c8d7235bfe82685..48e501130dea326ffc6503bc2e9306dffd8797f9 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieVillager.java -+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java -@@ -53,6 +53,15 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +index 6b2fd555122ba1af0adae3e479540e0da767a99d..280d716f3625c859c04c782fcf2b126068cb3c84 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityZombieVillager.java +@@ -29,6 +29,7 @@ import net.minecraft.world.entity.EnumItemSlot; + import net.minecraft.world.entity.EnumMobSpawn; + import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ReputationHandler; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.village.ReputationEvent; + import net.minecraft.world.entity.npc.EntityVillager; + import net.minecraft.world.entity.npc.VillagerData; +@@ -95,6 +96,15 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo public boolean jockeyTryExistingChickens() { return world.purpurConfig.zombieVillagerJockeyTryExistingChickens; } @@ -1313,8 +1313,96 @@ index 5b6ed77fb2b92b5bf701de436c8d7235bfe82685..48e501130dea326ffc6503bc2e9306df // Purpur end @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +index 828d01abe8202a246ce07c1c652a17cbc829d904..b271df48d04f12a68e0b7abf2f1375749a9a0f08 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java +@@ -76,6 +76,11 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + public int getPurpurBreedTime() { + return this.world.purpurConfig.hoglinBreedingTicks; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.hoglinMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +index 8c6f5273ed2ab4ec63b7854e290f790b2eca8c2f..99fc16aae085da564c5236e68925a8a2225f5c27 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java +@@ -80,6 +80,11 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + public boolean isRidableInWater() { + return world.purpurConfig.piglinRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.piglinMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java +index da2220b08a9cd9c2d7d3fd06702e6690e12f095e..c441d6b2ce29d914a29c2f39d70adb14e9ab31a6 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglinBrute.java +@@ -49,6 +49,11 @@ public class EntityPiglinBrute extends EntityPiglinAbstract { + public boolean isRidableInWater() { + return world.purpurConfig.piglinBruteRidableInWater; + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.piglinBruteMaxHealth); ++ } + // Purpur end + + public static AttributeProvider.Builder eS() { +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 77a5be6f5fc51689a74f853b5dfcef5e772e2c84..6ad608a795e85daf7425f26041b5e4a86cadc033 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -167,6 +167,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + public boolean a(EntityHuman entityhuman) { + return world.purpurConfig.villagerCanBeLeashed && !this.isLeashed(); + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.villagerMaxHealth); ++ } + // Purpur end + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +index 90cbef7fe8803295f82bddd6709fdf303aedcaba..b84916c0c58fd208ef5547299f8db8462d1c42fe 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerTrader.java +@@ -18,6 +18,7 @@ import net.minecraft.world.entity.EntityAgeable; + import net.minecraft.world.entity.EntityExperienceOrb; + import net.minecraft.world.entity.EntityInsentient; + import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.goal.PathfinderGoal; + import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; +@@ -110,6 +111,11 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + public boolean a(EntityHuman entityhuman) { + return world.purpurConfig.villagerTraderCanBeLeashed && !this.isLeashed(); + } ++ ++ @Override ++ public void initAttributes() { ++ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.villagerTraderMaxHealth); ++ } + // Purpur - end + + @Nullable diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 3790fcea3a556a979eacaf5b03e5ebc4c3a02925..31114da5cc21c5f3b59ea97e34bddfd09c2a5198 100644 +index 5c5aa1ab859c836945294cfdb06589639006a307..d0473f64fbb743f12eb7c98a59231b3fb7d20ccc 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -484,30 +484,58 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0149-Phantom-flames-on-swoop.patch b/patches/Purpur/patches/server/0149-Phantom-flames-on-swoop.patch index 1f996c38..387f77ac 100644 --- a/patches/Purpur/patches/server/0149-Phantom-flames-on-swoop.patch +++ b/patches/Purpur/patches/server/0149-Phantom-flames-on-swoop.patch @@ -4,11 +4,11 @@ Date: Sat, 12 Dec 2020 09:10:59 -0600 Subject: [PATCH] Phantom flames on swoop -diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 80cc4467d601b653583e387eb4be6f3b739058e6..52a3ae1eda874b41e5d71c16b8ab24d3c9f17470 100644 ---- a/src/main/java/net/minecraft/server/EntityPhantom.java -+++ b/src/main/java/net/minecraft/server/EntityPhantom.java -@@ -182,6 +182,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +index 902b26d609aef8dd46e8875cb7c06f187511e8d5..4f3d4f2596c69881f0653bddcc3bf2b9ede3ca8f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityPhantom.java +@@ -226,6 +226,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { this.world.addParticle(Particles.MYCELIUM, this.locX() - (double) f2, this.locY() + (double) f4, this.locZ() - (double) f3, 0.0D, 0.0D, 0.0D); } @@ -17,7 +17,7 @@ index 80cc4467d601b653583e387eb4be6f3b739058e6..52a3ae1eda874b41e5d71c16b8ab24d3 @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 31114da5cc21c5f3b59ea97e34bddfd09c2a5198..b630887b4ba9288e9724e97658d903ab334c3f8b 100644 +index d0473f64fbb743f12eb7c98a59231b3fb7d20ccc..b22344e942a212a204dd0935d3c6d55a37c23477 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1148,6 +1148,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0150-Option-for-chests-to-open-even-with-a-solid-block-on.patch b/patches/Purpur/patches/server/0150-Option-for-chests-to-open-even-with-a-solid-block-on.patch index a3073254..cd1d4b93 100644 --- a/patches/Purpur/patches/server/0150-Option-for-chests-to-open-even-with-a-solid-block-on.patch +++ b/patches/Purpur/patches/server/0150-Option-for-chests-to-open-even-with-a-solid-block-on.patch @@ -4,11 +4,11 @@ Date: Sat, 12 Dec 2020 14:34:18 -0800 Subject: [PATCH] Option for chests to open even with a solid block on top -diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index c4ff93a6b908c1bd157c7fe45b504909b189d09c..71a32a317e38b9c8f802fd5dd9ae546fb46eb020 100644 ---- a/src/main/java/net/minecraft/server/BlockChest.java -+++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -262,6 +262,7 @@ public class BlockChest extends BlockChestAbstract implements I +diff --git a/src/main/java/net/minecraft/world/level/block/BlockChest.java b/src/main/java/net/minecraft/world/level/block/BlockChest.java +index a45ee959f41e7f349ff2c309f21fa44ec671cb87..cddf8e3d34385eb264cd28ba6b4392d682df0360 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockChest.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockChest.java +@@ -306,6 +306,7 @@ public class BlockChest extends BlockChestAbstract implements I } private static boolean a(IBlockAccess iblockaccess, BlockPosition blockposition) { @@ -17,7 +17,7 @@ index c4ff93a6b908c1bd157c7fe45b504909b189d09c..71a32a317e38b9c8f802fd5dd9ae546f 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 b630887b4ba9288e9724e97658d903ab334c3f8b..98211b159564f1674c84a5ec7cce37a1f077af5e 100644 +index b22344e942a212a204dd0935d3c6d55a37c23477..06af8583af105765e758ca4f6c81babbfe199e25 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -381,6 +381,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0151-Implement-TPSBar.patch b/patches/Purpur/patches/server/0151-Implement-TPSBar.patch index 70382786..19040b32 100644 --- a/patches/Purpur/patches/server/0151-Implement-TPSBar.patch +++ b/patches/Purpur/patches/server/0151-Implement-TPSBar.patch @@ -4,11 +4,11 @@ Date: Sat, 12 Dec 2020 21:19:05 -0600 Subject: [PATCH] Implement TPSBar -diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index b5cc099746e9f05ea69bc438bda22a5ac3ebc3c5..bbd17231a4f7ad0ddde6eb5e589a6c403366cc36 100644 ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -109,6 +109,7 @@ public class CommandDispatcher { +diff --git a/src/main/java/net/minecraft/commands/CommandDispatcher.java b/src/main/java/net/minecraft/commands/CommandDispatcher.java +index a551636c2c59e68a5abb1cd5611c1d5c7e36f514..b7663a3d64ae5202abb93eabba6ec013bae96334 100644 +--- a/src/main/java/net/minecraft/commands/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/commands/CommandDispatcher.java +@@ -193,6 +193,7 @@ public class CommandDispatcher { CommandWhitelist.a(this.b); net.pl3x.purpur.command.DemoCommand.register(getDispatcher()); // Purpur net.pl3x.purpur.command.PingCommand.register(getDispatcher()); // Purpur @@ -17,10 +17,10 @@ index b5cc099746e9f05ea69bc438bda22a5ac3ebc3c5..bbd17231a4f7ad0ddde6eb5e589a6c40 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 16a03a92b786da366ecf84b3cc79499654d0a899..be48e686272b81dab4f1f584d946e15285934e88 100644 +index 5de12553875af626fa597ca440e52682624e35c8..e8146dad220330bdcc46e563172b40a66931d17c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -472,6 +472,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages"); @@ -16,7 +16,7 @@ index 7be03bb416a5723ce65411ba5d0b967040e8033c..9ff35aa827cf5b937b8dcbcabafd2730 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -982,6 +983,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1127,6 +1128,7 @@ public class PlayerConnection implements PacketListenerPlayIn { int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with with a page too large!"); @@ -24,7 +24,7 @@ index 7be03bb416a5723ce65411ba5d0b967040e8033c..9ff35aa827cf5b937b8dcbcabafd2730 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -1005,6 +1007,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1150,6 +1152,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (byteTotal > byteAllowed) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); diff --git a/patches/Purpur/patches/server/0154-Full-netherite-armor-grants-fire-resistance.patch b/patches/Purpur/patches/server/0154-Full-netherite-armor-grants-fire-resistance.patch index 12f21fca..3ade642f 100644 --- a/patches/Purpur/patches/server/0154-Full-netherite-armor-grants-fire-resistance.patch +++ b/patches/Purpur/patches/server/0154-Full-netherite-armor-grants-fire-resistance.patch @@ -4,11 +4,11 @@ Date: Thu, 24 Dec 2020 11:00:15 -0600 Subject: [PATCH] Full netherite armor grants fire resistance -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 7ce46b53ad9fbaf7baf198557565b2467ab43c09..5581e9f1b8656bd2ee0dd338ffd17ac8297df94f 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -236,6 +236,16 @@ public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index 907bfe42bd866188639f7d25150fcde039c1e5f7..b63019f40b28a2e543528a7919bbc08a4ccc8f07 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -334,6 +334,16 @@ public abstract class EntityHuman extends EntityLiving { this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit } @@ -26,7 +26,7 @@ index 7ce46b53ad9fbaf7baf198557565b2467ab43c09..5581e9f1b8656bd2ee0dd338ffd17ac8 protected ItemCooldown i() { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f19da65bcc79bd70bf9b5ac33867e49b6838cb7d..af33ee28276ac9848805765af6d51bf4b9f3c372 100644 +index 6afdcad6b6ab47f77dba3dcc97c2b6580b774e1c..73213bf975ffe38ff6ee9b05c5a48b232f767727 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -310,6 +310,19 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0155-Fix-rotating-UP-DOWN-CW-and-CCW.patch b/patches/Purpur/patches/server/0155-Fix-rotating-UP-DOWN-CW-and-CCW.patch index febdd94f..187d9306 100644 --- a/patches/Purpur/patches/server/0155-Fix-rotating-UP-DOWN-CW-and-CCW.patch +++ b/patches/Purpur/patches/server/0155-Fix-rotating-UP-DOWN-CW-and-CCW.patch @@ -4,11 +4,11 @@ Date: Wed, 6 Jan 2021 02:19:29 -0600 Subject: [PATCH] Fix rotating UP/DOWN CW and CCW -diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 23796bd657f071a337fdf76d777e33c207baf7a7..814b168eaa4b74dce2b83bc8aa557b33aebf35fa 100644 ---- a/src/main/java/net/minecraft/server/EnumDirection.java -+++ b/src/main/java/net/minecraft/server/EnumDirection.java -@@ -123,6 +123,12 @@ public enum EnumDirection implements INamable { +diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java +index 29d747f7fc5824a222755ebf96dfe053896d43d0..9f1ea11d0bc15b8b0069fcf46ea2f6751c5e3064 100644 +--- a/src/main/java/net/minecraft/core/EnumDirection.java ++++ b/src/main/java/net/minecraft/core/EnumDirection.java +@@ -127,6 +127,12 @@ public enum EnumDirection implements INamable { return EnumDirection.NORTH; case EAST: return EnumDirection.SOUTH; @@ -21,7 +21,7 @@ index 23796bd657f071a337fdf76d777e33c207baf7a7..814b168eaa4b74dce2b83bc8aa557b33 default: throw new IllegalStateException("Unable to get Y-rotated facing of " + this); } -@@ -139,6 +145,12 @@ public enum EnumDirection implements INamable { +@@ -143,6 +149,12 @@ public enum EnumDirection implements INamable { return EnumDirection.SOUTH; case EAST: return EnumDirection.NORTH; diff --git a/patches/Purpur/patches/server/0156-Add-mobGriefing-bypass-to-everything-affected.patch b/patches/Purpur/patches/server/0156-Add-mobGriefing-bypass-to-everything-affected.patch index 3425938e..18babc0f 100644 --- a/patches/Purpur/patches/server/0156-Add-mobGriefing-bypass-to-everything-affected.patch +++ b/patches/Purpur/patches/server/0156-Add-mobGriefing-bypass-to-everything-affected.patch @@ -5,111 +5,81 @@ Subject: [PATCH] Add mobGriefing bypass to everything affected This adds the "bypass-mob-griefing" world config option to everything that is affected by the gamerule. -diff --git a/src/main/java/net/minecraft/server/BlockCampfire.java b/src/main/java/net/minecraft/server/BlockCampfire.java -index 99decab11b3561edb0fea8964bfb97ccc997b772..e4cc567d28a5368f975e29c7d18dba007d914584 100644 ---- a/src/main/java/net/minecraft/server/BlockCampfire.java -+++ b/src/main/java/net/minecraft/server/BlockCampfire.java -@@ -139,7 +139,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged - public void a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) { - if (!world.isClientSide && iprojectile.isBurning()) { - Entity entity = iprojectile.getShooter(); -- boolean flag = entity == null || entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); -+ boolean flag = entity == null || entity instanceof EntityHuman || world.purpurConfig.fireballsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index f3f528065eb9ee2f385edbaceeeddef39552485c..1e57358c02e67a6b062149926ada46696da24487 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -1571,7 +1571,7 @@ public abstract class EntityLiving extends Entity { + boolean flag = false; - if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) { - BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); -diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java -index 0fdc960fa3bbe6506185480a7a86d5009d70b385..d49c309d7c31b3be0a21544ba23c0fd663f3317b 100644 ---- a/src/main/java/net/minecraft/server/BlockCrops.java -+++ b/src/main/java/net/minecraft/server/BlockCrops.java -@@ -144,7 +144,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + if (this.killed && entityliving instanceof EntityWither) { // Paper +- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + BlockPosition blockposition = this.getChunkCoordinates(); + IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData(); + +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java +index d785066e2a52699c18315f7244d80db6cab0c736..6c40b070c674f2b120b860b78a63d0a6635d2f5b 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor.java +@@ -34,7 +34,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { @Override - public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { -- if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // CraftBukkit -+ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))).isCancelled()) { // CraftBukkit // Purpur - world.a(blockposition, true, entity); - } + public boolean a() { +- return !super.a() ? false : (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a(this.entity.world.getDifficulty()) && !this.g()); ++ return !super.a() ? false : ((!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? false : this.a(this.entity.world.getDifficulty()) && !this.g()); // Purpur + } -diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java -index 099e0d3df219408ebe2a741a02e53eb9f7def28e..73dc0f499c456c21d298013fbab8c79ebcdecd6b 100644 ---- a/src/main/java/net/minecraft/server/BlockSoil.java -+++ b/src/main/java/net/minecraft/server/BlockSoil.java -@@ -76,7 +76,7 @@ public class BlockSoil extends Block { @Override - public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) { - super.fallOn(world, blockposition, entity, f); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. -- if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) { -+ if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.purpurConfig.farmlandBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) { // Purpur - // CraftBukkit start - Interact soil - org.bukkit.event.Cancellable cancellable; - if (entity instanceof EntityHuman) { -diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java -index 0f147dc938cef428452bd3137c68b52a78f9fbde..276aac9afd5d987cf388a87718453c4737049073 100644 ---- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java -+++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java -@@ -177,7 +177,7 @@ public class BlockTurtleEgg extends Block { +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java +index 6737dd77c8f46edf353f951b5adb4399142a1753..06dbce54602d02382e9d47b7e6925cfc686d26f6 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile.java +@@ -19,7 +19,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { + + private static final Predicate a = BlockStatePredicate.a(Blocks.GRASS); + private final EntityInsentient b; +- private final World c; ++ private final World c; private final World getWorld() { return c; } // Purpur - OBFHELPER + private int d; + + public PathfinderGoalEatTile(EntityInsentient entityinsentient) { +@@ -68,7 +68,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { + + if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) { + // CraftBukkit +- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur + this.c.b(blockposition, false); + } + +@@ -78,7 +78,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { + + if (this.c.getType(blockposition1).a(Blocks.GRASS_BLOCK)) { + // CraftBukkit +- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur + this.c.triggerEffect(2001, blockposition1, Block.getCombinedId(Blocks.GRASS_BLOCK.getBlockData())); + this.c.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2); + } +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java +index 61a62c093b24c43064f116630d85096159e082d3..2519a78f7e5dd759680a1f47a1047885d4ad32f1 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock.java +@@ -41,7 +41,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { + + @Override + public boolean a() { +- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur return false; - } - if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) { -- return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); -+ return world.purpurConfig.turtleEggsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur - } - return true; - // Purpur end -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 75e834caaf7bb64a3d51d793e86aa702f6ccb0ae..e2377c6e8a98be431953533bf0b2060028caad45 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -489,7 +489,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - Block block = iblockdata.getBlock(); - - if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) { -- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) { -+ if ((this.world.purpurConfig.enderDragonBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) { // Purpur - // CraftBukkit start - Add blocks to list rather than destroying them - // flag1 = this.world.a(blockposition, false) || flag1; - flag1 = true; -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index dfe6175ec8107f684ea1567d932d11de06c46372..beee80c3d8277f2d784fb6b8a4152a871ee020b0 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -392,7 +392,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - @Override - public boolean a() { - if (!enderman.world.purpurConfig.endermanAllowGriefing) return false; // Purpur -- return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); -+ return this.enderman.getCarried() != null ? false : (!this.enderman.world.purpurConfig.endermanBypassMobGriefing && !this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); // Purpur - } - - @Override -@@ -435,7 +435,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - @Override - public boolean a() { - if (!getEnderman().world.purpurConfig.endermanAllowGriefing) return false; // Purpur -- return this.a.getCarried() == null ? false : (!this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0); -+ return this.a.getCarried() == null ? false : (!this.a.world.purpurConfig.endermanBypassMobGriefing && !this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0); // Purpur - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index f0ecc6e6ef5843714a6423af5d6619856ef23977..5f24c36bf45a656e220475449113786732a47c56 100644 ---- a/src/main/java/net/minecraft/server/EntityEvoker.java -+++ b/src/main/java/net/minecraft/server/EntityEvoker.java -@@ -134,7 +134,7 @@ public class EntityEvoker extends EntityIllagerWizard { - return false; - } else if (EntityEvoker.this.ticksLived < this.c) { - return false; -- } else if (!EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ } else if (!EntityEvoker.this.world.purpurConfig.evokerBypassMobGriefing && !EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur - return false; - } else { - List list = EntityEvoker.this.world.a(EntitySheep.class, this.e, EntityEvoker.this, EntityEvoker.this.getBoundingBox().grow(16.0D, 4.0D, 16.0D)); -diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 7a3fb7a41e987adee675fbfd11f2648cf5de3e53..ff78bd607f19a1b9f37281946db3f705c844f7cc 100644 ---- a/src/main/java/net/minecraft/server/EntityFox.java -+++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -1002,7 +1002,7 @@ public class EntityFox extends EntityAnimal { + } else if (this.c > 0) { + --this.c; +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +index b8b0ee65798dc94d707fa64bd53fdda5506331d9..355735c2efbba62481d059b8e733c9c70e834be1 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityFox.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityFox.java +@@ -1075,7 +1075,7 @@ public class EntityFox extends EntityAnimal { } protected void n() { @@ -118,11 +88,142 @@ index 7a3fb7a41e987adee675fbfd11f2648cf5de3e53..ff78bd607f19a1b9f37281946db3f705 IBlockData iblockdata = EntityFox.this.world.getType(this.e); if (iblockdata.a(Blocks.SWEET_BERRY_BUSH)) { -diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java -index d12de20cf4bb2345c616d3cc0b9f50bddb5135ee..3f3be1b2ded6ad118ae7860c1231c7affc0715b6 100644 ---- a/src/main/java/net/minecraft/server/EntityLargeFireball.java -+++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java -@@ -8,19 +8,19 @@ public class EntityLargeFireball extends EntityFireballFireball { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +index 284c52276b2fd816990c23b7b8a9ee50e70ab005..acb4c79b23fada090c5605cd352a573bdb0667bf 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java +@@ -518,7 +518,7 @@ public class EntityRabbit extends EntityAnimal { + @Override + public boolean a() { + if (this.c <= 0) { +- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (!this.entity.world.purpurConfig.rabbitBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + return false; + } + +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index 88db8ff8cb415b84ab98cc0550c705d5a472230c..17f27d2bf5be746a0fa0e1e0fecab8158b2b3587 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -123,7 +123,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt + this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING + } + +- if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (!this.world.purpurConfig.snowGolemBypassMobGriefing && !this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + return; + } + +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index 999a6d17eccd6305c0063e1558abfe70d72c39fe..a81d782877ff6116477792fa4cec0846e56ed384 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -539,7 +539,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + Block block = iblockdata.getBlock(); + + if (!iblockdata.isAir() && iblockdata.getMaterial() != Material.FIRE) { +- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) { ++ if ((this.world.purpurConfig.enderDragonBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && !TagsBlock.DRAGON_IMMUNE.isTagged(block)) { // Purpur + // CraftBukkit start - Add blocks to list rather than destroying them + // flag1 = this.world.a(blockposition, false) || flag1; + flag1 = true; +diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +index beb4d59faf4bd7501468b2eaa0e866613625e963..fa6b72c7a12b20f8ccffa360a3895e4d8f4277e4 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java ++++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +@@ -380,7 +380,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + if (this.getInvul() > 0) { + i = this.getInvul() - 1; + if (i <= 0) { +- Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; ++ Explosion.Effect explosion_effect = (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur + // CraftBukkit start + // this.world.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), 7.0F, false, explosion_effect); + ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false); +@@ -492,7 +492,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + + if (this.bw > 0) { + --this.bw; +- if (this.bw == 0 && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (this.bw == 0 && (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur + i = MathHelper.floor(this.locY()); + j = MathHelper.floor(this.locX()); + int j1 = MathHelper.floor(this.locZ()); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 478ac5bfdc69b5c3e24906bb5e0ea1dff81cea98..ea500a6080f73dcc35d83a3b5a170f57dedaa431 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -455,7 +455,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + @Override + public boolean a() { + if (!enderman.world.purpurConfig.endermanAllowGriefing) return false; // Purpur +- return this.enderman.getCarried() != null ? false : (!this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); ++ return this.enderman.getCarried() != null ? false : (!this.enderman.world.purpurConfig.endermanBypassMobGriefing && !this.enderman.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.enderman.getRandom().nextInt(20) == 0); // Purpur + } + + @Override +@@ -498,7 +498,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + @Override + public boolean a() { + if (!getEnderman().world.purpurConfig.endermanAllowGriefing) return false; // Purpur +- return this.a.getCarried() == null ? false : (!this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0); ++ return this.a.getCarried() == null ? false : (!this.a.world.purpurConfig.endermanBypassMobGriefing && !this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a.getRandom().nextInt(2000) == 0); // Purpur + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +index 8d7b8d2ac9a7340e2cfd0d1b8963e4e4d97e8bc8..8a219ac18307c715913f5c2a80b1ff35a2ea8b93 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEvoker.java +@@ -171,7 +171,7 @@ public class EntityEvoker extends EntityIllagerWizard { + return false; + } else if (EntityEvoker.this.ticksLived < this.c) { + return false; +- } else if (!EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ } else if (!EntityEvoker.this.world.purpurConfig.evokerBypassMobGriefing && !EntityEvoker.this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + return false; + } else { + List list = EntityEvoker.this.world.a(EntitySheep.class, this.e, EntityEvoker.this, EntityEvoker.this.getBoundingBox().grow(16.0D, 4.0D, 16.0D)); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +index 80c3cd540a46e249e85586e8d7a2f0f6226091fc..6809c93fe435d183a27204fb4460fd68a86aa04f 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +@@ -179,7 +179,7 @@ public class EntityRavager extends EntityRaider { + this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(MathHelper.d(0.1D, d1, d0)); + } + +- if (this.positionChanged && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (this.positionChanged && (this.world.purpurConfig.ravagerBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur + boolean flag = false; + AxisAlignedBB axisalignedbb = this.getBoundingBox().g(0.2D); + Iterator iterator = BlockPosition.b(MathHelper.floor(axisalignedbb.minX), MathHelper.floor(axisalignedbb.minY), MathHelper.floor(axisalignedbb.minZ), MathHelper.floor(axisalignedbb.maxX), MathHelper.floor(axisalignedbb.maxY), MathHelper.floor(axisalignedbb.maxZ)).iterator(); +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +index a0a1e5977a3cbc8e9befd827dd1e15352a2c0c39..cbdb512c924ac54e925f8c52558d24d3286d31ce 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntitySilverfish.java +@@ -172,7 +172,7 @@ public class EntitySilverfish extends EntityMonster { + } else { + Random random = this.a.getRandom(); + +- if (this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && random.nextInt(10) == 0) { ++ if ((this.a.world.purpurConfig.silverfishBypassMobGriefing || this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && random.nextInt(10) == 0) { // Purpur + this.h = EnumDirection.a(random); + BlockPosition blockposition = (new BlockPosition(this.a.locX(), this.a.locY() + 0.5D, this.a.locZ())).shift(this.h); + IBlockData iblockdata = this.a.world.getType(blockposition); +@@ -260,7 +260,7 @@ public class EntitySilverfish extends EntityMonster { + continue; + } + // CraftBukkit end +- if (world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { ++ if (world.purpurConfig.silverfishBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + world.a(blockposition1, true, this.silverfish); + } else { + world.setTypeAndData(blockposition1, ((BlockMonsterEggs) block).c().getBlockData(), 3); +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +index e860737bacfea0a1d728dbaaf41d62165658ad89..61f06eacb4ea4ef869b60c9014cc23b25583eead 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +@@ -19,19 +19,19 @@ public class EntityLargeFireball extends EntityFireballFireball { public EntityLargeFireball(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -145,85 +246,11 @@ index d12de20cf4bb2345c616d3cc0b9f50bddb5135ee..3f3be1b2ded6ad118ae7860c1231c7af // CraftBukkit start - fire ExplosionPrimeEvent ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 79fde7b4763642dc4941899ab186db9dfab3b574..38f94d4983b69e265441a2b8365702df57a881f5 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1473,7 +1473,7 @@ public abstract class EntityLiving extends Entity { - boolean flag = false; - - if (this.killed && entityliving instanceof EntityWither) { // Paper -- if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur - BlockPosition blockposition = this.getChunkCoordinates(); - IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData(); - -diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index 0583fc55056a29e7629c76b72800c727401a4a83..6559dcafac6cb9673dccdbd44f18e9802b3ac3c2 100644 ---- a/src/main/java/net/minecraft/server/EntityRabbit.java -+++ b/src/main/java/net/minecraft/server/EntityRabbit.java -@@ -462,7 +462,7 @@ public class EntityRabbit extends EntityAnimal { - @Override - public boolean a() { - if (this.c <= 0) { -- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (!this.entity.world.purpurConfig.rabbitBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur - return false; - } - -diff --git a/src/main/java/net/minecraft/server/EntityRaider.java b/src/main/java/net/minecraft/server/EntityRaider.java -index ad2a2c27f0ef064064ded28cc049a6856d476808..e07f224289a937689a26d58639899abbfd6a6302 100644 ---- a/src/main/java/net/minecraft/server/EntityRaider.java -+++ b/src/main/java/net/minecraft/server/EntityRaider.java -@@ -496,7 +496,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { - - @Override - public boolean a() { -- if (!getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items -+ if ((!getRaider().world.purpurConfig.pillagerBypassMobGriefing && !getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur - Raid raid = this.b.fa(); - - if (this.b.fb() && !this.b.fa().a() && this.b.eN() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) { -diff --git a/src/main/java/net/minecraft/server/EntityRavager.java b/src/main/java/net/minecraft/server/EntityRavager.java -index 820938c76e787fac6c65eb000491232d5b749dee..3606440e41ab3193fadebb455c0967dbc0ccbb63 100644 ---- a/src/main/java/net/minecraft/server/EntityRavager.java -+++ b/src/main/java/net/minecraft/server/EntityRavager.java -@@ -137,7 +137,7 @@ public class EntityRavager extends EntityRaider { - this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(MathHelper.d(0.1D, d1, d0)); - } - -- if (this.positionChanged && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (this.positionChanged && (this.world.purpurConfig.ravagerBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur - boolean flag = false; - AxisAlignedBB axisalignedbb = this.getBoundingBox().g(0.2D); - Iterator iterator = BlockPosition.b(MathHelper.floor(axisalignedbb.minX), MathHelper.floor(axisalignedbb.minY), MathHelper.floor(axisalignedbb.minZ), MathHelper.floor(axisalignedbb.maxX), MathHelper.floor(axisalignedbb.maxY), MathHelper.floor(axisalignedbb.maxZ)).iterator(); -diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index 6bd00f0b5735d694e370cf85fdbf508c31fc7c27..9ccb7a805adf8c1e429f3fab2bc261c4dad5eda8 100644 ---- a/src/main/java/net/minecraft/server/EntitySilverfish.java -+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java -@@ -144,7 +144,7 @@ public class EntitySilverfish extends EntityMonster { - } else { - Random random = this.a.getRandom(); - -- if (this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && random.nextInt(10) == 0) { -+ if ((this.a.world.purpurConfig.silverfishBypassMobGriefing || this.a.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && random.nextInt(10) == 0) { // Purpur - this.h = EnumDirection.a(random); - BlockPosition blockposition = (new BlockPosition(this.a.locX(), this.a.locY() + 0.5D, this.a.locZ())).shift(this.h); - IBlockData iblockdata = this.a.world.getType(blockposition); -@@ -232,7 +232,7 @@ public class EntitySilverfish extends EntityMonster { - continue; - } - // CraftBukkit end -- if (world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (world.purpurConfig.silverfishBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur - world.a(blockposition1, true, this.silverfish); - } else { - world.setTypeAndData(blockposition1, ((BlockMonsterEggs) block).c().getBlockData(), 3); -diff --git a/src/main/java/net/minecraft/server/EntitySmallFireball.java b/src/main/java/net/minecraft/server/EntitySmallFireball.java -index 4ed7a20bfed267776628457a4b33178bac7d1972..e7e12ce2338102b875444c3f3cc767858de38dca 100644 ---- a/src/main/java/net/minecraft/server/EntitySmallFireball.java -+++ b/src/main/java/net/minecraft/server/EntitySmallFireball.java -@@ -12,7 +12,7 @@ public class EntitySmallFireball extends EntityFireballFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java +index bf747cbf6e1ef9ea9d1d41d0441b29a46ce874c0..53e02e512b8bcebac105e421991b3554a7ad699a 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntitySmallFireball.java +@@ -26,7 +26,7 @@ public class EntitySmallFireball extends EntityFireballFireball { super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world); // CraftBukkit start if (this.getShooter() != null && this.getShooter() instanceof EntityInsentient) { @@ -232,46 +259,11 @@ index 4ed7a20bfed267776628457a4b33178bac7d1972..e7e12ce2338102b875444c3f3cc76785 } // CraftBukkit end } -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index 1dd13dfea91a05b1e83b065328092a17d41a605f..eb6344a5671408ae9fdd6013774baa13addf304b 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -86,7 +86,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt - this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING - } - -- if (!this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (!this.world.purpurConfig.snowGolemBypassMobGriefing && !this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur - return; - } - -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 9b9eeb14776c09415823e0d5e313e44e51deb43a..7d5183cd2121092f7342a282ba98f659f10f19f8 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -323,7 +323,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { - if (this.getInvul() > 0) { - i = this.getInvul() - 1; - if (i <= 0) { -- Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; -+ Explosion.Effect explosion_effect = (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur - // CraftBukkit start - // this.world.createExplosion(this, this.locX(), this.getHeadY(), this.locZ(), 7.0F, false, explosion_effect); - ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 7.0F, false); -@@ -435,7 +435,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { - - if (this.bw > 0) { - --this.bw; -- if (this.bw == 0 && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (this.bw == 0 && (this.world.purpurConfig.witherBypassMobGriefing || this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))) { // Purpur - i = MathHelper.floor(this.locY()); - j = MathHelper.floor(this.locX()); - int j1 = MathHelper.floor(this.locZ()); -diff --git a/src/main/java/net/minecraft/server/EntityWitherSkull.java b/src/main/java/net/minecraft/server/EntityWitherSkull.java -index 4a97a7517dc1a2a25c578d9e168240cc19ab0831..fedc78e4111864d1413e6fcd588b9951595b463a 100644 ---- a/src/main/java/net/minecraft/server/EntityWitherSkull.java -+++ b/src/main/java/net/minecraft/server/EntityWitherSkull.java -@@ -73,7 +73,7 @@ public class EntityWitherSkull extends EntityFireball { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java +index 2fe0e32a1158cccb3060f5a986c9fc41a0237aa8..616b5267d1d94b2be37ec48983b45e4478502fb5 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityWitherSkull.java +@@ -94,7 +94,7 @@ public class EntityWitherSkull extends EntityFireball { protected void a(MovingObjectPosition movingobjectposition) { super.a(movingobjectposition); if (!this.world.isClientSide) { @@ -280,65 +272,73 @@ index 4a97a7517dc1a2a25c578d9e168240cc19ab0831..fedc78e4111864d1413e6fcd588b9951 // CraftBukkit start // this.world.createExplosion(this, this.locX(), this.locY(), this.locZ(), 1.0F, false, explosion_effect); -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -index 23870a271b759a953a095df835e08ea2a09f4218..c31bacf786ea750e922c938c042656515d8b0041 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java -@@ -27,7 +27,7 @@ public class PathfinderGoalBreakDoor extends PathfinderGoalDoorInteract { +diff --git a/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java b/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java +index ff41ee884e3e46af1b1e9fb550f0abc6998fd031..8eec32af12c69e1963dcd304a25ec4811b2f1f5a 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java ++++ b/src/main/java/net/minecraft/world/entity/raid/EntityRaider.java +@@ -532,7 +532,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { + + @Override + public boolean a() { +- if (!getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items ++ if ((!getRaider().world.purpurConfig.pillagerBypassMobGriefing && !getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur + Raid raid = this.b.fa(); + + if (this.b.fb() && !this.b.fa().a() && this.b.eN() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java +index 21baa8fb99b0587da503e14e2b04abf3134d03bc..3f816358758165bf5e346eaffcb3edc46c48dd40 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockCampfire.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockCampfire.java +@@ -181,7 +181,7 @@ public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged + public void a(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) { + if (!world.isClientSide && iprojectile.isBurning()) { + Entity entity = iprojectile.getShooter(); +- boolean flag = entity == null || entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); ++ boolean flag = entity == null || entity instanceof EntityHuman || world.purpurConfig.fireballsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur + + if (flag && !(Boolean) iblockdata.get(BlockCampfire.LIT) && !(Boolean) iblockdata.get(BlockCampfire.d)) { + BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); +diff --git a/src/main/java/net/minecraft/world/level/block/BlockCrops.java b/src/main/java/net/minecraft/world/level/block/BlockCrops.java +index 09f15d9087f1c40e5d50cb56f8c764ddaa992e41..5f8366beeaac7153a0421554f9bf91fbf265edca 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockCrops.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockCrops.java +@@ -160,7 +160,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement @Override - public boolean a() { -- return !super.a() ? false : (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) ? false : this.a(this.entity.world.getDifficulty()) && !this.g()); -+ return !super.a() ? false : ((!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) ? false : this.a(this.entity.world.getDifficulty()) && !this.g()); // Purpur - } + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // CraftBukkit ++ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))).isCancelled()) { // CraftBukkit // Purpur + world.a(blockposition, true, entity); + } +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +index 3e8893bf76b8ffda4c595c81086556ea929beaa4..d3fd0b418b9088b621e44f5da452db74b433efe8 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +@@ -99,7 +99,7 @@ public class BlockSoil extends Block { @Override -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java -index b7e1e7e35a33cf6a476b11284ebdb0cdda524af2..9e8f720ee0a39ccc27d671df4ae83ef404788a2f 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java -@@ -11,7 +11,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { - - private static final Predicate a = BlockStatePredicate.a(Blocks.GRASS); - private final EntityInsentient b; -- private final World c; -+ private final World c; private final World getWorld() { return c; } // Purpur - OBFHELPER - private int d; - - public PathfinderGoalEatTile(EntityInsentient entityinsentient) { -@@ -60,7 +60,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { - - if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) { - // CraftBukkit -- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { -+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur - this.c.b(blockposition, false); - } - -@@ -70,7 +70,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal { - - if (this.c.getType(blockposition1).a(Blocks.GRASS_BLOCK)) { - // CraftBukkit -- if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { -+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.b, blockposition, Blocks.AIR.getBlockData(), !this.getWorld().purpurConfig.sheepBypassMobGriefing && !this.c.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // Purpur - this.c.triggerEffect(2001, blockposition1, Block.getCombinedId(Blocks.GRASS_BLOCK.getBlockData())); - this.c.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2); - } -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -index 6ea402c603b9b54705e79a2fdc61fe5a254479a3..0119eb85fbb2aa85b402f7e0ff712e83c79880a4 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -@@ -24,7 +24,7 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { - - @Override - public boolean a() { -- if (!this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { -+ if (!this.entity.world.purpurConfig.zombieBypassMobGriefing && !this.entity.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { // Purpur + public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) { + super.fallOn(world, blockposition, entity, f); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. +- if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) { ++ if (!world.isClientSide && world.random.nextFloat() < f - 0.5F && entity instanceof EntityLiving && (entity instanceof EntityHuman || world.purpurConfig.farmlandBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) && entity.getWidth() * entity.getWidth() * entity.getHeight() > 0.512F) { // Purpur + // CraftBukkit start - Interact soil + org.bukkit.event.Cancellable cancellable; + if (entity instanceof EntityHuman) { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java +index 04504901b1933ed760b34b8abb994de8ec340a4e..e18be05c9a9230105ec54395d4391c86132e7930 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java +@@ -206,7 +206,7 @@ public class BlockTurtleEgg extends Block { return false; - } else if (this.c > 0) { - --this.c; + } + if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) { +- return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); ++ return world.purpurConfig.turtleEggsBypassMobGriefing || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING); // Purpur + } + return true; + // Purpur end diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index af33ee28276ac9848805765af6d51bf4b9f3c372..f9cd952ebddab8c963a8cc51755e3019c9286bd0 100644 +index 73213bf975ffe38ff6ee9b05c5a48b232f767727..9fae36ee7c25a0cf3a7677223a7aa55617797970 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -252,6 +252,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0157-Config-to-allow-Note-Block-sounds-when-blocked.patch b/patches/Purpur/patches/server/0157-Config-to-allow-Note-Block-sounds-when-blocked.patch index 039f187f..a2a7a8d4 100644 --- a/patches/Purpur/patches/server/0157-Config-to-allow-Note-Block-sounds-when-blocked.patch +++ b/patches/Purpur/patches/server/0157-Config-to-allow-Note-Block-sounds-when-blocked.patch @@ -8,11 +8,11 @@ Allows for Note Blocks to ignore whether or not there's air above them to play. Normally, the sounds will only play when the block directly above is air. With this patch enabled, players can place any block above the Note Block and it will still work. -diff --git a/src/main/java/net/minecraft/server/BlockNote.java b/src/main/java/net/minecraft/server/BlockNote.java -index df69d00d3a38417e53f433cd1eb1f6cf3ec9b55b..6bb6e229c8734d7b9f4e3cd3dd1b4b646bca1777 100644 ---- a/src/main/java/net/minecraft/server/BlockNote.java -+++ b/src/main/java/net/minecraft/server/BlockNote.java -@@ -37,7 +37,7 @@ public class BlockNote extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockNote.java b/src/main/java/net/minecraft/world/level/block/BlockNote.java +index feec1db88b22a4d13ffd3034633da79ed41b94fe..4882046f46c33a8d828d13325af17237ae07cd86 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockNote.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockNote.java +@@ -59,7 +59,7 @@ public class BlockNote extends Block { } private void play(World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit @@ -22,7 +22,7 @@ index df69d00d3a38417e53f433cd1eb1f6cf3ec9b55b..6bb6e229c8734d7b9f4e3cd3dd1b4b64 org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.get(BlockNote.INSTRUMENT), data.get(BlockNote.NOTE)); if (!event.isCancelled()) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index f9cd952ebddab8c963a8cc51755e3019c9286bd0..e1b2a39ea8847716c44d265a62492b5e6cbe262d 100644 +index 9fae36ee7c25a0cf3a7677223a7aa55617797970..c992521116d7aadebd43d2793d5ea1875841d51d 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -254,6 +254,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0158-Add-EntityTeleportHinderedEvent.patch b/patches/Purpur/patches/server/0158-Add-EntityTeleportHinderedEvent.patch index ac0f32db..d584bbf3 100644 --- a/patches/Purpur/patches/server/0158-Add-EntityTeleportHinderedEvent.patch +++ b/patches/Purpur/patches/server/0158-Add-EntityTeleportHinderedEvent.patch @@ -16,23 +16,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index b40f5167d2a9772658c115091f13706fbb4959b7..657885cdaa086293f6b5aa6f3058acd16df0ba35 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -250,6 +250,7 @@ public abstract class BlockBase { - return 0; - } - -+ @Deprecated public final void collideWithBlock(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { this.a(iblockdata, world, blockposition, entity); } // Purpur - OBFHELPER - @Deprecated - public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {} - -diff --git a/src/main/java/net/minecraft/server/BlockEnderPortal.java b/src/main/java/net/minecraft/server/BlockEnderPortal.java -index e731b6d811d179f07f84278d2cce75e0d98092ab..f0e5c378c4612192c1d4c74aa81e598f9370b8b8 100644 ---- a/src/main/java/net/minecraft/server/BlockEnderPortal.java -+++ b/src/main/java/net/minecraft/server/BlockEnderPortal.java -@@ -25,7 +25,15 @@ public class BlockEnderPortal extends BlockTileEntity { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java +index fc89b3bf5075497596885548d80e4ed0b800ea89..4900c90597358f7b701b8becd2ac58de11aacc71 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java +@@ -43,7 +43,15 @@ public class BlockEnderPortal extends BlockTileEntity { @Override public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { @@ -49,11 +37,11 @@ index e731b6d811d179f07f84278d2cce75e0d98092ab..f0e5c378c4612192c1d4c74aa81e598f ResourceKey resourcekey = world.getTypeKey() == DimensionManager.THE_END ? World.OVERWORLD : World.THE_END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends WorldServer worldserver = ((WorldServer) world).getMinecraftServer().getWorldServer(resourcekey); -diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java -index bd78d55ee94f1359739a9d790092d07c613eac0f..a574ef929ac60584ff6e1b2c76722456cc3895ff 100644 ---- a/src/main/java/net/minecraft/server/BlockPortal.java -+++ b/src/main/java/net/minecraft/server/BlockPortal.java -@@ -60,7 +60,15 @@ public class BlockPortal extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockPortal.java b/src/main/java/net/minecraft/world/level/block/BlockPortal.java +index 5f797260eff317409a5039b88b01ad79ee2fdd91..ac5ce96ab62ec210816e7af85a4269073b7a9270 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockPortal.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockPortal.java +@@ -82,7 +82,15 @@ public class BlockPortal extends Block { @Override public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { @@ -70,11 +58,11 @@ index bd78d55ee94f1359739a9d790092d07c613eac0f..a574ef929ac60584ff6e1b2c76722456 // CraftBukkit start - Entity in portal EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ())); world.getServer().getPluginManager().callEvent(event); -diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index e616b3759561e0d6e471f914f3dc843fe7464f2e..4a443827a316415c2c047ca468d965a80fce1fb1 100644 ---- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java -+++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -126,9 +126,18 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +index d918194e45953764fa3fd286b715714330a60941..70496562faa89e92da34a4f7b891f845d1d55012 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEndGateway.java +@@ -151,9 +151,18 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick } } @@ -93,8 +81,20 @@ index e616b3759561e0d6e471f914f3dc843fe7464f2e..4a443827a316415c2c047ca468d965a8 this.c = 100; if (this.exitPortal == null && this.world.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit - work in alternate worlds this.a((WorldServer) this.world); +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index 8d21f9451c60873d1524ad64876094e6e21509e4..5e8b3791ebec2f745af2527dc52c792f30f63106 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -302,6 +302,7 @@ public abstract class BlockBase { + return 0; + } + ++ @Deprecated public final void collideWithBlock(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { this.a(iblockdata, world, blockposition, entity); } // Purpur - OBFHELPER + @Deprecated + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {} + diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index e1b2a39ea8847716c44d265a62492b5e6cbe262d..2391e1ddbe062dde5cb9a240b0a6a85ed793e569 100644 +index c992521116d7aadebd43d2793d5ea1875841d51d..61bc3507a9f473e9dc1c948299e3bf11a02b632b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -1881,4 +1881,9 @@ public class PurpurWorldConfig { @@ -108,10 +108,10 @@ index e1b2a39ea8847716c44d265a62492b5e6cbe262d..2391e1ddbe062dde5cb9a240b0a6a85e + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5471422d23d261a06c67f9374cae933430ec03a0..4c592f6d4d6cbeb4c3225e7794f4b1d6c8d62394 100644 +index c524a0994f1c9ef1d0534403efa4e4481955b2f3..a80f664d2cf713fd751421be3735e2f4779f0056 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -522,6 +522,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -554,6 +554,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { location.checkFinite(); if (entity.isVehicle() || entity.dead) { @@ -123,10 +123,10 @@ index 5471422d23d261a06c67f9374cae933430ec03a0..4c592f6d4d6cbeb4c3225e7794f4b1d6 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7b5ffe92430121eebe2866ac33b37a840eed90f1..98f4407848347dfc46b70d1c1fe466dce10f54b7 100644 +index ca465a53a0c6232f912287704fc63cdcc59a28bd..37564214c6595dfc07534124f749bf65002325c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -117,6 +117,7 @@ import org.bukkit.entity.EntityType; +@@ -126,6 +126,7 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerRegisterChannelEvent; import org.bukkit.event.player.PlayerTeleportEvent; @@ -134,7 +134,7 @@ index 7b5ffe92430121eebe2866ac33b37a840eed90f1..98f4407848347dfc46b70d1c1fe466dc import org.bukkit.event.player.PlayerUnregisterChannelEvent; import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; -@@ -874,6 +875,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -883,6 +884,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } if (entity.isVehicle()) { diff --git a/patches/Purpur/patches/server/0159-Add-StructureGenerateEvent.patch b/patches/Purpur/patches/server/0159-Add-StructureGenerateEvent.patch index 90a1be64..48b3d171 100644 --- a/patches/Purpur/patches/server/0159-Add-StructureGenerateEvent.patch +++ b/patches/Purpur/patches/server/0159-Add-StructureGenerateEvent.patch @@ -18,11 +18,11 @@ along with this program. If not, see . Co-authored-by: Mariell Hoversholm -diff --git a/src/main/java/net/minecraft/server/ChunkGenerator.java b/src/main/java/net/minecraft/server/ChunkGenerator.java -index 17cf00dfe8b24adf2fb66eca4710ab7888a894e3..6223d1d9048e31fb10cec7f485d1556aec2c7d5e 100644 ---- a/src/main/java/net/minecraft/server/ChunkGenerator.java -+++ b/src/main/java/net/minecraft/server/ChunkGenerator.java -@@ -251,6 +251,14 @@ public abstract class ChunkGenerator { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +index 316287af6e405ff224636255c2964f46003215ce..ff98335155c86803b98d8c67f0b40b8d65214890 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +@@ -287,6 +287,14 @@ public abstract class ChunkGenerator { if (structuresettingsfeature != null) { StructureStart structurestart1 = structurefeature.a(iregistrycustom, this, this.b, definedstructuremanager, i, chunkcoordintpair, biomebase, j, structuresettingsfeature); @@ -37,11 +37,11 @@ index 17cf00dfe8b24adf2fb66eca4710ab7888a894e3..6223d1d9048e31fb10cec7f485d1556a structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), structurefeature.d, structurestart1, ichunkaccess); } -diff --git a/src/main/java/net/minecraft/server/StructureFeature.java b/src/main/java/net/minecraft/server/StructureFeature.java -index 8e3c0c3783b767c2ba603b3b50200ac76a7fc33e..379665ae55e76afb03b20d1b81c57347af1137db 100644 ---- a/src/main/java/net/minecraft/server/StructureFeature.java -+++ b/src/main/java/net/minecraft/server/StructureFeature.java -@@ -11,7 +11,7 @@ public class StructureFeature>> b = RegistryFileCodec.a(IRegistry.av, StructureFeature.a); public static final Codec>>> c = RegistryFileCodec.b(IRegistry.av, StructureFeature.a); @@ -50,11 +50,11 @@ index 8e3c0c3783b767c2ba603b3b50200ac76a7fc33e..379665ae55e76afb03b20d1b81c57347 public final FC e; public StructureFeature(F f0, FC fc) { -diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index a62c87bceab2c9700a7b3925f208b0ffa2b9b393..8fc283f014783b76afda83097201bb7938a1f9fa 100644 ---- a/src/main/java/net/minecraft/server/StructureGenerator.java -+++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -235,6 +235,7 @@ public abstract class StructureGenerator +diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java +index 6df42ff26ff6e65ec2885122fe53dde857a3d1d2..917d147b06b7045ea69917c81f35fcafdd5098dd 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureGenerator.java +@@ -268,6 +268,7 @@ public abstract class StructureGenerator public abstract StructureGenerator.a a(); diff --git a/patches/Purpur/patches/server/0160-Farmland-trampling-changes.patch b/patches/Purpur/patches/server/0160-Farmland-trampling-changes.patch index 8ad046e7..cc80f9a5 100644 --- a/patches/Purpur/patches/server/0160-Farmland-trampling-changes.patch +++ b/patches/Purpur/patches/server/0160-Farmland-trampling-changes.patch @@ -3,22 +3,48 @@ From: Mariell Hoversholm Date: Sat, 9 Jan 2021 16:06:40 +0100 Subject: [PATCH] Farmland trampling changes -This lets us choose if only players may trample farmland. +This lets us choose if farmland trampling is fully disabled or only +players may trample farmland. This lets us choose if entities can stop trampling if they fall a distance equal to their feather falling level, plus the extra block -necessary to trample in the first place. Feather Falling 1 requires you -to fall over 3+ blocks to trample. FF 2 requires 4+, etc. +necessary to trample in the first place. Feather Falling 1 requires +you to fall over 3+ blocks to trample. FF 2 requires 4+, etc. -diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java -index 73dc0f499c456c21d298013fbab8c79ebcdecd6b..6b65a4b1845c6770f92ceebd04827595725632b5 100644 ---- a/src/main/java/net/minecraft/server/BlockSoil.java -+++ b/src/main/java/net/minecraft/server/BlockSoil.java -@@ -97,6 +97,12 @@ public class BlockSoil extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSoil.java b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +index d3fd0b418b9088b621e44f5da452db74b433efe8..e7e5ee52cb7ac7e406c837db686d0a96dcc13fbc 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSoil.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSoil.java +@@ -4,13 +4,17 @@ import java.util.Iterator; + import java.util.Random; + import net.minecraft.core.BlockPosition; + import net.minecraft.core.EnumDirection; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.tags.Tag; + import net.minecraft.tags.TagsFluid; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityLiving; + import net.minecraft.world.entity.player.EntityHuman; ++import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.context.BlockActionContext; ++import net.minecraft.world.item.enchantment.EnchantmentManager; ++import net.minecraft.world.item.enchantment.Enchantments; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.IBlockAccess; +@@ -114,12 +118,19 @@ public class BlockSoil extends Block { + } + + // Purpur start ++ if (world.purpurConfig.farmlandTramplingDisabled) return; ++ if (world.purpurConfig.farmlandTramplingOnlyPlayers && !(entity instanceof EntityPlayer)) return; + if (world.purpurConfig.farmlandAlpha) { + Block block = world.getType(blockposition.down()).getBlock(); + if (block instanceof BlockFence || block instanceof BlockCobbleWall) { return; } } -+ if (world.purpurConfig.farmlandTramplingOnlyPlayers && !(entity instanceof EntityPlayer)) return; + if (world.purpurConfig.farmlandTramplingFeatherFalling) { + Iterator armor = entity.getArmorItems().iterator(); + if (armor.hasNext() && EnchantmentManager.getEnchantmentLevel(Enchantments.PROTECTION_FALL, armor.next()) >= (int) entity.fallDistance) @@ -28,19 +54,21 @@ index 73dc0f499c456c21d298013fbab8c79ebcdecd6b..6b65a4b1845c6770f92ceebd04827595 if (CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.DIRT.getBlockData()).isCancelled()) { return; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2391e1ddbe062dde5cb9a240b0a6a85ed793e569..e248681fc8d1c91077e2135a70347bf4c5282686 100644 +index 61bc3507a9f473e9dc1c948299e3bf11a02b632b..498abbe8e9324d215b4ac409e1af10a4db5f02d5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -413,10 +413,14 @@ public class PurpurWorldConfig { +@@ -413,10 +413,16 @@ public class PurpurWorldConfig { public boolean farmlandBypassMobGriefing = false; public boolean farmlandGetsMoistFromBelow = false; public boolean farmlandAlpha = false; ++ public boolean farmlandTramplingDisabled = false; + public boolean farmlandTramplingOnlyPlayers = false; + public boolean farmlandTramplingFeatherFalling = false; private void farmlandSettings() { farmlandBypassMobGriefing = getBoolean("blocks.farmland.bypass-mob-griefing", farmlandBypassMobGriefing); farmlandGetsMoistFromBelow = getBoolean("blocks.farmland.gets-moist-from-below", farmlandGetsMoistFromBelow); farmlandAlpha = getBoolean("blocks.farmland.use-alpha-farmland", farmlandAlpha); ++ farmlandTramplingDisabled = getBoolean("blocks.farmland.disable-trampling", farmlandTramplingDisabled); + farmlandTramplingOnlyPlayers = getBoolean("blocks.farmland.only-players-trample", farmlandTramplingOnlyPlayers); + farmlandTramplingFeatherFalling = getBoolean("blocks.farmland.feather-fall-distance-affects-trampling", farmlandTramplingFeatherFalling); } diff --git a/patches/Purpur/patches/server/0161-Movement-options-for-armour-stands.patch b/patches/Purpur/patches/server/0161-Movement-options-for-armor-stands.patch similarity index 66% rename from patches/Purpur/patches/server/0161-Movement-options-for-armour-stands.patch rename to patches/Purpur/patches/server/0161-Movement-options-for-armor-stands.patch index f2b41af0..4425d656 100644 --- a/patches/Purpur/patches/server/0161-Movement-options-for-armour-stands.patch +++ b/patches/Purpur/patches/server/0161-Movement-options-for-armor-stands.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Sat, 9 Jan 2021 22:22:59 +0100 -Subject: [PATCH] Movement options for armour stands +Subject: [PATCH] Movement options for armor stands This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,24 +16,32 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1ec8dcfcbacf373682cb46fee354e3cfd6d3f1b5..85ffb2e72dbf08604c004732f17aee9ec7e1ff9d 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1373,7 +1373,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 904bca540a42204a9856765e333eee6c5de6a960..ee1f0ccce5c5c920b2595ced9e72fd1544e2459a 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1469,7 +1469,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return this.isInWater() || flag; } - void aL() { -+ void aL() { // Purpur - diff on change; this is `updateInWaterStateAndDoWaterCurrentPushing()V` ++ public void aL() { updateInWaterStateAndDoWaterCurrentPushing(); } public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur if (this.getVehicle() instanceof EntityBoat) { this.inWater = false; } else if (this.a((Tag) TagsFluid.WATER, 0.014D)) { -diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 759a8f95038778aead2f33a65a2d8f2d6b26a765..74fda434ed7beb6612f46ed75fdccad59f394b60 100644 ---- a/src/main/java/net/minecraft/server/EntityArmorStand.java -+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -52,10 +52,12 @@ public class EntityArmorStand extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +index 43dc0925887e2e9e86445cccff57be7994ca0d58..ecb797e67554d30e35b3aca4d0fc9b0e3f6c1a50 100644 +--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java ++++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java +@@ -36,6 +36,7 @@ import net.minecraft.world.item.ItemStack; + import net.minecraft.world.item.Items; + import net.minecraft.world.level.World; + import net.minecraft.world.level.block.Block; ++import net.minecraft.world.level.block.BlockFence; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.material.EnumPistonReaction; + import net.minecraft.world.phys.Vec3D; +@@ -87,10 +88,12 @@ public class EntityArmorStand extends EntityLiving { private boolean noTickPoseDirty = false; private boolean noTickEquipmentDirty = false; // Paper end @@ -46,17 +54,17 @@ index 759a8f95038778aead2f33a65a2d8f2d6b26a765..74fda434ed7beb6612f46ed75fdccad5 this.handItems = NonNullList.a(2, ItemStack.b); this.armorItems = NonNullList.a(4, ItemStack.b); this.headPose = EntityArmorStand.bj; -@@ -897,4 +899,18 @@ public class EntityArmorStand extends EntityLiving { +@@ -932,4 +935,18 @@ public class EntityArmorStand extends EntityLiving { return true; } // Paper end + + // Purpur start + @Override -+ void aL() { ++ public void updateInWaterStateAndDoWaterCurrentPushing() { + if (this.world.purpurConfig.armorstandWaterMovement && + (this.world.purpurConfig.armorstandWaterFence || !(world.getType(getBlockLocation().down()).getBlock() instanceof BlockFence))) -+ super.aL(); ++ super.updateInWaterStateAndDoWaterCurrentPushing(); + } + + @Override @@ -66,7 +74,7 @@ index 759a8f95038778aead2f33a65a2d8f2d6b26a765..74fda434ed7beb6612f46ed75fdccad5 + // Purpur end } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index e248681fc8d1c91077e2135a70347bf4c5282686..a494a9e15456cf684c62957e8563ef06627695f9 100644 +index 498abbe8e9324d215b4ac409e1af10a4db5f02d5..01304a630d22a7de1a6d8beb8d9753a36a31fc42 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -111,10 +111,16 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0162-Fix-stuck-in-portals.patch b/patches/Purpur/patches/server/0162-Fix-stuck-in-portals.patch index 0f134d28..4c0a1f77 100644 --- a/patches/Purpur/patches/server/0162-Fix-stuck-in-portals.patch +++ b/patches/Purpur/patches/server/0162-Fix-stuck-in-portals.patch @@ -4,11 +4,23 @@ Date: Thu, 14 Jan 2021 16:48:10 -0600 Subject: [PATCH] Fix stuck in portals -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 85ffb2e72dbf08604c004732f17aee9ec7e1ff9d..49a1447bae91294a23ccab27c2809bea0c4c90a3 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2424,12 +2424,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index f942c3ab757b768fbd1d459752b7f29094471c56..ccee67df065dcdee5e0e24ab12476572ca696687 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -1293,6 +1293,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + playerlist.d(this); + worldserver1.removePlayer(this); + this.dead = false; ++ this.portalPos = MCUtil.toBlockPosition(exit); // Purpur + + // CraftBukkit end + this.spawnIn(worldserver); +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index ee1f0ccce5c5c920b2595ced9e72fd1544e2459a..fcbbf100990faf60250357b744cbd58701da0b0c 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2520,12 +2520,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return new Vec2F(this.pitch, this.yaw); } @@ -24,20 +36,8 @@ index 85ffb2e72dbf08604c004732f17aee9ec7e1ff9d..49a1447bae91294a23ccab27c2809bea } this.inPortal = true; -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 100472ab38414f6d393f86a790837e448c7db381..eb62597449081656a05073e5bbf878f893166b53 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1161,6 +1161,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - playerlist.d(this); - worldserver1.removePlayer(this); - this.dead = false; -+ this.portalPos = MCUtil.toBlockPosition(exit); // Purpur - - // CraftBukkit end - this.spawnIn(worldserver); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index a494a9e15456cf684c62957e8563ef06627695f9..c268ec1b3b3e558283d869629079049343b2f15d 100644 +index 01304a630d22a7de1a6d8beb8d9753a36a31fc42..82b4ece3c12d8180b7ab275c3f240e94578177fc 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -350,6 +350,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0163-Fix-PlayerEditBookEvent-not-saving-new-book.patch b/patches/Purpur/patches/server/0163-Fix-PlayerEditBookEvent-not-saving-new-book.patch index 56a2c53b..952e62f3 100644 --- a/patches/Purpur/patches/server/0163-Fix-PlayerEditBookEvent-not-saving-new-book.patch +++ b/patches/Purpur/patches/server/0163-Fix-PlayerEditBookEvent-not-saving-new-book.patch @@ -4,11 +4,11 @@ Date: Mon, 25 Jan 2021 10:22:28 -0600 Subject: [PATCH] Fix PlayerEditBookEvent not saving new book -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9ff35aa827cf5b937b8dcbcabafd27301574c35d..f7a031920c68d5d5d505d86ab1b513ac53f5bf84 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1065,7 +1065,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index b81b7a4f7debdb77a9b8906e3d87420be51b8e62..c7c26cd1b99c911efd12e325e0ca09d9ac98c6f4 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -1210,7 +1210,7 @@ public class PlayerConnection implements PacketListenerPlayIn { list.stream().map(s -> s = color(s, hasPerm, false)).map(NBTTagString::a).forEach(nbttaglist::add); // Purpur - edit book ItemStack old = itemstack.cloneItemStack(); // CraftBukkit itemstack.a("pages", (NBTBase) nbttaglist); diff --git a/patches/Purpur/patches/server/0164-Config-to-use-infinity-bows-without-arrows.patch b/patches/Purpur/patches/server/0164-Config-to-use-infinity-bows-without-arrows.patch index 56ead80d..f177ccb8 100644 --- a/patches/Purpur/patches/server/0164-Config-to-use-infinity-bows-without-arrows.patch +++ b/patches/Purpur/patches/server/0164-Config-to-use-infinity-bows-without-arrows.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Config to use infinity bows without arrows Allows for bows with infinity to be used without any arrows in the player's inventory. Uses a standard arrow when shot. -diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 8241f3dafa5852bed7a3967e7260b36f47198dba..edfb09fe673a9a7fe4e0410c0c0eeeda0d164270 100644 ---- a/src/main/java/net/minecraft/server/ItemBow.java -+++ b/src/main/java/net/minecraft/server/ItemBow.java -@@ -119,7 +119,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { +diff --git a/src/main/java/net/minecraft/world/item/ItemBow.java b/src/main/java/net/minecraft/world/item/ItemBow.java +index c7e20b25b4d09463fa54c66e62208e90515013e2..59b803ec4552058f2dda269e9435daf65be10559 100644 +--- a/src/main/java/net/minecraft/world/item/ItemBow.java ++++ b/src/main/java/net/minecraft/world/item/ItemBow.java +@@ -130,7 +130,7 @@ public class ItemBow extends ItemProjectileWeapon implements ItemVanishable { ItemStack itemstack = entityhuman.b(enumhand); boolean flag = !entityhuman.f(itemstack).isEmpty(); @@ -20,7 +20,7 @@ index 8241f3dafa5852bed7a3967e7260b36f47198dba..edfb09fe673a9a7fe4e0410c0c0eeeda } else { entityhuman.c(enumhand); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index c268ec1b3b3e558283d869629079049343b2f15d..2db8241602382927ae9365a5026451e199f48d36 100644 +index 82b4ece3c12d8180b7ab275c3f240e94578177fc..7ba0c16271fccf7609680b1409a93e2653aa0af2 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -209,10 +209,12 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch b/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch index 9fd263f9..537c2ee2 100644 --- a/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch +++ b/patches/Purpur/patches/server/0165-Toggle-for-water-sensitive-mob-damage.patch @@ -4,37 +4,11 @@ Date: Fri, 5 Feb 2021 01:11:22 +0100 Subject: [PATCH] Toggle for water sensitive mob damage -diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java -index 90b90fa33b39020189a1d4a5826fa3ab720488cd..b4db9869d172406f4eff84cfb2648b5c6c6d00e2 100644 ---- a/src/main/java/net/minecraft/server/EntityBlaze.java -+++ b/src/main/java/net/minecraft/server/EntityBlaze.java -@@ -116,7 +116,7 @@ public class EntityBlaze extends EntityMonster { - - @Override - public boolean dO() { -- return true; -+ return world.purpurConfig.blazeTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index beee80c3d8277f2d784fb6b8a4152a871ee020b0..b884addf2ce6f1ef7394658078deb2e75370654f 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -234,7 +234,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - - @Override - public boolean dO() { -- return true; -+ return world.purpurConfig.endermanTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage - } - - @Override -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 08efc5fec023acf68da1b5931a9b5eb8c16e9fc3..d6a086f59d9df8ef7f727e6a83fa51a14995123e 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -786,7 +786,8 @@ public abstract class EntityInsentient extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index 63d93060b350069040876aaacb91c853d674ea7b..e9793954c872baacfe7be80ecf3888e848dc924f 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -856,7 +856,8 @@ public abstract class EntityInsentient extends EntityLiving { if (goalFloat.validConditions()) goalFloat.update(); this.getControllerJump().jumpIfSet(); } @@ -44,11 +18,11 @@ index 08efc5fec023acf68da1b5931a9b5eb8c16e9fc3..d6a086f59d9df8ef7f727e6a83fa51a1 damageEntity(DamageSource.DROWN, 1.0F); } return; -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 38f94d4983b69e265441a2b8365702df57a881f5..50fa5f8395fea3ba6fa202a5a38519cd55ae00e0 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2876,6 +2876,7 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 1e57358c02e67a6b062149926ada46696da24487..66f1750172df09f1cbb47ca5a679a77a9ccab282 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2974,6 +2974,7 @@ public abstract class EntityLiving extends Entity { } @@ -56,11 +30,11 @@ index 38f94d4983b69e265441a2b8365702df57a881f5..50fa5f8395fea3ba6fa202a5a38519cd public boolean dO() { return false; } -diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java -index eb6344a5671408ae9fdd6013774baa13addf304b..663c6dd23e0aa75266cefc8f0514d2ca9dc51553 100644 ---- a/src/main/java/net/minecraft/server/EntitySnowman.java -+++ b/src/main/java/net/minecraft/server/EntitySnowman.java -@@ -71,7 +71,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +index 17f27d2bf5be746a0fa0e1e0fecab8158b2b3587..ad30cc92333aabf7d9fb3fb046e7ecb63629ee5b 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntitySnowman.java +@@ -108,7 +108,7 @@ public class EntitySnowman extends EntityGolem implements IShearable, IRangedEnt @Override public boolean dO() { @@ -69,11 +43,37 @@ index eb6344a5671408ae9fdd6013774baa13addf304b..663c6dd23e0aa75266cefc8f0514d2ca } @Override -diff --git a/src/main/java/net/minecraft/server/EntityStrider.java b/src/main/java/net/minecraft/server/EntityStrider.java -index 964956a0027bf0941ff75d658be760b754772fa0..7c5472a5138011a3376b7b6ec2467bdfc1739033 100644 ---- a/src/main/java/net/minecraft/server/EntityStrider.java -+++ b/src/main/java/net/minecraft/server/EntityStrider.java -@@ -338,7 +338,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +index 45e69d2f8da4c5babfd2e67055cc0a4c6d3baac7..f90a0fcd41996cfb6935a2299306e6a4bf19701a 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityBlaze.java +@@ -143,7 +143,7 @@ public class EntityBlaze extends EntityMonster { + + @Override + public boolean dO() { +- return true; ++ return world.purpurConfig.blazeTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index ea500a6080f73dcc35d83a3b5a170f57dedaa431..d290787f74579dd4c138eb827e44544814bfe315 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -290,7 +290,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + + @Override + public boolean dO() { +- return true; ++ return world.purpurConfig.endermanTakeDamageFromWater; // Purpur - Toggle for water sensitive mob damage + } + + @Override +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +index 5e4cc99a746d98231bbb71672fbc02431e4fab48..f52ae7446c16d5b8ac51bd2e12bb51d221ca43ca 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityStrider.java +@@ -405,7 +405,7 @@ public class EntityStrider extends EntityAnimal implements ISteerable, ISaddleab @Override public boolean dO() { @@ -83,10 +83,10 @@ index 964956a0027bf0941ff75d658be760b754772fa0..7c5472a5138011a3376b7b6ec2467bdf @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d5f0758a8 100644 +index 7ba0c16271fccf7609680b1409a93e2653aa0af2..3c0a9b8e71663ad60cf78d4f66f4fd9960f2c59b 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -569,6 +569,7 @@ public class PurpurWorldConfig { +@@ -571,6 +571,7 @@ public class PurpurWorldConfig { public boolean blazeRidableInWater = false; public double blazeMaxY = 256D; public double blazeMaxHealth = 20.0D; @@ -94,7 +94,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d private void blazeSettings() { blazeRidable = getBoolean("mobs.blaze.ridable", blazeRidable); blazeRidableInWater = getBoolean("mobs.blaze.ridable-in-water", blazeRidableInWater); -@@ -579,6 +580,7 @@ public class PurpurWorldConfig { +@@ -581,6 +582,7 @@ public class PurpurWorldConfig { set("mobs.blaze.attributes.max_health", oldValue); } blazeMaxHealth = getDouble("mobs.blaze.attributes.max_health", blazeMaxHealth); @@ -102,7 +102,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d } public boolean catRidable = false; -@@ -793,6 +795,7 @@ public class PurpurWorldConfig { +@@ -795,6 +797,7 @@ public class PurpurWorldConfig { public boolean endermanBypassMobGriefing = false; public boolean endermanDespawnEvenWithBlock = false; public double endermanMaxHealth = 40.0D; @@ -110,7 +110,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d private void endermanSettings() { endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable); endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater); -@@ -805,6 +808,7 @@ public class PurpurWorldConfig { +@@ -807,6 +810,7 @@ public class PurpurWorldConfig { set("mobs.enderman.attributes.max_health", oldValue); } endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth); @@ -118,7 +118,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d } public boolean endermiteRidable = false; -@@ -1492,6 +1496,7 @@ public class PurpurWorldConfig { +@@ -1494,6 +1498,7 @@ public class PurpurWorldConfig { public float snowGolemSnowBallModifier = 10.0F; public double snowGolemAttackDistance = 1.25D; public double snowGolemMaxHealth = 4.0D; @@ -126,7 +126,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d private void snowGolemSettings() { snowGolemRidable = getBoolean("mobs.snow_golem.ridable", snowGolemRidable); snowGolemRidableInWater = getBoolean("mobs.snow_golem.ridable-in-water", snowGolemRidableInWater); -@@ -1509,6 +1514,7 @@ public class PurpurWorldConfig { +@@ -1511,6 +1516,7 @@ public class PurpurWorldConfig { set("mobs.snow_golem.attributes.max_health", oldValue); } snowGolemMaxHealth = getDouble("mobs.snow_golem.attributes.max_health", snowGolemMaxHealth); @@ -134,7 +134,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d } public boolean squidRidable = false; -@@ -1562,6 +1568,7 @@ public class PurpurWorldConfig { +@@ -1564,6 +1570,7 @@ public class PurpurWorldConfig { public int striderBreedingTicks = 6000; public boolean striderGiveSaddleBack = false; public double striderMaxHealth = 20.0D; @@ -142,7 +142,7 @@ index 2db8241602382927ae9365a5026451e199f48d36..9973677fb2ebce985b25efddc1015c6d private void striderSettings() { striderRidable = getBoolean("mobs.strider.ridable", striderRidable); striderRidableInWater = getBoolean("mobs.strider.ridable-in-water", striderRidableInWater); -@@ -1573,6 +1580,7 @@ public class PurpurWorldConfig { +@@ -1575,6 +1582,7 @@ public class PurpurWorldConfig { set("mobs.strider.attributes.max_health", oldValue); } striderMaxHealth = getDouble("mobs.strider.attributes.max_health", striderMaxHealth); diff --git a/patches/Purpur/patches/server/0166-Config-to-always-tame-in-Creative.patch b/patches/Purpur/patches/server/0166-Config-to-always-tame-in-Creative.patch index 33b69cd4..f82bbcb2 100644 --- a/patches/Purpur/patches/server/0166-Config-to-always-tame-in-Creative.patch +++ b/patches/Purpur/patches/server/0166-Config-to-always-tame-in-Creative.patch @@ -6,50 +6,11 @@ Subject: [PATCH] Config to always tame in Creative Adds a configuration option that ensures a player in Creative always tames a tameable entity. This essentially allows Creative mode players to tame animals on their first try. -diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index f973408b1f098c8a090401205f809e95fdcf2f62..2128d8a9a6fe6bdea81881cfc8ab7b03f448576f 100644 ---- a/src/main/java/net/minecraft/server/EntityCat.java -+++ b/src/main/java/net/minecraft/server/EntityCat.java -@@ -375,7 +375,7 @@ public class EntityCat extends EntityTameableAnimal { - } - } else if (this.k(itemstack)) { - this.a(entityhuman, itemstack); -- if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit -+ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // CraftBukkit // Purpur - this.tame(entityhuman); - this.setWillSit(true); - this.world.broadcastEntityEffect(this, (byte) 7); -diff --git a/src/main/java/net/minecraft/server/EntityParrot.java b/src/main/java/net/minecraft/server/EntityParrot.java -index d19f8dda87c97de594ad051a6791d99eec581e95..6d5a56b96c3759c594fe2ee4b7cdd7fa67f3d3fb 100644 ---- a/src/main/java/net/minecraft/server/EntityParrot.java -+++ b/src/main/java/net/minecraft/server/EntityParrot.java -@@ -245,7 +245,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { - } - - if (!this.world.isClientSide) { -- if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit -+ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // CraftBukkit // Purpur - this.tame(entityhuman); - this.world.broadcastEntityEffect(this, (byte) 7); - } else { -diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 03bcbf7c280476ef0e6fe87e3a96edb75544bddb..5bf2a3205671a7cb001835ab241c34bcbe47e02c 100644 ---- a/src/main/java/net/minecraft/server/EntityWolf.java -+++ b/src/main/java/net/minecraft/server/EntityWolf.java -@@ -415,7 +415,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable - } - - // CraftBukkit - added event call and isCancelled check. -- if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { -+ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // Purpur - this.tame(entityhuman); - this.navigation.o(); - this.setGoalTarget((EntityLiving) null); -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTame.java b/src/main/java/net/minecraft/server/PathfinderGoalTame.java -index 8757c6487a433b1fa5c46b50c559aeca82f84b8d..b841f87f9d6b7c9c67e2497607cbd927909c3ddc 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalTame.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalTame.java -@@ -58,7 +58,7 @@ public class PathfinderGoalTame extends PathfinderGoal { +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java +index d285f5aa66fa81a2f56920c05afb4506cb82fa54..39e348847bcecd91013452e71ef1672994a1bfa7 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalTame.java +@@ -63,7 +63,7 @@ public class PathfinderGoalTame extends PathfinderGoal { int j = this.entity.getMaxDomestication(); // CraftBukkit - fire EntityTameEvent @@ -58,8 +19,47 @@ index 8757c6487a433b1fa5c46b50c559aeca82f84b8d..b841f87f9d6b7c9c67e2497607cbd927 this.entity.i((EntityHuman) entity); return; } +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +index 7143b0801be7877762e41da336ea5e4e57f2e463..a099d8e0c5a3e4b804c8af978161ec1747ee7fa3 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +@@ -439,7 +439,7 @@ public class EntityCat extends EntityTameableAnimal { + } + } else if (this.k(itemstack)) { + this.a(entityhuman, itemstack); +- if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit ++ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // CraftBukkit // Purpur + this.tame(entityhuman); + this.setWillSit(true); + this.world.broadcastEntityEffect(this, (byte) 7); +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +index efa4318989893c946e9d7671d0dead6c4a6e315f..b2a8bfc3e53a2071ab7451fbdb3d49d97f0c430a 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +@@ -301,7 +301,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + } + + if (!this.world.isClientSide) { +- if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { // CraftBukkit ++ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // CraftBukkit // Purpur + this.tame(entityhuman); + this.world.broadcastEntityEffect(this, (byte) 7); + } else { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +index 090903fbc8f6cd1522c7afb358f708f5ae3395f4..884a3f03c73efb8fb0863976615fba5ec10f716c 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityWolf.java +@@ -482,7 +482,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable + } + + // CraftBukkit - added event call and isCancelled check. +- if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { ++ if ((this.world.purpurConfig.alwaysTameInCreative && entityhuman.abilities.canInstantlyBuild) || (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled())) { // Purpur + this.tame(entityhuman); + this.navigation.o(); + this.setGoalTarget((EntityLiving) null); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9973677fb2ebce985b25efddc1015c6d5f0758a8..6481f8a964846ee835c2196197bd765d013377a4 100644 +index 3c0a9b8e71663ad60cf78d4f66f4fd9960f2c59b..b49a909bf1dcf0bebce3eec03b54d05583af2e43 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -255,6 +255,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0167-End-crystal-explosion-options.patch b/patches/Purpur/patches/server/0167-End-crystal-explosion-options.patch index ec6d2706..c54bbc6c 100644 --- a/patches/Purpur/patches/server/0167-End-crystal-explosion-options.patch +++ b/patches/Purpur/patches/server/0167-End-crystal-explosion-options.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Feb 2021 09:28:56 -0500 Subject: [PATCH] End crystal explosion options -diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java -index 1942fae27051af79b6eb1d790a219da100bf889e..0e2f9777fe1b62f8da20bf7559150e1dd041febc 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java -+++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java -@@ -100,6 +100,22 @@ public class EntityEnderCrystal extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java +index 2c983e6a092464d1867fcbe875b2e1461ec8556b..a92c900a6092c07b34711428fac268f446043c90 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java +@@ -118,6 +118,22 @@ public class EntityEnderCrystal extends Entity { phantomDamageCooldown = 0; idleCooldown = 60; } @@ -31,7 +31,7 @@ index 1942fae27051af79b6eb1d790a219da100bf889e..0e2f9777fe1b62f8da20bf7559150e1d // Purpur end @Override -@@ -143,15 +159,17 @@ public class EntityEnderCrystal extends Entity { +@@ -161,15 +177,17 @@ public class EntityEnderCrystal extends Entity { // CraftBukkit end this.die(); if (!damagesource.isExplosion()) { @@ -52,10 +52,10 @@ index 1942fae27051af79b6eb1d790a219da100bf889e..0e2f9777fe1b62f8da20bf7559150e1d this.a(damagesource); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 6481f8a964846ee835c2196197bd765d013377a4..20c4cd5ffe4d132012f1e55401e08cb894b80294 100644 +index b49a909bf1dcf0bebce3eec03b54d05583af2e43..16eac6648c7bb17fb10f5741857ac5e8283aed50 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -1913,4 +1913,33 @@ public class PurpurWorldConfig { +@@ -1915,4 +1915,33 @@ public class PurpurWorldConfig { private void imposeTeleportRestrictionsOnGateways() { imposeTeleportRestrictionsOnGateways = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-gateways", imposeTeleportRestrictionsOnGateways); } diff --git a/patches/Purpur/patches/server/0168-Add-unsafe-Entity-serialization-API.patch b/patches/Purpur/patches/server/0168-Add-unsafe-Entity-serialization-API.patch index 22567bc6..80574a18 100644 --- a/patches/Purpur/patches/server/0168-Add-unsafe-Entity-serialization-API.patch +++ b/patches/Purpur/patches/server/0168-Add-unsafe-Entity-serialization-API.patch @@ -16,11 +16,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . -diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 06fe0fca1936853748997c63f325df99da5fa2ee..730b91680b226df624180d64019c2984d0e29422 100644 ---- a/src/main/java/net/minecraft/server/EntityTypes.java -+++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -394,6 +394,7 @@ public class EntityTypes { +diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java +index 6eb91f73b7040c13c43c3e3c319244640bfbbeaf..72d97655906ed3798bc1ba4f647ebc75bb2e1b06 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java ++++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java +@@ -532,6 +532,7 @@ public class EntityTypes { return this.bf.create(this, world); } @@ -29,10 +29,10 @@ index 06fe0fca1936853748997c63f325df99da5fa2ee..730b91680b226df624180d64019c2984 return SystemUtils.a(a(nbttagcompound).map((entitytypes) -> { return entitytypes.a(world); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4c592f6d4d6cbeb4c3225e7794f4b1d6c8d62394..b441dac8f31b679aa7e36d23848d34e298e6abba 100644 +index a80f664d2cf713fd751421be3735e2f4779f0056..6c37bf58bd269c2d7e1c84e5791e8245e4c75aea 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1199,5 +1199,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1200,5 +1200,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean isRidableInWater() { return getHandle().isRidableInWater(); } @@ -46,7 +46,7 @@ index 4c592f6d4d6cbeb4c3225e7794f4b1d6c8d62394..b441dac8f31b679aa7e36d23848d34e2 // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 81cff601a5161c30df90de3cefc18d72cd7ee347..980696490709d04741c1617f528357100696d0e5 100644 +index eba28b9c5cb87dea09bf8430d253725f585f87b9..609eda567751b2f1cf74e9f090ca5cb0c1d771cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -390,9 +390,14 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -64,7 +64,7 @@ index 81cff601a5161c30df90de3cefc18d72cd7ee347..980696490709d04741c1617f52835710 - compound.setInt("DataVersion", getDataVersion()); + // Purpur end try { - net.minecraft.server.NBTCompressedStreamTools.writeNBT( + net.minecraft.nbt.NBTCompressedStreamTools.writeNBT( compound, @@ -405,26 +410,58 @@ public final class CraftMagicNumbers implements UnsafeValues { return outputStream.toByteArray(); @@ -79,13 +79,13 @@ index 81cff601a5161c30df90de3cefc18d72cd7ee347..980696490709d04741c1617f52835710 + // Purpur start - rework NBT <-> bytes + NBTTagCompound compound = deserializeNbtFromBytes(data, true); + Dynamic converted = DataConverterRegistry.getDataFixer().update(DataConverterTypes.ITEM_STACK, new Dynamic<>(getDynamicOpsNbtInstance(), compound), compound.getInt("DataVersion"), getDataVersion()); // TODO: obfhelper -+ return net.minecraft.server.ItemStack.fromCompound((NBTTagCompound) converted.getValue()).asBukkitMirror(); ++ return net.minecraft.world.item.ItemStack.fromCompound((NBTTagCompound) converted.getValue()).asBukkitMirror(); + } + + public NBTTagCompound deserializeNbtFromBytes(byte[] data, boolean verifyDataVersion) { + // Purpur end try { - NBTTagCompound compound = net.minecraft.server.NBTCompressedStreamTools.readNBT( + NBTTagCompound compound = net.minecraft.nbt.NBTCompressedStreamTools.readNBT( new java.io.ByteArrayInputStream(data) ); + if (verifyDataVersion) { // Purpur @@ -93,7 +93,7 @@ index 81cff601a5161c30df90de3cefc18d72cd7ee347..980696490709d04741c1617f52835710 Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); - Dynamic converted = DataConverterRegistry.getDataFixer().update(DataConverterTypes.ITEM_STACK, new Dynamic(DynamicOpsNBT.a, compound), dataVersion, getDataVersion()); -- return CraftItemStack.asCraftMirror(net.minecraft.server.ItemStack.fromCompound((NBTTagCompound) converted.getValue())); +- return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.fromCompound((NBTTagCompound) converted.getValue())); + } // Purpur + return compound; // Purpur } catch (IOException ex) { @@ -118,7 +118,7 @@ index 81cff601a5161c30df90de3cefc18d72cd7ee347..980696490709d04741c1617f52835710 + Dynamic converted = DataConverterRegistry.getDataFixer().update(DataConverterTypes.ENTITY, new Dynamic<>(getDynamicOpsNbtInstance(), compound), compound.getInt("DataVersion"), getDataVersion()); + compound = (NBTTagCompound) converted.getValue(); + compound.remove("UUID"); // Make the server make a new UUID for this entity; makes entities always spawnable. -+ return net.minecraft.server.EntityTypes.loadEntityFixedData(compound, ((org.bukkit.craftbukkit.CraftWorld) world).getHandle()) ++ return net.minecraft.world.entity.EntityTypes.loadEntityFixedData(compound, ((org.bukkit.craftbukkit.CraftWorld) world).getHandle()) + .orElseThrow(() -> new IllegalArgumentException("unknown ID was found for the data; did you downgrade?")) + .getBukkitEntity(); + } diff --git a/patches/Purpur/patches/server/0169-Add-ghast-allow-griefing-option.patch b/patches/Purpur/patches/server/0169-Add-ghast-allow-griefing-option.patch index c5cf04e4..46ee8b50 100644 --- a/patches/Purpur/patches/server/0169-Add-ghast-allow-griefing-option.patch +++ b/patches/Purpur/patches/server/0169-Add-ghast-allow-griefing-option.patch @@ -4,11 +4,11 @@ Date: Sat, 13 Feb 2021 14:02:43 -0600 Subject: [PATCH] Add ghast allow-griefing option -diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java -index 2c0148229283f95bed3c8f33cc02a31d6f682191..db96d2bb02dfeea4136eb587a7bd744c9eb30bf3 100644 ---- a/src/main/java/net/minecraft/server/EntityGhast.java -+++ b/src/main/java/net/minecraft/server/EntityGhast.java -@@ -198,6 +198,7 @@ public class EntityGhast extends EntityFlying implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +index 5c39a9aec865d25a9aa5edcfd3a0fd6d1166cbd1..4bc8b6ec44a03390ced313e84b03ab6662a3c0a2 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityGhast.java +@@ -230,6 +230,7 @@ public class EntityGhast extends EntityFlying implements IMonster { } EntityLargeFireball entitylargefireball = new EntityLargeFireball(world, this.ghast, d2, d3, d4); @@ -16,11 +16,11 @@ index 2c0148229283f95bed3c8f33cc02a31d6f682191..db96d2bb02dfeea4136eb587a7bd744c // CraftBukkit - set bukkitYield when setting explosionpower entitylargefireball.bukkitYield = entitylargefireball.yield = this.ghast.getPower(); -diff --git a/src/main/java/net/minecraft/server/EntityLargeFireball.java b/src/main/java/net/minecraft/server/EntityLargeFireball.java -index 3f3be1b2ded6ad118ae7860c1231c7affc0715b6..48174610518af8d053149e609c1b140e1ae6ba61 100644 ---- a/src/main/java/net/minecraft/server/EntityLargeFireball.java -+++ b/src/main/java/net/minecraft/server/EntityLargeFireball.java -@@ -5,6 +5,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +index 61f06eacb4ea4ef869b60c9014cc23b25583eead..627915ee205fdcc93c5424ad7d7ea05783bc07ad 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLargeFireball.java +@@ -16,6 +16,7 @@ import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit public class EntityLargeFireball extends EntityFireballFireball { public int yield = 1; @@ -28,7 +28,7 @@ index 3f3be1b2ded6ad118ae7860c1231c7affc0715b6..48174610518af8d053149e609c1b140e public EntityLargeFireball(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -20,7 +21,7 @@ public class EntityLargeFireball extends EntityFireballFireball { +@@ -31,7 +32,7 @@ public class EntityLargeFireball extends EntityFireballFireball { protected void a(MovingObjectPosition movingobjectposition) { super.a(movingobjectposition); if (!this.world.isClientSide) { @@ -38,10 +38,10 @@ index 3f3be1b2ded6ad118ae7860c1231c7affc0715b6..48174610518af8d053149e609c1b140e // CraftBukkit start - fire ExplosionPrimeEvent ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 20c4cd5ffe4d132012f1e55401e08cb894b80294..64657c3c9250d8767702a54bb0ee3a23f43da04a 100644 +index 16eac6648c7bb17fb10f5741857ac5e8283aed50..ba4377422abe55a6ce98551eb9f8633589f37f4c 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -866,6 +866,7 @@ public class PurpurWorldConfig { +@@ -868,6 +868,7 @@ public class PurpurWorldConfig { public boolean ghastRidable = false; public boolean ghastRidableInWater = false; public double ghastMaxY = 256D; @@ -49,7 +49,7 @@ index 20c4cd5ffe4d132012f1e55401e08cb894b80294..64657c3c9250d8767702a54bb0ee3a23 public double ghastMaxHealth = 10.0D; private void ghastSettings() { ghastRidable = getBoolean("mobs.ghast.ridable", ghastRidable); -@@ -876,6 +877,7 @@ public class PurpurWorldConfig { +@@ -878,6 +879,7 @@ public class PurpurWorldConfig { set("mobs.ghast.attributes.max-health", null); set("mobs.ghast.attributes.max_health", oldValue); } diff --git a/patches/Purpur/patches/server/0170-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch b/patches/Purpur/patches/server/0170-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch index 3c7edafb..afe2118d 100644 --- a/patches/Purpur/patches/server/0170-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch +++ b/patches/Purpur/patches/server/0170-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch @@ -4,11 +4,11 @@ Date: Sat, 20 Feb 2021 14:47:08 -0800 Subject: [PATCH] Configs for if Wither/Ender Dragon can ride vehicles -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 49a1447bae91294a23ccab27c2809bea0c4c90a3..94af972e115491d0f4394dd290ec2d9d426b8d32 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2274,7 +2274,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index fcbbf100990faf60250357b744cbd58701da0b0c..d321616b7f726f4ff307b46ced9efce6cc20b82f 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -2370,7 +2370,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } } @@ -17,11 +17,11 @@ index 49a1447bae91294a23ccab27c2809bea0c4c90a3..94af972e115491d0f4394dd290ec2d9d return !this.isSneaking() && this.j <= 0; } -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index e2377c6e8a98be431953533bf0b2060028caad45..a495c14b9f168884a0bba6b95d28c9ecfa9dfdab 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -1023,6 +1023,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index a81d782877ff6116477792fa4cec0846e56ed384..6b0a71ce1c51e587ee17c8d60aaa52bbc87fb321 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -1073,6 +1073,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @Override protected boolean n(Entity entity) { @@ -29,11 +29,11 @@ index e2377c6e8a98be431953533bf0b2060028caad45..a495c14b9f168884a0bba6b95d28c9ec return false; } -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 7d5183cd2121092f7342a282ba98f659f10f19f8..2c81a5d1381afa37b966625d3a6ec6cf603f466d 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -673,6 +673,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +index fa6b72c7a12b20f8ccffa360a3895e4d8f4277e4..4a3e0f7f59ca4fd64be62a580d08b6ab84649ee8 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java ++++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +@@ -730,6 +730,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { @Override protected boolean n(Entity entity) { @@ -42,10 +42,10 @@ index 7d5183cd2121092f7342a282ba98f659f10f19f8..2c81a5d1381afa37b966625d3a6ec6cf } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 64657c3c9250d8767702a54bb0ee3a23f43da04a..958b0ee8af21e4176e9d35af88294919c509a2c1 100644 +index ba4377422abe55a6ce98551eb9f8633589f37f4c..d4f7d0550b499018896964e2528f2481e2245dc6 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -773,6 +773,7 @@ public class PurpurWorldConfig { +@@ -775,6 +775,7 @@ public class PurpurWorldConfig { public boolean enderDragonAlwaysDropsFullExp = false; public boolean enderDragonBypassMobGriefing = false; public double enderDragonMaxHealth = 200.0D; @@ -53,7 +53,7 @@ index 64657c3c9250d8767702a54bb0ee3a23f43da04a..958b0ee8af21e4176e9d35af88294919 private void enderDragonSettings() { enderDragonRidable = getBoolean("mobs.ender_dragon.ridable", enderDragonRidable); enderDragonRidableInWater = getBoolean("mobs.ender_dragon.ridable-in-water", enderDragonRidableInWater); -@@ -789,6 +790,7 @@ public class PurpurWorldConfig { +@@ -791,6 +792,7 @@ public class PurpurWorldConfig { set("mobs.ender_dragon.attributes.max_health", oldValue); } enderDragonMaxHealth = getDouble("mobs.ender_dragon.attributes.max_health", enderDragonMaxHealth); @@ -61,7 +61,7 @@ index 64657c3c9250d8767702a54bb0ee3a23f43da04a..958b0ee8af21e4176e9d35af88294919 } public boolean endermanRidable = false; -@@ -1731,6 +1733,7 @@ public class PurpurWorldConfig { +@@ -1733,6 +1735,7 @@ public class PurpurWorldConfig { public float witherHealthRegenAmount = 1.0f; public int witherHealthRegenDelay = 20; public double witherMaxHealth = 300.0D; @@ -69,7 +69,7 @@ index 64657c3c9250d8767702a54bb0ee3a23f43da04a..958b0ee8af21e4176e9d35af88294919 private void witherSettings() { witherRidable = getBoolean("mobs.wither.ridable", witherRidable); witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater); -@@ -1748,6 +1751,7 @@ public class PurpurWorldConfig { +@@ -1750,6 +1753,7 @@ public class PurpurWorldConfig { set("mobs.wither.attributes.max_health", oldValue); } witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth); diff --git a/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch b/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch index 6b4f4596..61590813 100644 --- a/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch +++ b/patches/Purpur/patches/server/0171-Dont-run-with-scissors.patch @@ -4,17 +4,17 @@ Date: Fri, 5 Mar 2021 14:23:16 -0500 Subject: [PATCH] Dont run with scissors! -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f7a031920c68d5d5d505d86ab1b513ac53f5bf84..100ab4ae37a0d71a0d9bc3202802f705e1260ee1 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1388,6 +1388,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index c7c26cd1b99c911efd12e325e0ca09d9ac98c6f4..bdcc8ced52a858d2dd0bbfaab5a21197327d4dda 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -1533,6 +1533,12 @@ public class PlayerConnection implements PacketListenerPlayIn { this.player.fallDistance = 0.0F; } + // Purpur Start + if (this.player.isSprinting() && this.player.getWorldServer().purpurConfig.dontRunWithScissors && (this.player.getItemInHand(EnumHand.MAIN_HAND).getItem() == Items.SHEARS || this.player.getItemInHand(EnumHand.OFF_HAND).getItem() == Items.SHEARS) && (int) (Math.random() * 10) == 0) { -+ this.player.damageEntity(net.minecraft.server.DamageSource.MAGIC, (float) this.player.getWorldServer().purpurConfig.scissorsRunningDamage); ++ this.player.damageEntity(net.minecraft.world.damagesource.DamageSource.MAGIC, (float) this.player.getWorldServer().purpurConfig.scissorsRunningDamage); + } + // Purpur End + @@ -22,7 +22,7 @@ index f7a031920c68d5d5d505d86ab1b513ac53f5bf84..100ab4ae37a0d71a0d9bc3202802f705 this.o = this.player.locX(); this.p = this.player.locY(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 958b0ee8af21e4176e9d35af88294919c509a2c1..5f14c6c0e62ce5bece342b850e201357314061b2 100644 +index d4f7d0550b499018896964e2528f2481e2245dc6..7f5383518d45134bc2e3e39de310f8fa4ecf2451 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -168,6 +168,8 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0172-One-Punch-Man.patch b/patches/Purpur/patches/server/0172-One-Punch-Man.patch index 99180ad0..3d3e89b4 100644 --- a/patches/Purpur/patches/server/0172-One-Punch-Man.patch +++ b/patches/Purpur/patches/server/0172-One-Punch-Man.patch @@ -4,11 +4,11 @@ Date: Fri, 5 Mar 2021 17:42:35 -0500 Subject: [PATCH] One Punch Man! -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 50fa5f8395fea3ba6fa202a5a38519cd55ae00e0..90d41b9e286064f11ce55badfb76574778d933a6 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1921,6 +1921,23 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 66f1750172df09f1cbb47ca5a679a77a9ccab282..659ccc8075945531ca714c43a034f2d5baa5defb 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2019,6 +2019,23 @@ public abstract class EntityLiving extends Entity { ((EntityPlayer) damagesource.getEntity()).a(StatisticList.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F)); } @@ -32,11 +32,11 @@ index 50fa5f8395fea3ba6fa202a5a38519cd55ae00e0..90d41b9e286064f11ce55badfb765747 if (f > 0 || !human) { if (human) { // PAIL: Be sure to drag all this code from the EntityHuman subclass each update. -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 3f9062d8eca3ce53c0fb9e9e40330aa4e3296c9a..47e3ac6bcebacd9c424ddcc49774e06e05f02fe2 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -842,6 +842,7 @@ public final class ItemStack { +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 132972755ac74838f3386e0fac5033380b71fce5..26fff0540e3d8863e83b0a60df2205422d50f1e1 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -897,6 +897,7 @@ public final class ItemStack { this.getOrCreateTag().setInt("RepairCost", i); } @@ -45,7 +45,7 @@ index 3f9062d8eca3ce53c0fb9e9e40330aa4e3296c9a..47e3ac6bcebacd9c424ddcc49774e06e Object object; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 5f14c6c0e62ce5bece342b850e201357314061b2..1e7c75c1f8830b5c2660c2cf8aab0167916ff501 100644 +index 7f5383518d45134bc2e3e39de310f8fa4ecf2451..ef75a80793a5a36177dd99879d19a91a52077e95 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -274,6 +274,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0173-Add-config-for-snow-on-blue-ice.patch b/patches/Purpur/patches/server/0173-Add-config-for-snow-on-blue-ice.patch index bd9867df..4aaeb30a 100644 --- a/patches/Purpur/patches/server/0173-Add-config-for-snow-on-blue-ice.patch +++ b/patches/Purpur/patches/server/0173-Add-config-for-snow-on-blue-ice.patch @@ -4,11 +4,11 @@ Date: Fri, 5 Mar 2021 17:59:05 -0600 Subject: [PATCH] Add config for snow on blue ice -diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java -index 66f188c9eb6431eedfd655a1dd4a35b5141e7196..21fd6689e1e6e837debc3c39d155402bca084595 100644 ---- a/src/main/java/net/minecraft/server/BlockSnow.java -+++ b/src/main/java/net/minecraft/server/BlockSnow.java -@@ -56,7 +56,18 @@ public class BlockSnow extends Block { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockSnow.java b/src/main/java/net/minecraft/world/level/block/BlockSnow.java +index d44b88185ce58346007c6ef70b76f8e0df23e95c..4b7497acc5b26da48375625b4a31fb057805344d 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockSnow.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockSnow.java +@@ -74,7 +74,18 @@ public class BlockSnow extends Block { public boolean canPlace(IBlockData iblockdata, IWorldReader iworldreader, BlockPosition blockposition) { IBlockData iblockdata1 = iworldreader.getType(blockposition.down()); @@ -29,7 +29,7 @@ index 66f188c9eb6431eedfd655a1dd4a35b5141e7196..21fd6689e1e6e837debc3c39d155402b @Override diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 1e7c75c1f8830b5c2660c2cf8aab0167916ff501..bf8a842e7c43946c87c8f27afdf364b1475cf44e 100644 +index ef75a80793a5a36177dd99879d19a91a52077e95..3e7ec07ab595998b0a13ac9e44f5a5b9d0d45d03 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -419,6 +419,11 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0174-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch b/patches/Purpur/patches/server/0174-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch index 61c8b834..6669ce79 100644 --- a/patches/Purpur/patches/server/0174-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch +++ b/patches/Purpur/patches/server/0174-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch @@ -7,11 +7,11 @@ Subject: [PATCH] Configurable Ender Pearl cooldown, damage, and Endermite RNG - Damage dealt on pearl usage - Endermite spawn chance -diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java -index 44dbe818b19c927098c1e6b2bcb556378be5637c..a1a070e786a7b587d103809957ec4f70f30f999a 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderPearl.java -+++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java -@@ -54,7 +54,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java b/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java +index cf2c691357c41a7e7044f7a719144db2ffab5dbe..d80c1abefe53e6b20dd2a020f60c11e380b57bb1 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityEnderPearl.java +@@ -69,7 +69,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { Bukkit.getPluginManager().callEvent(teleEvent); if (!teleEvent.isCancelled() && !entityplayer.playerConnection.isDisconnected()) { @@ -20,7 +20,7 @@ index 44dbe818b19c927098c1e6b2bcb556378be5637c..a1a070e786a7b587d103809957ec4f70 EntityEndermite entityendermite = (EntityEndermite) EntityTypes.ENDERMITE.a(this.world); entityendermite.setPlayerSpawned(true); -@@ -69,7 +69,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { +@@ -84,7 +84,7 @@ public class EntityEnderPearl extends EntityProjectileThrowable { entityplayer.playerConnection.teleport(teleEvent.getTo()); entity.fallDistance = 0.0F; CraftEventFactory.entityDamage = this; @@ -29,21 +29,21 @@ index 44dbe818b19c927098c1e6b2bcb556378be5637c..a1a070e786a7b587d103809957ec4f70 CraftEventFactory.entityDamage = null; } // CraftBukkit end -diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java -index 0e154ee2976694dacf8d41fcd831f21fbbda13af..f2cafb9f9365a3428f8fa0c35e9b6045d5729a8f 100644 ---- a/src/main/java/net/minecraft/server/ItemEnderPearl.java -+++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java -@@ -27,7 +27,7 @@ public class ItemEnderPearl extends Item { +diff --git a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java +index 9896d77381e7fadf1ef2619210713e190c1445d0..61512c6755f29cb2c228ae3e80b1e08348d784a5 100644 +--- a/src/main/java/net/minecraft/world/item/ItemEnderPearl.java ++++ b/src/main/java/net/minecraft/world/item/ItemEnderPearl.java +@@ -36,7 +36,7 @@ public class ItemEnderPearl extends Item { - world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (net.minecraft.world.entity.Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); entityhuman.b(StatisticList.ITEM_USED.b(this)); - entityhuman.getCooldownTracker().setCooldown(this, 20); + entityhuman.getCooldownTracker().setCooldown(this, entityhuman.abilities.canInstantlyBuild ? world.purpurConfig.enderPearlCooldownCreative : world.purpurConfig.enderPearlCooldown); // Purpur } else { // Paper end - if (entityhuman instanceof EntityPlayer) { + if (entityhuman instanceof net.minecraft.server.level.EntityPlayer) { diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index bf8a842e7c43946c87c8f27afdf364b1475cf44e..9b7c1b16ad191f58fea0625ebf547431a6e8ddad 100644 +index 3e7ec07ab595998b0a13ac9e44f5a5b9d0d45d03..c5a8f78563abc4dae68254b599b2ee60dee6d416 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -170,6 +170,10 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0175-Config-to-ignore-nearby-mobs-when-sleeping.patch b/patches/Purpur/patches/server/0175-Config-to-ignore-nearby-mobs-when-sleeping.patch index 28a56a87..957ab72b 100644 --- a/patches/Purpur/patches/server/0175-Config-to-ignore-nearby-mobs-when-sleeping.patch +++ b/patches/Purpur/patches/server/0175-Config-to-ignore-nearby-mobs-when-sleeping.patch @@ -4,11 +4,11 @@ Date: Mon, 8 Mar 2021 16:46:54 -0500 Subject: [PATCH] Config to ignore nearby mobs when sleeping -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index eb62597449081656a05073e5bbf878f893166b53..e384a24d9b46587f66ee3e712a8206b1ca1f3877 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1311,7 +1311,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index ccee67df065dcdee5e0e24ab12476572ca696687..b4dbc59faff3fd6ceb74d829762eb68e649975c5 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -1443,7 +1443,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return entitymonster.f((EntityHuman) this); }); @@ -18,7 +18,7 @@ index eb62597449081656a05073e5bbf878f893166b53..e384a24d9b46587f66ee3e712a8206b1 } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 9b7c1b16ad191f58fea0625ebf547431a6e8ddad..839b76e406d9374c1b3aff7adee82acaa7d89dc9 100644 +index c5a8f78563abc4dae68254b599b2ee60dee6d416..fc68963c47d37b9ecec5debc367efe4647d67b2e 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -283,6 +283,7 @@ public class PurpurWorldConfig { diff --git a/patches/Purpur/patches/server/0176-Config-for-Enderman-to-aggro-spawned-Endermites.patch b/patches/Purpur/patches/server/0176-Config-for-Enderman-to-aggro-spawned-Endermites.patch index 2e902a6e..c5cfbc69 100644 --- a/patches/Purpur/patches/server/0176-Config-for-Enderman-to-aggro-spawned-Endermites.patch +++ b/patches/Purpur/patches/server/0176-Config-for-Enderman-to-aggro-spawned-Endermites.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Config for Enderman to aggro spawned Endermites By default, Enderman do not attack Endermites unless spawned by an Ender Pearl. -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index b884addf2ce6f1ef7394658078deb2e75370654f..6c60253fee2098889292837033396f0dcd75c4b7 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -16,7 +16,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index d290787f74579dd4c138eb827e44544814bfe315..46143a710e057378ebe0ad644de275604b11d886 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -72,7 +72,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { private static final DataWatcherObject bo = DataWatcher.a(EntityEnderman.class, DataWatcherRegistry.i); private static final DataWatcherObject bp = DataWatcher.a(EntityEnderman.class, DataWatcherRegistry.i); private static final Predicate bq = (entityliving) -> { @@ -19,10 +19,10 @@ index b884addf2ce6f1ef7394658078deb2e75370654f..6c60253fee2098889292837033396f0d private int br = Integer.MIN_VALUE; private int bs; diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 839b76e406d9374c1b3aff7adee82acaa7d89dc9..28814c8b5ecab56fca113e741305ac5dc4f49e8c 100644 +index fc68963c47d37b9ecec5debc367efe4647d67b2e..f6d6e57a0dea4d9e0de04caaab530682e3b212d5 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -821,6 +821,7 @@ public class PurpurWorldConfig { +@@ -823,6 +823,7 @@ public class PurpurWorldConfig { public boolean endermanDespawnEvenWithBlock = false; public double endermanMaxHealth = 40.0D; public boolean endermanTakeDamageFromWater = true; @@ -30,7 +30,7 @@ index 839b76e406d9374c1b3aff7adee82acaa7d89dc9..28814c8b5ecab56fca113e741305ac5d private void endermanSettings() { endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable); endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater); -@@ -834,6 +835,7 @@ public class PurpurWorldConfig { +@@ -836,6 +837,7 @@ public class PurpurWorldConfig { } endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth); endermanTakeDamageFromWater = getBoolean("mobs.enderman.takes-damage-from-water", endermanTakeDamageFromWater); diff --git a/patches/Purpur/patches/server/0177-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch b/patches/Purpur/patches/server/0177-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch index b7188141..8ab2aac4 100644 --- a/patches/Purpur/patches/server/0177-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch +++ b/patches/Purpur/patches/server/0177-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch @@ -6,11 +6,19 @@ Subject: [PATCH] Config to ignore Dragon Head wearers and stare aggro Prevents Enderman from becoming aggresive towards players that are wearing a Dragon Head. Adds functionality to a useless item! -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 6c60253fee2098889292837033396f0dcd75c4b7..df4d5ed5957658ee9ca083ac79b38a1202fe7015 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -197,7 +197,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +index 46143a710e057378ebe0ad644de275604b11d886..0ed19429c1a9021e636fdfffa582b4e093fbc2e7 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java +@@ -50,6 +50,7 @@ import net.minecraft.world.entity.ai.goal.target.PathfinderGoalUniversalAngerRes + import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition; + import net.minecraft.world.entity.player.EntityHuman; + import net.minecraft.world.item.ItemStack; ++import net.minecraft.world.item.Items; + import net.minecraft.world.level.GameRules; + import net.minecraft.world.level.GeneratorAccess; + import net.minecraft.world.level.IMaterial; +@@ -253,7 +254,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { // Paper end ItemStack itemstack = (ItemStack) entityhuman.inventory.armor.get(3); @@ -20,10 +28,10 @@ index 6c60253fee2098889292837033396f0dcd75c4b7..df4d5ed5957658ee9ca083ac79b38a12 } else { Vec3D vec3d = entityhuman.f(1.0F).d(); diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -index 28814c8b5ecab56fca113e741305ac5dc4f49e8c..45c5b7b9e7b207e25d80c008a87b06b91e81668b 100644 +index f6d6e57a0dea4d9e0de04caaab530682e3b212d5..fc29c54ee69bd39dec95cc5e877f5b6fb6bba442 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java -@@ -822,6 +822,8 @@ public class PurpurWorldConfig { +@@ -824,6 +824,8 @@ public class PurpurWorldConfig { public double endermanMaxHealth = 40.0D; public boolean endermanTakeDamageFromWater = true; public boolean endermanAggroSpawnedEndermites = false; @@ -32,7 +40,7 @@ index 28814c8b5ecab56fca113e741305ac5dc4f49e8c..45c5b7b9e7b207e25d80c008a87b06b9 private void endermanSettings() { endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable); endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater); -@@ -836,6 +838,8 @@ public class PurpurWorldConfig { +@@ -838,6 +840,8 @@ public class PurpurWorldConfig { endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth); endermanTakeDamageFromWater = getBoolean("mobs.enderman.takes-damage-from-water", endermanTakeDamageFromWater); endermanAggroSpawnedEndermites = getBoolean("mobs.enderman.aggressive-towards-spawned-endermites", endermanAggroSpawnedEndermites); diff --git a/patches/Purpur/patches/server/0178-Tick-fluids-config.patch b/patches/Purpur/patches/server/0178-Tick-fluids-config.patch new file mode 100644 index 00000000..dddf56e1 --- /dev/null +++ b/patches/Purpur/patches/server/0178-Tick-fluids-config.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Mon, 15 Mar 2021 03:52:17 -0500 +Subject: [PATCH] Tick fluids config + + +diff --git a/src/main/java/net/minecraft/world/level/block/BlockFluids.java b/src/main/java/net/minecraft/world/level/block/BlockFluids.java +index 0ed8d938b8fafdb03e01a00a201ba3f8597ac6e9..0eff89bf9e114271c34c37cad1b98691902529ac 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockFluids.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockFluids.java +@@ -100,7 +100,7 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { +- if (this.a(world, blockposition, iblockdata)) { ++ if (world.purpurConfig.tickFluids && this.a(world, blockposition, iblockdata)) { // Purpur + world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.getFlowSpeed(world, blockposition)); // Paper + } + +@@ -125,7 +125,7 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { +- if (iblockdata.getFluid().isSource() || iblockdata1.getFluid().isSource()) { ++ if (generatoraccess.getMinecraftWorld().purpurConfig.tickFluids && iblockdata.getFluid().isSource() || iblockdata1.getFluid().isSource()) { // Purpur + generatoraccess.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.b.a((IWorldReader) generatoraccess)); + } + +@@ -134,7 +134,7 @@ public class BlockFluids extends Block implements IFluidSource { + + @Override + public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) { +- if (this.a(world, blockposition, iblockdata)) { ++ if (world.purpurConfig.tickFluids && this.a(world, blockposition, iblockdata)) { // Purpur + world.getFluidTickList().a(blockposition, iblockdata.getFluid().getType(), this.getFlowSpeed(world, blockposition)); // Paper + } + +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index fc29c54ee69bd39dec95cc5e877f5b6fb6bba442..ca108b3163c31fddd43112123c1c4cb70ba26bc9 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -261,6 +261,11 @@ public class PurpurWorldConfig { + witherSkullDespawnRate = getInt("gameplay-mechanics.projectile-despawn-rates.wither_skull", witherSkullDespawnRate); + } + ++ public boolean tickFluids = true; ++ private void fluidSettings() { ++ tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids); ++ } ++ + public int snowballDamage = -1; + private void snowballSettings() { + snowballDamage = getInt("gameplay-mechanics.projectile-damage.snowball", snowballDamage); diff --git a/patches/Purpur/patches/server/0179-Config-to-disable-Llama-caravans.patch b/patches/Purpur/patches/server/0179-Config-to-disable-Llama-caravans.patch new file mode 100644 index 00000000..9a97ac71 --- /dev/null +++ b/patches/Purpur/patches/server/0179-Config-to-disable-Llama-caravans.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Encode42 +Date: Wed, 17 Mar 2021 10:12:53 -0400 +Subject: [PATCH] Config to disable Llama caravans + +Disables the mechanic where llamas follow leashed llamas. + +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java +index 34a854131dd939693a6df4d52103714ebe373dc3..ea02a78c31ed43220a2b83be4bd2a896500a70b8 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java +@@ -23,7 +23,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal { + + @Override + public boolean a() { +- if (!getLlama().shouldJoinCaravan) return false; // Purpur ++ if (!getLlama().world.purpurConfig.llamaCaravans || !getLlama().shouldJoinCaravan) return false; // Purpur + if (!this.a.isLeashed() && !this.a.fC()) { + List list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> { + EntityTypes entitytypes = entity.getEntityType(); +diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +index 762fed5ba27474951c1962e6f034e8494b1035d6..567a1da3c167c20ae3fb86c2a1f3608ebb1056b6 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java ++++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java +@@ -518,7 +518,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn + + public void joinCaravan(EntityLlama entitiyllama) { a(entitiyllama); } // Purpur - OBFHELPER + public void a(EntityLlama entityllama) { +- if (!shouldJoinCaravan || !new net.pl3x.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) entityllama.getBukkitEntity()).callEvent()) return; // Purpur ++ if (!this.world.purpurConfig.llamaCaravans || !shouldJoinCaravan || !new net.pl3x.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) entityllama.getBukkitEntity()).callEvent()) return; // Purpur + this.bB = entityllama; + this.bB.bC = this; + } +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index ca108b3163c31fddd43112123c1c4cb70ba26bc9..886d04393bfbd25d3c0131520e239ac0c3404654 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -1063,6 +1063,7 @@ public class PurpurWorldConfig { + + public boolean llamaRidable = false; + public boolean llamaRidableInWater = false; ++ public boolean llamaCaravans = true; + public int llamaBreedingTicks = 6000; + public double llamaMaxHealthMin = 15.0D; + public double llamaMaxHealthMax = 30.0D; +@@ -1073,6 +1074,7 @@ public class PurpurWorldConfig { + private void llamaSettings() { + llamaRidable = getBoolean("mobs.llama.ridable", llamaRidable); + llamaRidableInWater = getBoolean("mobs.llama.ridable-in-water", llamaRidableInWater); ++ llamaCaravans = getBoolean("mobs.llama.join-caravans", llamaCaravans); + llamaBreedingTicks = getInt("mobs.llama.breeding-delay-ticks", llamaBreedingTicks); + if (PurpurConfig.version < 10) { + double oldMin = getDouble("mobs.llama.attributes.max-health.min", llamaMaxHealthMin); diff --git a/patches/Purpur/patches/server/0180-Config-to-make-Creepers-explode-on-death.patch b/patches/Purpur/patches/server/0180-Config-to-make-Creepers-explode-on-death.patch new file mode 100644 index 00000000..768e6a77 --- /dev/null +++ b/patches/Purpur/patches/server/0180-Config-to-make-Creepers-explode-on-death.patch @@ -0,0 +1,77 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Encode42 +Date: Tue, 16 Mar 2021 19:50:58 -0400 +Subject: [PATCH] Config to make Creepers explode on death + +Creepers exploded after being killed in the alpha days. This brings that back. + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +index 6461e09e05f9255a399a6ce65d8fb90789a2fd7f..5e70746494c5397d4d798d24b7292c57d145aef2 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java +@@ -7,6 +7,7 @@ import net.minecraft.network.syncher.DataWatcher; + import net.minecraft.network.syncher.DataWatcherObject; + import net.minecraft.network.syncher.DataWatcherRegistry; + import net.minecraft.server.PathfinderGoalHasRider; ++import net.minecraft.server.level.EntityPlayer; + import net.minecraft.server.level.WorldServer; + import net.minecraft.sounds.SoundEffect; + import net.minecraft.sounds.SoundEffects; +@@ -63,6 +64,7 @@ public class EntityCreeper extends EntityMonster { + private int spacebarCharge = 0; + private int prevSpacebarCharge = 0; + private int powerToggleDelay = 0; ++ private boolean exploding = false; + // Purpur end + + public EntityCreeper(EntityTypes entitytypes, World world) { +@@ -142,6 +144,14 @@ public class EntityCreeper extends EntityMonster { + public void initAttributes() { + this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.creeperMaxHealth); + } ++ ++ protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { ++ if (!exploding && this.world.purpurConfig.creeperExplodeWhenKilled && damagesource.getEntity() instanceof EntityPlayer) { ++ this.explode(); ++ } ++ ++ return super.d(damagesource); ++ } + // Purpur end + + @Override +@@ -327,6 +337,7 @@ public class EntityCreeper extends EntityMonster { + } + + public void explode() { ++ this.exploding = true; // Purpur + if (!this.world.isClientSide) { + Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) && world.purpurConfig.creeperAllowGriefing ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; // Purpur + float f = this.isPowered() ? 2.0F : 1.0F; +@@ -346,6 +357,7 @@ public class EntityCreeper extends EntityMonster { + // CraftBukkit end + } + ++ this.exploding = false; // Purpur + } + + private void createEffectCloud() { +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 886d04393bfbd25d3c0131520e239ac0c3404654..d975b08e3ef4921f17fc0aac85cfa7d9febb9054 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -699,12 +699,14 @@ public class PurpurWorldConfig { + + public boolean creeperRidable = false; + public boolean creeperRidableInWater = false; ++ public boolean creeperExplodeWhenKilled = false; + public boolean creeperAllowGriefing = true; + public double creeperChargedChance = 0.0D; + public double creeperMaxHealth = 20.0D; + private void creeperSettings() { + creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable); + creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater); ++ creeperExplodeWhenKilled = getBoolean("mobs.creeper.explode-when-killed", creeperExplodeWhenKilled); + creeperAllowGriefing = getBoolean("mobs.creeper.allow-griefing", creeperAllowGriefing); + creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance); + if (PurpurConfig.version < 10) { diff --git a/patches/Purpur/patches/server/0181-Configurable-ravager-griefable-blocks-list.patch b/patches/Purpur/patches/server/0181-Configurable-ravager-griefable-blocks-list.patch new file mode 100644 index 00000000..3c8afddc --- /dev/null +++ b/patches/Purpur/patches/server/0181-Configurable-ravager-griefable-blocks-list.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Wed, 17 Mar 2021 14:54:43 -0500 +Subject: [PATCH] Configurable ravager griefable blocks list + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +index 6809c93fe435d183a27204fb4460fd68a86aa04f..aee5e370907d238cb0a0fb55a45341c8f60ed7d0 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java ++++ b/src/main/java/net/minecraft/world/entity/monster/EntityRavager.java +@@ -189,7 +189,7 @@ public class EntityRavager extends EntityRaider { + IBlockData iblockdata = this.world.getType(blockposition); + Block block = iblockdata.getBlock(); + +- if (block instanceof BlockLeaves && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit ++ if (world.purpurConfig.ravagerGriefableBlocks.contains(block) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.getBlockData()).isCancelled()) { // CraftBukkit // Purpur + flag = this.world.a(blockposition, true, this) || flag; + } + } +diff --git a/src/main/java/net/minecraft/world/level/block/BlockCrops.java b/src/main/java/net/minecraft/world/level/block/BlockCrops.java +index 5f8366beeaac7153a0421554f9bf91fbf265edca..7fca4d1713e8061d9de825cdae48401217d4c6b1 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockCrops.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockCrops.java +@@ -160,7 +160,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement + + @Override + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) { +- if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))).isCancelled()) { // CraftBukkit // Purpur ++ if (entity instanceof EntityRavager && world.purpurConfig.ravagerGriefableBlocks.contains(world.getType(blockposition).getBlock()) && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), (!world.purpurConfig.ravagerBypassMobGriefing && !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING))).isCancelled()) { // CraftBukkit // Purpur + world.a(blockposition, true, entity); + } + +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index d975b08e3ef4921f17fc0aac85cfa7d9febb9054..94f975521e9770577975810bb2c6c40d96303392 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -1404,6 +1404,7 @@ public class PurpurWorldConfig { + public boolean ravagerRidableInWater = false; + public boolean ravagerBypassMobGriefing = false; + public double ravagerMaxHealth = 100.0D; ++ public List ravagerGriefableBlocks = new ArrayList<>(); + private void ravagerSettings() { + ravagerRidable = getBoolean("mobs.ravager.ridable", ravagerRidable); + ravagerRidableInWater = getBoolean("mobs.ravager.ridable-in-water", ravagerRidableInWater); +@@ -1414,6 +1415,23 @@ public class PurpurWorldConfig { + set("mobs.ravager.attributes.max_health", oldValue); + } + ravagerMaxHealth = getDouble("mobs.ravager.attributes.max_health", ravagerMaxHealth); ++ getList("mobs.ravager.griefable-blocks", new ArrayList(){{ ++ add("minecraft:oak_leaves"); ++ add("minecraft:spruce_leaves"); ++ add("minecraft:birch_leaves"); ++ add("minecraft:jungle_leaves"); ++ add("minecraft:acacia_leaves"); ++ add("minecraft:dark_oak_leaves"); ++ add("minecraft:beetroots"); ++ add("minecraft:carrots"); ++ add("minecraft:potatoes"); ++ add("minecraft:wheat"); ++ }}).forEach(key -> { ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(key.toString())); ++ if (!block.getBlockData().isAir()) { ++ ravagerGriefableBlocks.add(block); ++ } ++ }); + } + + public boolean salmonRidable = false; diff --git a/patches/Purpur/patches/server/0182-Sneak-to-bulk-process-composter.patch b/patches/Purpur/patches/server/0182-Sneak-to-bulk-process-composter.patch new file mode 100644 index 00000000..4195347f --- /dev/null +++ b/patches/Purpur/patches/server/0182-Sneak-to-bulk-process-composter.patch @@ -0,0 +1,61 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Sun, 21 Mar 2021 15:49:15 -0500 +Subject: [PATCH] Sneak to bulk process composter + + +diff --git a/src/main/java/net/minecraft/world/level/block/BlockComposter.java b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +index e4e519ba773388b8d26a8f794a6eff51e3d8f72e..c0b235d5edf3cd14021696d1b4f76ce3de41f5d5 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockComposter.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +@@ -44,7 +44,7 @@ import org.bukkit.craftbukkit.util.DummyGeneratorAccess; + + public class BlockComposter extends Block implements IInventoryHolder { + +- public static final BlockStateInteger a = BlockProperties.as; ++ public static final BlockStateInteger a = BlockProperties.as; public static BlockStateInteger level() { return BlockComposter.a; } // Purpur - OBFHELPER + public static final Object2FloatMap b = new Object2FloatOpenHashMap(); + private static final VoxelShape c = VoxelShapes.b(); + private static final VoxelShape[] d = (VoxelShape[]) SystemUtils.a((new VoxelShape[9]), (avoxelshape) -> { // CraftBukkit - decompile error +@@ -203,6 +203,25 @@ public class BlockComposter extends Block implements IInventoryHolder { + public static IBlockData a(IBlockData iblockdata, WorldServer worldserver, ItemStack itemstack, BlockPosition blockposition, Entity entity) { // CraftBukkit + int i = (Integer) iblockdata.get(BlockComposter.a); + ++ // Purpur start ++ IBlockData newState = process(i, iblockdata, worldserver, itemstack, blockposition, entity); ++ ++ if (worldserver.purpurConfig.composterBulkProcess && entity.isSneaking()) { ++ IBlockData oldState; ++ int oldCount, newCount, oldLevel, newLevel; ++ do { ++ oldState = newState; ++ oldCount = itemstack.getCount(); ++ oldLevel = oldState.get(BlockComposter.level()); ++ newState = process(oldLevel, oldState, worldserver, itemstack, blockposition, entity); ++ newCount = itemstack.getCount(); ++ newLevel = newState.get(BlockComposter.level()); ++ } while (newCount > 0 && (newCount != oldCount || newLevel != oldLevel || newState != oldState)); ++ } ++ return newState; ++ } ++ private static IBlockData process(int i, IBlockData iblockdata, WorldServer worldserver, ItemStack itemstack, BlockPosition blockposition, Entity entity) { ++ // Purpur end + if (i < 7 && BlockComposter.b.containsKey(itemstack.getItem())) { + // CraftBukkit start + double rand = worldserver.getRandom().nextDouble(); +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index 94f975521e9770577975810bb2c6c40d96303392..546d10217ffdf6de4c0c76ad4a55911b9fb6e903 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 { + chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop); + } + ++ public boolean composterBulkProcess = false; ++ private void composterSettings() { ++ composterBulkProcess = getBoolean("blocks.composter.sneak-to-bulk-process", composterBulkProcess); ++ } ++ + public boolean dispenserApplyCursedArmor = true; + public boolean dispenserPlaceAnvils = false; + private void dispenserSettings() { diff --git a/patches/Tuinity/patches/api/0001-Tuinity-POM-Changes.patch b/patches/Tuinity/patches/api/0001-Tuinity-POM-Changes.patch index 96539f34..54fc5454 100644 --- a/patches/Tuinity/patches/api/0001-Tuinity-POM-Changes.patch +++ b/patches/Tuinity/patches/api/0001-Tuinity-POM-Changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Tuinity POM Changes diff --git a/pom.xml b/pom.xml -index ff3894bfa4ddb54b56c28792debaf2218ee3a044..821df3413345c613eccff158f8081cf9ba848a14 100644 +index e66661eb84308dc13faa0d39b7487f40c1180443..6c200882954adc4831307f3d6dfa3202571fb30b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,18 @@ diff --git a/patches/Tuinity/patches/server/0001-Tuinity-POM-Changes.patch b/patches/Tuinity/patches/server/0001-Tuinity-POM-Changes.patch index 01de272b..b15cf66b 100644 --- a/patches/Tuinity/patches/server/0001-Tuinity-POM-Changes.patch +++ b/patches/Tuinity/patches/server/0001-Tuinity-POM-Changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Tuinity POM Changes diff --git a/pom.xml b/pom.xml -index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..650c6b91440d4ce1c5f82517a00056673750e74e 100644 +index 25ec9c4f8c08551fd80a597a1b39854e70e4f895..5d5cf802e6b6a0d90bf8326e7761c6d358b63b3f 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ @@ -44,7 +44,7 @@ index 9ba379b7e3ee3bc8c6d2c8ec46213c404c73d682..650c6b91440d4ce1c5f82517a0005667 ${project.version} compile -@@ -173,15 +173,15 @@ +@@ -153,15 +153,15 @@ diff --git a/patches/Tuinity/patches/server/0002-Brand-changes.patch b/patches/Tuinity/patches/server/0002-Brand-changes.patch index d157ca2f..7273583d 100644 --- a/patches/Tuinity/patches/server/0002-Brand-changes.patch +++ b/patches/Tuinity/patches/server/0002-Brand-changes.patch @@ -27,10 +27,10 @@ index dee00aac05f1acf050f05d4db557a08dd0f301c8..52c0ab1ce46e1f3233ef746d9bc69935 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java -index 550232cb3819138b3bae0fa1c51429485e8bc593..229c3b0f0c650b501f31147adaa17194af57fedd 100644 +index a0f53c9eff04a40780b3ba568dbfc5bbe9bd8504..3bc5cd1e53dd7c94b948e7f57f0dc8e073e349b0 100644 --- a/src/main/java/net/minecraft/server/EULA.java +++ b/src/main/java/net/minecraft/server/EULA.java -@@ -70,7 +70,7 @@ public class EULA { +@@ -72,7 +72,7 @@ public class EULA { Properties properties = new Properties(); properties.setProperty("eula", "false"); @@ -40,10 +40,10 @@ index 550232cb3819138b3bae0fa1c51429485e8bc593..229c3b0f0c650b501f31147adaa17194 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 c572ef2830f2653e2b30622bbac0a3b072bacd7a..2131f7322640879496692b73fd2a8c52b059ae24 100644 +index c372e6897c73fad6f9c478cec9f58303fb0cce17..2d567bda66f010d2e2eac9fe343196901ad16a1c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1457,7 +1457,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant j; @@ -17,7 +17,7 @@ index 068b92c5c4ae112771757626ea75694e59f3d255..14ddb2a8949ce18a0c42e17a82d0d7a1 HeightMap.Type[] aheightmap_type = values(); int i = aheightmap_type.length; -@@ -149,7 +149,7 @@ public class HeightMap { +@@ -157,7 +157,7 @@ public class HeightMap { }); diff --git a/patches/Tuinity/patches/server/0004-Util-patch.patch b/patches/Tuinity/patches/server/0004-Util-patch.patch index 383fcac4..76379a25 100644 --- a/patches/Tuinity/patches/server/0004-Util-patch.patch +++ b/patches/Tuinity/patches/server/0004-Util-patch.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Util patch diff --git a/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java b/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java new file mode 100644 -index 0000000000000000000000000000000000000000..6985b1df450a3b2b9e9c4696fef60652cb84fa2c +index 0000000000000000000000000000000000000000..5ea5b3933725d80dd193e815ac507ee51ee17630 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/SingleThreadChunkRegionManager.java @@ -0,0 +1,477 @@ @@ -16,9 +16,9 @@ index 0000000000000000000000000000000000000000..6985b1df450a3b2b9e9c4696fef60652 +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet; +import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; -+import net.minecraft.server.ChunkCoordIntPair; +import net.minecraft.server.MCUtil; -+import net.minecraft.server.WorldServer; ++import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.level.ChunkCoordIntPair; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; @@ -1955,76 +1955,111 @@ index 0000000000000000000000000000000000000000..606417a8aeaca2682595f417bba8e9d4 + } + } +} -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 1f334d63282bd5c23dc3b275a220f09e60c34537..85f60b56b5689b77ba3d9e99e29b4f734df5d91e 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -295,14 +295,14 @@ public abstract class BlockBase { +diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java +index 1d72af9cace7aa8f1d20c7c1c5be621f533e2dad..006e7076932f6be576a64da09c4d84ca4a15f5dd 100644 +--- a/src/main/java/net/minecraft/server/MCUtil.java ++++ b/src/main/java/net/minecraft/server/MCUtil.java +@@ -238,6 +238,63 @@ public final class MCUtil { + return getBlockKey(getBlockCoordinate(entity.locX()), getBlockCoordinate(entity.locY()), getBlockCoordinate(entity.locZ())); + } - public abstract static class BlockData extends IBlockDataHolder { - -- private final int b; -- private final boolean e; -+ private final int b; public final int getEmittedLight() { return this.b; } // Tuinity - OBFHELPER -+ private final boolean e; public final boolean isTransparentOnSomeFaces() { return this.e; } // Tuinity - OBFHELPER - private final boolean f; - private final Material g; - private final MaterialMapColor h; - public final float strength; - private final boolean j; -- private final boolean k; -+ private final boolean k; public final boolean isOpaque() { return this.k; } // Tuinity - OBFHELPER - private final BlockBase.e l; - private final BlockBase.e m; - private final BlockBase.e n; -@@ -343,12 +343,20 @@ public abstract class BlockBase { - protected Fluid fluid; - // Paper end - -+ // Tuinity start - micro the hell out of this call -+ protected boolean shapeExceedsCube = true; -+ public final boolean shapeExceedsCube() { -+ return this.shapeExceedsCube; -+ } -+ // Tuinity end ++ // Tuinity start + - public void a() { - this.fluid = this.getBlock().d(this.p()); // Paper - moved from getFluid() - this.isTicking = this.getBlock().isTicking(this.p()); // Paper - moved from isTicking() - if (!this.getBlock().o()) { - this.a = new BlockBase.BlockData.Cache(this.p()); - } -+ this.shapeExceedsCube = this.a == null || this.a.c; // Tuinity - moved from actual method to here ++ static final int SECTION_X_BITS = 22; ++ static final long SECTION_X_MASK = (1L << SECTION_X_BITS) - 1; ++ static final int SECTION_Y_BITS = 20; ++ static final long SECTION_Y_MASK = (1L << SECTION_Y_BITS) - 1; ++ static final int SECTION_Z_BITS = 22; ++ static final long SECTION_Z_MASK = (1L << SECTION_Z_BITS) - 1; ++ // format is y,z,x (in order of LSB to MSB) ++ static final int SECTION_Y_SHIFT = 0; ++ static final int SECTION_Z_SHIFT = SECTION_Y_SHIFT + SECTION_Y_BITS; ++ static final int SECTION_X_SHIFT = SECTION_Z_SHIFT + SECTION_X_BITS; ++ static final int SECTION_TO_BLOCK_SHIFT = 4; ++ ++ public static long getSectionKey(final int x, final int y, final int z) { ++ return ((x & SECTION_X_MASK) << SECTION_X_SHIFT) ++ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT) ++ | ((z & SECTION_Z_MASK) << SECTION_Z_SHIFT); ++ } ++ ++ public static long getSectionKey(final net.minecraft.core.SectionPosition pos) { ++ return ((pos.getX() & SECTION_X_MASK) << SECTION_X_SHIFT) ++ | ((pos.getY() & SECTION_Y_MASK) << SECTION_Y_SHIFT) ++ | ((pos.getZ() & SECTION_Z_MASK) << SECTION_Z_SHIFT); ++ } ++ ++ public static long getSectionKey(final ChunkCoordIntPair pos, final int y) { ++ return ((pos.x & SECTION_X_MASK) << SECTION_X_SHIFT) ++ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT) ++ | ((pos.z & SECTION_Z_MASK) << SECTION_Z_SHIFT); ++ } ++ ++ public static long getSectionKey(final BlockPosition pos) { ++ return (((long)pos.getX() << (SECTION_X_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_X_MASK << SECTION_X_SHIFT)) | ++ ((pos.getY() >> SECTION_TO_BLOCK_SHIFT) & (SECTION_Y_MASK << SECTION_Y_SHIFT)) | ++ (((long)pos.getZ() << (SECTION_Z_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_Z_MASK << SECTION_Z_SHIFT)); ++ } ++ ++ public static long getSectionKey(final Entity entity) { ++ return ((MCUtil.fastFloor(entity.locX()) & SECTION_X_MASK) << SECTION_X_SHIFT) ++ | ((MCUtil.fastFloor(entity.locY()) & SECTION_Y_MASK) << SECTION_Y_SHIFT) ++ | ((MCUtil.fastFloor(entity.locZ()) & SECTION_Z_MASK) << SECTION_Z_SHIFT); ++ } ++ ++ public static int getSectionX(final long key) { ++ return (int)(key << (Long.SIZE - (SECTION_X_SHIFT + SECTION_X_BITS)) >> (Long.SIZE - SECTION_X_BITS)); ++ } ++ ++ public static int getSectionY(final long key) { ++ return (int)(key << (Long.SIZE - (SECTION_Y_SHIFT + SECTION_Y_BITS)) >> (Long.SIZE - SECTION_Y_BITS)); ++ } ++ ++ public static int getSectionZ(final long key) { ++ return (int)(key << (Long.SIZE - (SECTION_Z_SHIFT + SECTION_Z_BITS)) >> (Long.SIZE - SECTION_Z_BITS)); ++ } ++ // Tuinity end ++ + // assumes the sets have the same comparator, and if this comparator is null then assume T is Comparable + 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 2d567bda66f010d2e2eac9fe343196901ad16a1c..6a7fed72bdf9c576170591359e78f943e1523e43 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -267,6 +267,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); + public int autosavePeriod; + public boolean serverAutoSave = false; // Paper +@@ -1088,6 +1089,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant onLoad) { if (Thread.currentThread() != this.serverThread) { -@@ -201,6 +201,165 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -226,6 +226,165 @@ public class ChunkProviderServer extends IChunkProvider { } // Paper end - rewrite ticklistserver @@ -2199,7 +2234,7 @@ index 0ea1b25bf98d71c251351807fa92d4d08eb6b06e..c8c0748628e83b6396c13afe896acc16 public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier supplier) { this.world = worldserver; this.serverThreadQueue = new ChunkProviderServer.a(worldserver); -@@ -599,8 +758,8 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -624,8 +783,8 @@ public class ChunkProviderServer extends IChunkProvider { return !this.a(playerchunk, k); } @@ -2210,142 +2245,11 @@ index 0ea1b25bf98d71c251351807fa92d4d08eb6b06e..c8c0748628e83b6396c13afe896acc16 long k = ChunkCoordIntPair.pair(i, j); PlayerChunk playerchunk = this.getChunk(k); -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 534238688be75c53058dcfeabcdf86d9c0504089..6eee9c858dffad0bb0ce06d850deec0725789c9f 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -207,6 +207,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - // CraftBukkit end - -+ // Tuinity start -+ public final AxisAlignedBB getBoundingBoxAt(double x, double y, double z) { -+ double widthHalf = (double)this.size.width / 2.0; -+ double height = (double)this.size.height; -+ return new AxisAlignedBB(x - widthHalf, y, z - widthHalf, x + widthHalf, y + height, z + widthHalf); -+ } -+ // Tuinity end -+ - // Paper start - optimise entity tracking - final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); - -diff --git a/src/main/java/net/minecraft/server/HeightMap.java b/src/main/java/net/minecraft/server/HeightMap.java -index 14ddb2a8949ce18a0c42e17a82d0d7a13ac325fe..476da43b9f0ef35b4985f88e4784b1f8c5222af3 100644 ---- a/src/main/java/net/minecraft/server/HeightMap.java -+++ b/src/main/java/net/minecraft/server/HeightMap.java -@@ -101,6 +101,7 @@ public class HeightMap { - } - } - -+ public final int get(int x, int z) { return this.a(x, z); } // Tuinity - OBFHELPER - public int a(int i, int j) { - return this.a(c(i, j)); - } -diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index ff74be14512a947e81b62d53e616131ca7d7f609..2371557d083446b17ffebdae576b1cc39e939eb1 100644 ---- a/src/main/java/net/minecraft/server/MCUtil.java -+++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -221,6 +221,63 @@ public final class MCUtil { - return getBlockKey(getBlockCoordinate(entity.locX()), getBlockCoordinate(entity.locY()), getBlockCoordinate(entity.locZ())); - } - -+ // Tuinity start -+ -+ static final int SECTION_X_BITS = 22; -+ static final long SECTION_X_MASK = (1L << SECTION_X_BITS) - 1; -+ static final int SECTION_Y_BITS = 20; -+ static final long SECTION_Y_MASK = (1L << SECTION_Y_BITS) - 1; -+ static final int SECTION_Z_BITS = 22; -+ static final long SECTION_Z_MASK = (1L << SECTION_Z_BITS) - 1; -+ // format is y,z,x (in order of LSB to MSB) -+ static final int SECTION_Y_SHIFT = 0; -+ static final int SECTION_Z_SHIFT = SECTION_Y_SHIFT + SECTION_Y_BITS; -+ static final int SECTION_X_SHIFT = SECTION_Z_SHIFT + SECTION_X_BITS; -+ static final int SECTION_TO_BLOCK_SHIFT = 4; -+ -+ public static long getSectionKey(final int x, final int y, final int z) { -+ return ((x & SECTION_X_MASK) << SECTION_X_SHIFT) -+ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT) -+ | ((z & SECTION_Z_MASK) << SECTION_Z_SHIFT); -+ } -+ -+ public static long getSectionKey(final SectionPosition pos) { -+ return ((pos.getX() & SECTION_X_MASK) << SECTION_X_SHIFT) -+ | ((pos.getY() & SECTION_Y_MASK) << SECTION_Y_SHIFT) -+ | ((pos.getZ() & SECTION_Z_MASK) << SECTION_Z_SHIFT); -+ } -+ -+ public static long getSectionKey(final ChunkCoordIntPair pos, final int y) { -+ return ((pos.x & SECTION_X_MASK) << SECTION_X_SHIFT) -+ | ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT) -+ | ((pos.z & SECTION_Z_MASK) << SECTION_Z_SHIFT); -+ } -+ -+ public static long getSectionKey(final BlockPosition pos) { -+ return (((long)pos.getX() << (SECTION_X_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_X_MASK << SECTION_X_SHIFT)) | -+ ((pos.getY() >> SECTION_TO_BLOCK_SHIFT) & (SECTION_Y_MASK << SECTION_Y_SHIFT)) | -+ (((long)pos.getZ() << (SECTION_Z_SHIFT - SECTION_TO_BLOCK_SHIFT)) & (SECTION_Z_MASK << SECTION_Z_SHIFT)); -+ } -+ -+ public static long getSectionKey(final Entity entity) { -+ return ((MCUtil.fastFloor(entity.locX()) & SECTION_X_MASK) << SECTION_X_SHIFT) -+ | ((MCUtil.fastFloor(entity.locY()) & SECTION_Y_MASK) << SECTION_Y_SHIFT) -+ | ((MCUtil.fastFloor(entity.locZ()) & SECTION_Z_MASK) << SECTION_Z_SHIFT); -+ } -+ -+ public static int getSectionX(final long key) { -+ return (int)(key << (Long.SIZE - (SECTION_X_SHIFT + SECTION_X_BITS)) >> (Long.SIZE - SECTION_X_BITS)); -+ } -+ -+ public static int getSectionY(final long key) { -+ return (int)(key << (Long.SIZE - (SECTION_Y_SHIFT + SECTION_Y_BITS)) >> (Long.SIZE - SECTION_Y_BITS)); -+ } -+ -+ public static int getSectionZ(final long key) { -+ return (int)(key << (Long.SIZE - (SECTION_Z_SHIFT + SECTION_Z_BITS)) >> (Long.SIZE - SECTION_Z_BITS)); -+ } -+ // Tuinity end -+ - // assumes the sets have the same comparator, and if this comparator is null then assume T is Comparable - 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 2131f7322640879496692b73fd2a8c52b059ae24..91545586909d37b4bfaa4444a35953873ca819e8 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -155,6 +155,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); - public int autosavePeriod; - public boolean serverAutoSave = false; // Paper -@@ -976,6 +977,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { int i = chunkstatus.c(); CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(i); -@@ -678,6 +679,9 @@ public class PlayerChunk { +@@ -704,6 +705,9 @@ public class PlayerChunk { // Paper start - rewrite ticklistserver PlayerChunk.this.chunkMap.world.onChunkSetTicking(PlayerChunk.this.location.x, PlayerChunk.this.location.z); // Paper end - rewrite ticklistserver @@ -2363,7 +2267,7 @@ index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..b03865a932d341ae2fdad6c9447979fa } }); -@@ -688,6 +692,12 @@ public class PlayerChunk { +@@ -714,6 +718,12 @@ public class PlayerChunk { if (flag4 && !flag5) { this.tickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isTickingReady = false; // Paper - cache chunk ticking stage this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; @@ -2376,7 +2280,7 @@ index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..b03865a932d341ae2fdad6c9447979fa } boolean flag6 = playerchunk_state.isAtLeast(PlayerChunk.State.ENTITY_TICKING); -@@ -705,7 +715,9 @@ public class PlayerChunk { +@@ -731,7 +741,9 @@ public class PlayerChunk { Chunk entityTickingChunk = either.left().get(); PlayerChunk.this.isEntityTickingReady = true; @@ -2387,7 +2291,7 @@ index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..b03865a932d341ae2fdad6c9447979fa } -@@ -717,6 +729,12 @@ public class PlayerChunk { +@@ -743,6 +755,12 @@ public class PlayerChunk { if (flag6 && !flag7) { this.entityTickingFuture.complete(PlayerChunk.UNLOADED_CHUNK); this.isEntityTickingReady = false; // Paper - cache chunk ticking stage this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; @@ -2400,16 +2304,16 @@ index 904c6a7d0a36b57bb4f693fc4fd0dd5b17adcbac..b03865a932d341ae2fdad6c9447979fa } // Paper start - raise IO/load priority if priority changes, use our preferred priority -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a114564705 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -278,6 +278,36 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..f3d6811156e68040106f1d027a10ea33b5646b05 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -332,6 +332,36 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end + // Tuinity start -+ protected final List regionManagers = new java.util.ArrayList<>(); ++ public final List regionManagers = new java.util.ArrayList<>(); + public final com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager dataRegionManager; + + public static final class DataRegionData implements com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager.RegionData { @@ -2441,7 +2345,7 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 private final java.util.concurrent.ExecutorService lightThread; public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i, boolean flag) { super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag); -@@ -445,6 +475,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -499,6 +529,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { PlayerChunkMap.this.sendChunk(player, new ChunkCoordIntPair(rangeX, rangeZ), null, true, false); // unloaded, loaded }); // Paper end - no-tick view distance @@ -2452,7 +2356,7 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 } // Paper start - Chunk Prioritization public void queueHolderUpdate(PlayerChunk playerchunk) { -@@ -779,6 +813,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -833,6 +867,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { playerchunk.a(j); } else { playerchunk = new PlayerChunk(new ChunkCoordIntPair(i), j, this.lightEngine, this.p, this); @@ -2464,7 +2368,7 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 } this.updatingChunks.put(i, playerchunk); -@@ -1021,7 +1060,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1075,7 +1114,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (completablefuture1 != completablefuture) { this.a(i, playerchunk); } else { @@ -2480,7 +2384,7 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 if (ichunkaccess instanceof Chunk) { ((Chunk) ichunkaccess).setLoaded(false); } -@@ -1044,7 +1090,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1098,7 +1144,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.lightEngine.a(ichunkaccess.getPos()); this.lightEngine.queueUpdate(); this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null); @@ -2495,7 +2399,7 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 } }; -@@ -1711,6 +1763,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1765,6 +1817,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow(); } // Paper end @@ -2507,23 +2411,11 @@ index 00d0a5fd7c5d2db19756f3c6cfb2381868af51fd..a470e8fb8df29f611c13039b7a4f58a1 // Paper start - async io -diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index e21c747b6c39155c44bf30860681d67b0b29fb12..9f4f9df09968dc45878ad59f5ee45672a3f08fbd 100644 ---- a/src/main/java/net/minecraft/server/VoxelShapes.java -+++ b/src/main/java/net/minecraft/server/VoxelShapes.java -@@ -314,6 +314,7 @@ public final class VoxelShapes { - } - } - -+ public static boolean combinationOccludes(VoxelShape voxelshape, VoxelShape voxelshape1) { return b(voxelshape, voxelshape1); } // Tuinity - OBFHELPER - public static boolean b(VoxelShape voxelshape, VoxelShape voxelshape1) { - return voxelshape != b() && voxelshape1 != b() ? (voxelshape.isEmpty() && voxelshape1.isEmpty() ? false : !c(b(), b(voxelshape, voxelshape1, OperatorBoolean.OR), OperatorBoolean.ONLY_FIRST)) : true; - } -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index cf7d94aabab600822eb5e27f38690b06456d5fcc..4183117fe3977e4f0c927b4262a4804bcb8738f6 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -55,6 +55,7 @@ import org.bukkit.event.server.MapInitializeEvent; +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 0a698a5a4a6502a488c9afb0ad97165e60030896..e67c57573ea3be869fecb7a00de8157e3f5437d1 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -168,6 +168,7 @@ import org.bukkit.event.server.MapInitializeEvent; import org.bukkit.event.weather.LightningStrikeEvent; import org.bukkit.event.world.TimeSkipEvent; // CraftBukkit end @@ -2531,7 +2423,7 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..4183117fe3977e4f0c927b4262a4804b public class WorldServer extends World implements GeneratorAccessSeed { -@@ -206,6 +207,96 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -319,6 +320,96 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end - rewrite ticklistserver @@ -2628,3 +2520,111 @@ index cf7d94aabab600822eb5e27f38690b06456d5fcc..4183117fe3977e4f0c927b4262a4804b // Add env and gen to constructor, WorldData -> WorldDataServer public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 429f0591c6a55f6c5d08a0755f7d39da676468bc..6a3e859eef2878d9e203bba7930e52d7513d96e8 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -299,6 +299,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + } + // CraftBukkit end + ++ // Tuinity start ++ public final AxisAlignedBB getBoundingBoxAt(double x, double y, double z) { ++ double widthHalf = (double)this.size.width / 2.0; ++ double height = (double)this.size.height; ++ return new AxisAlignedBB(x - widthHalf, y, z - widthHalf, x + widthHalf, y + height, z + widthHalf); ++ } ++ // Tuinity end ++ + // Paper start - optimise entity tracking + final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); + +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index ac3709c8158d42ccafd457cfa44a16dc8c9eb949..19936d615c14c4cb4eeddfaaf8438765f6c0b8b3 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -347,14 +347,14 @@ public abstract class BlockBase { + + public abstract static class BlockData extends IBlockDataHolder { + +- private final int b; +- private final boolean e; ++ private final int b; public final int getEmittedLight() { return this.b; } // Tuinity - OBFHELPER ++ private final boolean e; public final boolean isTransparentOnSomeFaces() { return this.e; } // Tuinity - OBFHELPER + private final boolean f; + private final Material g; + private final MaterialMapColor h; + public final float strength; + private final boolean j; +- private final boolean k; ++ private final boolean k; public final boolean isOpaque() { return this.k; } // Tuinity - OBFHELPER + private final BlockBase.e l; + private final BlockBase.e m; + private final BlockBase.e n; +@@ -395,12 +395,20 @@ public abstract class BlockBase { + protected Fluid fluid; + // Paper end + ++ // Tuinity start - micro the hell out of this call ++ protected boolean shapeExceedsCube = true; ++ public final boolean shapeExceedsCube() { ++ return this.shapeExceedsCube; ++ } ++ // Tuinity end ++ + public void a() { + this.fluid = this.getBlock().d(this.p()); // Paper - moved from getFluid() + this.isTicking = this.getBlock().isTicking(this.p()); // Paper - moved from isTicking() + if (!this.getBlock().o()) { + this.a = new BlockBase.BlockData.Cache(this.p()); + } ++ this.shapeExceedsCube = this.a == null || this.a.c; // Tuinity - moved from actual method to here + + } + +@@ -424,10 +432,12 @@ public abstract class BlockBase { + return this.a != null ? this.a.g : this.getBlock().b(this.p(), iblockaccess, blockposition); + } + ++ public final int getOpacity(IBlockAccess iblockaccess, BlockPosition blockposition) { return this.b(iblockaccess, blockposition); } // Tuinity - OBFHELPER + public int b(IBlockAccess iblockaccess, BlockPosition blockposition) { + return this.a != null ? this.a.h : this.getBlock().f(this.p(), iblockaccess, blockposition); + } + ++ public final VoxelShape getCullingFace(IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { return this.a(iblockaccess, blockposition, enumdirection); } // Tuinity - OBFHELPER + public VoxelShape a(IBlockAccess iblockaccess, BlockPosition blockposition, EnumDirection enumdirection) { + return this.a != null && this.a.i != null ? this.a.i[enumdirection.ordinal()] : VoxelShapes.a(this.c(iblockaccess, blockposition), enumdirection); + } +@@ -437,7 +447,7 @@ public abstract class BlockBase { + } + + public final boolean d() { // Paper +- return this.a == null || this.a.c; ++ return this.shapeExceedsCube; // Tuinity - moved into shape cache init + } + + public final boolean e() { // Paper +diff --git a/src/main/java/net/minecraft/world/level/levelgen/HeightMap.java b/src/main/java/net/minecraft/world/level/levelgen/HeightMap.java +index aed66330b0f42eb8c8fbbebdb36f190db8e3b6b9..79214a93c533839d0c560a1e4f5904c62265590e 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/HeightMap.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/HeightMap.java +@@ -109,6 +109,7 @@ public class HeightMap { + } + } + ++ public final int get(int x, int z) { return this.a(x, z); } // Tuinity - OBFHELPER + public int a(int i, int j) { + return this.a(c(i, j)); + } +diff --git a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java +index 858d4689e618c72250447adb61e0bcc3c156f8f3..38fde2e10adf06bf5c5141d17d82ba125b372cd7 100644 +--- a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java ++++ b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java +@@ -324,6 +324,7 @@ public final class VoxelShapes { + } + } + ++ public static boolean combinationOccludes(VoxelShape voxelshape, VoxelShape voxelshape1) { return b(voxelshape, voxelshape1); } // Tuinity - OBFHELPER + public static boolean b(VoxelShape voxelshape, VoxelShape voxelshape1) { + return voxelshape != b() && voxelshape1 != b() ? (voxelshape.isEmpty() && voxelshape1.isEmpty() ? false : !c(b(), b(voxelshape, voxelshape1, OperatorBoolean.OR), OperatorBoolean.ONLY_FIRST)) : true; + } diff --git a/patches/Tuinity/patches/server/0005-Tuinity-Server-Config.patch b/patches/Tuinity/patches/server/0005-Tuinity-Server-Config.patch index e8ff1490..b500c122 100644 --- a/patches/Tuinity/patches/server/0005-Tuinity-Server-Config.patch +++ b/patches/Tuinity/patches/server/0005-Tuinity-Server-Config.patch @@ -261,23 +261,11 @@ index 0000000000000000000000000000000000000000..0f66484a80d3cc7caaf8a111bd50229e + +} \ No newline at end of file -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index d4793a1d476d8d6687ec8782501c31265f284daa..617ba6fb85c55967360ca270ee8feeff5acbf8e0 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -175,6 +175,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - com.destroystokyo.paper.PaperConfig.registerCommands(); - com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now - // Paper end -+ com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config - - this.setPVP(dedicatedserverproperties.pvp); - this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 91545586909d37b4bfaa4444a35953873ca819e8..f2fd2c2df4b99910d1838035a5f1ed11731c98ca 100644 +index 6a7fed72bdf9c576170591359e78f943e1523e43..b7a452b51ee4382e03d7879f511a7c34b415925a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -960,6 +960,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant extends TickListServer { // extend to avo @@ -20,7 +20,7 @@ index e7624948ea4aa1a07d84ed3d295cfe2dd354fd14..a263cd7a0680e0cc3517f84308118eb3 @@ -268,6 +269,7 @@ public final class PaperTickList extends TickListServer { // extend to avo @Override - protected void nextTick() { + public void nextTick() { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("async tick list tick"); // Tuinity - soft async catcher ++this.currentTick; if (this.currentTick != this.world.getTime()) { @@ -119,11 +119,11 @@ index 033548a58d27f64d3954206d267783c0437d4019..08ed243259f052165c6f75aed1d1d65a public final int id; /* We don't override getId as the spec requires that it be unique (with respect to all other threads) */ public TickThread(final Runnable run, final String name, final int id) { -diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f620a84ef3 100644 ---- a/src/main/java/net/minecraft/server/ChunkMapDistance.java -+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -65,6 +65,7 @@ public abstract class ChunkMapDistance { +diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +index 2f8bca35508640f6b8c312fff17d55f129431599..aac3f74af760e8d7dbb1e9d4031ce1aabe45ca21 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +@@ -74,6 +74,7 @@ public abstract class ChunkMapDistance { } protected void purgeTickets() { @@ -131,7 +131,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 ++this.currentTick; ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); -@@ -98,6 +99,7 @@ public abstract class ChunkMapDistance { +@@ -107,6 +108,7 @@ public abstract class ChunkMapDistance { protected abstract PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k); public boolean a(PlayerChunkMap playerchunkmap) { @@ -139,7 +139,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 //this.f.a(); // Paper - no longer used AsyncCatcher.catchOp("DistanceManagerTick"); // Paper this.g.a(); -@@ -370,6 +372,7 @@ public abstract class ChunkMapDistance { +@@ -379,6 +381,7 @@ public abstract class ChunkMapDistance { } private ArraySetSorted> e(long i) { @@ -147,7 +147,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 return (ArraySetSorted) this.tickets.computeIfAbsent(i, (j) -> { return ArraySetSorted.a(4); }); -@@ -387,6 +390,7 @@ public abstract class ChunkMapDistance { +@@ -396,6 +399,7 @@ public abstract class ChunkMapDistance { } public void a(SectionPosition sectionposition, EntityPlayer entityplayer) { @@ -155,7 +155,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 long i = sectionposition.r().pair(); ((ObjectSet) this.c.computeIfAbsent(i, (j) -> { -@@ -397,6 +401,7 @@ public abstract class ChunkMapDistance { +@@ -406,6 +410,7 @@ public abstract class ChunkMapDistance { } public void b(SectionPosition sectionposition, EntityPlayer entityplayer) { @@ -163,7 +163,7 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 long i = sectionposition.r().pair(); ObjectSet objectset = (ObjectSet) this.c.get(i); if (objectset == null) return; // CraftBukkit - SPIGOT-6208 -@@ -447,6 +452,7 @@ public abstract class ChunkMapDistance { +@@ -456,6 +461,7 @@ public abstract class ChunkMapDistance { // CraftBukkit start public void removeAllTicketsFor(TicketType ticketType, int ticketLevel, T ticketIdentifier) { @@ -171,11 +171,11 @@ index 76f9bb728def91744910d0b680b73e753f1a2b26..84ff9cfe89defad2e907708f837d33f6 Ticket target = new Ticket<>(ticketType, ticketLevel, ticketIdentifier); for (java.util.Iterator>>> iterator = this.tickets.long2ObjectEntrySet().fastIterator(); iterator.hasNext();) { -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c8c0748628e83b6396c13afe896acc16c85109b0..4082c4f366bce1784759bda773d3d35472403ade 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1198,6 +1198,7 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index a755ef31627ad398c152c2bd3340855da4fa3a93..e9f66fbde9a70779600ff6d15b43a93347b9f1e8 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -1223,6 +1223,7 @@ public class ChunkProviderServer extends IChunkProvider { @Override protected boolean executeNext() { @@ -183,11 +183,11 @@ index c8c0748628e83b6396c13afe896acc16c85109b0..4082c4f366bce1784759bda773d3d354 // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task try { boolean execChunkTask = com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue() || ChunkProviderServer.this.world.asyncChunkTaskManager.pollNextChunkTask(); // Paper -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index f2a9396c2ec64c79391782249db7507f12a69a9e..798ebfdcd8e06ffb576964da006e77bd188ad274 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -74,6 +74,7 @@ public class EntityTrackerEntry { +diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +index f65eb0168ed365e5c1b490c56ec84e3b7ff87c1d..8d792f96ca655c7f5d66d19af9c37efbf40fa556 100644 +--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +@@ -103,6 +103,7 @@ public class EntityTrackerEntry { public final void tick() { this.a(); } // Paper - OBFHELPER public void a() { @@ -195,11 +195,11 @@ index f2a9396c2ec64c79391782249db7507f12a69a9e..798ebfdcd8e06ffb576964da006e77bd List list = this.tracker.passengers; // Paper - do not copy list if (!list.equals(this.p)) { -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f780b9c9c 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -201,6 +201,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index f3d6811156e68040106f1d027a10ea33b5646b05..e7cd6392d722d0e13b86b57d70946b18688f6621 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -255,6 +255,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end - no-tick view distance void addPlayerToDistanceMaps(EntityPlayer player) { @@ -207,7 +207,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f int chunkX = MCUtil.getChunkCoordinate(player.locX()); int chunkZ = MCUtil.getChunkCoordinate(player.locZ()); // Note: players need to be explicitly added to distance maps before they can be updated -@@ -231,6 +232,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -285,6 +286,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } void removePlayerFromDistanceMaps(EntityPlayer player) { @@ -215,7 +215,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f // Paper start - use distance map to optimise tracker for (int i = 0, len = TRACKING_RANGE_TYPES.length; i < len; ++i) { this.playerEntityTrackerTrackMaps[i].remove(player); -@@ -248,6 +250,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -302,6 +304,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } void updateMaps(EntityPlayer player) { @@ -223,7 +223,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f int chunkX = MCUtil.getChunkCoordinate(player.locX()); int chunkZ = MCUtil.getChunkCoordinate(player.locZ()); // Note: players need to be explicitly added to distance maps before they can be updated -@@ -791,6 +794,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -845,6 +848,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Nullable private PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k) { @@ -231,7 +231,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f if (k > PlayerChunkMap.GOLDEN_TICKET && j > PlayerChunkMap.GOLDEN_TICKET) { return playerchunk; } else { -@@ -1112,6 +1116,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1166,6 +1170,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } protected boolean b() { @@ -239,7 +239,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f if (!this.updatingChunksModified) { return false; } else { -@@ -1551,6 +1556,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1605,6 +1610,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } public void setViewDistance(int i) { // Paper - public @@ -247,7 +247,7 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f int j = MathHelper.clamp(i + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32 if (j != this.viewDistance) { -@@ -1564,6 +1570,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1618,6 +1624,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - no-tick view distance public final void setNoTickViewDistance(int viewDistance) { @@ -255,31 +255,11 @@ index a470e8fb8df29f611c13039b7a4f58a114564705..4abd156556b40aa82e6ed5093b279c0f viewDistance = viewDistance == -1 ? -1 : MathHelper.clamp(viewDistance, 2, 32); this.noTickViewDistance = viewDistance; -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8efdd9bd0827d1f6a31d5f943f986dabe7d05137..43b5fa67a6b6e778a059063390fb47d6a599a948 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -363,6 +363,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - - @Override - public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { -+ org.spigotmc.AsyncCatcher.catchOp("set type call"); // Tuinity - // CraftBukkit start - tree generation - if (this.captureTreeGeneration) { - // Paper start -@@ -464,6 +465,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - - // CraftBukkit start - Split off from above in order to directly send client and physic updates - public void notifyAndUpdatePhysics(BlockPosition blockposition, Chunk chunk, IBlockData oldBlock, IBlockData newBlock, IBlockData actualBlock, int i, int j) { -+ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Async notify and update"); // Tuinity - IBlockData iblockdata = newBlock; - IBlockData iblockdata1 = oldBlock; - IBlockData iblockdata2 = actualBlock; -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4183117fe3977e4f0c927b4262a4804bcb8738f6..e285038154d83cbf0d7c0b6b8a247c11b9e20119 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1661,6 +1661,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index e67c57573ea3be869fecb7a00de8157e3f5437d1..d7399bc4a4c8ec0712dbe8b909bf5ef1fafa75db 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1774,6 +1774,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { @Override public void notify(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1, int i) { @@ -287,6 +267,26 @@ index 4183117fe3977e4f0c927b4262a4804bcb8738f6..e285038154d83cbf0d7c0b6b8a247c11 this.getChunkProvider().flagDirty(blockposition); if(this.paperConfig.updatePathfindingOnBlockUpdate) { // Paper - option to disable pathfinding updates VoxelShape voxelshape = iblockdata.getCollisionShape(this, blockposition); +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 983e61051b7a8a8f5094cee8de9b8ca8c072fc68..6ec5d99dffa26b9a94f59340ba9498baf8bc2015 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -423,6 +423,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + @Override + public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { ++ org.spigotmc.AsyncCatcher.catchOp("set type call"); // Tuinity + // CraftBukkit start - tree generation + if (this.captureTreeGeneration) { + // Paper start +@@ -524,6 +525,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + // CraftBukkit start - Split off from above in order to directly send client and physic updates + public void notifyAndUpdatePhysics(BlockPosition blockposition, Chunk chunk, IBlockData oldBlock, IBlockData newBlock, IBlockData actualBlock, int i, int j) { ++ com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Async notify and update"); // Tuinity + IBlockData iblockdata = newBlock; + IBlockData iblockdata1 = oldBlock; + IBlockData iblockdata2 = actualBlock; diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java index 10606ed03e88e4e467de2d5424df12466c4e7873..51e9c54cddf4b28ba3d3d892322c487774bdab70 100644 --- a/src/main/java/org/spigotmc/AsyncCatcher.java diff --git a/patches/Tuinity/patches/server/0009-Delay-chunk-unloads.patch b/patches/Tuinity/patches/server/0009-Delay-chunk-unloads.patch index 4958ff10..256508d9 100644 --- a/patches/Tuinity/patches/server/0009-Delay-chunk-unloads.patch +++ b/patches/Tuinity/patches/server/0009-Delay-chunk-unloads.patch @@ -19,14 +19,14 @@ affects player loaded chunks, when we want to target all loads. diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index f10fa659680f8a574f77d260bbc52be349c244e8..7b12e7610444ff20f2c3f458887bd7d4e6715036 100644 +index f10fa659680f8a574f77d260bbc52be349c244e8..182f419fde8eb3646a79cc0ba689ee486cb53338 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -1,6 +1,7 @@ package com.tuinity.tuinity.config; import com.destroystokyo.paper.util.SneakyThrow; -+import net.minecraft.server.TicketType; ++import net.minecraft.server.level.TicketType; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; @@ -46,11 +46,11 @@ index f10fa659680f8a574f77d260bbc52be349c244e8..7b12e7610444ff20f2c3f458887bd7d4 public static final class WorldConfig { public final String worldName; -diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 84ff9cfe89defad2e907708f837d33f620a84ef3..7f3887b0894aca0f972922f434382646a6ad6174 100644 ---- a/src/main/java/net/minecraft/server/ChunkMapDistance.java -+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -31,7 +31,7 @@ public abstract class ChunkMapDistance { +diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +index aac3f74af760e8d7dbb1e9d4031ce1aabe45ca21..8d4944fa1c761bb3ab299ec639663e7f52b512a3 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +@@ -40,7 +40,7 @@ public abstract class ChunkMapDistance { private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2; private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); public final Long2ObjectOpenHashMap>> tickets = new Long2ObjectOpenHashMap(); @@ -59,7 +59,7 @@ index 84ff9cfe89defad2e907708f837d33f620a84ef3..7f3887b0894aca0f972922f434382646 public static final int MOB_SPAWN_RANGE = 8; // private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); // Paper start use a queue, but still keep unique requirement -@@ -53,6 +53,47 @@ public abstract class ChunkMapDistance { +@@ -62,6 +62,47 @@ public abstract class ChunkMapDistance { PlayerChunkMap chunkMap; // Paper @@ -107,7 +107,7 @@ index 84ff9cfe89defad2e907708f837d33f620a84ef3..7f3887b0894aca0f972922f434382646 protected ChunkMapDistance(Executor executor, Executor executor1) { executor1.getClass(); Mailbox mailbox = Mailbox.a("player ticket throttler", executor1::execute); -@@ -69,18 +110,41 @@ public abstract class ChunkMapDistance { +@@ -78,18 +119,41 @@ public abstract class ChunkMapDistance { ++this.currentTick; ObjectIterator objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); @@ -153,7 +153,7 @@ index 84ff9cfe89defad2e907708f837d33f620a84ef3..7f3887b0894aca0f972922f434382646 } } -@@ -178,27 +242,11 @@ public abstract class ChunkMapDistance { +@@ -187,27 +251,11 @@ public abstract class ChunkMapDistance { boolean removed = false; // CraftBukkit if (arraysetsorted.remove(ticket)) { removed = true; // CraftBukkit @@ -185,10 +185,10 @@ index 84ff9cfe89defad2e907708f837d33f620a84ef3..7f3887b0894aca0f972922f434382646 } if (arraysetsorted.isEmpty()) { -diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java -index e41cb8613efc86499dfe3be36c9130ab6dc9b89e..c19ffb925a02d123da8a5c77186e6105422dccf7 100644 ---- a/src/main/java/net/minecraft/server/Ticket.java -+++ b/src/main/java/net/minecraft/server/Ticket.java +diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java +index 6e5ae954c6eb40590bf8c83f592c22088d489be8..c9b395dd0e4881a2e2e409bf782491b42ff087e6 100644 +--- a/src/main/java/net/minecraft/server/level/Ticket.java ++++ b/src/main/java/net/minecraft/server/level/Ticket.java @@ -5,17 +5,17 @@ import java.util.Objects; public final class Ticket implements Comparable> { @@ -222,11 +222,11 @@ index e41cb8613efc86499dfe3be36c9130ab6dc9b89e..c19ffb925a02d123da8a5c77186e6105 return j != 0L && i - this.d > j; } -diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java -index 5c789b25f1df2eae8ea8ceb4ba977ba336fe6d5e..ab0417b3897911ba29602d696f4842bfb77cee16 100644 ---- a/src/main/java/net/minecraft/server/TicketType.java -+++ b/src/main/java/net/minecraft/server/TicketType.java -@@ -26,8 +26,18 @@ public class TicketType { +diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java +index 3c804c7b20a14ea6e510810e2be10c1cc89ff5c1..47da7efffde2e6d63c1a064b950abf8135705622 100644 +--- a/src/main/java/net/minecraft/server/level/TicketType.java ++++ b/src/main/java/net/minecraft/server/level/TicketType.java +@@ -30,8 +30,18 @@ public class TicketType { public static final TicketType ASYNC_LOAD = a("async_load", Long::compareTo); // Paper public static final TicketType PRIORITY = a("priority", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper public static final TicketType URGENT = a("urgent", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper @@ -247,7 +247,7 @@ index 5c789b25f1df2eae8ea8ceb4ba977ba336fe6d5e..ab0417b3897911ba29602d696f4842bf return new TicketType<>(s, comparator, 0L); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index cade3ed6079011f44eba613dece3d69ec18f8f04..3c7e3db06be46b20c417b7ef36a17affa4c6ef78 100644 +index 16567619d7ca84a997ef46417d72f92e6db6993d..494e3b65880a5a5ced4adc8b4d5a51d2e78a51b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -505,6 +505,7 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0010-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch b/patches/Tuinity/patches/server/0010-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch index 7cc61843..3ec57c9e 100644 --- a/patches/Tuinity/patches/server/0010-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch +++ b/patches/Tuinity/patches/server/0010-Attempt-to-recalculate-regionfile-header-if-it-is-co.patch @@ -9,11 +9,24 @@ we instead drop the current regionfile header and recalculate - hoping that at least then we don't swap chunks, and maybe recover them all. -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index f51bf71c8d6eef3c054ac64765709794fcfad5ee..17a5b5b5bab4412242a18224b366674c25cdf286 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 { +diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java +index a4970654496c52fcd02c5c055ff5ac551bd19da3..6725b31a5183d5af7f8f7566ed21eb61797ef4c9 100644 +--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java ++++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java +@@ -235,7 +235,7 @@ public class WorldUpgrader { + int l = Integer.parseInt(matcher.group(2)) << 5; + + try { +- RegionFile regionfile = new RegionFile(file2, file1, true); ++ RegionFile regionfile = new RegionFile(file2, file1, true, true); // Tuinity - allow for chunk regionfiles to regen header + Throwable throwable = null; + + try { +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +index 4eaf497d048324a85ce49fc1c6e9559991c20df7..2d6b14345d4fcc803b011235e9798d5db613502a 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -68,6 +68,14 @@ public class ChunkRegionLoader { private static final Logger LOGGER = LogManager.getLogger(); @@ -28,7 +41,7 @@ index f51bf71c8d6eef3c054ac64765709794fcfad5ee..17a5b5b5bab4412242a18224b366674c // Paper start - guard against serializing mismatching coordinates // TODO Note: This needs to be re-checked each update public static ChunkCoordIntPair getChunkCoordinate(NBTTagCompound chunkData) { -@@ -401,10 +409,10 @@ public class ChunkRegionLoader { +@@ -445,10 +453,10 @@ public class ChunkRegionLoader { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion()); @@ -41,12 +54,12 @@ index f51bf71c8d6eef3c054ac64765709794fcfad5ee..17a5b5b5bab4412242a18224b366674c nbttagcompound1.setLong("InhabitedTime", ichunkaccess.getInhabitedTime()); nbttagcompound1.setString("Status", ichunkaccess.getChunkStatus().d()); ChunkConverter chunkconverter = ichunkaccess.p(); -diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java -index 582a5695bac7d078e3022b8ee70c512c0680d992..5601088cd5024a40e8296bab979f43de924c2b62 100644 ---- a/src/main/java/net/minecraft/server/IChunkLoader.java -+++ b/src/main/java/net/minecraft/server/IChunkLoader.java -@@ -21,7 +21,7 @@ public class IChunkLoader implements AutoCloseable { - protected final RegionFileCache regionFileCache; +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java +index 890362d28ab9cb760c73fe5014e144fb08ada6b8..3c532d3996dfc734ec07181701280b6072bff55f 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/IChunkLoader.java +@@ -39,7 +39,7 @@ public class IChunkLoader implements AutoCloseable { + public final RegionFileCache regionFileCache; public IChunkLoader(File file, DataFixer datafixer, boolean flag) { - this.regionFileCache = new RegionFileCache(file, flag); // Paper - nuke IOWorker @@ -54,10 +67,10 @@ index 582a5695bac7d078e3022b8ee70c512c0680d992..5601088cd5024a40e8296bab979f43de this.b = datafixer; // Paper - nuke IOWorker } -diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771de8081a5 100644 ---- a/src/main/java/net/minecraft/server/RegionFile.java -+++ b/src/main/java/net/minecraft/server/RegionFile.java +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +index 4999ba61fb04713ffe3d23c556f732dc4abbf0bc..0bba434d29b09d7d164f5ca4f49cd660bec66927 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java @@ -5,6 +5,7 @@ import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; @@ -66,13 +79,13 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; -@@ -29,15 +30,350 @@ public class RegionFile implements AutoCloseable { +@@ -35,15 +36,350 @@ public class RegionFile implements AutoCloseable { private static final Logger LOGGER = LogManager.getLogger(); private static final ByteBuffer c = ByteBuffer.allocateDirect(1); private final FileChannel dataFile; -- private final java.nio.file.Path e; +- private final Path e; - private final RegionFileCompression f; -+ private final java.nio.file.Path e; private final java.nio.file.Path getContainingDataFolder() { return this.e; } // Tuinity - OBFHELPER ++ private final Path e; private final java.nio.file.Path getContainingDataFolder() { return this.e; } // Tuinity - OBFHELPER + private final RegionFileCompression f; private final RegionFileCompression getRegionFileCompression() { return this.f; } // Tuinity - OBFHELPER private final ByteBuffer g; - private final IntBuffer h; @@ -148,11 +161,11 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + private void backupRegionFile(File to) { + try { + this.dataFile.force(true); -+ MinecraftServer.LOGGER.warn("Backing up regionfile \"" + this.file.getAbsolutePath() + "\" to " + to.getAbsolutePath()); ++ LOGGER.warn("Backing up regionfile \"" + this.file.getAbsolutePath() + "\" to " + to.getAbsolutePath()); + java.nio.file.Files.copy(this.file.toPath(), to.toPath()); -+ MinecraftServer.LOGGER.warn("Backed up the regionfile to " + to.getAbsolutePath()); ++ LOGGER.warn("Backed up the regionfile to " + to.getAbsolutePath()); + } catch (IOException ex) { -+ MinecraftServer.LOGGER.error("Failed to backup to " + to.getAbsolutePath(), ex); ++ LOGGER.error("Failed to backup to " + to.getAbsolutePath(), ex); + } + } + @@ -162,7 +175,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + return; + } + synchronized (this) { -+ MinecraftServer.LOGGER.warn("Corrupt regionfile header detected! Attempting to re-calculate header offsets for regionfile " + this.file.getAbsolutePath(), new Throwable()); ++ LOGGER.warn("Corrupt regionfile header detected! Attempting to re-calculate header offsets for regionfile " + this.file.getAbsolutePath(), new Throwable()); + + // try to backup file so maybe it could be sent to us for further investigation + @@ -204,7 +217,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + isAikarOversized = true; + } + } catch (Exception ex) { -+ MinecraftServer.LOGGER.error("Failed to read aikar oversized data for absolute chunk (" + chunkPos.x + "," + chunkPos.z + ") in regionfile " + this.file.getAbsolutePath() + ", oversized data for this chunk will be lost", ex); ++ LOGGER.error("Failed to read aikar oversized data for absolute chunk (" + chunkPos.x + "," + chunkPos.z + ") in regionfile " + this.file.getAbsolutePath() + ", oversized data for this chunk will be lost", ex); + // fall through, if we can't read aikar oversized we can't risk corrupting chunk data + } + } @@ -232,7 +245,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + ChunkCoordIntPair ourLowerLeftPosition = RegionFileCache.getRegionFileCoordinates(this.file); + + if (ourLowerLeftPosition == null) { -+ MinecraftServer.LOGGER.fatal("Unable to get chunk location of regionfile " + this.file.getAbsolutePath() + ", cannot recover oversized chunks"); ++ LOGGER.fatal("Unable to get chunk location of regionfile " + this.file.getAbsolutePath() + ", cannot recover oversized chunks"); + } else { + int lowerXBound = ourLowerLeftPosition.x; // inclusive + int lowerZBound = ourLowerLeftPosition.z; // inclusive @@ -258,7 +271,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + try { + chunkData = Files.readAllBytes(regionFile.toPath()); + } catch (Exception ex) { -+ MinecraftServer.LOGGER.error("Failed to read oversized chunk data in file " + regionFile.getAbsolutePath() + ", data will be lost", ex); ++ LOGGER.error("Failed to read oversized chunk data in file " + regionFile.getAbsolutePath() + ", data will be lost", ex); + continue; + } + @@ -278,7 +291,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + } + + if (compound == null) { -+ MinecraftServer.LOGGER.error("Failed to read oversized chunk data in file " + regionFile.getAbsolutePath() + ", it's corrupt. Its data will be lost"); ++ LOGGER.error("Failed to read oversized chunk data in file " + regionFile.getAbsolutePath() + ", it's corrupt. Its data will be lost"); + continue; + } + @@ -313,7 +326,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + if (newSectorAllocations.tryAllocate(sectorOffset, sectorLength)) { + calculatedOffsets[location] = sectorOffset << 8 | (sectorLength > 255 ? 255 : sectorLength); // support forge style oversized + } else { -+ MinecraftServer.LOGGER.error("Failed to allocate space for local chunk (overlapping data??) at (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath() + ", chunk will be regenerated"); ++ LOGGER.error("Failed to allocate space for local chunk (overlapping data??) at (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath() + ", chunk will be regenerated"); + } + } + } @@ -337,7 +350,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + calculatedOffsets[location] = sectorOffset << 8 | (sectorLength > 255 ? 255 : sectorLength); // support forge style oversized + } catch (IOException ex) { + newSectorAllocations.free(sectorOffset, sectorLength); -+ MinecraftServer.LOGGER.error("Failed to write new oversized chunk data holder, local chunk at (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath() + " will be regenerated"); ++ LOGGER.error("Failed to write new oversized chunk data holder, local chunk at (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath() + " will be regenerated"); + } + } + } @@ -359,7 +372,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + try { + this.writeOversizedMeta(); + } catch (Exception ex) { -+ MinecraftServer.LOGGER.error("Failed to write aikar oversized chunk meta, all aikar style oversized chunk data will be lost for regionfile " + this.file.getAbsolutePath(), ex); ++ LOGGER.error("Failed to write aikar oversized chunk meta, all aikar style oversized chunk data will be lost for regionfile " + this.file.getAbsolutePath(), ex); + this.getOversizedMetaFile().delete(); + } + } else { @@ -370,7 +383,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + + // before we overwrite the old sectors, print a summary of the chunks that got changed. + -+ MinecraftServer.LOGGER.info("Starting summary of changes for regionfile " + this.file.getAbsolutePath()); ++ LOGGER.info("Starting summary of changes for regionfile " + this.file.getAbsolutePath()); + + for (int chunkX = 0; chunkX < 32; ++chunkX) { + for (int chunkZ = 0; chunkZ < 32; ++chunkZ) { @@ -387,16 +400,16 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + + if (oldOffset == 0) { + // found lost data -+ MinecraftServer.LOGGER.info("Found missing data for local chunk (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath()); ++ LOGGER.info("Found missing data for local chunk (" + chunkX + "," + chunkZ + ") in regionfile " + this.file.getAbsolutePath()); + } else if (newOffset == 0) { -+ MinecraftServer.LOGGER.warn("Data for local chunk (" + chunkX + "," + chunkZ + ") could not be recovered in regionfile " + this.file.getAbsolutePath() + ", it will be regenerated"); ++ LOGGER.warn("Data for local chunk (" + chunkX + "," + chunkZ + ") could not be recovered in regionfile " + this.file.getAbsolutePath() + ", it will be regenerated"); + } else { -+ MinecraftServer.LOGGER.info("Local chunk (" + chunkX + "," + chunkZ + ") changed to point to newer data or correct chunk in regionfile " + this.file.getAbsolutePath()); ++ LOGGER.info("Local chunk (" + chunkX + "," + chunkZ + ") changed to point to newer data or correct chunk in regionfile " + this.file.getAbsolutePath()); + } + } + } + -+ MinecraftServer.LOGGER.info("End of change summary for regionfile " + this.file.getAbsolutePath()); ++ LOGGER.info("End of change summary for regionfile " + this.file.getAbsolutePath()); + + // simply destroy the timestamp header, it's not used + @@ -408,9 +421,9 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + try { + this.flushHeader(); + this.dataFile.force(true); // try to ensure it goes through... -+ MinecraftServer.LOGGER.info("Successfully wrote new header to disk for regionfile " + this.file.getAbsolutePath()); ++ LOGGER.info("Successfully wrote new header to disk for regionfile " + this.file.getAbsolutePath()); + } catch (IOException ex) { -+ MinecraftServer.LOGGER.fatal("Failed to write new header to disk for regionfile " + this.file.getAbsolutePath(), ex); ++ LOGGER.fatal("Failed to write new header to disk for regionfile " + this.file.getAbsolutePath(), ex); + } + } + } @@ -421,7 +434,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper // Paper start - Cache chunk status -@@ -65,11 +401,22 @@ public class RegionFile implements AutoCloseable { +@@ -71,10 +407,21 @@ public class RegionFile implements AutoCloseable { // Paper end public RegionFile(File file, File file1, boolean flag) throws IOException { @@ -433,23 +446,22 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + // Tuinity end - add can recalc flag + } - public RegionFile(java.nio.file.Path java_nio_file_path, java.nio.file.Path java_nio_file_path1, RegionFileCompression regionfilecompression, boolean flag) throws IOException { + public RegionFile(Path path, Path path1, RegionFileCompression regionfilecompression, boolean flag) throws IOException { + // Tuinity start - add can recalc flag -+ this(java_nio_file_path, java_nio_file_path1, regionfilecompression, flag, false); ++ this(path, path1, regionfilecompression, flag, false); + } -+ public RegionFile(java.nio.file.Path java_nio_file_path, java.nio.file.Path java_nio_file_path1, RegionFileCompression regionfilecompression, boolean flag, boolean canRecalcHeader) throws IOException { - this.g = ByteBuffer.allocateDirect(8192); ++ public RegionFile(Path path, Path path1, RegionFileCompression regionfilecompression, boolean flag, boolean canRecalcHeader) throws IOException { + this.canRecalcHeader = canRecalcHeader; -+ // Tuinity end - add can recalc flag - this.file = java_nio_file_path.toFile(); // Paper ++ // Tuinity start - add can recalc flag + this.g = ByteBuffer.allocateDirect(8192); + this.file = path.toFile(); // Paper initOversizedState(); // Paper - this.freeSectors = new RegionFileBitSet(); -@@ -97,14 +444,16 @@ public class RegionFile implements AutoCloseable { - RegionFile.LOGGER.warn("Region file {} has truncated header: {}", java_nio_file_path, i); +@@ -103,14 +450,16 @@ public class RegionFile implements AutoCloseable { + RegionFile.LOGGER.warn("Region file {} has truncated header: {}", path, i); } -- long j = Files.size(java_nio_file_path); -+ final long j = Files.size(java_nio_file_path); final long regionFileSize = j; +- long j = Files.size(path); ++ final long j = Files.size(path); final long regionFileSize = j; // Tuinity - recalculate header on header corruption + boolean needsHeaderRecalc = false; // Tuinity - recalculate header on header corruption + boolean hasBackedUp = false; // Tuinity - recalculate header on header corruption @@ -465,7 +477,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 // Spigot start if (j1 == 255) { // We're maxed out, so we need to read the proper length from the section -@@ -112,33 +461,105 @@ public class RegionFile implements AutoCloseable { +@@ -118,33 +467,105 @@ public class RegionFile implements AutoCloseable { this.dataFile.read(realLen, i1 * 4096); j1 = (realLen.getInt(0) + 4) / 4096 + 1; } @@ -473,16 +485,16 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 // Spigot end if (i1 < 2) { - RegionFile.LOGGER.warn("Region file {} has invalid sector at index: {}; sector {} overlaps with header", java_nio_file_path, k, i1); + RegionFile.LOGGER.warn("Region file {} has invalid sector at index: {}; sector {} overlaps with header", path, k, i1); - this.h.put(k, 0); - } else if (j1 == 0) { + //this.h.put(k, 0); // Tuinity - we catch this, but need it in the header for the summary change + } else if (j1 <= 0) { // Tuinity - <= 0, not == - RegionFile.LOGGER.warn("Region file {} has an invalid sector at index: {}; size has to be > 0", java_nio_file_path, k); + RegionFile.LOGGER.warn("Region file {} has an invalid sector at index: {}; size has to be > 0", path, k); - this.h.put(k, 0); + //this.h.put(k, 0); // Tuinity - we catch this, but need it in the header for the summary change } else if ((long) i1 * 4096L > j) { - RegionFile.LOGGER.warn("Region file {} has an invalid sector at index: {}; sector {} is out of bounds", java_nio_file_path, k, i1); + RegionFile.LOGGER.warn("Region file {} has an invalid sector at index: {}; sector {} is out of bounds", path, k, i1); - this.h.put(k, 0); + //this.h.put(k, 0); // Tuinity - we catch this, but need it in the header for the summary change } else { @@ -492,12 +504,12 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + // Tuinity start - recalculate header on header corruption + if (offset < 2 || sectorLength <= 0 || ((long)offset * 4096L) > regionFileSize) { + if (canRecalcHeader) { -+ MinecraftServer.LOGGER.error("Detected invalid header for regionfile " + this.file.getAbsolutePath() + "! Recalculating header..."); ++ LOGGER.error("Detected invalid header for regionfile " + this.file.getAbsolutePath() + "! Recalculating header..."); + needsHeaderRecalc = true; + break; + } else { + // location = chunkX | (chunkZ << 5); -+ MinecraftServer.LOGGER.fatal("Detected invalid header for regionfile " + this.file.getAbsolutePath() + ++ LOGGER.fatal("Detected invalid header for regionfile " + this.file.getAbsolutePath() + + "! Cannot recalculate, removing local chunk (" + (headerLocation & 31) + "," + (headerLocation >>> 5) + ") from header"); + if (!hasBackedUp) { + hasBackedUp = true; @@ -510,11 +522,11 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + } + boolean failedToAllocate = !this.freeSectors.tryAllocate(offset, sectorLength); + if (failedToAllocate) { -+ MinecraftServer.LOGGER.error("Overlapping allocation by local chunk (" + (headerLocation & 31) + "," + (headerLocation >>> 5) + ") in regionfile " + this.file.getAbsolutePath()); ++ LOGGER.error("Overlapping allocation by local chunk (" + (headerLocation & 31) + "," + (headerLocation >>> 5) + ") in regionfile " + this.file.getAbsolutePath()); } + if (failedToAllocate & !canRecalcHeader) { + // location = chunkX | (chunkZ << 5); -+ MinecraftServer.LOGGER.fatal("Detected invalid header for regionfile " + this.file.getAbsolutePath() + ++ LOGGER.fatal("Detected invalid header for regionfile " + this.file.getAbsolutePath() + + "! Cannot recalculate, removing local chunk (" + (headerLocation & 31) + "," + (headerLocation >>> 5) + ") from header"); + if (!hasBackedUp) { + hasBackedUp = true; @@ -532,7 +544,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 + // Tuinity start - recalculate header on header corruption + // we move the recalc here so comparison to old header is correct when logging to console + if (needsHeaderRecalc) { // true if header gave us overlapping allocations or had other issues -+ MinecraftServer.LOGGER.error("Recalculating regionfile " + this.file.getAbsolutePath() + ", header gave erroneous offsets & locations"); ++ LOGGER.error("Recalculating regionfile " + this.file.getAbsolutePath() + ", header gave erroneous offsets & locations"); + this.recalculateHeader(); + } + // Tuinity end @@ -542,7 +554,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 } + private final java.nio.file.Path getOversizedChunkPath(ChunkCoordIntPair chunkcoordintpair) { return this.e(chunkcoordintpair); } // Tuinity - OBFHELPER - private java.nio.file.Path e(ChunkCoordIntPair chunkcoordintpair) { + private Path e(ChunkCoordIntPair chunkcoordintpair) { - String s = "c." + chunkcoordintpair.x + "." + chunkcoordintpair.z + ".mcc"; + String s = "c." + chunkcoordintpair.x + "." + chunkcoordintpair.z + ".mcc"; // Tuinity - diff on change @@ -577,7 +589,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 @Nullable public synchronized DataInputStream getReadStream(ChunkCoordIntPair chunkCoordIntPair) throws IOException { return a(chunkCoordIntPair);} // Paper - OBFHELPER @Nullable public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) throws IOException { -@@ -163,6 +584,12 @@ public class RegionFile implements AutoCloseable { +@@ -169,6 +590,12 @@ public class RegionFile implements AutoCloseable { ((java.nio.Buffer) bytebuffer).flip(); if (bytebuffer.remaining() < 5) { RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", chunkcoordintpair, l, bytebuffer.remaining()); @@ -590,7 +602,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 return null; } else { int i1 = bytebuffer.getInt(); -@@ -170,6 +597,12 @@ public class RegionFile implements AutoCloseable { +@@ -176,6 +603,12 @@ public class RegionFile implements AutoCloseable { if (i1 == 0) { RegionFile.LOGGER.warn("Chunk {} is allocated, but stream is missing", chunkcoordintpair); @@ -603,7 +615,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 return null; } else { int j1 = i1 - 1; -@@ -177,17 +610,49 @@ public class RegionFile implements AutoCloseable { +@@ -183,17 +616,49 @@ public class RegionFile implements AutoCloseable { if (a(b0)) { if (j1 != 0) { RegionFile.LOGGER.warn("Chunk has both internal and external streams"); @@ -655,7 +667,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 } } } -@@ -347,10 +812,15 @@ public class RegionFile implements AutoCloseable { +@@ -353,10 +818,15 @@ public class RegionFile implements AutoCloseable { } private ByteBuffer b() { @@ -672,7 +684,7 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 ((java.nio.Buffer) bytebuffer).flip(); return bytebuffer; } -@@ -387,6 +857,7 @@ public class RegionFile implements AutoCloseable { +@@ -393,6 +863,7 @@ public class RegionFile implements AutoCloseable { }; } @@ -680,10 +692,10 @@ index 1751fb6934d9242e475c1a44b2a4a1ade6987766..1ffa213a819f9d39488ca3599f77e771 private void c() throws IOException { ((java.nio.Buffer) this.g).position(0); this.dataFile.write(this.g, 0L); -diff --git a/src/main/java/net/minecraft/server/RegionFileBitSet.java b/src/main/java/net/minecraft/server/RegionFileBitSet.java -index 1ebdf73cc927405bc536dc74a5118d2a086db0e5..cfa3ecb031b59ec677f016ecdea92d16436fb511 100644 ---- a/src/main/java/net/minecraft/server/RegionFileBitSet.java -+++ b/src/main/java/net/minecraft/server/RegionFileBitSet.java +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileBitSet.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileBitSet.java +index c96eac4b0b519b2807153fa5a8ebf5a020a2b140..b5c8d9b17c2d5e229db5b48448709194d1fc04f8 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileBitSet.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileBitSet.java @@ -4,18 +4,42 @@ import java.util.BitSet; public class RegionFileBitSet { @@ -728,11 +740,11 @@ index 1ebdf73cc927405bc536dc74a5118d2a086db0e5..cfa3ecb031b59ec677f016ecdea92d16 public int a(int i) { int j = 0; -diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index d64f7ad925e5f40740a58ceee0845ac2db5419f2..8b341c14e7082fc96a464f2386a3dedea31ec59c 100644 ---- a/src/main/java/net/minecraft/server/RegionFileCache.java -+++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -15,12 +15,43 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java +index ebb0d6988f87013ea5d523ab4a1b31cb669ccc43..68cdbe184cd2e490595900d988c64f2011e47495 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCache.java +@@ -22,12 +22,43 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final public final Long2ObjectLinkedOpenHashMap cache = new Long2ObjectLinkedOpenHashMap(); private final File b; private final boolean c; @@ -776,7 +788,7 @@ index d64f7ad925e5f40740a58ceee0845ac2db5419f2..8b341c14e7082fc96a464f2386a3dede // Paper start public synchronized RegionFile getRegionFileIfLoaded(ChunkCoordIntPair chunkcoordintpair) { // Paper - synchronize for async io -@@ -54,9 +85,9 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final +@@ -61,9 +92,9 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final this.b.mkdirs(); } @@ -788,7 +800,7 @@ index d64f7ad925e5f40740a58ceee0845ac2db5419f2..8b341c14e7082fc96a464f2386a3dede this.cache.putAndMoveToFirst(i, regionfile1); // Paper start -@@ -145,6 +176,13 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final +@@ -152,6 +183,13 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final return null; } // CraftBukkit end @@ -802,7 +814,7 @@ index d64f7ad925e5f40740a58ceee0845ac2db5419f2..8b341c14e7082fc96a464f2386a3dede try { // Paper DataInputStream datainputstream = regionfile.a(chunkcoordintpair); // Paper start -@@ -160,6 +198,17 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final +@@ -167,6 +205,17 @@ public class RegionFileCache implements AutoCloseable { // Paper - no final try { if (datainputstream != null) { nbttagcompound = NBTCompressedStreamTools.a((DataInput) datainputstream); @@ -820,10 +832,10 @@ index d64f7ad925e5f40740a58ceee0845ac2db5419f2..8b341c14e7082fc96a464f2386a3dede return nbttagcompound; } -diff --git a/src/main/java/net/minecraft/server/RegionFileCompression.java b/src/main/java/net/minecraft/server/RegionFileCompression.java -index 3382d678e68e559b8d3cb9dced4fce24206cd38f..3b7894256dc8daa81be35f845cb5f8de02d7cb00 100644 ---- a/src/main/java/net/minecraft/server/RegionFileCompression.java -+++ b/src/main/java/net/minecraft/server/RegionFileCompression.java +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCompression.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCompression.java +index 78728e064479e7056b7c69e306854330691faa12..d94640f8bdc71d708efca9a95e1986872e1a00d7 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCompression.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileCompression.java @@ -13,7 +13,7 @@ import javax.annotation.Nullable; public class RegionFileCompression { @@ -860,16 +872,3 @@ index 3382d678e68e559b8d3cb9dced4fce24206cd38f..3b7894256dc8daa81be35f845cb5f8de public InputStream a(InputStream inputstream) throws IOException { return (InputStream) this.f.wrap(inputstream); } -diff --git a/src/main/java/net/minecraft/server/WorldUpgrader.java b/src/main/java/net/minecraft/server/WorldUpgrader.java -index 5ccdc0b87b922724c3dd3085860c55d4959ca0b4..888dae2d5ee8a71e83dd24e5f3c6bc8513016f9d 100644 ---- a/src/main/java/net/minecraft/server/WorldUpgrader.java -+++ b/src/main/java/net/minecraft/server/WorldUpgrader.java -@@ -218,7 +218,7 @@ public class WorldUpgrader { - int l = Integer.parseInt(matcher.group(2)) << 5; - - try { -- RegionFile regionfile = new RegionFile(file2, file1, true); -+ RegionFile regionfile = new RegionFile(file2, file1, true, true); // Tuinity - allow for chunk regionfiles to regen header - Throwable throwable = null; - - try { diff --git a/patches/Tuinity/patches/server/0011-Lag-compensate-block-breaking.patch b/patches/Tuinity/patches/server/0011-Lag-compensate-block-breaking.patch index 0844293a..c936e771 100644 --- a/patches/Tuinity/patches/server/0011-Lag-compensate-block-breaking.patch +++ b/patches/Tuinity/patches/server/0011-Lag-compensate-block-breaking.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Lag compensate block breaking Use time instead of ticks if ticks fall behind diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index 7b12e7610444ff20f2c3f458887bd7d4e6715036..994c735958dc0ee0dfd8c28820fcd4f50057aad0 100644 +index 182f419fde8eb3646a79cc0ba689ee486cb53338..5aa558bd05c4ab735730263f220478c36a4ba0fd 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -133,6 +133,12 @@ public final class TuinityConfig { @@ -22,11 +22,11 @@ index 7b12e7610444ff20f2c3f458887bd7d4e6715036..994c735958dc0ee0dfd8c28820fcd4f5 public static final class WorldConfig { public final String worldName; -diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff00415f61a 100644 ---- a/src/main/java/net/minecraft/server/PlayerInteractManager.java -+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -22,14 +22,29 @@ public class PlayerInteractManager { +diff --git a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +index 1511cf54fea53577a2808b5d84417eee834db984..e47a743fd3adc62aa47beec722f49eeaded246bc 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerInteractManager.java ++++ b/src/main/java/net/minecraft/server/level/PlayerInteractManager.java +@@ -55,14 +55,29 @@ public class PlayerInteractManager { private EnumGamemode gamemode; private EnumGamemode e; private boolean f; @@ -59,7 +59,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 public PlayerInteractManager(WorldServer worldserver) { this.gamemode = EnumGamemode.NOT_SET; this.e = EnumGamemode.NOT_SET; -@@ -85,7 +100,7 @@ public class PlayerInteractManager { +@@ -118,7 +133,7 @@ public class PlayerInteractManager { if (iblockdata == null || iblockdata.isAir()) { // Paper this.j = false; } else { @@ -68,7 +68,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 if (f >= 1.0F) { this.j = false; -@@ -105,7 +120,7 @@ public class PlayerInteractManager { +@@ -138,7 +153,7 @@ public class PlayerInteractManager { this.m = -1; this.f = false; } else { @@ -77,7 +77,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 } } -@@ -113,6 +128,12 @@ public class PlayerInteractManager { +@@ -146,6 +161,12 @@ public class PlayerInteractManager { private float a(IBlockData iblockdata, BlockPosition blockposition, int i) { int j = this.currentTick - i; @@ -90,7 +90,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 float f = iblockdata.getDamage(this.player, this.player.world, blockposition) * (float) (j + 1); int k = (int) (f * 10.0F); -@@ -180,7 +201,7 @@ public class PlayerInteractManager { +@@ -213,7 +234,7 @@ public class PlayerInteractManager { return; } @@ -99,7 +99,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 float f = 1.0F; iblockdata = this.world.getType(blockposition); -@@ -233,12 +254,12 @@ public class PlayerInteractManager { +@@ -266,12 +287,12 @@ public class PlayerInteractManager { int j = (int) (f * 10.0F); this.world.a(this.player.getId(), blockposition, j); @@ -114,7 +114,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 iblockdata = this.world.getType(blockposition); if (!iblockdata.isAir()) { -@@ -255,12 +276,18 @@ public class PlayerInteractManager { +@@ -288,12 +309,18 @@ public class PlayerInteractManager { this.f = false; this.j = true; this.k = blockposition; @@ -134,7 +134,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 } else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) { this.f = false; if (!Objects.equals(this.h, blockposition) && !BlockPosition.ZERO.equals(this.h)) { -@@ -272,7 +299,7 @@ public class PlayerInteractManager { +@@ -305,7 +332,7 @@ public class PlayerInteractManager { } this.world.a(this.player.getId(), blockposition, -1); @@ -143,7 +143,7 @@ index d57784c5dd44cc110b7c863ffff82263178e7d9a..967443a44106563fe71a528703751ff0 } } -@@ -282,7 +309,13 @@ public class PlayerInteractManager { +@@ -315,7 +342,13 @@ public class PlayerInteractManager { public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype, String s) { if (this.breakBlock(blockposition)) { diff --git a/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch b/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch index aaeb9ed4..53d9a975 100644 --- a/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch +++ b/patches/Tuinity/patches/server/0013-Per-World-Spawn-Limits.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Per World Spawn Limits This patch is licensed under the MIT license. See /licenses/MIT.md. diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index 994c735958dc0ee0dfd8c28820fcd4f50057aad0..a302cda14aa2dd6550cca03b07be21cdcb993061 100644 +index 5aa558bd05c4ab735730263f220478c36a4ba0fd..6473b951788a3ecbeee4811ea0288ff47b48355f 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -269,6 +269,23 @@ public final class TuinityConfig { @@ -35,7 +35,7 @@ index 994c735958dc0ee0dfd8c28820fcd4f50057aad0..a302cda14aa2dd6550cca03b07be21cd } \ No newline at end of file diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3c7e3db06be46b20c417b7ef36a17affa4c6ef78..80944242cb0c16a7b2b1c6b193656e78c2e58dd5 100644 +index 494e3b65880a5a5ced4adc8b4d5a51d2e78a51b0..77057470addd6e6934bd6c32b0c36dea11bbb95d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -342,6 +342,14 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0014-Detail-more-information-in-watchdog-dumps.patch b/patches/Tuinity/patches/server/0014-Detail-more-information-in-watchdog-dumps.patch index 78d5b4d6..a31f7609 100644 --- a/patches/Tuinity/patches/server/0014-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/Tuinity/patches/server/0014-Detail-more-information-in-watchdog-dumps.patch @@ -6,11 +6,123 @@ Subject: [PATCH] Detail more information in watchdog dumps - Dump position, world, velocity, and uuid for currently ticking entities - Dump player name, player uuid, position, and world for packet handling -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6eee9c858dffad0bb0ce06d850deec0725789c9f..32dadb91a30b67202a463cf5c9abc998efecad80 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -599,7 +599,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index f86f430598026a3a7e27fb8d40cfc5fe7b9b845d..7a61e5d21486a9e62cf5cfa4250e859d60385f0e 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -405,7 +405,14 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + } + + if (this.packetListener instanceof PlayerConnection) { ++ // Tuinity start - detailed watchdog information ++ net.minecraft.network.protocol.PlayerConnectionUtils.packetProcessing.push(this.packetListener); ++ try { ++ // Tuinity end - detailed watchdog information + ((PlayerConnection) this.packetListener).tick(); ++ } finally { // Tuinity start - detailed watchdog information ++ net.minecraft.network.protocol.PlayerConnectionUtils.packetProcessing.pop(); ++ } // Tuinity start - detailed watchdog information + } + + if (this.channel != null) { +diff --git a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java +index 67d8fe8ad036a9252c774bb6a914c8ec79981876..71a000edfab27c9965d1929af78582821d5af97a 100644 +--- a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java ++++ b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java +@@ -25,10 +25,30 @@ public class PlayerConnectionUtils { + ensureMainThread(packet, t0, (IAsyncTaskHandler) worldserver.getMinecraftServer()); + } + ++ // Tuinity start - detailed watchdog information ++ public static final java.util.concurrent.ConcurrentLinkedDeque packetProcessing = new java.util.concurrent.ConcurrentLinkedDeque<>(); ++ static final java.util.concurrent.atomic.AtomicLong totalMainThreadPacketsProcessed = new java.util.concurrent.atomic.AtomicLong(); ++ ++ public static long getTotalProcessedPackets() { ++ return totalMainThreadPacketsProcessed.get(); ++ } ++ ++ public static java.util.List getCurrentPacketProcessors() { ++ java.util.List ret = new java.util.ArrayList<>(4); ++ for (PacketListener listener : packetProcessing) { ++ ret.add(listener); ++ } ++ ++ return ret; ++ } ++ // Tuinity end - detailed watchdog information ++ + public static void ensureMainThread(Packet packet, T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { + if (!iasynctaskhandler.isMainThread()) { + Timing timing = MinecraftTimings.getPacketTiming(packet); // Paper - timings + iasynctaskhandler.execute(() -> { ++ packetProcessing.push(t0); // Tuinity - detailed watchdog information ++ try { // Tuinity - detailed watchdog information + if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590 + if (t0.a().isConnected()) { + try (Timing ignored = timing.startTiming()) { // Paper - timings +@@ -52,6 +72,12 @@ public class PlayerConnectionUtils { + } else { + PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet); + } ++ // Tuinity start - detailed watchdog information ++ } finally { ++ totalMainThreadPacketsProcessed.getAndIncrement(); ++ packetProcessing.pop(); ++ } ++ // Tuinity end - detailed watchdog information + + }); + throw CancelledPacketHandleException.INSTANCE; +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index d7399bc4a4c8ec0712dbe8b909bf5ef1fafa75db..2dc399e7aab930b062d7fdac354de7b7188f2369 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1014,7 +1014,26 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + } + ++ // Tuinity start - log detailed entity tick information ++ // TODO replace with varhandle ++ static final java.util.concurrent.atomic.AtomicReference currentlyTickingEntity = new java.util.concurrent.atomic.AtomicReference<>(); ++ ++ public static List getCurrentlyTickingEntities() { ++ Entity ticking = currentlyTickingEntity.get(); ++ List ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking }); ++ ++ return ret; ++ } ++ // Tuinity end - log detailed entity tick information ++ + public void entityJoinedWorld(Entity entity) { ++ // Tuinity start - log detailed entity tick information ++ com.tuinity.tuinity.util.TickThread.ensureTickThread("Cannot tick an entity off-main"); ++ try { ++ if (currentlyTickingEntity.get() == null) { ++ currentlyTickingEntity.lazySet(entity); ++ } ++ // Tuinity end - log detailed entity tick information + if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) { + this.chunkCheck(entity); + } else { +@@ -1067,6 +1086,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { + //} finally { timer.stopTiming(); } // Paper - timings - move up + + } ++ // Tuinity start - log detailed entity tick information ++ } finally { ++ if (currentlyTickingEntity.get() == entity) { ++ currentlyTickingEntity.lazySet(null); ++ } ++ } ++ // Tuinity end - log detailed entity tick information + } + + public void a(Entity entity, Entity entity1) { +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 6a3e859eef2878d9e203bba7930e52d7513d96e8..3912a524c6ada9c3b6d4abddc1578368c5391bee 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -691,7 +691,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return this.onGround; } @@ -50,7 +162,7 @@ index 6eee9c858dffad0bb0ce06d850deec0725789c9f..32dadb91a30b67202a463cf5c9abc998 if (this.noclip) { this.a(this.getBoundingBox().c(vec3d)); this.recalcPosition(); -@@ -743,6 +775,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -835,6 +867,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.world.getMethodProfiler().exit(); } @@ -64,7 +176,7 @@ index 6eee9c858dffad0bb0ce06d850deec0725789c9f..32dadb91a30b67202a463cf5c9abc998 } protected BlockPosition ap() { -@@ -3316,12 +3355,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3408,12 +3447,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return this.locBlock; } @@ -81,7 +193,7 @@ index 6eee9c858dffad0bb0ce06d850deec0725789c9f..32dadb91a30b67202a463cf5c9abc998 } public void setMot(double d0, double d1, double d2) { -@@ -3376,7 +3419,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3468,7 +3511,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } // Paper end if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) { @@ -91,120 +203,8 @@ index 6eee9c858dffad0bb0ce06d850deec0725789c9f..32dadb91a30b67202a463cf5c9abc998 int i = MathHelper.floor(d0); int j = MathHelper.floor(d1); int k = MathHelper.floor(d2); -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index fb1e3c705b8abee13695762cdfd0e9f1bfdb5ad8..ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -387,7 +387,14 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - } - - if (this.packetListener instanceof PlayerConnection) { -+ // Tuinity start - detailed watchdog information -+ PlayerConnectionUtils.packetProcessing.push(this.packetListener); -+ try { -+ // Tuinity end - detailed watchdog information - ((PlayerConnection) this.packetListener).tick(); -+ } finally { // Tuinity start - detailed watchdog information -+ PlayerConnectionUtils.packetProcessing.pop(); -+ } // Tuinity start - detailed watchdog information - } - - if (this.channel != null) { -diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -index 8c7080777b370f97e1291dfedde5b419290f39cc..8112b01f15c33f50fe5ec9aebf75d8091d440994 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -@@ -13,10 +13,30 @@ public class PlayerConnectionUtils { - ensureMainThread(packet, t0, (IAsyncTaskHandler) worldserver.getMinecraftServer()); - } - -+ // Tuinity start - detailed watchdog information -+ static final java.util.concurrent.ConcurrentLinkedDeque packetProcessing = new java.util.concurrent.ConcurrentLinkedDeque<>(); -+ static final java.util.concurrent.atomic.AtomicLong totalMainThreadPacketsProcessed = new java.util.concurrent.atomic.AtomicLong(); -+ -+ public static long getTotalProcessedPackets() { -+ return totalMainThreadPacketsProcessed.get(); -+ } -+ -+ public static java.util.List getCurrentPacketProcessors() { -+ java.util.List ret = new java.util.ArrayList<>(4); -+ for (PacketListener listener : packetProcessing) { -+ ret.add(listener); -+ } -+ -+ return ret; -+ } -+ // Tuinity end - detailed watchdog information -+ - public static void ensureMainThread(Packet packet, T t0, IAsyncTaskHandler iasynctaskhandler) throws CancelledPacketHandleException { - if (!iasynctaskhandler.isMainThread()) { - Timing timing = MinecraftTimings.getPacketTiming(packet); // Paper - timings - iasynctaskhandler.execute(() -> { -+ packetProcessing.push(t0); // Tuinity - detailed watchdog information -+ try { // Tuinity - detailed watchdog information - if (MinecraftServer.getServer().hasStopped() || (t0 instanceof PlayerConnection && ((PlayerConnection) t0).processedDisconnect)) return; // CraftBukkit, MC-142590 - if (t0.a().isConnected()) { - try (Timing ignored = timing.startTiming()) { // Paper - timings -@@ -40,6 +60,12 @@ public class PlayerConnectionUtils { - } else { - PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet); - } -+ // Tuinity start - detailed watchdog information -+ } finally { -+ totalMainThreadPacketsProcessed.getAndIncrement(); -+ packetProcessing.pop(); -+ } -+ // Tuinity end - detailed watchdog information - - }); - throw CancelledPacketHandleException.INSTANCE; -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index e285038154d83cbf0d7c0b6b8a247c11b9e20119..949ed1cbb19317844424975c9e976148cfa2614d 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -901,7 +901,26 @@ public class WorldServer extends World implements GeneratorAccessSeed { - - } - -+ // Tuinity start - log detailed entity tick information -+ // TODO replace with varhandle -+ static final java.util.concurrent.atomic.AtomicReference currentlyTickingEntity = new java.util.concurrent.atomic.AtomicReference<>(); -+ -+ public static List getCurrentlyTickingEntities() { -+ Entity ticking = currentlyTickingEntity.get(); -+ List ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking }); -+ -+ return ret; -+ } -+ // Tuinity end - log detailed entity tick information -+ - public void entityJoinedWorld(Entity entity) { -+ // Tuinity start - log detailed entity tick information -+ com.tuinity.tuinity.util.TickThread.ensureTickThread("Cannot tick an entity off-main"); -+ try { -+ if (currentlyTickingEntity.get() == null) { -+ currentlyTickingEntity.lazySet(entity); -+ } -+ // Tuinity end - log detailed entity tick information - if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) { - this.chunkCheck(entity); - } else { -@@ -954,6 +973,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { - //} finally { timer.stopTiming(); } // Paper - timings - move up - - } -+ // Tuinity start - log detailed entity tick information -+ } finally { -+ if (currentlyTickingEntity.get() == entity) { -+ currentlyTickingEntity.lazySet(null); -+ } -+ } -+ // Tuinity end - log detailed entity tick information - } - - public void a(Entity entity, Entity entity1) { diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index ae8903ee1decd22e2ad6138f29fbc757b807e0a7..089ddda8892c3660c5dcb62d0fd56544857a2eba 100644 +index 30a665c090f419985e1d0f49df9e8d110c83943a..00c728704a1a7aa8b3a2e7679eaa0d2f604da087 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -65,6 +65,78 @@ public class WatchdogThread extends Thread @@ -212,12 +212,12 @@ index ae8903ee1decd22e2ad6138f29fbc757b807e0a7..089ddda8892c3660c5dcb62d0fd56544 } + // Tuinity start - log detailed tick information -+ private void dumpEntity(net.minecraft.server.Entity entity) { ++ private void dumpEntity(net.minecraft.world.entity.Entity entity) { + Logger log = Bukkit.getServer().getLogger(); + double posX, posY, posZ; -+ net.minecraft.server.Vec3D mot; ++ net.minecraft.world.phys.Vec3D mot; + double moveStartX, moveStartY, moveStartZ; -+ net.minecraft.server.Vec3D moveVec; ++ net.minecraft.world.phys.Vec3D moveVec; + synchronized (entity.posLock) { + posX = entity.locX(); + posY = entity.locY(); @@ -231,7 +231,7 @@ index ae8903ee1decd22e2ad6138f29fbc757b807e0a7..089ddda8892c3660c5dcb62d0fd56544 + + String entityType = entity.getMinecraftKey().toString(); + java.util.UUID entityUUID = entity.getUniqueID(); -+ net.minecraft.server.World world = entity.getWorld(); ++ net.minecraft.world.level.World world = entity.getWorld(); + + log.log(Level.SEVERE, "Ticking entity: " + entityType + ", entity class: " + entity.getClass().getName()); + log.log(Level.SEVERE, "Entity status: dead: " + entity.dead + ", valid: " + entity.valid + ", alive: " + entity.isAlive() + ", is passenger: " + entity.isPassenger()); @@ -250,9 +250,9 @@ index ae8903ee1decd22e2ad6138f29fbc757b807e0a7..089ddda8892c3660c5dcb62d0fd56544 + Logger log = Bukkit.getServer().getLogger(); + + // ticking entities -+ for (net.minecraft.server.Entity entity : net.minecraft.server.WorldServer.getCurrentlyTickingEntities()) { ++ for (net.minecraft.world.entity.Entity entity : net.minecraft.server.level.WorldServer.getCurrentlyTickingEntities()) { + this.dumpEntity(entity); -+ net.minecraft.server.Entity vehicle = entity.getVehicle(); ++ net.minecraft.world.entity.Entity vehicle = entity.getVehicle(); + if (vehicle != null) { + log.log(Level.SEVERE, "Detailing vehicle for above entity:"); + this.dumpEntity(vehicle); @@ -260,16 +260,16 @@ index ae8903ee1decd22e2ad6138f29fbc757b807e0a7..089ddda8892c3660c5dcb62d0fd56544 + } + + // packet processors -+ for (net.minecraft.server.PacketListener packetListener : net.minecraft.server.PlayerConnectionUtils.getCurrentPacketProcessors()) { -+ if (packetListener instanceof net.minecraft.server.PlayerConnection) { -+ net.minecraft.server.EntityPlayer player = ((net.minecraft.server.PlayerConnection)packetListener).player; -+ long totalPackets = net.minecraft.server.PlayerConnectionUtils.getTotalProcessedPackets(); ++ for (net.minecraft.network.PacketListener packetListener : net.minecraft.network.protocol.PlayerConnectionUtils.getCurrentPacketProcessors()) { ++ if (packetListener instanceof net.minecraft.server.network.PlayerConnection) { ++ net.minecraft.server.level.EntityPlayer player = ((net.minecraft.server.network.PlayerConnection)packetListener).player; ++ long totalPackets = net.minecraft.network.protocol.PlayerConnectionUtils.getTotalProcessedPackets(); + if (player == null) { + log.log(Level.SEVERE, "Handling packet for player connection or ticking player connection (null player): " + packetListener); + log.log(Level.SEVERE, "Total packets processed on the main thread for all players: " + totalPackets); + } else { + this.dumpEntity(player); -+ net.minecraft.server.Entity vehicle = player.getVehicle(); ++ net.minecraft.world.entity.Entity vehicle = player.getVehicle(); + if (vehicle != null) { + log.log(Level.SEVERE, "Detailing vehicle for above entity:"); + this.dumpEntity(vehicle); diff --git a/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch b/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch index ce65c654..33ab9fbc 100644 --- a/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch +++ b/patches/Tuinity/patches/server/0015-Execute-chunk-tasks-mid-tick.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Execute chunk tasks mid-tick This will help the server load chunks if tick times are high. diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java -index a263cd7a0680e0cc3517f84308118eb32c487732..77df6888803093ad9527d276033f2ed767b39764 100644 +index 4666d6582535d6e49c5bd40d4fcdcdfe07590aa9..b870cca05f0ba354e6976a70511235636093d13c 100644 --- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +++ b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java @@ -310,6 +310,7 @@ public final class PaperTickList extends TickListServer { // extend to avo @@ -17,94 +17,11 @@ index a263cd7a0680e0cc3517f84308118eb32c487732..77df6888803093ad9527d276033f2ed7 } else { // re-schedule eventually toTick.tickState = STATE_SCHEDULED; -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 4082c4f366bce1784759bda773d3d35472403ade..7bb23731b548d5344013429a7d7df13686cb2249 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -893,7 +893,7 @@ public class ChunkProviderServer extends IChunkProvider { - this.world.getMethodProfiler().enter("purge"); - this.world.timings.doChunkMap.startTiming(); // Spigot - this.chunkMapDistance.purgeTickets(); -- this.world.getMinecraftServer().midTickLoadChunks(); // Paper -+ // Tuinity - replace logic - this.tickDistanceManager(); - this.world.timings.doChunkMap.stopTiming(); // Spigot - this.world.getMethodProfiler().exitEnter("chunks"); -@@ -903,7 +903,7 @@ public class ChunkProviderServer extends IChunkProvider { - this.world.timings.doChunkUnload.startTiming(); // Spigot - this.world.getMethodProfiler().exitEnter("unload"); - this.playerChunkMap.unloadChunks(booleansupplier); -- this.world.getMinecraftServer().midTickLoadChunks(); // Paper -+ // Tuinity - replace logic - this.world.timings.doChunkUnload.stopTiming(); // Spigot - this.world.getMethodProfiler().exit(); - this.clearCache(); -@@ -975,6 +975,8 @@ public class ChunkProviderServer extends IChunkProvider { - // Paper end - this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings - -+ int ticked = 0; // Tuinity - exec chunk tasks during world tick -+ - this.p = spawnercreature_d; - this.world.getMethodProfiler().exit(); - //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper -@@ -1004,7 +1006,7 @@ public class ChunkProviderServer extends IChunkProvider { - this.world.timings.chunkTicks.startTiming(); // Spigot // Paper - this.world.a(chunk, k); - this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper -- if (chunksTicked[0]++ % 10 == 0) this.world.getMinecraftServer().midTickLoadChunks(); // Paper -+ if ((++ticked & 1) == 0) MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - exec chunk tasks during world tick - } - } - } -@@ -1160,41 +1162,7 @@ public class ChunkProviderServer extends IChunkProvider { - ChunkProviderServer.this.world.getMethodProfiler().c("runTask"); - super.executeTask(runnable); - } -- -- // Paper start -- private long lastMidTickChunkTask = 0; -- public boolean pollChunkLoadTasks() { -- if (com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue() || ChunkProviderServer.this.world.asyncChunkTaskManager.pollNextChunkTask()) { -- try { -- ChunkProviderServer.this.tickDistanceManager(); -- } finally { -- // from below: process pending Chunk loadCallback() and unloadCallback() after each run task -- playerChunkMap.callbackExecutor.run(); -- } -- return true; -- } -- return false; -- } -- public void midTickLoadChunks() { -- MinecraftServer server = ChunkProviderServer.this.world.getMinecraftServer(); -- // always try to load chunks, restrain generation/other updates only. don't count these towards tick count -- //noinspection StatementWithEmptyBody -- while (pollChunkLoadTasks()) {} -- -- if (System.nanoTime() - lastMidTickChunkTask < 200000) { -- return; -- } -- -- for (;server.midTickChunksTasksRan < com.destroystokyo.paper.PaperConfig.midTickChunkTasks && server.canSleepForTick();) { -- if (this.executeNext()) { -- server.midTickChunksTasksRan++; -- lastMidTickChunkTask = System.nanoTime(); -- } else { -- break; -- } -- } -- } -- // Paper end -+ // Tuinity - replace logic - - @Override - protected boolean executeNext() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f2fd2c2df4b99910d1838035a5f1ed11731c98ca..a50b311876ce6aa3a571b3d290235775aa02d925 100644 +index b7a452b51ee4382e03d7879f511a7c34b415925a..41c8646aef9a8df2f99319c2a8e76d850bdcc1f6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -993,7 +993,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -231,7 +148,7 @@ index f2fd2c2df4b99910d1838035a5f1ed11731c98ca..a50b311876ce6aa3a571b3d290235775 return !this.canOversleep(); }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -@@ -1299,16 +1355,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant list = Lists.newArrayList(this.playerChunkMap.f()); // Paper +@@ -1029,7 +1031,7 @@ public class ChunkProviderServer extends IChunkProvider { + this.world.timings.chunkTicks.startTiming(); // Spigot // Paper + this.world.a(chunk, k); + this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper +- if (chunksTicked[0]++ % 10 == 0) this.world.getMinecraftServer().midTickLoadChunks(); // Paper ++ if ((++ticked & 1) == 0) MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - exec chunk tasks during world tick + } + } + } +@@ -1185,41 +1187,7 @@ public class ChunkProviderServer extends IChunkProvider { + ChunkProviderServer.this.world.getMethodProfiler().c("runTask"); + super.executeTask(runnable); } -+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick - } - // Paper start - Prevent armor stands from doing entity lookups - @Override -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 949ed1cbb19317844424975c9e976148cfa2614d..a1e0761f255b5bda9834738fbcea57a129ada4e3 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -297,6 +297,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +- +- // Paper start +- private long lastMidTickChunkTask = 0; +- public boolean pollChunkLoadTasks() { +- if (com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue() || ChunkProviderServer.this.world.asyncChunkTaskManager.pollNextChunkTask()) { +- try { +- ChunkProviderServer.this.tickDistanceManager(); +- } finally { +- // from below: process pending Chunk loadCallback() and unloadCallback() after each run task +- playerChunkMap.callbackExecutor.run(); +- } +- return true; +- } +- return false; +- } +- public void midTickLoadChunks() { +- MinecraftServer server = ChunkProviderServer.this.world.getMinecraftServer(); +- // always try to load chunks, restrain generation/other updates only. don't count these towards tick count +- //noinspection StatementWithEmptyBody +- while (pollChunkLoadTasks()) {} +- +- if (System.nanoTime() - lastMidTickChunkTask < 200000) { +- return; +- } +- +- for (;server.midTickChunksTasksRan < com.destroystokyo.paper.PaperConfig.midTickChunkTasks && server.canSleepForTick();) { +- if (this.executeNext()) { +- server.midTickChunksTasksRan++; +- lastMidTickChunkTask = System.nanoTime(); +- } else { +- break; +- } +- } +- } +- // Paper end ++ // Tuinity - replace logic + + @Override + protected boolean executeNext() { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 2dc399e7aab930b062d7fdac354de7b7188f2369..794704609afa80038077fad9a21d9b1462d84377 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -410,6 +410,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Tuinity end + // Tuinity start - execute chunk tasks mid tick -+ long lastMidTickExecuteFailure; ++ public long lastMidTickExecuteFailure; + // Tuinity end - execute chunk tasks mid tick + // Add env and gen to constructor, WorldData -> WorldDataServer public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -559,7 +563,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -672,7 +676,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } timings.scheduledBlocks.stopTiming(); // Paper @@ -314,7 +302,7 @@ index 949ed1cbb19317844424975c9e976148cfa2614d..a1e0761f255b5bda9834738fbcea57a1 gameprofilerfiller.exitEnter("raid"); this.timings.raids.startTiming(); // Paper - timings this.persistentRaid.a(); -@@ -568,7 +572,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -681,7 +685,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { timings.doSounds.startTiming(); // Spigot this.ak(); timings.doSounds.stopTiming(); // Spigot @@ -323,7 +311,7 @@ index 949ed1cbb19317844424975c9e976148cfa2614d..a1e0761f255b5bda9834738fbcea57a1 this.ticking = false; gameprofilerfiller.exitEnter("entities"); boolean flag3 = true || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players -@@ -645,7 +649,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -758,7 +762,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } this.afterEntityTickingTasks.clear(); // Paper end @@ -332,7 +320,7 @@ index 949ed1cbb19317844424975c9e976148cfa2614d..a1e0761f255b5bda9834738fbcea57a1 Entity entity2; -@@ -655,7 +659,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -768,7 +772,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } timings.tickEntities.stopTiming(); // Spigot @@ -341,3 +329,15 @@ index 949ed1cbb19317844424975c9e976148cfa2614d..a1e0761f255b5bda9834738fbcea57a1 this.tickBlockEntities(); } +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 6ec5d99dffa26b9a94f59340ba9498baf8bc2015..96a5a05443091b797a59c6da03086e4e1a08e3d8 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -960,6 +960,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return; + // Paper end + } ++ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick + } + // Paper start - Prevent armor stands from doing entity lookups + @Override diff --git a/patches/Tuinity/patches/server/0016-Change-writes-to-use-NORMAL-priority-rather-than-LOW.patch b/patches/Tuinity/patches/server/0016-Change-writes-to-use-NORMAL-priority-rather-than-LOW.patch index a6a3a918..a4483ea4 100644 --- a/patches/Tuinity/patches/server/0016-Change-writes-to-use-NORMAL-priority-rather-than-LOW.patch +++ b/patches/Tuinity/patches/server/0016-Change-writes-to-use-NORMAL-priority-rather-than-LOW.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Change writes to use NORMAL priority rather than LOW Should limit build up of I/O tasks, or at least properly indicate to server owners that I/O is falling behind -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 4abd156556b40aa82e6ed5093b279c0f780b9c9c..bef3ff1e4527e4eb98fcb29910d8f2e39689a240 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1014,7 +1014,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index e7cd6392d722d0e13b86b57d70946b18688f6621..31d5356b1498f55ef53f3c66b6629bc556b9508f 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -1068,7 +1068,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world, chunkPos.x, chunkPos.z, @@ -19,7 +19,7 @@ index 4abd156556b40aa82e6ed5093b279c0f780b9c9c..bef3ff1e4527e4eb98fcb29910d8f2e3 if (!chunk.isNeedsSaving()) { return; -@@ -1048,7 +1048,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1102,7 +1102,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { asyncSaveData = ChunkRegionLoader.getAsyncSaveData(this.world, chunk); } @@ -28,7 +28,7 @@ index 4abd156556b40aa82e6ed5093b279c0f780b9c9c..bef3ff1e4527e4eb98fcb29910d8f2e3 asyncSaveData, chunk); chunk.setLastSaved(this.world.getTime()); -@@ -1686,7 +1686,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1740,7 +1740,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (Thread.currentThread() != com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE) { com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave( this.world, chunkcoordintpair.x, chunkcoordintpair.z, null, nbttagcompound, @@ -37,11 +37,11 @@ index 4abd156556b40aa82e6ed5093b279c0f780b9c9c..bef3ff1e4527e4eb98fcb29910d8f2e3 return; } super.write(chunkcoordintpair, nbttagcompound); -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 6a0f07b13eef5560dfc7c7b39618c0b825533aec..46c4e66566b7206d311653341987b9312dea3e68 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -167,7 +167,7 @@ public class VillagePlace extends RegionFileSection { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index ce165233739c7b92a76031b949f269bd0a11149c..dc36d714dfb360ddb203480079d1ab231da0ed45 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +@@ -180,7 +180,7 @@ public class VillagePlace extends RegionFileSection { data = this.getData(chunkcoordintpair); } com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.world, @@ -50,7 +50,7 @@ index 6a0f07b13eef5560dfc7c7b39618c0b825533aec..46c4e66566b7206d311653341987b931 } } // Paper end -@@ -292,7 +292,7 @@ public class VillagePlace extends RegionFileSection { +@@ -305,7 +305,7 @@ public class VillagePlace extends RegionFileSection { if (this.world != null && Thread.currentThread() != com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE) { com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave( this.world, chunkcoordintpair.x, chunkcoordintpair.z, nbttagcompound, null, diff --git a/patches/Tuinity/patches/server/0017-Allow-controlled-flushing-for-network-manager.patch b/patches/Tuinity/patches/server/0017-Allow-controlled-flushing-for-network-manager.patch index 4e10e220..39bfcb59 100644 --- a/patches/Tuinity/patches/server/0017-Allow-controlled-flushing-for-network-manager.patch +++ b/patches/Tuinity/patches/server/0017-Allow-controlled-flushing-for-network-manager.patch @@ -8,12 +8,12 @@ Only make one flush call when emptying the packet queue too This patch will be used to optimise out flush calls in later patches. -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437c2dd18d1 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -71,6 +71,39 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - EnumProtocol protocol; +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index 7a61e5d21486a9e62cf5cfa4250e859d60385f0e..a9637772ead360ee476d59104b50a505e6d0ef4c 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -89,6 +89,39 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + public EnumProtocol protocol; // Paper end + // Tuinity start - allow controlled flushing @@ -22,14 +22,14 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 + private int flushPacketsStart; + private final Object flushLock = new Object(); + -+ void disableAutomaticFlush() { ++ public void disableAutomaticFlush() { + synchronized (this.flushLock) { + this.flushPacketsStart = this.packetWrites.get(); // must be volatile and before canFlush = false + this.canFlush = false; + } + } + -+ void enableAutomaticFlush() { ++ public void enableAutomaticFlush() { + synchronized (this.flushLock) { + this.canFlush = true; + if (this.packetWrites.get() != this.flushPacketsStart) { // must be after canFlush = true @@ -52,7 +52,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 public NetworkManager(EnumProtocolDirection enumprotocoldirection) { this.h = enumprotocoldirection; } -@@ -222,7 +255,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -240,7 +273,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { MCUtil.isMainThread() && packet.isReady() && this.packetQueue.isEmpty() && (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty()) ))) { @@ -61,7 +61,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 return; } // write the packets to the queue, then flush - antixray hooks there already -@@ -248,6 +281,14 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -266,6 +299,14 @@ public class NetworkManager extends SimpleChannelInboundHandler> { private void dispatchPacket(Packet packet, @Nullable GenericFutureListener> genericFutureListener) { this.b(packet, genericFutureListener); } // Paper - OBFHELPER private void b(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { @@ -76,7 +76,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 EnumProtocol enumprotocol = EnumProtocol.a(packet); EnumProtocol enumprotocol1 = (EnumProtocol) this.channel.attr(NetworkManager.c).get(); -@@ -270,7 +311,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -288,7 +329,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { try { // Paper end @@ -85,7 +85,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 if (genericfuturelistener != null) { channelfuture.addListener(genericfuturelistener); -@@ -302,7 +343,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -320,7 +361,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } try { // Paper end @@ -94,7 +94,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 if (genericfuturelistener != null) { -@@ -345,6 +386,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -363,6 +404,8 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } private boolean processQueue() { if (this.packetQueue.isEmpty()) return true; @@ -103,7 +103,7 @@ index ed9c06c91a3ee77dad6e616cf28a34a4177ce6e3..a7530cfe7055017e8a98ee5422b48437 // If we are on main, we are safe here in that nothing else should be processing queue off main anymore // But if we are not on main due to login/status, the parent is synchronized on packetQueue java.util.Iterator iterator = this.packetQueue.iterator(); -@@ -352,16 +395,22 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -370,16 +413,22 @@ public class NetworkManager extends SimpleChannelInboundHandler> { NetworkManager.QueuedPacket queued = iterator.next(); // poll -> peek // Fix NPE (Spigot bug caused by handleDisconnection()) diff --git a/patches/Tuinity/patches/server/0018-Consolidate-flush-calls-for-entity-tracker-packets.patch b/patches/Tuinity/patches/server/0018-Consolidate-flush-calls-for-entity-tracker-packets.patch index f529b81c..6c36d7a5 100644 --- a/patches/Tuinity/patches/server/0018-Consolidate-flush-calls-for-entity-tracker-packets.patch +++ b/patches/Tuinity/patches/server/0018-Consolidate-flush-calls-for-entity-tracker-packets.patch @@ -21,18 +21,18 @@ With this change I could get all 200 on at 0ms ping. So in general this patch should reduce Netty I/O thread load. -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7bb23731b548d5344013429a7d7df13686cb2249..c8c4d4f3d5a0ca6255473f3f256eeb32f18a9984 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1022,7 +1022,25 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index 75d2c33e27d6f0a8308aa2c1eabc3acc69e90695..187a49998d83c6a7c2005480c4ae405f26b11018 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -1047,7 +1047,25 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().exit(); } + // Tuinity start - controlled flush for entity tracker packets -+ List disabledFlushes = new java.util.ArrayList<>(this.world.getPlayers().size()); ++ List disabledFlushes = new java.util.ArrayList<>(this.world.getPlayers().size()); + for (EntityPlayer player : this.world.getPlayers()) { -+ PlayerConnection connection = player.playerConnection; ++ net.minecraft.server.network.PlayerConnection connection = player.playerConnection; + if (connection != null) { + connection.networkManager.disableAutomaticFlush(); + disabledFlushes.add(connection.networkManager); @@ -43,7 +43,7 @@ index 7bb23731b548d5344013429a7d7df13686cb2249..c8c4d4f3d5a0ca6255473f3f256eeb32 this.playerChunkMap.g(); + // Tuinity start - controlled flush for entity tracker packets + } finally { -+ for (NetworkManager networkManager : disabledFlushes) { ++ for (net.minecraft.network.NetworkManager networkManager : disabledFlushes) { + networkManager.enableAutomaticFlush(); + } + } diff --git a/patches/Tuinity/patches/server/0019-Time-scoreboard-search.patch b/patches/Tuinity/patches/server/0019-Time-scoreboard-search.patch index 4c19fcc2..c14d27ee 100644 --- a/patches/Tuinity/patches/server/0019-Time-scoreboard-search.patch +++ b/patches/Tuinity/patches/server/0019-Time-scoreboard-search.patch @@ -7,10 +7,10 @@ Plugins leaking scoreboards will make this very expensive, let server owners debug it easily diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 884b59d478aa7de49906520e77866a7949bed19d..7991c66a8fe7ee9725ab75fb80d1363cd7348532 100644 +index b4d43ceed368552e703886213327a0c0bb5ccb92..9d64fffd10ce21a26541198b0c2fd8f0c77f47f1 100644 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java -@@ -43,6 +43,8 @@ public final class MinecraftTimings { +@@ -46,6 +46,8 @@ public final class MinecraftTimings { public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update"); public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); @@ -20,7 +20,7 @@ index 884b59d478aa7de49906520e77866a7949bed19d..7991c66a8fe7ee9725ab75fb80d1363c private MinecraftTimings() {} diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java -index 6fa2e271f7f01cd0bf247e2071fa33bd8c5c6cbe..3a9491e9495bec93d5556bd8c09196ea117161d5 100644 +index 9c30a79cc55c6455aa18e3798728deaacc3434ca..332e4bb8a5a426b27b1f580e7a2d77dc1a13064c 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java @@ -113,9 +113,18 @@ public final class CraftScoreboardManager implements ScoreboardManager { diff --git a/patches/Tuinity/patches/server/0020-Make-CallbackExecutor-strict-again.patch b/patches/Tuinity/patches/server/0020-Make-CallbackExecutor-strict-again.patch index a710f2c8..6cc3e282 100644 --- a/patches/Tuinity/patches/server/0020-Make-CallbackExecutor-strict-again.patch +++ b/patches/Tuinity/patches/server/0020-Make-CallbackExecutor-strict-again.patch @@ -18,11 +18,11 @@ This patch also reverts incorrect use(s) of the class by paper. the callback executor also prevents the future from catching any exception thrown from it. -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c8c4d4f3d5a0ca6255473f3f256eeb32f18a9984..e1a17abda657c7eb7aee7cd0763bcb48cc8b154a 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -174,9 +174,9 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index 187a49998d83c6a7c2005480c4ae405f26b11018..2f57e20e6a05274c8d2d5654f3c81599d16840af 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -199,9 +199,9 @@ public class ChunkProviderServer extends IChunkProvider { try { if (onLoad != null) { @@ -34,11 +34,11 @@ index c8c4d4f3d5a0ca6255473f3f256eeb32f18a9984..e1a17abda657c7eb7aee7cd0763bcb48 } } catch (Throwable thr) { if (thr instanceof ThreadDeath) { -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index bef3ff1e4527e4eb98fcb29910d8f2e39689a240..b36568601dd2956518cc5dfe1b10cca8d65b6fb6 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -122,31 +122,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 31d5356b1498f55ef53f3c66b6629bc556b9508f..2beb14192910a35936e0ff5878c227bf22abd442 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -176,31 +176,28 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable { diff --git a/patches/Tuinity/patches/server/0021-Optimise-entity-hard-collision-checking.patch b/patches/Tuinity/patches/server/0021-Optimise-entity-hard-collision-checking.patch index ac4a9644..fb42f5d0 100644 --- a/patches/Tuinity/patches/server/0021-Optimise-entity-hard-collision-checking.patch +++ b/patches/Tuinity/patches/server/0021-Optimise-entity-hard-collision-checking.patch @@ -10,11 +10,152 @@ for crammed entities (shove 130 cows into an 8x6 area in one chunk). Less crammed entities are likely to show significantly less benefit. Effectively, this patch optimises crammed entity situations. -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 3bcd63a754538ccfc5965207a8fc79faa31925c0..dface62144bb230c576e9eafad1016d19d211118 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,56 @@ public class Chunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 3912a524c6ada9c3b6d4abddc1578368c5391bee..b32b0ebf283a8face528ded0b845270953f536f1 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -322,6 +322,41 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + } + // Paper end - optimise entity tracking + ++ // Tuinity start ++ /** ++ * Overriding this field will cause memory leaks. ++ */ ++ private final boolean hardCollides; ++ ++ private static final java.util.Map, Boolean> cachedOverrides = java.util.Collections.synchronizedMap(new java.util.WeakHashMap<>()); ++ { ++ Boolean hardCollides = cachedOverrides.get(this.getClass()); ++ if (hardCollides == null) { ++ try { ++ java.lang.reflect.Method getHardCollisionBoxEntityMethod = Entity.class.getMethod("j", Entity.class); ++ java.lang.reflect.Method hasHardCollisionBoxMethod = Entity.class.getMethod("aZ"); ++ if (!this.getClass().getMethod(hasHardCollisionBoxMethod.getName(), hasHardCollisionBoxMethod.getParameterTypes()).equals(hasHardCollisionBoxMethod) ++ || !this.getClass().getMethod(getHardCollisionBoxEntityMethod.getName(), getHardCollisionBoxEntityMethod.getParameterTypes()).equals(getHardCollisionBoxEntityMethod)) { ++ hardCollides = Boolean.TRUE; ++ } else { ++ hardCollides = Boolean.FALSE; ++ } ++ cachedOverrides.put(this.getClass(), hardCollides); ++ } ++ catch (ThreadDeath thr) { throw thr; } ++ catch (Throwable thr) { ++ // shouldn't happen, just explode ++ throw new RuntimeException(thr); ++ } ++ } ++ this.hardCollides = hardCollides.booleanValue(); ++ } ++ ++ public final boolean hardCollides() { ++ return this.hardCollides; ++ } ++ // Tuinity end ++ + public Entity(EntityTypes entitytypes, World world) { + this.id = Entity.entityCount.incrementAndGet(); + this.passengers = Lists.newArrayList(); +@@ -2094,11 +2129,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return EnumInteractionResult.PASS; + } + +- public boolean j(Entity entity) { ++ public boolean j(Entity entity) { // Tuinity - diff on change, hard colliding entities override this + return entity.aZ() && !this.isSameVehicle(entity); + } + +- public boolean aZ() { ++ public boolean aZ() {// Tuinity - diff on change, hard colliding entities override this + return false; + } + +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index 1ff9e771788a4ab52129070e355ca48df2949470..4b0736d1f805b82e031e7cd7077b59365c196ebe 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -64,16 +64,25 @@ public interface IEntityAccess { + return this.b(oclass, axisalignedbb, IEntitySelector.g); + } + ++ // Tuinity start - optimise hard collision ++ /** ++ * Not guaranteed to only return hard colliding entities ++ */ ++ default List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { ++ return this.getEntities(entity, axisalignedbb, predicate); ++ } ++ // Tuinity end - optimise hard collision ++ + default Stream c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { + if (axisalignedbb.a() < 1.0E-7D) { + return Stream.empty(); + } else { + AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D); + +- return this.getEntities(entity, axisalignedbb1, predicate.and((entity1) -> { ++ predicate = predicate.and((entity1) -> { // Tuinity - optimise entity hard collisions + boolean flag; + +- if (entity1.getBoundingBox().c(axisalignedbb1)) { ++ if (true || entity1.getBoundingBox().c(axisalignedbb1)) { // Tuinity - always true, wtf did they think this.getEntities(entity, axisalignedbb1) does? + label25: + { + if (entity == null) { +@@ -91,7 +100,7 @@ public interface IEntityAccess { + + flag = false; + return flag; +- })).stream().map(Entity::getBoundingBox).map(VoxelShapes::a); ++ }); return ((entity != null && entity.hardCollides()) ? this.getEntities(entity, axisalignedbb1, predicate) : this.getHardCollidingEntities(entity, axisalignedbb1, predicate)).stream().map(Entity::getBoundingBox).map(VoxelShapes::a); // Tuinity - optimise entity hard collisions + } + } + +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 96a5a05443091b797a59c6da03086e4e1a08e3d8..d2e4028c67e70fc6aa3193ea6f1fc845bc637fd3 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1144,6 +1144,35 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return this.getChunkAt(i, j, ChunkStatus.FULL, false); + } + ++ // Tuinity start - optimise hard collision handling ++ @Override ++ public List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { ++ return this.getHardCollidingEntities(entity, axisalignedbb, predicate, Lists.newArrayList()); ++ } ++ ++ public List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate, List list) { ++ // copied from below ++ 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); ++ int l = MathHelper.floor((axisalignedbb.maxZ + 2.0D) / 16.0D); ++ ++ net.minecraft.server.level.ChunkProviderServer chunkProvider = ((WorldServer)this).getChunkProvider(); ++ ++ for (int i1 = i; i1 <= j; ++i1) { ++ for (int j1 = k; j1 <= l; ++j1) { ++ Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThread(i1, j1); ++ ++ if (chunk != null) { ++ chunk.getHardCollidingEntities(entity, axisalignedbb, list, predicate); ++ } ++ } ++ } ++ ++ return list; ++ } ++ // Tuinity end - optimise hard collision handling ++ + @Override + public List getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { + this.getMethodProfiler().c("getEntities"); +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index 34a9f7b2f998f77b1279516cd09397ab6c2ac1cc..9293cb1dd27bb3b797e29f6edddf22ba80ff4134 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -137,6 +137,56 @@ public class Chunk implements IChunkAccess { private final int[] inventoryEntityCounts = new int[16]; // Paper end @@ -71,7 +212,7 @@ index 3bcd63a754538ccfc5965207a8fc79faa31925c0..dface62144bb230c576e9eafad1016d1 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(); -@@ -595,7 +645,7 @@ public class Chunk implements IChunkAccess { +@@ -641,7 +691,7 @@ public class Chunk implements IChunkAccess { entity.chunkY = k; entity.chunkZ = this.loc.z; this.entities.add(entity); // Paper - per chunk entity list @@ -80,7 +221,7 @@ index 3bcd63a754538ccfc5965207a8fc79faa31925c0..dface62144bb230c576e9eafad1016d1 // Paper start if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -633,7 +683,7 @@ public class Chunk implements IChunkAccess { +@@ -679,7 +729,7 @@ public class Chunk implements IChunkAccess { entity.entitySlice = null; entity.inChunk = false; } @@ -89,144 +230,3 @@ index 3bcd63a754538ccfc5965207a8fc79faa31925c0..dface62144bb230c576e9eafad1016d1 return; } if (entity instanceof EntityItem) { -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 32dadb91a30b67202a463cf5c9abc998efecad80..4c67a767e65b8a76c5f5a267d0b4ddf28494bc55 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -230,6 +230,41 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - // Paper end - optimise entity tracking - -+ // Tuinity start -+ /** -+ * Overriding this field will cause memory leaks. -+ */ -+ private final boolean hardCollides; -+ -+ private static final java.util.Map, Boolean> cachedOverrides = java.util.Collections.synchronizedMap(new java.util.WeakHashMap<>()); -+ { -+ Boolean hardCollides = cachedOverrides.get(this.getClass()); -+ if (hardCollides == null) { -+ try { -+ java.lang.reflect.Method getHardCollisionBoxEntityMethod = Entity.class.getMethod("j", Entity.class); -+ java.lang.reflect.Method hasHardCollisionBoxMethod = Entity.class.getMethod("aZ"); -+ if (!this.getClass().getMethod(hasHardCollisionBoxMethod.getName(), hasHardCollisionBoxMethod.getParameterTypes()).equals(hasHardCollisionBoxMethod) -+ || !this.getClass().getMethod(getHardCollisionBoxEntityMethod.getName(), getHardCollisionBoxEntityMethod.getParameterTypes()).equals(getHardCollisionBoxEntityMethod)) { -+ hardCollides = Boolean.TRUE; -+ } else { -+ hardCollides = Boolean.FALSE; -+ } -+ cachedOverrides.put(this.getClass(), hardCollides); -+ } -+ catch (ThreadDeath thr) { throw thr; } -+ catch (Throwable thr) { -+ // shouldn't happen, just explode -+ throw new RuntimeException(thr); -+ } -+ } -+ this.hardCollides = hardCollides.booleanValue(); -+ } -+ -+ public final boolean hardCollides() { -+ return this.hardCollides; -+ } -+ // Tuinity end -+ - public Entity(EntityTypes entitytypes, World world) { - this.id = Entity.entityCount.incrementAndGet(); - this.passengers = Lists.newArrayList(); -@@ -2002,11 +2037,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return EnumInteractionResult.PASS; - } - -- public boolean j(Entity entity) { -+ public boolean j(Entity entity) { // Tuinity - diff on change, hard colliding entities override this - return entity.aZ() && !this.isSameVehicle(entity); - } - -- public boolean aZ() { -+ public boolean aZ() {// Tuinity - diff on change, hard colliding entities override this - return false; - } - -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 2639c17b7f6100533f33124f9e49990cd303d161..b053bb74f6df174a27dbfd7b1b3e3ccbb0b26659 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -55,16 +55,25 @@ public interface IEntityAccess { - return this.b(oclass, axisalignedbb, IEntitySelector.g); - } - -+ // Tuinity start - optimise hard collision -+ /** -+ * Not guaranteed to only return hard colliding entities -+ */ -+ default List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { -+ return this.getEntities(entity, axisalignedbb, predicate); -+ } -+ // Tuinity end - optimise hard collision -+ - default Stream c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { - if (axisalignedbb.a() < 1.0E-7D) { - return Stream.empty(); - } else { - AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D); - -- return this.getEntities(entity, axisalignedbb1, predicate.and((entity1) -> { -+ predicate = predicate.and((entity1) -> { // Tuinity - optimise entity hard collisions - boolean flag; - -- if (entity1.getBoundingBox().c(axisalignedbb1)) { -+ if (true || entity1.getBoundingBox().c(axisalignedbb1)) { // Tuinity - always true, wtf did they think this.getEntities(entity, axisalignedbb1) does? - label25: - { - if (entity == null) { -@@ -82,7 +91,7 @@ public interface IEntityAccess { - - flag = false; - return flag; -- })).stream().map(Entity::getBoundingBox).map(VoxelShapes::a); -+ }); return ((entity != null && entity.hardCollides()) ? this.getEntities(entity, axisalignedbb1, predicate) : this.getHardCollidingEntities(entity, axisalignedbb1, predicate)).stream().map(Entity::getBoundingBox).map(VoxelShapes::a); // Tuinity - optimise entity hard collisions - } - } - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 165b8e20ab090284b7c70b5cc9c0d58242400b54..15617d20883030b240014dbb258fd0086fef4235 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1084,6 +1084,35 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return this.getChunkAt(i, j, ChunkStatus.FULL, false); - } - -+ // Tuinity start - optimise hard collision handling -+ @Override -+ public List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { -+ return this.getHardCollidingEntities(entity, axisalignedbb, predicate, Lists.newArrayList()); -+ } -+ -+ public List getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate, List list) { -+ // copied from below -+ 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); -+ int l = MathHelper.floor((axisalignedbb.maxZ + 2.0D) / 16.0D); -+ -+ ChunkProviderServer chunkProvider = ((WorldServer)this).getChunkProvider(); -+ -+ for (int i1 = i; i1 <= j; ++i1) { -+ for (int j1 = k; j1 <= l; ++j1) { -+ Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThread(i1, j1); -+ -+ if (chunk != null) { -+ chunk.getHardCollidingEntities(entity, axisalignedbb, list, predicate); -+ } -+ } -+ } -+ -+ return list; -+ } -+ // Tuinity end - optimise hard collision handling -+ - @Override - public List getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { - this.getMethodProfiler().c("getEntities"); diff --git a/patches/Tuinity/patches/server/0022-Improved-oversized-chunk-data-packet-handling.patch b/patches/Tuinity/patches/server/0022-Improved-oversized-chunk-data-packet-handling.patch index e72b2638..966de024 100644 --- a/patches/Tuinity/patches/server/0022-Improved-oversized-chunk-data-packet-handling.patch +++ b/patches/Tuinity/patches/server/0022-Improved-oversized-chunk-data-packet-handling.patch @@ -10,11 +10,11 @@ This patch relies upon the improve extra packet handling patch, as we now use PacketPlayOutMapChunk as an extra packet. See its patch notes for further details. -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d10835c44 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -19,7 +19,7 @@ public class PacketPlayOutMapChunk implements Packet { +diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutMapChunk.java +index 3047cf8c4ec1b664d6b790f18d2b1657e4b00435..1295c391ae48f0864c243ca9046f31480eb768fe 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutMapChunk.java ++++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutMapChunk.java +@@ -32,7 +32,7 @@ public class PacketPlayOutMapChunk implements Packet { @Nullable private int[] e; private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER @@ -23,7 +23,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d private boolean h; // Paper start - Async-Anti-Xray - Set the ready flag to true -@@ -31,7 +31,9 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -44,7 +44,9 @@ public class PacketPlayOutMapChunk implements Packet { // Paper start private final java.util.List extraPackets = new java.util.ArrayList<>(); @@ -34,7 +34,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d @Override public java.util.List getExtraPackets() { -@@ -40,7 +42,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -53,7 +55,7 @@ public class PacketPlayOutMapChunk implements Packet { // Paper end // 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 @@ -43,7 +43,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d ChunkPacketInfo chunkPacketInfo = modifyBlocks ? chunk.world.chunkPacketBlockController.getChunkPacketInfo(this, chunk, i) : null; // Paper end ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); -@@ -49,27 +51,12 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -62,27 +64,12 @@ public class PacketPlayOutMapChunk implements Packet { this.b = chunkcoordintpair.z; this.h = i == 65535; this.d = new NBTTagCompound(); @@ -77,7 +77,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d // Paper end this.g = Lists.newArrayList(); iterator = chunk.getTileEntities().entrySet().iterator(); -@@ -82,8 +69,16 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -95,8 +82,16 @@ public class PacketPlayOutMapChunk implements Packet { int j = blockposition.getY() >> 4; if (this.f() || (i & 1 << j) != 0) { @@ -95,7 +95,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d PacketPlayOutTileEntityData updatePacket = tileentity.getUpdatePacket(); if (updatePacket != null) { this.extraPackets.add(updatePacket); -@@ -97,7 +92,42 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -110,7 +105,42 @@ public class PacketPlayOutMapChunk implements Packet { this.g.add(nbttagcompound); } } @@ -138,7 +138,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d } // Paper start - Async-Anti-Xray - Getter and Setter for the ready flag -@@ -188,7 +218,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -201,7 +231,7 @@ public class PacketPlayOutMapChunk implements Packet { for (int l = achunksection.length; k < l; ++k) { ChunkSection chunksection = achunksection[k]; @@ -147,7 +147,7 @@ index b9276928a58d56ca9aac95d262d8555522946bd7..d5a8036b764699a70a69b7dc3d45ea6d j |= 1 << k; chunksection.writeChunkSection(packetdataserializer, chunkPacketInfo); // Paper - Anti-Xray - Add chunk packet info } -@@ -205,7 +235,7 @@ public class PacketPlayOutMapChunk implements Packet { +@@ -218,7 +248,7 @@ public class PacketPlayOutMapChunk implements Packet { for (int l = achunksection.length; k < l; ++k) { ChunkSection chunksection = achunksection[k]; diff --git a/patches/Tuinity/patches/server/0023-Reduce-iterator-allocation-from-chunk-gen.patch b/patches/Tuinity/patches/server/0023-Reduce-iterator-allocation-from-chunk-gen.patch index da23296f..3cb9bc7f 100644 --- a/patches/Tuinity/patches/server/0023-Reduce-iterator-allocation-from-chunk-gen.patch +++ b/patches/Tuinity/patches/server/0023-Reduce-iterator-allocation-from-chunk-gen.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Reduce iterator allocation from chunk gen Replace via iterating over an array -diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index f6c9bdbf52d773d7aa601125b887b347163f9328..51ea295d66312c95685b9fe4ee502a029d2fff20 100644 ---- a/src/main/java/net/minecraft/server/ChunkStatus.java -+++ b/src/main/java/net/minecraft/server/ChunkStatus.java -@@ -109,7 +109,7 @@ public class ChunkStatus { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java +index f094ddf6b4d155f3c7a08a3b811c98b0862fd098..f4a4d63a2e21b08580023cf0dcd15a68d192cf14 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkStatus.java +@@ -120,7 +120,7 @@ public class ChunkStatus { private final ChunkStatus.c w; private final int x; private final ChunkStatus.Type y; @@ -18,7 +18,7 @@ index f6c9bdbf52d773d7aa601125b887b347163f9328..51ea295d66312c95685b9fe4ee502a02 private static CompletableFuture> a(ChunkStatus chunkstatus, LightEngineThreaded lightenginethreaded, IChunkAccess ichunkaccess) { boolean flag = a(chunkstatus, ichunkaccess); -@@ -171,7 +171,7 @@ public class ChunkStatus { +@@ -182,7 +182,7 @@ public class ChunkStatus { this.w = chunkstatus_c; this.x = i; this.y = chunkstatus_type; @@ -27,11 +27,11 @@ index f6c9bdbf52d773d7aa601125b887b347163f9328..51ea295d66312c95685b9fe4ee502a02 this.t = chunkstatus == null ? 0 : chunkstatus.c() + 1; } -diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 5b0cd414ca1949ab53b289f7159f18da07d21f14..a3ac883500eaebb353ad3108a17b5c740e384b03 100644 ---- a/src/main/java/net/minecraft/server/ProtoChunk.java -+++ b/src/main/java/net/minecraft/server/ProtoChunk.java -@@ -179,14 +179,11 @@ public class ProtoChunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +index 7bfac4e852c4a6697435647dab173913df6034e9..72c258ae5c3cc93e42b86af9426b5e9715dc1599 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +@@ -197,14 +197,11 @@ public class ProtoChunk implements IChunkAccess { lightengine.a(blockposition); } @@ -49,7 +49,7 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..a3ac883500eaebb353ad3108a17b5c74 HeightMap heightmap = (HeightMap) this.f.get(heightmap_type); if (heightmap == null) { -@@ -202,10 +199,9 @@ public class ProtoChunk implements IChunkAccess { +@@ -220,10 +217,9 @@ public class ProtoChunk implements IChunkAccess { HeightMap.a(this, enumset1); } diff --git a/patches/Tuinity/patches/server/0024-Prevent-long-map-entry-creation-in-light-engine.patch b/patches/Tuinity/patches/server/0024-Prevent-long-map-entry-creation-in-light-engine.patch index 5b3d7d1f..02d5ee3d 100644 --- a/patches/Tuinity/patches/server/0024-Prevent-long-map-entry-creation-in-light-engine.patch +++ b/patches/Tuinity/patches/server/0024-Prevent-long-map-entry-creation-in-light-engine.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Prevent long map entry creation in light engine Use fastiterator to prevent it -diff --git a/src/main/java/net/minecraft/server/LightEngineStorage.java b/src/main/java/net/minecraft/server/LightEngineStorage.java -index b98e60772bad7e06845b50fdc11e98c0ea775d3d..e0bbfe1422cbad811ecb43d7436380d86b0f8abc 100644 ---- a/src/main/java/net/minecraft/server/LightEngineStorage.java -+++ b/src/main/java/net/minecraft/server/LightEngineStorage.java -@@ -23,7 +23,8 @@ public abstract class LightEngineStorage> e +diff --git a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorage.java b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorage.java +index fc0162e7f543d230277457638f208a66537560d7..3825a3ddea21e7dd14c455daac1a6af5b0871e00 100644 +--- a/src/main/java/net/minecraft/world/level/lighting/LightEngineStorage.java ++++ b/src/main/java/net/minecraft/world/level/lighting/LightEngineStorage.java +@@ -30,7 +30,8 @@ public abstract class LightEngineStorage> e protected final M f; protected final M updating; // Paper - diff on change, should be "updating" protected final LongSet g = new LongOpenHashSet(); protected final LongSet h = new LongOpenHashSet(); LongSet dirty = h; // Paper - OBFHELPER @@ -19,7 +19,7 @@ index b98e60772bad7e06845b50fdc11e98c0ea775d3d..e0bbfe1422cbad811ecb43d7436380d8 private final LongSet n = new LongOpenHashSet(); private final LongSet o = new LongOpenHashSet(); private final LongSet p = new LongOpenHashSet(); -@@ -247,7 +248,7 @@ public abstract class LightEngineStorage> e +@@ -254,7 +255,7 @@ public abstract class LightEngineStorage> e this.p.clear(); this.j = false; @@ -28,7 +28,7 @@ index b98e60772bad7e06845b50fdc11e98c0ea775d3d..e0bbfe1422cbad811ecb43d7436380d8 Entry entry; long j; -@@ -284,7 +285,7 @@ public abstract class LightEngineStorage> e +@@ -291,7 +292,7 @@ public abstract class LightEngineStorage> e } this.n.clear(); diff --git a/patches/Tuinity/patches/server/0025-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/Tuinity/patches/server/0025-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index da90a155..a727a1dc 100644 --- a/patches/Tuinity/patches/server/0025-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/Tuinity/patches/server/0025-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch @@ -7,14 +7,14 @@ Subject: [PATCH] Highly optimise single and multi-AABB VoxelShapes and diff --git a/src/main/java/com/tuinity/tuinity/util/CachedLists.java b/src/main/java/com/tuinity/tuinity/util/CachedLists.java new file mode 100644 -index 0000000000000000000000000000000000000000..387eeb5d770ba9fe564c61df8cc92ac8b1569f61 +index 0000000000000000000000000000000000000000..866f6e701c6a10a3ac1e58d12bba966c478d2e77 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/util/CachedLists.java @@ -0,0 +1,53 @@ +package com.tuinity.tuinity.util; + -+import net.minecraft.server.AxisAlignedBB; -+import net.minecraft.server.Entity; ++import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.world.entity.Entity; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.util.UnsafeList; +import java.util.List; @@ -66,7 +66,7 @@ index 0000000000000000000000000000000000000000..387eeb5d770ba9fe564c61df8cc92ac8 +} diff --git a/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java b/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java new file mode 100644 -index 0000000000000000000000000000000000000000..002abb3cbf0f742e685f2f043d2600de03e37a19 +index 0000000000000000000000000000000000000000..ccc6935f45f91eac17cf09d044060b5bb4c2c935 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/voxel/AABBVoxelShape.java @@ -0,0 +1,165 @@ @@ -74,10 +74,10 @@ index 0000000000000000000000000000000000000000..002abb3cbf0f742e685f2f043d2600de + +import it.unimi.dsi.fastutil.doubles.DoubleArrayList; +import it.unimi.dsi.fastutil.doubles.DoubleList; -+import net.minecraft.server.AxisAlignedBB; -+import net.minecraft.server.EnumDirection; -+import net.minecraft.server.VoxelShape; -+import net.minecraft.server.VoxelShapes; ++import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.core.EnumDirection; ++import net.minecraft.world.phys.shapes.VoxelShape; ++import net.minecraft.world.phys.shapes.VoxelShapes; +import java.util.ArrayList; +import java.util.List; + @@ -235,228 +235,96 @@ index 0000000000000000000000000000000000000000..002abb3cbf0f742e685f2f043d2600de + return this.aabb.voxelShapeIntersect(axisalingedbb); + } +} -diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index ed9b2f9adfecdc6d1b9925579ec510657adde11f..5c3d5b22b833d9f835e17803295b87893fd05e62 100644 ---- a/src/main/java/net/minecraft/server/AxisAlignedBB.java -+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java -@@ -13,6 +13,157 @@ public class AxisAlignedBB { - public final double maxY; - public final double maxZ; +diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java +index 006e7076932f6be576a64da09c4d84ca4a15f5dd..e832ea0497b2d6af7556bda7f6728e72c48d80a8 100644 +--- a/src/main/java/net/minecraft/server/MCUtil.java ++++ b/src/main/java/net/minecraft/server/MCUtil.java +@@ -55,6 +55,7 @@ import java.util.function.Consumer; + import java.util.function.Supplier; -+ // Tuinity start -+ public final boolean isEmpty() { -+ return (this.maxX - this.minX) < MCUtil.COLLISION_EPSILON && (this.maxY - this.minY) < MCUtil.COLLISION_EPSILON && (this.maxZ - this.minZ) < MCUtil.COLLISION_EPSILON; + public final class MCUtil { ++ public static final double COLLISION_EPSILON = 1.0E-7; // Tuinity - Just in case mojang changes this... + public static final ThreadPoolExecutor asyncExecutor = new ThreadPoolExecutor( + 0, 2, 60L, TimeUnit.SECONDS, + new LinkedBlockingQueue(), +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 41c8646aef9a8df2f99319c2a8e76d850bdcc1f6..6b6a90dc07ab126a21d011d1a831019ec1456834 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1441,6 +1441,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant predicate) { ++ return this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, loadChunks, collidesWithUnloaded, true, predicate); + } + -+ /* -+ A couple of rules for VoxelShape collisions: -+ Two shapes only intersect if they are actually more than EPSILON units into each other. This also applies to movement -+ checks. -+ If the two shapes strictly collide, then the return value of a collide call will return a value in the opposite -+ direction of the source move. However, this value will not be greater in magnitude than EPSILON. Collision code -+ will automatically round it to 0. -+ */ -+ -+ public final boolean voxelShapeIntersect(AxisAlignedBB other) { -+ return (this.minX - other.maxX) < -MCUtil.COLLISION_EPSILON && (this.maxX - other.minX) > MCUtil.COLLISION_EPSILON && -+ (this.minY - other.maxY) < -MCUtil.COLLISION_EPSILON && (this.maxY - other.minY) > MCUtil.COLLISION_EPSILON && -+ (this.minZ - other.maxZ) < -MCUtil.COLLISION_EPSILON && (this.maxZ - other.minZ) > MCUtil.COLLISION_EPSILON; -+ } -+ -+ public final boolean voxelShapeIntersect(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { -+ return (this.minX - maxX) < -MCUtil.COLLISION_EPSILON && (this.maxX - minX) > MCUtil.COLLISION_EPSILON && -+ (this.minY - maxY) < -MCUtil.COLLISION_EPSILON && (this.maxY - minY) > MCUtil.COLLISION_EPSILON && -+ (this.minZ - maxZ) < -MCUtil.COLLISION_EPSILON && (this.maxZ - minZ) > MCUtil.COLLISION_EPSILON; -+ } -+ -+ public static boolean voxelShapeIntersect(double minX1, double minY1, double minZ1, double maxX1, double maxY1, double maxZ1, -+ double minX2, double minY2, double minZ2, double maxX2, double maxY2, double maxZ2) { -+ return (minX1 - maxX2) < -MCUtil.COLLISION_EPSILON && (maxX1 - minX2) > MCUtil.COLLISION_EPSILON && -+ (minY1 - maxY2) < -MCUtil.COLLISION_EPSILON && (maxY1 - minY2) > MCUtil.COLLISION_EPSILON && -+ (minZ1 - maxZ2) < -MCUtil.COLLISION_EPSILON && (maxZ1 - minZ2) > MCUtil.COLLISION_EPSILON; -+ } -+ -+ public static double collideX(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (source_move == 0.0) { -+ return 0.0; ++ public final boolean hardCollidesWithAnyEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { ++ if (axisalignedbb.isEmpty()) { ++ return false; + } + -+ if ((source.minY - target.maxY) < -MCUtil.COLLISION_EPSILON && (source.maxY - target.minY) > MCUtil.COLLISION_EPSILON && -+ (source.minZ - target.maxZ) < -MCUtil.COLLISION_EPSILON && (source.maxZ - target.minZ) > MCUtil.COLLISION_EPSILON) { -+ -+ if (source_move >= 0.0) { -+ double max_move = target.minX - source.maxX; // < 0.0 if no strict collision -+ if (max_move < -MCUtil.COLLISION_EPSILON) { -+ return source_move; -+ } -+ return Math.min(max_move, source_move); ++ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with. ++ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems ++ // specifically with boat collisions. ++ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON); ++ List entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); ++ try { ++ if (entity != null && entity.hardCollides()) { ++ this.getEntities(entity, axisalignedbb, predicate, entities); + } else { -+ double max_move = target.maxX - source.minX; // > 0.0 if no strict collision -+ if (max_move > MCUtil.COLLISION_EPSILON) { -+ return source_move; -+ } -+ return Math.max(max_move, source_move); ++ this.getHardCollidingEntities(entity, axisalignedbb, predicate, entities); + } -+ } -+ return source_move; -+ } + -+ public static double collideY(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (source_move == 0.0) { -+ return 0.0; -+ } ++ for (int i = 0, len = entities.size(); i < len; ++i) { ++ Entity otherEntity = entities.get(i); + -+ if ((source.minX - target.maxX) < -MCUtil.COLLISION_EPSILON && (source.maxX - target.minX) > MCUtil.COLLISION_EPSILON && -+ (source.minZ - target.maxZ) < -MCUtil.COLLISION_EPSILON && (source.maxZ - target.minZ) > MCUtil.COLLISION_EPSILON) { -+ if (source_move >= 0.0) { -+ double max_move = target.minY - source.maxY; // < 0.0 if no strict collision -+ if (max_move < -MCUtil.COLLISION_EPSILON) { -+ return source_move; ++ if ((entity == null || otherEntity.collisionBoxIsHard()) || entity.hardCollidesWith(otherEntity)) { ++ return true; + } -+ return Math.min(max_move, source_move); -+ } else { -+ double max_move = target.maxY - source.minY; // > 0.0 if no strict collision -+ if (max_move > MCUtil.COLLISION_EPSILON) { -+ return source_move; -+ } -+ return Math.max(max_move, source_move); + } ++ ++ return false; ++ } finally { ++ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); + } -+ return source_move; + } + -+ public static double collideZ(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (source_move == 0.0) { -+ return 0.0; -+ } -+ -+ if ((source.minX - target.maxX) < -MCUtil.COLLISION_EPSILON && (source.maxX - target.minX) > MCUtil.COLLISION_EPSILON && -+ (source.minY - target.maxY) < -MCUtil.COLLISION_EPSILON && (source.maxY - target.minY) > MCUtil.COLLISION_EPSILON) { -+ if (source_move >= 0.0) { -+ double max_move = target.minZ - source.maxZ; // < 0.0 if no strict collision -+ if (max_move < -MCUtil.COLLISION_EPSILON) { -+ return source_move; -+ } -+ return Math.min(max_move, source_move); -+ } else { -+ double max_move = target.maxZ - source.minZ; // > 0.0 if no strict collision -+ if (max_move > MCUtil.COLLISION_EPSILON) { -+ return source_move; -+ } -+ return Math.max(max_move, source_move); -+ } -+ } -+ return source_move; ++ public final boolean hasAnyCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb) { ++ return this.hasAnyCollisions(entity, axisalignedbb, true); + } + -+ public final AxisAlignedBB offsetX(double dx) { -+ return new AxisAlignedBB(this.minX + dx, this.minY, this.minZ, this.maxX + dx, this.maxY, this.maxZ, false); -+ } -+ -+ public final AxisAlignedBB offsetY(double dy) { -+ return new AxisAlignedBB(this.minX, this.minY + dy, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); -+ } -+ -+ public final AxisAlignedBB offsetZ(double dz) { -+ return new AxisAlignedBB(this.minX, this.minY, this.minZ + dz, this.maxX, this.maxY, this.maxZ + dz, false); -+ } -+ -+ public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5, boolean dummy) { -+ this.minX = d0; -+ this.minY = d1; -+ this.minZ = d2; -+ this.maxX = d3; -+ this.maxY = d4; -+ this.maxZ = d5; -+ } -+ -+ public final AxisAlignedBB expandUpwards(double dy) { -+ return new AxisAlignedBB(this.minX, this.minY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); -+ } -+ -+ public final AxisAlignedBB cutUpwards(final double dy) { // dy > 0.0 -+ return new AxisAlignedBB(this.minX, this.maxY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); -+ } -+ -+ public final AxisAlignedBB cutDownwards(final double dy) { // dy < 0.0 -+ return new AxisAlignedBB(this.minX, this.minY + dy, this.minZ, this.maxX, this.minY, this.maxZ, false); -+ } -+ -+ public final AxisAlignedBB expandUpwardsAndCutBelow(double dy) { -+ return new AxisAlignedBB(this.minX, this.maxY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); -+ } -+ // Tuinity end -+ - public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5) { - this.minX = Math.min(d0, d3); - this.minY = Math.min(d1, d4); -@@ -185,6 +336,7 @@ public class AxisAlignedBB { - return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); - } - -+ public final AxisAlignedBB offset(double d0, double d1, double d2) { return this.d(d0, d1, d2); } // Tuinity - OBFHELPER - public AxisAlignedBB d(double d0, double d1, double d2) { - return new AxisAlignedBB(this.minX + d0, this.minY + d1, this.minZ + d2, this.maxX + d0, this.maxY + d1, this.maxZ + d2); - } -@@ -193,6 +345,7 @@ public class AxisAlignedBB { - return new AxisAlignedBB(this.minX + (double) blockposition.getX(), this.minY + (double) blockposition.getY(), this.minZ + (double) blockposition.getZ(), this.maxX + (double) blockposition.getX(), this.maxY + (double) blockposition.getY(), this.maxZ + (double) blockposition.getZ()); - } - -+ public final AxisAlignedBB offset(Vec3D vec3d) { return this.b(vec3d); } // Tuinity - OBFHELPER - public AxisAlignedBB c(Vec3D vec3d) { - return this.d(vec3d.x, vec3d.y, vec3d.z); - } -@@ -212,6 +365,7 @@ public class AxisAlignedBB { - return this.e(vec3d.x, vec3d.y, vec3d.z); - } - -+ public final boolean contains(double d0, double d1, double d2) { return this.e(d0, d1, d2); } // Tuinity - OBFHELPER - public boolean e(double d0, double d1, double d2) { - return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ; - } -diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050d00a6f5e 100644 ---- a/src/main/java/net/minecraft/server/ChunkCache.java -+++ b/src/main/java/net/minecraft/server/ChunkCache.java -@@ -1,5 +1,6 @@ - package net.minecraft.server; - -+import java.util.List; - import java.util.function.Predicate; - import java.util.stream.Stream; - import javax.annotation.Nullable; -@@ -12,6 +13,156 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess { - protected boolean d; - protected final World e; protected final World getWorld() { return e; } // Paper - OBFHELPER - -+ // Tuinity start - optimise pathfinder collision detection -+ @Override -+ public boolean getCubes(Entity entity) { -+ return !this.getCollisionsForBlocksOrWorldBorder(entity, entity.getBoundingBox(), null, true, null); -+ } -+ -+ @Override -+ public boolean getCubes(Entity entity, AxisAlignedBB axisalignedbb) { -+ return !this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, true, null); -+ } -+ -+ @Override -+ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { -+ return !this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, true, null); ++ public final boolean hasAnyCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, boolean loadChunks) { ++ return this.collidesWithAnyBlockOrWorldBorder(entity, axisalignedbb, loadChunks, true) ++ || this.hardCollidesWithAnyEntities(entity, axisalignedbb, null); + } + ++ // returns whether any collisions were detected + public boolean getCollisionsForBlocksOrWorldBorder(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, -+ boolean collidesWithUnloaded, ++ boolean loadChunks, boolean collidesWithUnloaded, boolean checkOnly, + java.util.function.BiPredicate predicate) { + boolean ret = false; -+ final boolean checkOnly = true; + + if (entity != null) { + if (this.getWorldBorder().isAlmostCollidingOnBorder(axisalignedbb)) { @@ -480,7 +348,7 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + + + BlockPosition.MutableBlockPosition mutablePos = new BlockPosition.MutableBlockPosition(); -+ VoxelShapeCollision collisionShape = null; ++ net.minecraft.world.phys.shapes.VoxelShapeCollision collisionShape = null; + + // special cases: + if (minBlockY > 255 || maxBlockY < 0) { @@ -497,6 +365,7 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + int minChunkZ = minBlockZ >> 4; + int maxChunkZ = maxBlockZ >> 4; + ++ ChunkProviderServer chunkProvider = (ChunkProviderServer)this.chunkProvider; + // TODO special case single chunk? + + for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) { @@ -509,7 +378,7 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + + int chunkXGlobalPos = currChunkX << 4; + int chunkZGlobalPos = currChunkZ << 4; -+ Chunk chunk = (Chunk)this.getChunkIfLoaded(currChunkX, currChunkZ); ++ Chunk chunk = loadChunks ? chunkProvider.getChunkAt(currChunkX, currChunkZ, true) : chunkProvider.getChunkAtIfLoadedImmediately(currChunkX, currChunkZ); + + if (chunk == null) { + if (collidesWithUnloaded) { @@ -536,7 +405,7 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + continue; + } + -+ DataPaletteBlock blocks = section.blockIds; ++ net.minecraft.world.level.chunk.DataPaletteBlock blocks = section.blockIds; + + for (int currZ = minZ; currZ <= maxZ; ++currZ) { + for (int currX = minX; currX <= maxX; ++currX) { @@ -557,7 +426,7 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + if ((edgeCount != 1 || blockData.shapeExceedsCube()) && (edgeCount != 2 || blockData.getBlock() == Blocks.MOVING_PISTON)) { + mutablePos.setValues(blockX, blockY, blockZ); + if (collisionShape == null) { -+ collisionShape = entity == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a(entity); ++ collisionShape = entity == null ? net.minecraft.world.phys.shapes.VoxelShapeCollision.a() : net.minecraft.world.phys.shapes.VoxelShapeCollision.a(entity); + } + VoxelShape voxelshape2 = blockData.getCollisionShape(this, mutablePos, collisionShape); + if (voxelshape2 != VoxelShapes.getEmptyShape()) { @@ -584,40 +453,74 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 + + return ret; + } -+ // Tuinity end - optimise pathfinder collision detection + - public ChunkCache(World world, BlockPosition blockposition, BlockPosition blockposition1) { - this.e = world; - this.a = blockposition.getX() >> 4; -diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index e52df8096e399c84ff8a2637fdd65ea57d9001d0..cebd808e273dbdb88feb16920dd7a2f60390b34f 100644 ---- a/src/main/java/net/minecraft/server/ChunkSection.java -+++ b/src/main/java/net/minecraft/server/ChunkSection.java -@@ -96,6 +96,7 @@ public class ChunkSection { - return iblockdata1; - } - -+ public final boolean isFullOfAir() { return this.c(); } // Tuinity - OBFHELPER - public boolean c() { - return this.nonEmptyBlockCount == 0; - } -diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 95ef96286855624590b72d69514b0fc0e08fddba..73163b417af7e522a4509bf9c1ab56d6499be622 100644 ---- a/src/main/java/net/minecraft/server/DataPaletteBlock.java -+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java -@@ -163,6 +163,7 @@ public class DataPaletteBlock implements DataPaletteExpandable { - return this.a(j << 8 | k << 4 | i); // Paper - inline - } - -+ public final T rawGet(int index) { return this.a(index); } // Tuinity - OBFHELPER - protected T a(int i) { - T t0 = this.h.a(this.a.a(i)); - -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655b9f2e4c3 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke ++ public final void getEntityHardCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate, List list) { ++ if (axisalignedbb.isEmpty()) { ++ return; ++ } ++ ++ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with. ++ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems ++ // specifically with boat collisions. ++ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON); ++ List entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); ++ try { ++ if (entity != null && entity.hardCollides()) { ++ this.getEntities(entity, axisalignedbb, predicate, entities); ++ } else { ++ this.getHardCollidingEntities(entity, axisalignedbb, predicate, entities); ++ } ++ ++ for (int i = 0, len = entities.size(); i < len; ++i) { ++ Entity otherEntity = entities.get(i); ++ ++ if ((entity == null || otherEntity.collisionBoxIsHard()) || entity.hardCollidesWith(otherEntity)) { ++ if (!otherEntity.getBoundingBox().isEmpty()) { ++ list.add(otherEntity.getBoundingBox()); ++ } ++ } ++ } ++ } finally { ++ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); ++ } ++ } ++ ++ public final void getCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, boolean loadChunks) { ++ this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, list, loadChunks, true, false, null); ++ this.getEntityHardCollisions(entity, axisalignedbb, null, list); ++ } ++ ++ @Override ++ public boolean getCubes(AxisAlignedBB axisalignedbb) { ++ return !this.hasAnyCollisions(null, axisalignedbb); ++ } ++ ++ @Override ++ public boolean getCubes(Entity entity) { ++ return !this.hasAnyCollisions(entity, entity.getBoundingBox()); ++ } ++ ++ @Override ++ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb) { ++ if (entity instanceof net.minecraft.world.entity.decoration.EntityArmorStand && !entity.world.paperConfig.armorStandEntityLookups) return false; ++ return !this.hasAnyCollisions(entity, axisalignedbb); ++ } ++ ++ @Override ++ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { ++ if (entity instanceof net.minecraft.world.entity.decoration.EntityArmorStand && !entity.world.paperConfig.armorStandEntityLookups) return false; ++ return !this.collidesWithAnyBlockOrWorldBorder(entity, axisalignedbb, true, true) && !this.hardCollidesWithAnyEntities(entity, axisalignedbb, predicate); ++ } ++ // Tuinity end - optimise collision ++ + // CraftBukkit start + @Override + public TileEntity getTileEntity(BlockPosition pos, boolean validate) { +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index b32b0ebf283a8face528ded0b845270953f536f1..c5ce10a55de6f611ec65f32382b0082f86e73fe3 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -228,7 +228,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne public double D; public double E; public double F; @@ -626,7 +529,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 public boolean noclip; public float I; protected final Random random; -@@ -694,7 +694,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -786,7 +786,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne // Paper end vec3d = this.a(vec3d, enummovetype); @@ -635,7 +538,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 if (vec3d1.g() > 1.0E-7D) { this.a(this.getBoundingBox().c(vec3d1)); -@@ -785,7 +785,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -877,7 +877,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } try { @@ -644,7 +547,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being checked for collision"); -@@ -797,11 +797,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -889,11 +889,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne float f2 = this.getBlockSpeedFactor(); this.setMot(this.getMot().d((double) f2, 1.0D, (double) f2)); @@ -657,7 +560,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 if (this.aG() && this.isBurning()) { this.playSound(SoundEffects.ENTITY_GENERIC_EXTINGUISH_FIRE, 0.7F, 1.6F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); -@@ -897,6 +893,137 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -989,6 +985,137 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return d0; } @@ -795,7 +698,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 private Vec3D g(Vec3D vec3d) { AxisAlignedBB axisalignedbb = this.getBoundingBox(); VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this); -@@ -932,6 +1059,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1024,6 +1151,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return vec3d1; } @@ -803,7 +706,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 public static double c(Vec3D vec3d) { return vec3d.x * vec3d.x + vec3d.z * vec3d.z; } -@@ -1044,18 +1172,34 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1136,18 +1264,34 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } protected void checkBlockCollisions() { @@ -841,7 +744,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 try { iblockdata.a(this.world, blockposition_mutableblockposition, this); this.a(iblockdata); -@@ -1069,6 +1213,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1161,6 +1305,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } } } @@ -853,7 +756,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 } } -@@ -2027,9 +2176,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2119,9 +2268,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne float f1 = this.size.width * 0.8F; AxisAlignedBB axisalignedbb = AxisAlignedBB.g((double) f1, 0.10000000149011612D, (double) f1).d(this.locX(), this.getHeadY(), this.locZ()); @@ -865,7 +768,7 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 } } -@@ -2037,10 +2186,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2129,10 +2278,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne return EnumInteractionResult.PASS; } @@ -878,11 +781,179 @@ index 4c67a767e65b8a76c5f5a267d0b4ddf28494bc55..99b01cb35e2af2d61688b0b10ad1c655 public boolean aZ() {// Tuinity - diff on change, hard colliding entities override this return false; } -diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java -index 25e54a1fadc5d31fb250a3f47524b4f345fc8cc6..cce0ac8a36bef3b9e5a2b95e0c3dd137e8525226 100644 ---- a/src/main/java/net/minecraft/server/ICollisionAccess.java -+++ b/src/main/java/net/minecraft/server/ICollisionAccess.java -@@ -28,6 +28,11 @@ public interface ICollisionAccess extends IBlockAccess { +diff --git a/src/main/java/net/minecraft/world/level/ChunkCache.java b/src/main/java/net/minecraft/world/level/ChunkCache.java +index 7a760ef0264c9041c38bdfb8fd31333052c26139..b547eb352f90f68cf36ffb82e43ad7acb1892f6a 100644 +--- a/src/main/java/net/minecraft/world/level/ChunkCache.java ++++ b/src/main/java/net/minecraft/world/level/ChunkCache.java +@@ -1,5 +1,6 @@ + package net.minecraft.world.level; + ++import java.util.List; + import java.util.function.Predicate; + import java.util.stream.Stream; + import javax.annotation.Nullable; +@@ -26,6 +27,156 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess { + protected boolean d; + protected final World e; protected final World getWorld() { return e; } // Paper - OBFHELPER + ++ // Tuinity start - optimise pathfinder collision detection ++ @Override ++ public boolean getCubes(Entity entity) { ++ return !this.getCollisionsForBlocksOrWorldBorder(entity, entity.getBoundingBox(), null, true, null); ++ } ++ ++ @Override ++ public boolean getCubes(Entity entity, AxisAlignedBB axisalignedbb) { ++ return !this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, true, null); ++ } ++ ++ @Override ++ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { ++ return !this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, true, null); ++ } ++ ++ public boolean getCollisionsForBlocksOrWorldBorder(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, ++ boolean collidesWithUnloaded, ++ java.util.function.BiPredicate predicate) { ++ boolean ret = false; ++ final boolean checkOnly = true; ++ ++ if (entity != null) { ++ if (this.getWorldBorder().isAlmostCollidingOnBorder(axisalignedbb)) { ++ if (checkOnly) { ++ return true; ++ } else { ++ net.minecraft.world.phys.shapes.VoxelShapes.addBoxesTo(this.getWorldBorder().getCollisionShape(), list); ++ ret = true; ++ } ++ } ++ } ++ ++ int minBlockX = net.minecraft.util.MathHelper.floor(axisalignedbb.minX - net.minecraft.server.MCUtil.COLLISION_EPSILON) - 1; ++ int maxBlockX = net.minecraft.util.MathHelper.floor(axisalignedbb.maxX + net.minecraft.server.MCUtil.COLLISION_EPSILON) + 1; ++ ++ int minBlockY = net.minecraft.util.MathHelper.floor(axisalignedbb.minY - net.minecraft.server.MCUtil.COLLISION_EPSILON) - 1; ++ int maxBlockY = net.minecraft.util.MathHelper.floor(axisalignedbb.maxY + net.minecraft.server.MCUtil.COLLISION_EPSILON) + 1; ++ ++ int minBlockZ = net.minecraft.util.MathHelper.floor(axisalignedbb.minZ - net.minecraft.server.MCUtil.COLLISION_EPSILON) - 1; ++ int maxBlockZ = net.minecraft.util.MathHelper.floor(axisalignedbb.maxZ + net.minecraft.server.MCUtil.COLLISION_EPSILON) + 1; ++ ++ ++ BlockPosition.MutableBlockPosition mutablePos = new BlockPosition.MutableBlockPosition(); ++ net.minecraft.world.phys.shapes.VoxelShapeCollision collisionShape = null; ++ ++ // special cases: ++ if (minBlockY > 255 || maxBlockY < 0) { ++ // no point in checking ++ return ret; ++ } ++ ++ int minYIterate = Math.max(0, minBlockY); ++ int maxYIterate = Math.min(255, maxBlockY); ++ ++ int minChunkX = minBlockX >> 4; ++ int maxChunkX = maxBlockX >> 4; ++ ++ int minChunkZ = minBlockZ >> 4; ++ int maxChunkZ = maxBlockZ >> 4; ++ ++ // TODO special case single chunk? ++ ++ for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) { ++ int minZ = currChunkZ == minChunkZ ? minBlockZ & 15 : 0; // coordinate in chunk ++ int maxZ = currChunkZ == maxChunkZ ? maxBlockZ & 15 : 15; // coordinate in chunk ++ ++ for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) { ++ int minX = currChunkX == minChunkX ? minBlockX & 15 : 0; // coordinate in chunk ++ int maxX = currChunkX == maxChunkX ? maxBlockX & 15 : 15; // coordinate in chunk ++ ++ int chunkXGlobalPos = currChunkX << 4; ++ int chunkZGlobalPos = currChunkZ << 4; ++ net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk)this.getChunkIfLoaded(currChunkX, currChunkZ); ++ ++ if (chunk == null) { ++ if (collidesWithUnloaded) { ++ if (checkOnly) { ++ return true; ++ } else { ++ list.add(AxisAlignedBB.getBoxForChunk(currChunkX, currChunkZ)); ++ ret = true; ++ } ++ } ++ continue; ++ } ++ ++ net.minecraft.world.level.chunk.ChunkSection[] sections = chunk.getSections(); ++ ++ // bound y ++ ++ for (int currY = minYIterate; currY <= maxYIterate; ++currY) { ++ net.minecraft.world.level.chunk.ChunkSection section = sections[currY >>> 4]; ++ if (section == null || section.isFullOfAir()) { ++ // empty ++ // skip to next section ++ currY = (currY & ~(15)) + 15; // increment by 15: iterator loop increments by the extra one ++ continue; ++ } ++ ++ net.minecraft.world.level.chunk.DataPaletteBlock blocks = section.blockIds; ++ ++ for (int currZ = minZ; currZ <= maxZ; ++currZ) { ++ for (int currX = minX; currX <= maxX; ++currX) { ++ int localBlockIndex = (currX) | (currZ << 4) | ((currY & 15) << 8); ++ int blockX = currX | chunkXGlobalPos; ++ int blockY = currY; ++ int blockZ = currZ | chunkZGlobalPos; ++ ++ int edgeCount = ((blockX == minBlockX || blockX == maxBlockX) ? 1 : 0) + ++ ((blockY == minBlockY || blockY == maxBlockY) ? 1 : 0) + ++ ((blockZ == minBlockZ || blockZ == maxBlockZ) ? 1 : 0); ++ if (edgeCount == 3) { ++ continue; ++ } ++ ++ IBlockData blockData = blocks.rawGet(localBlockIndex); ++ ++ if ((edgeCount != 1 || blockData.shapeExceedsCube()) && (edgeCount != 2 || blockData.getBlock() == Blocks.MOVING_PISTON)) { ++ mutablePos.setValues(blockX, blockY, blockZ); ++ if (collisionShape == null) { ++ collisionShape = entity == null ? net.minecraft.world.phys.shapes.VoxelShapeCollision.a() : net.minecraft.world.phys.shapes.VoxelShapeCollision.a(entity); ++ } ++ VoxelShape voxelshape2 = blockData.getCollisionShape(this, mutablePos, collisionShape); ++ if (voxelshape2 != net.minecraft.world.phys.shapes.VoxelShapes.getEmptyShape()) { ++ VoxelShape voxelshape3 = voxelshape2.offset((double)blockX, (double)blockY, (double)blockZ); ++ ++ if (predicate != null && !predicate.test(blockData, mutablePos)) { ++ continue; ++ } ++ ++ if (checkOnly) { ++ if (voxelshape3.intersects(axisalignedbb)) { ++ return true; ++ } ++ } else { ++ ret |= net.minecraft.world.phys.shapes.VoxelShapes.addBoxesToIfIntersects(voxelshape3, axisalignedbb, list); ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ return ret; ++ } ++ // Tuinity end - optimise pathfinder collision detection ++ + public ChunkCache(World world, BlockPosition blockposition, BlockPosition blockposition1) { + this.e = world; + this.a = blockposition.getX() >> 4; +diff --git a/src/main/java/net/minecraft/world/level/ICollisionAccess.java b/src/main/java/net/minecraft/world/level/ICollisionAccess.java +index fcb3e2f9dea97138e0fd4cd2eb11b54799e1d3b5..1c66d6c69148e6aa45641c0351d63c9b96ffb1d3 100644 +--- a/src/main/java/net/minecraft/world/level/ICollisionAccess.java ++++ b/src/main/java/net/minecraft/world/level/ICollisionAccess.java +@@ -36,6 +36,11 @@ public interface ICollisionAccess extends IBlockAccess { } default boolean b(AxisAlignedBB axisalignedbb) { @@ -894,7 +965,7 @@ index 25e54a1fadc5d31fb250a3f47524b4f345fc8cc6..cce0ac8a36bef3b9e5a2b95e0c3dd137 return this.b((Entity) null, axisalignedbb, (entity) -> { return true; }); -@@ -46,6 +51,11 @@ public interface ICollisionAccess extends IBlockAccess { +@@ -54,6 +59,11 @@ public interface ICollisionAccess extends IBlockAccess { } default boolean b(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { @@ -906,11 +977,11 @@ index 25e54a1fadc5d31fb250a3f47524b4f345fc8cc6..cce0ac8a36bef3b9e5a2b95e0c3dd137 try { if (entity != null) entity.collisionLoadChunks = true; // Paper return this.d(entity, axisalignedbb, predicate).allMatch(VoxelShape::isEmpty); } finally { if (entity != null) entity.collisionLoadChunks = false; } // Paper -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index b053bb74f6df174a27dbfd7b1b3e3ccbb0b26659..c17cbadeff9cb3ea955b9db99ab71d6d7fd8c247 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -68,9 +68,10 @@ public interface IEntityAccess { +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index 4b0736d1f805b82e031e7cd7077b59365c196ebe..69cc7664089c505eb5cfdc437f16b91e9713eada 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -77,9 +77,10 @@ public interface IEntityAccess { if (axisalignedbb.a() < 1.0E-7D) { return Stream.empty(); } else { @@ -923,36 +994,340 @@ index b053bb74f6df174a27dbfd7b1b3e3ccbb0b26659..c17cbadeff9cb3ea955b9db99ab71d6d boolean flag; if (true || entity1.getBoundingBox().c(axisalignedbb1)) { // Tuinity - always true, wtf did they think this.getEntities(entity, axisalignedbb1) does? -diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 2371557d083446b17ffebdae576b1cc39e939eb1..e79e773f2219f9a9ae076fcbc8108b792201b11a 100644 ---- a/src/main/java/net/minecraft/server/MCUtil.java -+++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -38,6 +38,7 @@ import java.util.function.Consumer; - import java.util.function.Supplier; +diff --git a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java +index 03584572fa5bf0d96fc4cecece573547f9c94cea..8bc965a3b3d0d4140c6b94636f0b33b2805c5867 100644 +--- a/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java ++++ b/src/main/java/net/minecraft/world/level/VoxelShapeSpliterator.java +@@ -106,7 +106,7 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { + VoxelShape voxelshape = iblockdata.b((IBlockAccess) this.g, this.e, this.c); - public final class MCUtil { -+ public static final double COLLISION_EPSILON = 1.0E-7; // Tuinity - Just in case mojang changes this... - public static final ThreadPoolExecutor asyncExecutor = new ThreadPoolExecutor( - 0, 2, 60L, TimeUnit.SECONDS, - new LinkedBlockingQueue(), -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a50b311876ce6aa3a571b3d290235775aa02d925..e64c57fd46f3d5e7989f01f063887e81be0590df 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1329,6 +1329,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { +- this.getMethodProfiler().c("getEntities"); ++ // Tuinity start - add list parameter + List list = Lists.newArrayList(); ++ return this.getEntities(entity, axisalignedbb, predicate, list); ++ } ++ public List getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate, List list) { ++ // Tuinity end - add list parameter ++ this.getMethodProfiler().c("getEntities"); + 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); +diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java +index 3c25021835d6d8fd112fc89636616bfd744e7f1a..aa49565cd364db3781a110ee138ee1a4edbfa288 100644 +--- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java ++++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java +@@ -60,11 +60,59 @@ public class WorldBorder { + return axisalignedbb.maxX > this.e() && axisalignedbb.minX < this.g() && axisalignedbb.maxZ > this.f() && axisalignedbb.minZ < this.h(); + } + ++ // Tuinity start - optimise collisions ++ // determines whether we are almost colliding with the world border ++ // for clear collisions, this rets false ++ public final boolean isAlmostCollidingOnBorder(AxisAlignedBB boundingBox) { ++ return this.isAlmostCollidingOnBorder(boundingBox.minX, boundingBox.maxX, boundingBox.minZ, boundingBox.maxZ); ++ } + - // Paper start - long endTime = System.nanoTime(); - long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime; -diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java -index 7f05587d42b7cdb09552277ec2e467f0edf06f10..5af554870bcf36e47aef43b966b141b9eda6c4d5 100644 ---- a/src/main/java/net/minecraft/server/Vec3D.java -+++ b/src/main/java/net/minecraft/server/Vec3D.java -@@ -4,7 +4,7 @@ import java.util.EnumSet; ++ public final boolean isAlmostCollidingOnBorder(double boxMinX, double boxMaxX, double boxMinZ, double boxMaxZ) { ++ double borderMinX = this.getMinX(); ++ double borderMaxX = this.getMaxX(); ++ ++ double borderMinZ = this.getMinZ(); ++ double borderMaxZ = this.getMaxZ(); ++ ++ return ++ // Not intersecting if we're smaller ++ !AxisAlignedBB.voxelShapeIntersect( ++ boxMinX + net.minecraft.server.MCUtil.COLLISION_EPSILON, Double.NEGATIVE_INFINITY, boxMinZ + net.minecraft.server.MCUtil.COLLISION_EPSILON, ++ boxMaxX - net.minecraft.server.MCUtil.COLLISION_EPSILON, Double.POSITIVE_INFINITY, boxMaxZ - net.minecraft.server.MCUtil.COLLISION_EPSILON, ++ borderMinX, Double.NEGATIVE_INFINITY, borderMinZ, borderMaxX, Double.POSITIVE_INFINITY, borderMaxZ ++ ) ++ && ++ ++ // Are intersecting if we're larger ++ AxisAlignedBB.voxelShapeIntersect( ++ boxMinX - net.minecraft.server.MCUtil.COLLISION_EPSILON, Double.NEGATIVE_INFINITY, boxMinZ - net.minecraft.server.MCUtil.COLLISION_EPSILON, ++ boxMaxX + net.minecraft.server.MCUtil.COLLISION_EPSILON, Double.POSITIVE_INFINITY, boxMaxZ + net.minecraft.server.MCUtil.COLLISION_EPSILON, ++ borderMinX, Double.NEGATIVE_INFINITY, borderMinZ, borderMaxX, Double.POSITIVE_INFINITY, borderMaxZ ++ ) ++ ; ++ } ++ ++ public final boolean isCollidingWithBorderEdge(AxisAlignedBB boundingBox) { ++ return this.isCollidingWithBorderEdge(boundingBox.minX, boundingBox.maxX, boundingBox.minZ, boundingBox.maxZ); ++ } ++ ++ public final boolean isCollidingWithBorderEdge(double boxMinX, double boxMaxX, double boxMinZ, double boxMaxZ) { ++ double borderMinX = this.getMinX() + net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ double borderMaxX = this.getMaxX() - net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ ++ double borderMinZ = this.getMinZ() + net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ double borderMaxZ = this.getMaxZ() - net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ ++ return boxMinX < borderMinX || boxMaxX > borderMaxX || boxMinZ < borderMinZ || boxMaxZ > borderMaxZ; ++ } ++ // Tuinity end - optimise collisions ++ + public double a(Entity entity) { + return this.b(entity.locX(), entity.locZ()); + } + + public final VoxelShape asVoxelShape(){ return c();} // Paper - OBFHELPER ++ public final VoxelShape getCollisionShape() { return this.c(); } // Tuinity - OBFHELPER + public VoxelShape c() { + return this.j.m(); + } +@@ -80,18 +128,22 @@ public class WorldBorder { + return Math.min(d6, d3); + } + ++ public final double getMinX() { return this.e(); } // Tuinity - OBFHELPER + public double e() { + return this.j.a(); + } + ++ public final double getMinZ() { return this.f(); } // Tuinity - OBFHELPER + public double f() { + return this.j.c(); + } + ++ public final double getMaxX() { return this.g(); } // Tuinity - OBFHELPER + public double g() { + return this.j.b(); + } + ++ public final double getMaxZ() { return this.h(); } // Tuinity - OBFHELPER + public double h() { + return this.j.d(); + } +diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java +index 8fe060c3b2ad0873f96218eb7d02cdff3279224e..b17bedec0fa10d81273119b04f05f1cb4d908111 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java +@@ -103,6 +103,7 @@ public class ChunkSection { + return iblockdata1; + } + ++ public final boolean isFullOfAir() { return this.c(); } // Tuinity - OBFHELPER + public boolean c() { + return this.nonEmptyBlockCount == 0; + } +diff --git a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java +index 86dfab740883c138a0df8a3da9dfb4eb9acefaa3..a6937366cd9c9d708edb5cd1ab3ac096e7b2032e 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/world/level/chunk/DataPaletteBlock.java +@@ -172,6 +172,7 @@ public class DataPaletteBlock implements DataPaletteExpandable { + return this.a(j << 8 | k << 4 | i); // Paper - inline + } + ++ public final T rawGet(int index) { return this.a(index); } // Tuinity - OBFHELPER + protected T a(int i) { + T t0 = this.h.a(this.a.a(i)); + +diff --git a/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java b/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java +index 62513c812b497bb9d8dafe1d9c2f574059aebf15..0248ff18bf3f2dede4d0dda90df5e0eea56b7708 100644 +--- a/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java ++++ b/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java +@@ -17,6 +17,157 @@ public class AxisAlignedBB { + public final double maxY; + public final double maxZ; + ++ // Tuinity start ++ public final boolean isEmpty() { ++ return (this.maxX - this.minX) < net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxY - this.minY) < net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxZ - this.minZ) < net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ } ++ ++ public static AxisAlignedBB getBoxForChunk(int chunkX, int chunkZ) { ++ double x = (double)(chunkX << 4); ++ double z = (double)(chunkZ << 4); ++ // use a bounding box bigger than the chunk to prevent entities from entering it on move ++ return new AxisAlignedBB(x - 3*net.minecraft.server.MCUtil.COLLISION_EPSILON, Double.NEGATIVE_INFINITY, z - 3*net.minecraft.server.MCUtil.COLLISION_EPSILON, x + (16.0 + 3*net.minecraft.server.MCUtil.COLLISION_EPSILON), Double.POSITIVE_INFINITY, z + (16.0 + 3*net.minecraft.server.MCUtil.COLLISION_EPSILON), false); ++ } ++ ++ /* ++ A couple of rules for VoxelShape collisions: ++ Two shapes only intersect if they are actually more than EPSILON units into each other. This also applies to movement ++ checks. ++ If the two shapes strictly collide, then the return value of a collide call will return a value in the opposite ++ direction of the source move. However, this value will not be greater in magnitude than EPSILON. Collision code ++ will automatically round it to 0. ++ */ ++ ++ public final boolean voxelShapeIntersect(AxisAlignedBB other) { ++ return (this.minX - other.maxX) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxX - other.minX) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (this.minY - other.maxY) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxY - other.minY) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (this.minZ - other.maxZ) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxZ - other.minZ) > net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ } ++ ++ public final boolean voxelShapeIntersect(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { ++ return (this.minX - maxX) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxX - minX) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (this.minY - maxY) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxY - minY) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (this.minZ - maxZ) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (this.maxZ - minZ) > net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ } ++ ++ public static boolean voxelShapeIntersect(double minX1, double minY1, double minZ1, double maxX1, double maxY1, double maxZ1, ++ double minX2, double minY2, double minZ2, double maxX2, double maxY2, double maxZ2) { ++ return (minX1 - maxX2) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (maxX1 - minX2) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (minY1 - maxY2) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (maxY1 - minY2) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (minZ1 - maxZ2) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (maxZ1 - minZ2) > net.minecraft.server.MCUtil.COLLISION_EPSILON; ++ } ++ ++ public static double collideX(AxisAlignedBB target, AxisAlignedBB source, double source_move) { ++ if (source_move == 0.0) { ++ return 0.0; ++ } ++ ++ if ((source.minY - target.maxY) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxY - target.minY) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (source.minZ - target.maxZ) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxZ - target.minZ) > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ ++ if (source_move >= 0.0) { ++ double max_move = target.minX - source.maxX; // < 0.0 if no strict collision ++ if (max_move < -net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.min(max_move, source_move); ++ } else { ++ double max_move = target.maxX - source.minX; // > 0.0 if no strict collision ++ if (max_move > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.max(max_move, source_move); ++ } ++ } ++ return source_move; ++ } ++ ++ public static double collideY(AxisAlignedBB target, AxisAlignedBB source, double source_move) { ++ if (source_move == 0.0) { ++ return 0.0; ++ } ++ ++ if ((source.minX - target.maxX) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxX - target.minX) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (source.minZ - target.maxZ) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxZ - target.minZ) > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ if (source_move >= 0.0) { ++ double max_move = target.minY - source.maxY; // < 0.0 if no strict collision ++ if (max_move < -net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.min(max_move, source_move); ++ } else { ++ double max_move = target.maxY - source.minY; // > 0.0 if no strict collision ++ if (max_move > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.max(max_move, source_move); ++ } ++ } ++ return source_move; ++ } ++ ++ public static double collideZ(AxisAlignedBB target, AxisAlignedBB source, double source_move) { ++ if (source_move == 0.0) { ++ return 0.0; ++ } ++ ++ if ((source.minX - target.maxX) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxX - target.minX) > net.minecraft.server.MCUtil.COLLISION_EPSILON && ++ (source.minY - target.maxY) < -net.minecraft.server.MCUtil.COLLISION_EPSILON && (source.maxY - target.minY) > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ if (source_move >= 0.0) { ++ double max_move = target.minZ - source.maxZ; // < 0.0 if no strict collision ++ if (max_move < -net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.min(max_move, source_move); ++ } else { ++ double max_move = target.maxZ - source.minZ; // > 0.0 if no strict collision ++ if (max_move > net.minecraft.server.MCUtil.COLLISION_EPSILON) { ++ return source_move; ++ } ++ return Math.max(max_move, source_move); ++ } ++ } ++ return source_move; ++ } ++ ++ public final AxisAlignedBB offsetX(double dx) { ++ return new AxisAlignedBB(this.minX + dx, this.minY, this.minZ, this.maxX + dx, this.maxY, this.maxZ, false); ++ } ++ ++ public final AxisAlignedBB offsetY(double dy) { ++ return new AxisAlignedBB(this.minX, this.minY + dy, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); ++ } ++ ++ public final AxisAlignedBB offsetZ(double dz) { ++ return new AxisAlignedBB(this.minX, this.minY, this.minZ + dz, this.maxX, this.maxY, this.maxZ + dz, false); ++ } ++ ++ public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5, boolean dummy) { ++ this.minX = d0; ++ this.minY = d1; ++ this.minZ = d2; ++ this.maxX = d3; ++ this.maxY = d4; ++ this.maxZ = d5; ++ } ++ ++ public final AxisAlignedBB expandUpwards(double dy) { ++ return new AxisAlignedBB(this.minX, this.minY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); ++ } ++ ++ public final AxisAlignedBB cutUpwards(final double dy) { // dy > 0.0 ++ return new AxisAlignedBB(this.minX, this.maxY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); ++ } ++ ++ public final AxisAlignedBB cutDownwards(final double dy) { // dy < 0.0 ++ return new AxisAlignedBB(this.minX, this.minY + dy, this.minZ, this.maxX, this.minY, this.maxZ, false); ++ } ++ ++ public final AxisAlignedBB expandUpwardsAndCutBelow(double dy) { ++ return new AxisAlignedBB(this.minX, this.maxY, this.minZ, this.maxX, this.maxY + dy, this.maxZ, false); ++ } ++ // Tuinity end ++ + public AxisAlignedBB(double d0, double d1, double d2, double d3, double d4, double d5) { + this.minX = Math.min(d0, d3); + this.minY = Math.min(d1, d4); +@@ -189,6 +340,7 @@ public class AxisAlignedBB { + return new AxisAlignedBB(d0, d1, d2, d3, d4, d5); + } + ++ public final AxisAlignedBB offset(double d0, double d1, double d2) { return this.d(d0, d1, d2); } // Tuinity - OBFHELPER + public AxisAlignedBB d(double d0, double d1, double d2) { + return new AxisAlignedBB(this.minX + d0, this.minY + d1, this.minZ + d2, this.maxX + d0, this.maxY + d1, this.maxZ + d2); + } +@@ -197,6 +349,7 @@ public class AxisAlignedBB { + return new AxisAlignedBB(this.minX + (double) blockposition.getX(), this.minY + (double) blockposition.getY(), this.minZ + (double) blockposition.getZ(), this.maxX + (double) blockposition.getX(), this.maxY + (double) blockposition.getY(), this.maxZ + (double) blockposition.getZ()); + } + ++ public final AxisAlignedBB offset(Vec3D vec3d) { return this.b(vec3d); } // Tuinity - OBFHELPER + public AxisAlignedBB c(Vec3D vec3d) { + return this.d(vec3d.x, vec3d.y, vec3d.z); + } +@@ -216,6 +369,7 @@ public class AxisAlignedBB { + return this.e(vec3d.x, vec3d.y, vec3d.z); + } + ++ public final boolean contains(double d0, double d1, double d2) { return this.e(d0, d1, d2); } // Tuinity - OBFHELPER + public boolean e(double d0, double d1, double d2) { + return d0 >= this.minX && d0 < this.maxX && d1 >= this.minY && d1 < this.maxY && d2 >= this.minZ && d2 < this.maxZ; + } +diff --git a/src/main/java/net/minecraft/world/phys/Vec3D.java b/src/main/java/net/minecraft/world/phys/Vec3D.java +index b71e119eed6fa283d99dc033144c8be7b336d9c4..3fe1508b091e1fd0325eae50138d02fa6445c9ff 100644 +--- a/src/main/java/net/minecraft/world/phys/Vec3D.java ++++ b/src/main/java/net/minecraft/world/phys/Vec3D.java +@@ -9,7 +9,7 @@ import net.minecraft.util.MathHelper; public class Vec3D implements IPosition { @@ -961,7 +1336,7 @@ index 7f05587d42b7cdb09552277ec2e467f0edf06f10..5af554870bcf36e47aef43b966b141b9 public final double x; public final double y; public final double z; -@@ -61,6 +61,7 @@ public class Vec3D implements IPosition { +@@ -66,6 +66,7 @@ public class Vec3D implements IPosition { return this.add(-d0, -d1, -d2); } @@ -969,7 +1344,7 @@ index 7f05587d42b7cdb09552277ec2e467f0edf06f10..5af554870bcf36e47aef43b966b141b9 public Vec3D e(Vec3D vec3d) { return this.add(vec3d.x, vec3d.y, vec3d.z); } -@@ -109,10 +110,12 @@ public class Vec3D implements IPosition { +@@ -114,10 +115,12 @@ public class Vec3D implements IPosition { return new Vec3D(this.x * d0, this.y * d1, this.z * d2); } @@ -982,11 +1357,11 @@ index 7f05587d42b7cdb09552277ec2e467f0edf06f10..5af554870bcf36e47aef43b966b141b9 public double g() { return this.x * this.x + this.y * this.y + this.z * this.z; } -diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index eb926b74e17fb2f88c1d6ce2fb546541f8e6e274..700660dd93b3090334bb3033d5f5fdd6ab684744 100644 ---- a/src/main/java/net/minecraft/server/VoxelShape.java -+++ b/src/main/java/net/minecraft/server/VoxelShape.java -@@ -8,11 +8,11 @@ import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java b/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java +index 887016224c16f8a38c10a98eb0e2ae6cb353a153..8ecd4d38334872da8d7d05cdef1fb08cf0ff17d9 100644 +--- a/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java ++++ b/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java +@@ -16,11 +16,11 @@ import net.minecraft.world.phys.Vec3D; public abstract class VoxelShape { @@ -1000,7 +1375,7 @@ index eb926b74e17fb2f88c1d6ce2fb546541f8e6e274..700660dd93b3090334bb3033d5f5fdd6 this.a = voxelshapediscrete; } -@@ -48,9 +48,15 @@ public abstract class VoxelShape { +@@ -56,9 +56,15 @@ public abstract class VoxelShape { public final VoxelShape offset(double x, double y, double z) { return this.a(x, y, z); } // Paper - OBFHELPER public VoxelShape a(double d0, double d1, double d2) { @@ -1017,7 +1392,7 @@ index eb926b74e17fb2f88c1d6ce2fb546541f8e6e274..700660dd93b3090334bb3033d5f5fdd6 public VoxelShape c() { VoxelShape[] avoxelshape = new VoxelShape[]{VoxelShapes.a()}; -@@ -70,6 +76,7 @@ public abstract class VoxelShape { +@@ -78,6 +84,7 @@ public abstract class VoxelShape { }, true); } @@ -1025,25 +1400,17 @@ index eb926b74e17fb2f88c1d6ce2fb546541f8e6e274..700660dd93b3090334bb3033d5f5fdd6 public List d() { List list = Lists.newArrayList(); -diff --git a/src/main/java/net/minecraft/server/VoxelShapeArray.java b/src/main/java/net/minecraft/server/VoxelShapeArray.java -index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825a8d2062f 100644 ---- a/src/main/java/net/minecraft/server/VoxelShapeArray.java -+++ b/src/main/java/net/minecraft/server/VoxelShapeArray.java -@@ -3,6 +3,7 @@ package net.minecraft.server; - import it.unimi.dsi.fastutil.doubles.DoubleArrayList; - import it.unimi.dsi.fastutil.doubles.DoubleList; - import java.util.Arrays; -+import java.util.List; - - public final class VoxelShapeArray extends VoxelShape { - -@@ -10,11 +11,25 @@ public final class VoxelShapeArray extends VoxelShape { +diff --git a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapeArray.java b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapeArray.java +index 56f0b3a74f676d288d81671a4791337e169b9758..5a0f8a9f5bfb3f271ccf8293bbe9fe99dcb116a1 100644 +--- a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapeArray.java ++++ b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapeArray.java +@@ -12,11 +12,25 @@ public final class VoxelShapeArray extends VoxelShape { private final DoubleList c; private final DoubleList d; + // Tuinity start - optimise multi-aabb shapes -+ static final AxisAlignedBB[] EMPTY = new AxisAlignedBB[0]; -+ final AxisAlignedBB[] boundingBoxesRepresentation; ++ static final net.minecraft.world.phys.AxisAlignedBB[] EMPTY = new net.minecraft.world.phys.AxisAlignedBB[0]; ++ final net.minecraft.world.phys.AxisAlignedBB[] boundingBoxesRepresentation; + + final double offsetX; + final double offsetY; @@ -1058,12 +1425,12 @@ index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825 + // Tuinity start - optimise multi-aabb shapes + this(voxelshapediscrete, doublelist, doublelist1, doublelist2, null, null, 0.0, 0.0, 0.0); + } -+ VoxelShapeArray(VoxelShapeDiscrete voxelshapediscrete, DoubleList doublelist, DoubleList doublelist1, DoubleList doublelist2, VoxelShapeArray original, AxisAlignedBB[] boundingBoxesRepresentation, double offsetX, double offsetY, double offsetZ) { ++ VoxelShapeArray(VoxelShapeDiscrete voxelshapediscrete, DoubleList doublelist, DoubleList doublelist1, DoubleList doublelist2, VoxelShapeArray original, net.minecraft.world.phys.AxisAlignedBB[] boundingBoxesRepresentation, double offsetX, double offsetY, double offsetZ) { + // Tuinity end - optimise multi-aabb shapes super(voxelshapediscrete); int i = voxelshapediscrete.b() + 1; int j = voxelshapediscrete.c() + 1; -@@ -27,6 +42,18 @@ public final class VoxelShapeArray extends VoxelShape { +@@ -29,6 +43,18 @@ public final class VoxelShapeArray extends VoxelShape { } else { throw (IllegalArgumentException) SystemUtils.c((Throwable) (new IllegalArgumentException("Lengths of point arrays must be consistent with the size of the VoxelShape."))); } @@ -1082,7 +1449,7 @@ index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825 } @Override -@@ -42,4 +69,63 @@ public final class VoxelShapeArray extends VoxelShape { +@@ -44,4 +70,63 @@ public final class VoxelShapeArray extends VoxelShape { throw new IllegalArgumentException(); } } @@ -1097,23 +1464,23 @@ index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825 + } + + @Override -+ public List d() { // getBoundingBoxesRepresentation ++ public java.util.List d() { // getBoundingBoxesRepresentation + if (this.boundingBoxesRepresentation == null) { + return super.d(); + } -+ List ret = new java.util.ArrayList<>(this.boundingBoxesRepresentation.length); ++ java.util.List ret = new java.util.ArrayList<>(this.boundingBoxesRepresentation.length); + + double offX = this.offsetX; + double offY = this.offsetY; + double offZ = this.offsetZ; -+ for (AxisAlignedBB boundingBox : this.boundingBoxesRepresentation) { ++ for (net.minecraft.world.phys.AxisAlignedBB boundingBox : this.boundingBoxesRepresentation) { + ret.add(boundingBox.offset(offX, offY, offZ)); + } + + return ret; + } + -+ public final AxisAlignedBB[] getBoundingBoxesRepresentationRaw() { ++ public final net.minecraft.world.phys.AxisAlignedBB[] getBoundingBoxesRepresentationRaw() { + return this.boundingBoxesRepresentation; + } + @@ -1129,13 +1496,13 @@ index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825 + return this.offsetZ; + } + -+ public final boolean intersects(AxisAlignedBB axisalingedbb) { ++ public final boolean intersects(net.minecraft.world.phys.AxisAlignedBB axisalingedbb) { + // this can be optimised by checking an "overall shape" first, but not needed + double offX = this.offsetX; + double offY = this.offsetY; + double offZ = this.offsetZ; + -+ for (AxisAlignedBB boundingBox : this.boundingBoxesRepresentation) { ++ for (net.minecraft.world.phys.AxisAlignedBB boundingBox : this.boundingBoxesRepresentation) { + if (axisalingedbb.voxelShapeIntersect(boundingBox.minX + offX, boundingBox.minY + offY, boundingBox.minZ + offZ, + boundingBox.maxX + offX, boundingBox.maxY + offY, boundingBox.maxZ + offZ)) { + return true; @@ -1146,24 +1513,11 @@ index 3c29cb1452cde1308f630bfcb82876ef19057e8f..c14b7bd63e3917bc5f495655c40d8825 + } + // Tuinity end - optimise multi-aabb shapes } -diff --git a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java -index e841611bb7c36dffec44bb9e74a0a9657a113263..259605daabb18aedb15d56c78e6553ae2d22e13f 100644 ---- a/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java -+++ b/src/main/java/net/minecraft/server/VoxelShapeSpliterator.java -@@ -91,7 +91,7 @@ public class VoxelShapeSpliterator extends AbstractSpliterator { - VoxelShape voxelshape = iblockdata.b((IBlockAccess) this.g, this.e, this.c); - - if (voxelshape == VoxelShapes.b()) { -- if (!this.b.a((double) i, (double) j, (double) k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)) { -+ if (!this.b.voxelShapeIntersect((double) i, (double) j, (double) k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D)) { // Tuinity - keep vanilla behavior for voxelshape intersection - See comment in AxisAlignedBB - continue; - } - -diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe64cc2e79 100644 ---- a/src/main/java/net/minecraft/server/VoxelShapes.java -+++ b/src/main/java/net/minecraft/server/VoxelShapes.java -@@ -17,18 +17,101 @@ public final class VoxelShapes { +diff --git a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java +index 38fde2e10adf06bf5c5141d17d82ba125b372cd7..98e787e6383a39de1708428137fd7f9e057ff153 100644 +--- a/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java ++++ b/src/main/java/net/minecraft/world/phys/shapes/VoxelShapes.java +@@ -27,18 +27,101 @@ public final class VoxelShapes { voxelshapebitset.a(0, 0, 0, true, true); return new VoxelShapeCube(voxelshapebitset); @@ -1185,7 +1539,7 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe return VoxelShapes.c; } -+ static final com.tuinity.tuinity.voxel.AABBVoxelShape optimisedFullCube = new com.tuinity.tuinity.voxel.AABBVoxelShape(new AxisAlignedBB(0, 0, 0, 1.0, 1.0, 1.0)); // Tuinity - optimise voxelshape ++ public static final com.tuinity.tuinity.voxel.AABBVoxelShape optimisedFullCube = new com.tuinity.tuinity.voxel.AABBVoxelShape(new AxisAlignedBB(0, 0, 0, 1.0, 1.0, 1.0)); // Tuinity - optimise voxelshape + + // Tuinity start - optimise voxelshapes + public static boolean addBoxesToIfIntersects(VoxelShape shape, AxisAlignedBB aabb, java.util.List list) { @@ -1268,7 +1622,7 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe } public static VoxelShape create(double d0, double d1, double d2, double d3, double d4, double d5) { -@@ -67,7 +150,7 @@ public final class VoxelShapes { +@@ -77,7 +160,7 @@ public final class VoxelShapes { return new VoxelShapeCube(voxelshapebitset); } } else { @@ -1277,7 +1631,7 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe } } -@@ -132,6 +215,20 @@ public final class VoxelShapes { +@@ -142,6 +225,20 @@ public final class VoxelShapes { public static final boolean applyOperation(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { return VoxelShapes.c(voxelshape, voxelshape1, operatorboolean); } // Paper - OBFHELPER public static boolean c(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { @@ -1298,7 +1652,7 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe if (operatorboolean.apply(false, false)) { throw (IllegalArgumentException) SystemUtils.c((Throwable) (new IllegalArgumentException())); } else if (voxelshape == voxelshape1) { -@@ -316,7 +413,50 @@ public final class VoxelShapes { +@@ -326,7 +423,50 @@ public final class VoxelShapes { public static boolean combinationOccludes(VoxelShape voxelshape, VoxelShape voxelshape1) { return b(voxelshape, voxelshape1); } // Tuinity - OBFHELPER public static boolean b(VoxelShape voxelshape, VoxelShape voxelshape1) { @@ -1321,26 +1675,26 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe + // check overall bounding box + double minY = Math.min(boundingBox1.minY, boundingBox2.minY); + double maxY = Math.max(boundingBox1.maxY, boundingBox2.maxY); -+ if (minY > MCUtil.COLLISION_EPSILON || maxY < (1 - MCUtil.COLLISION_EPSILON)) { ++ if (minY > net.minecraft.server.MCUtil.COLLISION_EPSILON || maxY < (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)) { + return false; + } + double minX = Math.min(boundingBox1.minX, boundingBox2.minX); + double maxX = Math.max(boundingBox1.maxX, boundingBox2.maxX); -+ if (minX > MCUtil.COLLISION_EPSILON || maxX < (1 - MCUtil.COLLISION_EPSILON)) { ++ if (minX > net.minecraft.server.MCUtil.COLLISION_EPSILON || maxX < (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)) { + return false; + } + double minZ = Math.min(boundingBox1.minZ, boundingBox2.minZ); + double maxZ = Math.max(boundingBox1.maxZ, boundingBox2.maxZ); -+ if (minZ > MCUtil.COLLISION_EPSILON || maxZ < (1 - MCUtil.COLLISION_EPSILON)) { ++ if (minZ > net.minecraft.server.MCUtil.COLLISION_EPSILON || maxZ < (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)) { + return false; + } + // fall through to full merge check + } else { + AxisAlignedBB boundingBox = v1Empty ? ((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape1).aabb : ((com.tuinity.tuinity.voxel.AABBVoxelShape)voxelshape).aabb; + // check if the bounding box encloses the full cube -+ return (boundingBox.minY <= MCUtil.COLLISION_EPSILON && boundingBox.maxY >= (1 - MCUtil.COLLISION_EPSILON)) && -+ (boundingBox.minX <= MCUtil.COLLISION_EPSILON && boundingBox.maxX >= (1 - MCUtil.COLLISION_EPSILON)) && -+ (boundingBox.minZ <= MCUtil.COLLISION_EPSILON && boundingBox.maxZ >= (1 - MCUtil.COLLISION_EPSILON)); ++ return (boundingBox.minY <= net.minecraft.server.MCUtil.COLLISION_EPSILON && boundingBox.maxY >= (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)) && ++ (boundingBox.minX <= net.minecraft.server.MCUtil.COLLISION_EPSILON && boundingBox.maxX >= (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)) && ++ (boundingBox.minZ <= net.minecraft.server.MCUtil.COLLISION_EPSILON && boundingBox.maxZ >= (1 - net.minecraft.server.MCUtil.COLLISION_EPSILON)); + } + } + return b_rare(voxelshape, voxelshape1); @@ -1350,368 +1704,6 @@ index 9f4f9df09968dc45878ad59f5ee45672a3f08fbd..636bbbc42466cb54c300352f400464fe } @VisibleForTesting -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 15617d20883030b240014dbb258fd0086fef4235..f40ddc91b6102ce67d5989037c9b9ec822fefa34 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1115,8 +1115,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - - @Override - public List getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { -- this.getMethodProfiler().c("getEntities"); -+ // Tuinity start - add list parameter - List list = Lists.newArrayList(); -+ return this.getEntities(entity, axisalignedbb, predicate, list); -+ } -+ public List getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate, List list) { -+ // Tuinity end - add list parameter -+ this.getMethodProfiler().c("getEntities"); - 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); -diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 6e82c1d1b272a95144bfc78d34b630c24466fa3e..6b4c007550c3e2e405314d8931630557655ce6f1 100644 ---- a/src/main/java/net/minecraft/server/WorldBorder.java -+++ b/src/main/java/net/minecraft/server/WorldBorder.java -@@ -50,11 +50,59 @@ public class WorldBorder { - return axisalignedbb.maxX > this.e() && axisalignedbb.minX < this.g() && axisalignedbb.maxZ > this.f() && axisalignedbb.minZ < this.h(); - } - -+ // Tuinity start - optimise collisions -+ // determines whether we are almost colliding with the world border -+ // for clear collisions, this rets false -+ public final boolean isAlmostCollidingOnBorder(AxisAlignedBB boundingBox) { -+ return this.isAlmostCollidingOnBorder(boundingBox.minX, boundingBox.maxX, boundingBox.minZ, boundingBox.maxZ); -+ } -+ -+ public final boolean isAlmostCollidingOnBorder(double boxMinX, double boxMaxX, double boxMinZ, double boxMaxZ) { -+ double borderMinX = this.getMinX(); -+ double borderMaxX = this.getMaxX(); -+ -+ double borderMinZ = this.getMinZ(); -+ double borderMaxZ = this.getMaxZ(); -+ -+ return -+ // Not intersecting if we're smaller -+ !AxisAlignedBB.voxelShapeIntersect( -+ boxMinX + MCUtil.COLLISION_EPSILON, Double.NEGATIVE_INFINITY, boxMinZ + MCUtil.COLLISION_EPSILON, -+ boxMaxX - MCUtil.COLLISION_EPSILON, Double.POSITIVE_INFINITY, boxMaxZ - MCUtil.COLLISION_EPSILON, -+ borderMinX, Double.NEGATIVE_INFINITY, borderMinZ, borderMaxX, Double.POSITIVE_INFINITY, borderMaxZ -+ ) -+ && -+ -+ // Are intersecting if we're larger -+ AxisAlignedBB.voxelShapeIntersect( -+ boxMinX - MCUtil.COLLISION_EPSILON, Double.NEGATIVE_INFINITY, boxMinZ - MCUtil.COLLISION_EPSILON, -+ boxMaxX + MCUtil.COLLISION_EPSILON, Double.POSITIVE_INFINITY, boxMaxZ + MCUtil.COLLISION_EPSILON, -+ borderMinX, Double.NEGATIVE_INFINITY, borderMinZ, borderMaxX, Double.POSITIVE_INFINITY, borderMaxZ -+ ) -+ ; -+ } -+ -+ public final boolean isCollidingWithBorderEdge(AxisAlignedBB boundingBox) { -+ return this.isCollidingWithBorderEdge(boundingBox.minX, boundingBox.maxX, boundingBox.minZ, boundingBox.maxZ); -+ } -+ -+ public final boolean isCollidingWithBorderEdge(double boxMinX, double boxMaxX, double boxMinZ, double boxMaxZ) { -+ double borderMinX = this.getMinX() + MCUtil.COLLISION_EPSILON; -+ double borderMaxX = this.getMaxX() - MCUtil.COLLISION_EPSILON; -+ -+ double borderMinZ = this.getMinZ() + MCUtil.COLLISION_EPSILON; -+ double borderMaxZ = this.getMaxZ() - MCUtil.COLLISION_EPSILON; -+ -+ return boxMinX < borderMinX || boxMaxX > borderMaxX || boxMinZ < borderMinZ || boxMaxZ > borderMaxZ; -+ } -+ // Tuinity end - optimise collisions -+ - public double a(Entity entity) { - return this.b(entity.locX(), entity.locZ()); - } - - public final VoxelShape asVoxelShape(){ return c();} // Paper - OBFHELPER -+ public final VoxelShape getCollisionShape() { return this.c(); } // Tuinity - OBFHELPER - public VoxelShape c() { - return this.j.m(); - } -@@ -70,18 +118,22 @@ public class WorldBorder { - return Math.min(d6, d3); - } - -+ public final double getMinX() { return this.e(); } // Tuinity - OBFHELPER - public double e() { - return this.j.a(); - } - -+ public final double getMinZ() { return this.f(); } // Tuinity - OBFHELPER - public double f() { - return this.j.c(); - } - -+ public final double getMaxX() { return this.g(); } // Tuinity - OBFHELPER - public double g() { - return this.j.b(); - } - -+ public final double getMaxZ() { return this.h(); } // Tuinity - OBFHELPER - public double h() { - return this.j.d(); - } -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a1e0761f255b5bda9834738fbcea57a129ada4e3..d1d54c9c8657cdebf320ea03547417876a7af092 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -361,6 +361,251 @@ public class WorldServer extends World implements GeneratorAccessSeed { - this.asyncChunkTaskManager = new com.destroystokyo.paper.io.chunk.ChunkTaskManager(this); // Paper - } - -+ // Tuinity start - optimise collision -+ public boolean collidesWithAnyBlockOrWorldBorder(@Nullable Entity entity, AxisAlignedBB axisalignedbb, boolean loadChunks, -+ boolean collidesWithUnloaded) { -+ return this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, loadChunks, collidesWithUnloaded, true, null); -+ } -+ -+ public boolean collidesWithAnyBlockOrWorldBorder(@Nullable Entity entity, AxisAlignedBB axisalignedbb, -+ boolean loadChunks, boolean collidesWithUnloaded, -+ java.util.function.BiPredicate predicate) { -+ return this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, null, loadChunks, collidesWithUnloaded, true, predicate); -+ } -+ -+ public final boolean hardCollidesWithAnyEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate) { -+ if (axisalignedbb.isEmpty()) { -+ return false; -+ } -+ -+ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with. -+ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems -+ // specifically with boat collisions. -+ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON); -+ List entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); -+ try { -+ if (entity != null && entity.hardCollides()) { -+ this.getEntities(entity, axisalignedbb, predicate, entities); -+ } else { -+ this.getHardCollidingEntities(entity, axisalignedbb, predicate, entities); -+ } -+ -+ for (int i = 0, len = entities.size(); i < len; ++i) { -+ Entity otherEntity = entities.get(i); -+ -+ if ((entity == null || otherEntity.collisionBoxIsHard()) || entity.hardCollidesWith(otherEntity)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } finally { -+ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); -+ } -+ } -+ -+ public final boolean hasAnyCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb) { -+ return this.hasAnyCollisions(entity, axisalignedbb, true); -+ } -+ -+ public final boolean hasAnyCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, boolean loadChunks) { -+ return this.collidesWithAnyBlockOrWorldBorder(entity, axisalignedbb, loadChunks, true) -+ || this.hardCollidesWithAnyEntities(entity, axisalignedbb, null); -+ } -+ -+ // returns whether any collisions were detected -+ public boolean getCollisionsForBlocksOrWorldBorder(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, -+ boolean loadChunks, boolean collidesWithUnloaded, boolean checkOnly, -+ java.util.function.BiPredicate predicate) { -+ boolean ret = false; -+ -+ if (entity != null) { -+ if (this.getWorldBorder().isAlmostCollidingOnBorder(axisalignedbb)) { -+ if (checkOnly) { -+ return true; -+ } else { -+ VoxelShapes.addBoxesTo(this.getWorldBorder().getCollisionShape(), list); -+ ret = true; -+ } -+ } -+ } -+ -+ int minBlockX = MathHelper.floor(axisalignedbb.minX - MCUtil.COLLISION_EPSILON) - 1; -+ int maxBlockX = MathHelper.floor(axisalignedbb.maxX + MCUtil.COLLISION_EPSILON) + 1; -+ -+ int minBlockY = MathHelper.floor(axisalignedbb.minY - MCUtil.COLLISION_EPSILON) - 1; -+ int maxBlockY = MathHelper.floor(axisalignedbb.maxY + MCUtil.COLLISION_EPSILON) + 1; -+ -+ int minBlockZ = MathHelper.floor(axisalignedbb.minZ - MCUtil.COLLISION_EPSILON) - 1; -+ int maxBlockZ = MathHelper.floor(axisalignedbb.maxZ + MCUtil.COLLISION_EPSILON) + 1; -+ -+ -+ BlockPosition.MutableBlockPosition mutablePos = new BlockPosition.MutableBlockPosition(); -+ VoxelShapeCollision collisionShape = null; -+ -+ // special cases: -+ if (minBlockY > 255 || maxBlockY < 0) { -+ // no point in checking -+ return ret; -+ } -+ -+ int minYIterate = Math.max(0, minBlockY); -+ int maxYIterate = Math.min(255, maxBlockY); -+ -+ int minChunkX = minBlockX >> 4; -+ int maxChunkX = maxBlockX >> 4; -+ -+ int minChunkZ = minBlockZ >> 4; -+ int maxChunkZ = maxBlockZ >> 4; -+ -+ ChunkProviderServer chunkProvider = (ChunkProviderServer)this.chunkProvider; -+ // TODO special case single chunk? -+ -+ for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) { -+ int minZ = currChunkZ == minChunkZ ? minBlockZ & 15 : 0; // coordinate in chunk -+ int maxZ = currChunkZ == maxChunkZ ? maxBlockZ & 15 : 15; // coordinate in chunk -+ -+ for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) { -+ int minX = currChunkX == minChunkX ? minBlockX & 15 : 0; // coordinate in chunk -+ int maxX = currChunkX == maxChunkX ? maxBlockX & 15 : 15; // coordinate in chunk -+ -+ int chunkXGlobalPos = currChunkX << 4; -+ int chunkZGlobalPos = currChunkZ << 4; -+ Chunk chunk = loadChunks ? chunkProvider.getChunkAt(currChunkX, currChunkZ, true) : chunkProvider.getChunkAtIfLoadedImmediately(currChunkX, currChunkZ); -+ -+ if (chunk == null) { -+ if (collidesWithUnloaded) { -+ if (checkOnly) { -+ return true; -+ } else { -+ list.add(AxisAlignedBB.getBoxForChunk(currChunkX, currChunkZ)); -+ ret = true; -+ } -+ } -+ continue; -+ } -+ -+ ChunkSection[] sections = chunk.getSections(); -+ -+ // bound y -+ -+ for (int currY = minYIterate; currY <= maxYIterate; ++currY) { -+ ChunkSection section = sections[currY >>> 4]; -+ if (section == null || section.isFullOfAir()) { -+ // empty -+ // skip to next section -+ currY = (currY & ~(15)) + 15; // increment by 15: iterator loop increments by the extra one -+ continue; -+ } -+ -+ DataPaletteBlock blocks = section.blockIds; -+ -+ for (int currZ = minZ; currZ <= maxZ; ++currZ) { -+ for (int currX = minX; currX <= maxX; ++currX) { -+ int localBlockIndex = (currX) | (currZ << 4) | ((currY & 15) << 8); -+ int blockX = currX | chunkXGlobalPos; -+ int blockY = currY; -+ int blockZ = currZ | chunkZGlobalPos; -+ -+ int edgeCount = ((blockX == minBlockX || blockX == maxBlockX) ? 1 : 0) + -+ ((blockY == minBlockY || blockY == maxBlockY) ? 1 : 0) + -+ ((blockZ == minBlockZ || blockZ == maxBlockZ) ? 1 : 0); -+ if (edgeCount == 3) { -+ continue; -+ } -+ -+ IBlockData blockData = blocks.rawGet(localBlockIndex); -+ -+ if ((edgeCount != 1 || blockData.shapeExceedsCube()) && (edgeCount != 2 || blockData.getBlock() == Blocks.MOVING_PISTON)) { -+ mutablePos.setValues(blockX, blockY, blockZ); -+ if (collisionShape == null) { -+ collisionShape = entity == null ? VoxelShapeCollision.a() : VoxelShapeCollision.a(entity); -+ } -+ VoxelShape voxelshape2 = blockData.getCollisionShape(this, mutablePos, collisionShape); -+ if (voxelshape2 != VoxelShapes.getEmptyShape()) { -+ VoxelShape voxelshape3 = voxelshape2.offset((double)blockX, (double)blockY, (double)blockZ); -+ -+ if (predicate != null && !predicate.test(blockData, mutablePos)) { -+ continue; -+ } -+ -+ if (checkOnly) { -+ if (voxelshape3.intersects(axisalignedbb)) { -+ return true; -+ } -+ } else { -+ ret |= VoxelShapes.addBoxesToIfIntersects(voxelshape3, axisalignedbb, list); -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ return ret; -+ } -+ -+ public final void getEntityHardCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate predicate, List list) { -+ if (axisalignedbb.isEmpty()) { -+ return; -+ } -+ -+ // to comply with vanilla intersection rules, expand by -epsilon so we only get stuff we definitely collide with. -+ // Vanilla for hard collisions has this backwards, and they expand by +epsilon but this causes terrible problems -+ // specifically with boat collisions. -+ axisalignedbb = axisalignedbb.grow(-MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON, -MCUtil.COLLISION_EPSILON); -+ List entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); -+ try { -+ if (entity != null && entity.hardCollides()) { -+ this.getEntities(entity, axisalignedbb, predicate, entities); -+ } else { -+ this.getHardCollidingEntities(entity, axisalignedbb, predicate, entities); -+ } -+ -+ for (int i = 0, len = entities.size(); i < len; ++i) { -+ Entity otherEntity = entities.get(i); -+ -+ if ((entity == null || otherEntity.collisionBoxIsHard()) || entity.hardCollidesWith(otherEntity)) { -+ if (!otherEntity.getBoundingBox().isEmpty()) { -+ list.add(otherEntity.getBoundingBox()); -+ } -+ } -+ } -+ } finally { -+ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); -+ } -+ } -+ -+ public final void getCollisions(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, boolean loadChunks) { -+ this.getCollisionsForBlocksOrWorldBorder(entity, axisalignedbb, list, loadChunks, true, false, null); -+ this.getEntityHardCollisions(entity, axisalignedbb, null, list); -+ } -+ -+ @Override -+ public boolean getCubes(AxisAlignedBB axisalignedbb) { -+ return !this.hasAnyCollisions(null, axisalignedbb); -+ } -+ -+ @Override -+ public boolean getCubes(Entity entity) { -+ return !this.hasAnyCollisions(entity, entity.getBoundingBox()); -+ } -+ -+ @Override -+ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb) { -+ if (entity instanceof EntityArmorStand && !entity.world.paperConfig.armorStandEntityLookups) return false; -+ return !this.hasAnyCollisions(entity, axisalignedbb); -+ } -+ -+ @Override -+ public boolean getCubes(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate) { -+ if (entity instanceof EntityArmorStand && !entity.world.paperConfig.armorStandEntityLookups) return false; -+ return !this.collidesWithAnyBlockOrWorldBorder(entity, axisalignedbb, true, true) && !this.hardCollidesWithAnyEntities(entity, axisalignedbb, predicate); -+ } -+ // Tuinity end - optimise collision -+ - // CraftBukkit start - @Override - protected TileEntity getTileEntity(BlockPosition pos, boolean validate) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java index f72c13bedaa6fa45e26f5dcad564835bdd4af61f..50f855b931dba60754fff9c7cdf5e0e744f00fdd 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java diff --git a/patches/Tuinity/patches/server/0026-Reduce-allocation-rate-from-crammed-entities.patch b/patches/Tuinity/patches/server/0026-Reduce-allocation-rate-from-crammed-entities.patch index dada4c27..a83c8207 100644 --- a/patches/Tuinity/patches/server/0026-Reduce-allocation-rate-from-crammed-entities.patch +++ b/patches/Tuinity/patches/server/0026-Reduce-allocation-rate-from-crammed-entities.patch @@ -4,11 +4,11 @@ Date: Wed, 27 May 2020 14:26:26 -0700 Subject: [PATCH] Reduce allocation rate from crammed entities -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9a79371b40803947ed5deef68c50d45683aaae52..d568db532de83a85d5c387121cec151c160f36bf 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2879,7 +2879,11 @@ public abstract class EntityLiving extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index b0ee9e98d5f1e56c8d82e90dd7761c8ef79cfb1c..561905be42428855a07a2e63aca80d5dd63b22bf 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2973,7 +2973,11 @@ public abstract class EntityLiving extends Entity { return; } // Paper - end don't run getEntities if we're not going to use its result @@ -21,7 +21,7 @@ index 9a79371b40803947ed5deef68c50d45683aaae52..d568db532de83a85d5c387121cec151c if (!list.isEmpty()) { // Paper - move up -@@ -2908,6 +2912,9 @@ public abstract class EntityLiving extends Entity { +@@ -3002,6 +3006,9 @@ public abstract class EntityLiving extends Entity { this.C(entity); } } diff --git a/patches/Tuinity/patches/server/0027-Optimise-chunk-tick-iteration.patch b/patches/Tuinity/patches/server/0027-Optimise-chunk-tick-iteration.patch index c567b9af..85e5894a 100644 --- a/patches/Tuinity/patches/server/0027-Optimise-chunk-tick-iteration.patch +++ b/patches/Tuinity/patches/server/0027-Optimise-chunk-tick-iteration.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Optimise chunk tick iteration Use a dedicated list of entity ticking chunks to reduce the cost -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index e1a17abda657c7eb7aee7cd0763bcb48cc8b154a..8c0aed61400a89799592d3d457c1d78f0217d066 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -22,6 +22,12 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index 2f57e20e6a05274c8d2d5654f3c81599d16840af..b44b1b79a38ac2c15666e5b04e16f1bed67d3d89 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -47,6 +47,12 @@ import net.minecraft.world.level.storage.WorldData; + import net.minecraft.world.level.storage.WorldPersistentData; + import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper +// Tuinity start +import it.unimi.dsi.fastutil.objects.Object2BooleanLinkedOpenHashMap; @@ -21,8 +21,8 @@ index e1a17abda657c7eb7aee7cd0763bcb48cc8b154a..8c0aed61400a89799592d3d457c1d78f + public class ChunkProviderServer extends IChunkProvider { - private static final List b = ChunkStatus.a(); static final List getPossibleChunkStatuses() { return ChunkProviderServer.b; } // Paper - OBFHELPER -@@ -982,19 +988,23 @@ public class ChunkProviderServer extends IChunkProvider { + private static final List b = ChunkStatus.a(); public static final List getPossibleChunkStatuses() { return ChunkProviderServer.b; } // Paper - OBFHELPER +@@ -1007,19 +1013,23 @@ public class ChunkProviderServer extends IChunkProvider { //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper // Paper - moved up @@ -54,7 +54,7 @@ index e1a17abda657c7eb7aee7cd0763bcb48cc8b154a..8c0aed61400a89799592d3d457c1d78f ChunkCoordIntPair chunkcoordintpair = playerchunk.i(); if (!this.playerChunkMap.isOutsideOfRange(playerchunk, chunkcoordintpair, false)) { // Paper - optimise isOutsideOfRange -@@ -1010,7 +1020,11 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -1035,7 +1045,11 @@ public class ChunkProviderServer extends IChunkProvider { } } } diff --git a/patches/Tuinity/patches/server/0028-Use-entity-ticking-chunk-map-for-entity-tracker.patch b/patches/Tuinity/patches/server/0028-Use-entity-ticking-chunk-map-for-entity-tracker.patch index 0b92afdd..9e789719 100644 --- a/patches/Tuinity/patches/server/0028-Use-entity-ticking-chunk-map-for-entity-tracker.patch +++ b/patches/Tuinity/patches/server/0028-Use-entity-ticking-chunk-map-for-entity-tracker.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Use entity ticking chunk map for entity tracker Should bring us back in-line with tracker performance before the loaded entity list reversion. -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b36568601dd2956518cc5dfe1b10cca8d65b6fb6..1a25a8ebd88d49ac16b58abc6d366367671e1ee7 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -2099,22 +2099,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 2beb14192910a35936e0ff5878c227bf22abd442..db271a5a1f09f8c11ac2498f8975cf7b025dd5e3 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -2153,22 +2153,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private final void processTrackQueue() { this.world.timings.tracker1.startTiming(); try { diff --git a/patches/Tuinity/patches/server/0029-Improve-paper-prevent-moving-into-unloaded-chunk-che.patch b/patches/Tuinity/patches/server/0029-Improve-paper-prevent-moving-into-unloaded-chunk-che.patch index 2f54ff37..f457d2b2 100644 --- a/patches/Tuinity/patches/server/0029-Improve-paper-prevent-moving-into-unloaded-chunk-che.patch +++ b/patches/Tuinity/patches/server/0029-Improve-paper-prevent-moving-into-unloaded-chunk-che.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Improve paper prevent moving into unloaded chunk check Check the AABB of the move -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 3435eb1584546d2963324372ddab1645dcf6327a..8871e9dbbfe7e815012b914d930aeeed4c602d67 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -423,7 +423,9 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index a15230235ba0244c42346f51cabb470cb362a455..bcdd256c09135b72e6ed951992d9d3f26cb1633f 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -568,7 +568,9 @@ public class PlayerConnection implements PacketListenerPlayIn { speed *= 2f; // TODO: Get the speed of the vehicle instead of the player // Paper start - Prevent moving into unloaded chunks @@ -20,7 +20,7 @@ index 3435eb1584546d2963324372ddab1645dcf6327a..8871e9dbbfe7e815012b914d930aeeed this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); return; } -@@ -1142,7 +1144,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1287,7 +1289,7 @@ public class PlayerConnection implements PacketListenerPlayIn { speed = player.abilities.walkSpeed * 10f; } // Paper start - Prevent moving into unloaded chunks diff --git a/patches/Tuinity/patches/server/0030-Improve-async-tp-to-not-load-chunks-when-crossing-wo.patch b/patches/Tuinity/patches/server/0030-Improve-async-tp-to-not-load-chunks-when-crossing-wo.patch index 4a5409c1..60e9b61b 100644 --- a/patches/Tuinity/patches/server/0030-Improve-async-tp-to-not-load-chunks-when-crossing-wo.patch +++ b/patches/Tuinity/patches/server/0030-Improve-async-tp-to-not-load-chunks-when-crossing-wo.patch @@ -7,42 +7,26 @@ Fixes an issue where a getCubes call would load neighbouring chunks. Loads less chunks than paper's implementation diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 2fc101869775711533a1e50f9ae608cd74d36d3a..2af3bee540ee25ea32a7548fd0d64dea16a0a268 100644 +index 295ffab08672d77d88aca368cb5b56f80bc4f1b5..dee4d12a49468d38f077784b219199f0070786f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -509,27 +509,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -512,27 +512,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { entity.setHeadRotation(yaw); } - @Override// Paper start - public java.util.concurrent.CompletableFuture teleportAsync(Location loc, @javax.annotation.Nonnull org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) { -- net.minecraft.server.PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap; +- PlayerChunkMap playerChunkMap = ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().playerChunkMap; - java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); - - loc.getWorld().getChunkAtAsyncUrgently(loc).thenCompose(chunk -> { -- net.minecraft.server.ChunkCoordIntPair pair = new net.minecraft.server.ChunkCoordIntPair(chunk.getX(), chunk.getZ()); -- ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(net.minecraft.server.TicketType.POST_TELEPORT, pair, 31, 0); -- net.minecraft.server.PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair()); +- ChunkCoordIntPair pair = new ChunkCoordIntPair(chunk.getX(), chunk.getZ()); +- ((CraftWorld) loc.getWorld()).getHandle().getChunkProvider().addTicketAtLevel(TicketType.POST_TELEPORT, pair, 31, 0); +- PlayerChunk updatingChunk = playerChunkMap.getUpdatingChunk(pair.pair()); - if (updatingChunk != null) { - return updatingChunk.getEntityTickingFuture(); - } else { - return java.util.concurrent.CompletableFuture.completedFuture(com.mojang.datafixers.util.Either.left(((org.bukkit.craftbukkit.CraftChunk)chunk).getHandle())); -- } -- }).thenAccept((chunk) -> future.complete(teleport(loc, cause))).exceptionally(ex -> { -- future.completeExceptionally(ex); -- return null; -- }); -- return future; -- } -- // Paper end -+ // Tuinity - - @Override - public boolean teleport(Location location) { -@@ -563,6 +543,37 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - return true; - } - + // Tuinity start - implement teleportAsync better + @Override + public java.util.concurrent.CompletableFuture teleportAsync(Location location, TeleportCause cause) { @@ -50,14 +34,17 @@ index 2fc101869775711533a1e50f9ae608cd74d36d3a..2af3bee540ee25ea32a7548fd0d64dea + location.checkFinite(); + Location locationClone = location.clone(); // clone so we don't need to worry about mutations after this call. + -+ net.minecraft.server.WorldServer world = ((CraftWorld)locationClone.getWorld()).getHandle(); ++ net.minecraft.server.level.WorldServer world = ((CraftWorld)locationClone.getWorld()).getHandle(); + java.util.concurrent.CompletableFuture ret = new java.util.concurrent.CompletableFuture<>(); + + world.loadChunksForMoveAsync(getHandle().getBoundingBoxAt(locationClone.getX(), locationClone.getY(), locationClone.getZ()), location.getX(), location.getZ(), (list) -> { -+ net.minecraft.server.ChunkProviderServer chunkProviderServer = world.getChunkProvider(); -+ for (net.minecraft.server.IChunkAccess chunk : list) { -+ chunkProviderServer.addTicketAtLevel(net.minecraft.server.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId()); -+ } ++ net.minecraft.server.level.ChunkProviderServer chunkProviderServer = world.getChunkProvider(); ++ for (net.minecraft.world.level.chunk.IChunkAccess chunk : list) { ++ chunkProviderServer.addTicketAtLevel(net.minecraft.server.level.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId()); + } +- }).thenAccept((chunk) -> future.complete(teleport(loc, cause))).exceptionally(ex -> { +- future.completeExceptionally(ex); +- return null; + net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> { + try { + ret.complete(CraftEntity.this.teleport(locationClone, cause) ? Boolean.TRUE : Boolean.FALSE); @@ -68,12 +55,13 @@ index 2fc101869775711533a1e50f9ae608cd74d36d3a..2af3bee540ee25ea32a7548fd0d64dea + ret.completeExceptionally(throwable); + } + }); -+ }); + }); +- return future; + + return ret; -+ } + } +- // Paper end + // Tuinity end - implement teleportAsync better -+ + @Override - public boolean teleport(org.bukkit.entity.Entity destination) { - return teleport(destination.getLocation()); + public boolean teleport(Location location) { diff --git a/patches/Tuinity/patches/server/0031-Revert-getChunkAt-Async-retaining-chunks-for-long-pe.patch b/patches/Tuinity/patches/server/0031-Revert-getChunkAt-Async-retaining-chunks-for-long-pe.patch index 630aa81f..5638baaf 100644 --- a/patches/Tuinity/patches/server/0031-Revert-getChunkAt-Async-retaining-chunks-for-long-pe.patch +++ b/patches/Tuinity/patches/server/0031-Revert-getChunkAt-Async-retaining-chunks-for-long-pe.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Revert getChunkAt(Async) retaining chunks for long periods of diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 80944242cb0c16a7b2b1c6b193656e78c2e58dd5..eb90c0802e3ca344885ee14fd852e963a66f5f33 100644 +index 77057470addd6e6934bd6c32b0c36dea11bbb95d..5f83ad77edfa2f7ddd58334a592864185f88e435 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -423,14 +423,7 @@ public class CraftWorld implements World { @@ -14,7 +14,7 @@ index 80944242cb0c16a7b2b1c6b193656e78c2e58dd5..eb90c0802e3ca344885ee14fd852e963 @Override public Chunk getChunkAt(int x, int z) { - // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it -- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z); +- net.minecraft.world.level.chunk.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z); - if (chunk == null) { - addTicket(x, z); - chunk = this.world.getChunkProvider().getChunkAt(x, z, true); @@ -28,9 +28,9 @@ index 80944242cb0c16a7b2b1c6b193656e78c2e58dd5..eb90c0802e3ca344885ee14fd852e963 @@ -2590,7 +2583,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); + net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null); - if (chunk != null) addTicket(x, z); // Paper + if (false && chunk != null) addTicket(x, z); // Paper // Tuinity - revert return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk()); - }, MinecraftServer.getServer()); + }, net.minecraft.server.MinecraftServer.getServer()); } diff --git a/patches/Tuinity/patches/server/0032-Rework-PlayerChunk-main-thread-checks.patch b/patches/Tuinity/patches/server/0032-Rework-PlayerChunk-main-thread-checks.patch index 8245fc0f..9ec912ed 100644 --- a/patches/Tuinity/patches/server/0032-Rework-PlayerChunk-main-thread-checks.patch +++ b/patches/Tuinity/patches/server/0032-Rework-PlayerChunk-main-thread-checks.patch @@ -11,11 +11,11 @@ For example, thanks to this patch incorrect future completion (completion of the world gen future, PlayerChunkMap#b(PlayerChunk, ChunkStatus)) was detected and fixed. -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af17204389 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -564,6 +564,7 @@ public class PlayerChunk { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index f7deb4fe98ef9900acb276c7680d5a2da9661e8f..6b939d35e13fdc84fd3767e74eaf78c9d9b90c69 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -590,6 +590,7 @@ public class PlayerChunk { } protected void a(PlayerChunkMap playerchunkmap) { @@ -23,7 +23,7 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET; -@@ -573,7 +574,8 @@ public class PlayerChunk { +@@ -599,7 +600,8 @@ public class PlayerChunk { // CraftBukkit start // ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins. if (playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && !playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) { @@ -33,7 +33,7 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af Chunk chunk = (Chunk)either.left().orElse(null); if (chunk != null) { playerchunkmap.callbackExecutor.execute(() -> { -@@ -638,7 +640,8 @@ public class PlayerChunk { +@@ -664,7 +666,8 @@ public class PlayerChunk { if (!flag2 && flag3) { // Paper start - cache ticking ready status int expectCreateCount = ++this.fullChunkCreateCount; @@ -43,7 +43,7 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af if (either.left().isPresent() && PlayerChunk.this.fullChunkCreateCount == expectCreateCount) { // note: Here is a very good place to add callbacks to logic waiting on this. Chunk fullChunk = either.left().get(); -@@ -669,7 +672,8 @@ public class PlayerChunk { +@@ -695,7 +698,8 @@ public class PlayerChunk { if (!flag4 && flag5) { // Paper start - cache ticking ready status @@ -53,7 +53,7 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af if (either.left().isPresent()) { // note: Here is a very good place to add callbacks to logic waiting on this. Chunk tickingChunk = either.left().get(); -@@ -709,7 +713,8 @@ public class PlayerChunk { +@@ -735,7 +739,8 @@ public class PlayerChunk { } // Paper start - cache ticking ready status @@ -63,7 +63,7 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af if (either.left().isPresent()) { // note: Here is a very good place to add callbacks to logic waiting on this. Chunk entityTickingChunk = either.left().get(); -@@ -760,7 +765,8 @@ public class PlayerChunk { +@@ -786,7 +791,8 @@ public class PlayerChunk { // CraftBukkit start // ChunkLoadEvent: Called after the chunk is loaded: isChunkLoaded returns true and chunk is ready to be modified by plugins. if (!playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) { @@ -73,11 +73,11 @@ index b03865a932d341ae2fdad6c9447979fa9e95fc14..9a321c8a0a357ca1fd47d0c7fe4fe7af Chunk chunk = (Chunk)either.left().orElse(null); 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 1a25a8ebd88d49ac16b58abc6d366367671e1ee7..bd1abaa47109abaeafb728cbb9185804927ecbf2 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1301,7 +1301,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index db271a5a1f09f8c11ac2498f8975cf7b025dd5e3..d395a694335f2ffcdfae3abf3884f09fb69b59d7 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -1355,7 +1355,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end this.mailboxWorldGen.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); diff --git a/patches/Tuinity/patches/server/0033-Allow-Entities-to-be-removed-from-a-world-while-tick.patch b/patches/Tuinity/patches/server/0033-Allow-Entities-to-be-removed-from-a-world-while-tick.patch index 5699c687..4b8a5889 100644 --- a/patches/Tuinity/patches/server/0033-Allow-Entities-to-be-removed-from-a-world-while-tick.patch +++ b/patches/Tuinity/patches/server/0033-Allow-Entities-to-be-removed-from-a-world-while-tick.patch @@ -8,11 +8,11 @@ issues where teleporting players across worlds while ticking. Also allows us to run mid tick while ticking entities. -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf2150f422f2 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -61,7 +61,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index f696cc065c7058550a10705f0f827872be11c54d..e563589ac5622990dc6091f69fde79878d4c8d94 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -174,7 +174,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { public static final BlockPosition a = new BlockPosition(100, 50, 0); private static final Logger LOGGER = LogManager.getLogger(); @@ -21,7 +21,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 private final Map entitiesByUUID = Maps.newHashMap(); private final Queue entitiesToAdd = Queues.newArrayDeque(); public final List players = Lists.newArrayList(); // Paper - private -> public -@@ -85,7 +85,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -198,7 +198,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private final PortalTravelAgent portalTravelAgent; private final TickListServer nextTickListBlock; private final TickListServer nextTickListFluid; @@ -30,7 +30,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 protected final PersistentRaid persistentRaid; private final ObjectLinkedOpenHashSet L; private boolean ticking; -@@ -833,13 +833,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -946,13 +946,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { } this.tickingEntities = true; @@ -46,7 +46,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 Entity entity1 = entity.getVehicle(); /* CraftBukkit start - We prevent spawning in general, so this butchering is not needed -@@ -875,7 +874,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -988,7 +987,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { gameprofilerfiller.enter("remove"); if (entity.dead) { this.removeEntityFromChunk(entity); @@ -55,7 +55,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 this.unregisterEntity(entity); } -@@ -883,6 +882,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -996,6 +995,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } timings.entityTick.stopTiming(); // Spigot @@ -63,7 +63,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 this.tickingEntities = false; // Paper start for (java.lang.Runnable run : this.afterEntityTickingTasks) { -@@ -1664,7 +1664,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1777,7 +1777,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { Entity entity = (Entity) iterator.next(); if (!(entity instanceof EntityPlayer)) { @@ -72,7 +72,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!"))); } -@@ -1692,6 +1692,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1805,6 +1805,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { public void unregisterEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot @@ -80,7 +80,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 // Paper start - fix entity registration issues if (entity instanceof EntityComplexPart) { // Usually this is a no-op for complex parts, and ID's should be removed, but go ahead and remove it anyways -@@ -1758,12 +1759,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1871,12 +1872,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.getScoreboard().a(entity); // CraftBukkit start - SPIGOT-5278 if (entity instanceof EntityDrowned) { @@ -100,7 +100,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 } new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid entity.valid = false; // CraftBukkit -@@ -1779,7 +1784,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1892,7 +1897,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { return; } // Paper end @@ -109,7 +109,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 if (!entity.isQueuedForRegister) { // Paper this.entitiesToAdd.add(entity); entity.isQueuedForRegister = true; // Paper -@@ -1787,6 +1792,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1900,6 +1905,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } else { entity.isQueuedForRegister = false; // Paper this.entitiesById.put(entity.getId(), entity); @@ -117,7 +117,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 if (entity instanceof EntityEnderDragon) { EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eJ(); int i = aentitycomplexpart.length; -@@ -1795,6 +1801,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1908,6 +1914,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { EntityComplexPart entitycomplexpart = aentitycomplexpart[j]; this.entitiesById.put(entitycomplexpart.getId(), entitycomplexpart); @@ -125,7 +125,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 } } -@@ -1819,12 +1826,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1932,12 +1939,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { // this.getChunkProvider().addEntity(entity); // Paper - moved down below valid=true // CraftBukkit start - SPIGOT-5278 if (entity instanceof EntityDrowned) { @@ -145,7 +145,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 } entity.valid = true; // CraftBukkit this.getChunkProvider().addEntity(entity); // Paper - from above to be below valid=true -@@ -1840,7 +1851,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1953,7 +1964,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } public void removeEntity(Entity entity) { @@ -154,7 +154,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!"))); } else { this.removeEntityFromChunk(entity); -@@ -1944,7 +1955,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2057,7 +2068,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) { boolean wasTicking = this.tickingEntities; this.tickingEntities = true; // Paper @@ -165,7 +165,7 @@ index d1d54c9c8657cdebf320ea03547417876a7af092..3e46e49aebee3c47447419eb784fcf21 while (iterator.hasNext()) { // CraftBukkit start - fix SPIGOT-6362 -@@ -1964,6 +1977,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2077,6 +2090,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { navigationabstract.b(blockposition); } } diff --git a/patches/Tuinity/patches/server/0034-Prevent-unload-calls-removing-tickets-for-sync-loads.patch b/patches/Tuinity/patches/server/0034-Prevent-unload-calls-removing-tickets-for-sync-loads.patch index e8900d49..0ed3595e 100644 --- a/patches/Tuinity/patches/server/0034-Prevent-unload-calls-removing-tickets-for-sync-loads.patch +++ b/patches/Tuinity/patches/server/0034-Prevent-unload-calls-removing-tickets-for-sync-loads.patch @@ -4,11 +4,11 @@ Date: Thu, 18 Jun 2020 18:23:20 -0700 Subject: [PATCH] Prevent unload() calls removing tickets for sync loads -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 8c0aed61400a89799592d3d457c1d78f0217d066..99f618cc9fbde5bd96cd7e6a7601d0f65d2d842f 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -709,6 +709,8 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index b44b1b79a38ac2c15666e5b04e16f1bed67d3d89..a68803eaf773be992b5fb9facba7add84c5b41ad 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -734,6 +734,8 @@ public class ChunkProviderServer extends IChunkProvider { Arrays.fill(this.cacheChunk, (Object) null); } @@ -17,7 +17,7 @@ index 8c0aed61400a89799592d3d457c1d78f0217d066..99f618cc9fbde5bd96cd7e6a7601d0f6 private CompletableFuture> getChunkFutureMainThread(int i, int j, ChunkStatus chunkstatus, boolean flag) { // Paper start - add isUrgent - old sig left in place for dirty nms plugins return getChunkFutureMainThread(i, j, chunkstatus, flag, false); -@@ -727,9 +729,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -752,9 +754,12 @@ public class ChunkProviderServer extends IChunkProvider { PlayerChunk.State currentChunkState = PlayerChunk.getChunkState(playerchunk.getTicketLevel()); currentlyUnloading = (oldChunkState.isAtLeast(PlayerChunk.State.BORDER) && !currentChunkState.isAtLeast(PlayerChunk.State.BORDER)); } @@ -30,7 +30,7 @@ index 8c0aed61400a89799592d3d457c1d78f0217d066..99f618cc9fbde5bd96cd7e6a7601d0f6 if (isUrgent) this.chunkMapDistance.markUrgent(chunkcoordintpair); // Paper if (this.a(playerchunk, l)) { GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); -@@ -740,12 +745,20 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -765,12 +770,20 @@ public class ChunkProviderServer extends IChunkProvider { playerchunk = this.getChunk(k); gameprofilerfiller.exit(); if (this.a(playerchunk, l)) { @@ -52,11 +52,11 @@ index 8c0aed61400a89799592d3d457c1d78f0217d066..99f618cc9fbde5bd96cd7e6a7601d0f6 if (isUrgent) { future.thenAccept(either -> this.chunkMapDistance.clearUrgent(chunkcoordintpair)); } -diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java -index ab0417b3897911ba29602d696f4842bfb77cee16..25cff70b45aa2c92a9ffb2cd968ffef5bb1a6c2f 100644 ---- a/src/main/java/net/minecraft/server/TicketType.java -+++ b/src/main/java/net/minecraft/server/TicketType.java -@@ -27,6 +27,7 @@ public class TicketType { +diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java +index 47da7efffde2e6d63c1a064b950abf8135705622..1122df50a7f9cbc489e8da7a91e9af73476eb148 100644 +--- a/src/main/java/net/minecraft/server/level/TicketType.java ++++ b/src/main/java/net/minecraft/server/level/TicketType.java +@@ -31,6 +31,7 @@ public class TicketType { public static final TicketType PRIORITY = a("priority", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper public static final TicketType URGENT = a("urgent", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper public static final TicketType DELAYED_UNLOAD = a("delayed_unload", Long::compareTo); // Tuinity - delay chunk unloads diff --git a/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch index 5bd73248..4a87fbc3 100644 --- a/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/Tuinity/patches/server/0035-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Optimise collision checking in player move packet handling Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be9d2f0d56 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -438,12 +438,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index bcdd256c09135b72e6ed951992d9d3f26cb1633f..b7e72fe1cd04219391c75beb7d67a1e32e393a16 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -583,12 +583,14 @@ public class PlayerConnection implements PacketListenerPlayIn { return; } @@ -25,7 +25,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be double d11 = d7; d6 = d3 - entity.locX(); -@@ -457,16 +459,25 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -602,16 +604,25 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean flag1 = false; if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot @@ -55,7 +55,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be entity.setLocation(d0, d1, d2, f, f1); player.setLocation(d0, d1, d2, this.player.yaw, this.player.pitch); // CraftBukkit this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); -@@ -552,7 +563,32 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -697,7 +708,32 @@ public class PlayerConnection implements PacketListenerPlayIn { } private boolean a(Entity entity) { @@ -89,7 +89,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be } @Override -@@ -1074,7 +1110,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1219,7 +1255,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (this.teleportPos != null) { @@ -98,7 +98,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be this.A = this.e; this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); } -@@ -1161,7 +1197,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1306,7 +1342,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } } @@ -107,7 +107,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be d7 = d4 - this.o; d8 = d5 - this.p; -@@ -1200,6 +1236,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1345,6 +1381,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9)); @@ -115,7 +115,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move // Paper start - prevent position desync if (this.teleportPos != null) { -@@ -1219,12 +1256,23 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1364,12 +1401,23 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean flag1 = false; if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot @@ -141,7 +141,7 @@ index 8871e9dbbfe7e815012b914d930aeeed4c602d67..9146b60cff0aa06e2f6b6003bfe9e2be this.a(d0, d1, d2, f, f1); } else { // CraftBukkit start - fire PlayerMoveEvent -@@ -1311,6 +1359,26 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1456,6 +1504,26 @@ public class PlayerConnection implements PacketListenerPlayIn { } } diff --git a/patches/Tuinity/patches/server/0036-Manually-inline-methods-in-BlockPosition.patch b/patches/Tuinity/patches/server/0036-Manually-inline-methods-in-BlockPosition.patch index 9a48fb6c..522aee8a 100644 --- a/patches/Tuinity/patches/server/0036-Manually-inline-methods-in-BlockPosition.patch +++ b/patches/Tuinity/patches/server/0036-Manually-inline-methods-in-BlockPosition.patch @@ -4,11 +4,11 @@ Date: Mon, 6 Jul 2020 22:48:48 -0700 Subject: [PATCH] Manually inline methods in BlockPosition -diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 6b655b744d31d9660c7521ab596b27bcd92f4d58..e811295b4d6afcd920f60e0ce5440e43300d9085 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -16,9 +16,9 @@ public class BaseBlockPosition implements Comparable { +diff --git a/src/main/java/net/minecraft/core/BaseBlockPosition.java b/src/main/java/net/minecraft/core/BaseBlockPosition.java +index a44bcdb053877a6281e566ffe03ef72ffd50ca08..e72c852517f9fdc7b7a3a5bc5d3aa067815ff944 100644 +--- a/src/main/java/net/minecraft/core/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/core/BaseBlockPosition.java +@@ -18,9 +18,9 @@ public class BaseBlockPosition implements Comparable { return IntStream.of(new int[]{baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()}); }); public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0); @@ -21,7 +21,7 @@ index 6b655b744d31d9660c7521ab596b27bcd92f4d58..e811295b4d6afcd920f60e0ce5440e43 // Paper start public boolean isValidLocation() { -@@ -71,15 +71,15 @@ public class BaseBlockPosition implements Comparable { +@@ -73,15 +73,15 @@ public class BaseBlockPosition implements Comparable { return this.e; } @@ -40,11 +40,11 @@ index 6b655b744d31d9660c7521ab596b27bcd92f4d58..e811295b4d6afcd920f60e0ce5440e43 this.e = i; } -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd7e472672 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -449,10 +449,10 @@ public class BlockPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java +index eb67af795dd716d9f92ac32843accc1ec4efd647..8edc279e7a3fdfb7e10718f1deee34b7e3fb2f28 100644 +--- a/src/main/java/net/minecraft/core/BlockPosition.java ++++ b/src/main/java/net/minecraft/core/BlockPosition.java +@@ -455,10 +455,10 @@ public class BlockPosition extends BaseBlockPosition { } public final BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER @@ -59,7 +59,7 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd return this; } -@@ -462,12 +462,18 @@ public class BlockPosition extends BaseBlockPosition { +@@ -468,12 +468,18 @@ public class BlockPosition extends BaseBlockPosition { } public final BlockPosition.MutableBlockPosition setValues(final BaseBlockPosition baseblockposition) { return this.g(baseblockposition); } // Paper - OBFHELPER @@ -82,7 +82,7 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd } public BlockPosition.MutableBlockPosition a(EnumAxisCycle enumaxiscycle, int i, int j, int k) { -@@ -482,8 +488,11 @@ public class BlockPosition extends BaseBlockPosition { +@@ -488,8 +494,11 @@ public class BlockPosition extends BaseBlockPosition { return this.d(baseblockposition.getX() + i, baseblockposition.getY() + j, baseblockposition.getZ() + k); } @@ -96,7 +96,7 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd } public BlockPosition.MutableBlockPosition c(EnumDirection enumdirection, int i) { -@@ -511,21 +520,30 @@ public class BlockPosition extends BaseBlockPosition { +@@ -517,21 +526,30 @@ public class BlockPosition extends BaseBlockPosition { } } diff --git a/patches/Tuinity/patches/server/0037-Separate-lookup-locking-from-state-access-in-UserCac.patch b/patches/Tuinity/patches/server/0037-Separate-lookup-locking-from-state-access-in-UserCac.patch index 2ad3a800..a7704d4b 100644 --- a/patches/Tuinity/patches/server/0037-Separate-lookup-locking-from-state-access-in-UserCac.patch +++ b/patches/Tuinity/patches/server/0037-Separate-lookup-locking-from-state-access-in-UserCac.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Separate lookup locking from state access in UserCache Prevent lookups from stalling simple state access/write calls -diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7b825f332 100644 ---- a/src/main/java/net/minecraft/server/UserCache.java -+++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -49,6 +49,11 @@ public class UserCache { +diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java +index 74b024a51f6c3ee88db730cbf97a24af66fa332b..66eee0998be2210042db8e6b537fa10a016a9c8a 100644 +--- a/src/main/java/net/minecraft/server/players/UserCache.java ++++ b/src/main/java/net/minecraft/server/players/UserCache.java +@@ -51,6 +51,11 @@ public class UserCache { private final File g; private final AtomicLong h = new AtomicLong(); @@ -21,7 +21,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 public UserCache(GameProfileRepository gameprofilerepository, File file) { this.e = gameprofilerepository; this.g = file; -@@ -56,6 +61,7 @@ public class UserCache { +@@ -58,6 +63,7 @@ public class UserCache { } private void a(UserCache.UserCacheEntry usercache_usercacheentry) { @@ -29,7 +29,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 GameProfile gameprofile = usercache_usercacheentry.a(); usercache_usercacheentry.a(this.d()); -@@ -70,6 +76,7 @@ public class UserCache { +@@ -72,6 +78,7 @@ public class UserCache { if (uuid != null) { this.d.put(uuid, usercache_usercacheentry); } @@ -37,7 +37,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 } -@@ -107,7 +114,7 @@ public class UserCache { +@@ -109,7 +116,7 @@ public class UserCache { } public void saveProfile(GameProfile gameprofile) { a(gameprofile); } // Paper - OBFHELPER @@ -46,7 +46,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); -@@ -124,8 +131,9 @@ public class UserCache { +@@ -126,8 +133,9 @@ public class UserCache { } @Nullable @@ -57,7 +57,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1); boolean flag = false; -@@ -139,10 +147,14 @@ public class UserCache { +@@ -141,10 +149,14 @@ public class UserCache { GameProfile gameprofile; if (usercache_usercacheentry != null) { @@ -72,7 +72,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 if (gameprofile != null) { this.a(gameprofile); flag = false; -@@ -154,6 +166,7 @@ public class UserCache { +@@ -156,6 +168,7 @@ public class UserCache { } return gameprofile; @@ -80,7 +80,7 @@ index 8c3aa47a28914fd69a7f2e55a8c8f91d8e02371e..afc2ddf519cf4930663f1859b8ce89a7 } // Paper start -@@ -288,7 +301,9 @@ public class UserCache { +@@ -290,7 +303,9 @@ public class UserCache { } private Stream a(int i) { diff --git a/patches/Tuinity/patches/server/0038-Distance-manager-tick-timings.patch b/patches/Tuinity/patches/server/0038-Distance-manager-tick-timings.patch index 438d49ce..c7d24732 100644 --- a/patches/Tuinity/patches/server/0038-Distance-manager-tick-timings.patch +++ b/patches/Tuinity/patches/server/0038-Distance-manager-tick-timings.patch @@ -7,10 +7,10 @@ Recently this has been taking up more time, so add a timings to really figure out how much. diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 7991c66a8fe7ee9725ab75fb80d1363cd7348532..68ab5ccb2fcfe1de0503c9336572f28e11832b2d 100644 +index 9d64fffd10ce21a26541198b0c2fd8f0c77f47f1..67980e1dc186c0b458eca9f00acfea7d2b26d575 100644 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java -@@ -44,6 +44,7 @@ public final class MinecraftTimings { +@@ -47,6 +47,7 @@ public final class MinecraftTimings { public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate"); public static final Timing scoreboardScoreSearch = Timings.ofSafe("Scoreboard score search"); // Tuinity - add timings for scoreboard search @@ -18,11 +18,11 @@ index 7991c66a8fe7ee9725ab75fb80d1363cd7348532..68ab5ccb2fcfe1de0503c9336572f28e private static final Map, String> taskNameCache = new MapMaker().weakKeys().makeMap(); -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 99f618cc9fbde5bd96cd7e6a7601d0f65d2d842f..0e5e7a321dc7066444d92387968a7c41cb3a8470 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -815,6 +815,7 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index a68803eaf773be992b5fb9facba7add84c5b41ad..a6185a17606785f1b4893d7d32e0cf1f32d00f4f 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -840,6 +840,7 @@ public class ChunkProviderServer extends IChunkProvider { public boolean tickDistanceManager() { // Paper - private -> public if (chunkMapDistance.delayDistanceManagerTick) return false; // Paper @@ -30,7 +30,7 @@ index 99f618cc9fbde5bd96cd7e6a7601d0f65d2d842f..0e5e7a321dc7066444d92387968a7c41 boolean flag = this.chunkMapDistance.a(this.playerChunkMap); boolean flag1 = this.playerChunkMap.b(); -@@ -824,6 +825,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -849,6 +850,7 @@ public class ChunkProviderServer extends IChunkProvider { this.clearCache(); return true; } diff --git a/patches/Tuinity/patches/server/0040-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/Tuinity/patches/server/0040-Fix-swamp-hut-cat-generation-deadlock.patch index e7220370..e61dea5a 100644 --- a/patches/Tuinity/patches/server/0040-Fix-swamp-hut-cat-generation-deadlock.patch +++ b/patches/Tuinity/patches/server/0040-Fix-swamp-hut-cat-generation-deadlock.patch @@ -9,11 +9,11 @@ not cancelled - but if the chunk was unloaded, the call will block indefinitely. Instead of using the world state, we use the already supplied generatoraccess which will always have the chunk available. -diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 8bc8dcf7dfe79c5522bc715ad60aeaab4b1d85da..675083e3952779e43bf8cc3175ad70458a79e49c 100644 ---- a/src/main/java/net/minecraft/server/EntityCat.java -+++ b/src/main/java/net/minecraft/server/EntityCat.java -@@ -292,7 +292,7 @@ public class EntityCat extends EntityTameableAnimal { +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +index 054a1a74c48a3d936e45cc6b62a9fd6a90663cbc..c8f529b3fd227ce3354f442038b27cd716f57254 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityCat.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityCat.java +@@ -355,7 +355,7 @@ public class EntityCat extends EntityTameableAnimal { WorldServer worldserver = worldaccess.getMinecraftWorld(); @@ -22,11 +22,11 @@ index 8bc8dcf7dfe79c5522bc715ad60aeaab4b1d85da..675083e3952779e43bf8cc3175ad7045 this.setCatType(10); this.setPersistent(); } -diff --git a/src/main/java/net/minecraft/server/StructureManager.java b/src/main/java/net/minecraft/server/StructureManager.java -index f199368a6d78b0cd52f11ca2c8509d729b918852..2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea 100644 ---- a/src/main/java/net/minecraft/server/StructureManager.java -+++ b/src/main/java/net/minecraft/server/StructureManager.java -@@ -35,8 +35,13 @@ public class StructureManager { +diff --git a/src/main/java/net/minecraft/world/level/StructureManager.java b/src/main/java/net/minecraft/world/level/StructureManager.java +index 1077f988e16688f74c9e40d6da517c954cb06ecb..acacbf9617f99b97fc7fd2ba718775e1b3e429e9 100644 +--- a/src/main/java/net/minecraft/world/level/StructureManager.java ++++ b/src/main/java/net/minecraft/world/level/StructureManager.java +@@ -45,8 +45,13 @@ public class StructureManager { // Paper start - remove structure streams public java.util.List> getFeatureStarts(SectionPosition sectionPosition, StructureGenerator structureGenerator) { @@ -41,7 +41,7 @@ index f199368a6d78b0cd52f11ca2c8509d729b918852..2598ae3710d46c2cfd2be5d6be2a56e5 SectionPosition sectionPosition1 = SectionPosition.a(new ChunkCoordIntPair(curLong), 0); StructureStart structurestart = a(sectionPosition1, structureGenerator, getLevel().getChunkAt(sectionPosition1.a(), sectionPosition1.c(), ChunkStatus.STRUCTURE_STARTS)); if (structurestart != null && structurestart.e()) { -@@ -65,8 +70,12 @@ public class StructureManager { +@@ -75,8 +80,12 @@ public class StructureManager { } public StructureStart a(BlockPosition blockposition, boolean flag, StructureGenerator structuregenerator) { diff --git a/patches/Tuinity/patches/server/0041-Range-check-flag-dirty-calls-in-PlayerChunk.patch b/patches/Tuinity/patches/server/0041-Range-check-flag-dirty-calls-in-PlayerChunk.patch index bee9fd2d..19d0abba 100644 --- a/patches/Tuinity/patches/server/0041-Range-check-flag-dirty-calls-in-PlayerChunk.patch +++ b/patches/Tuinity/patches/server/0041-Range-check-flag-dirty-calls-in-PlayerChunk.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Range check flag dirty calls in PlayerChunk Simply return. -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 9a321c8a0a357ca1fd47d0c7fe4fe7af17204389..48976b1f07aeb0d588d0856f18b6fd07b2d18e05 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -366,7 +366,7 @@ public class PlayerChunk { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index 6b939d35e13fdc84fd3767e74eaf78c9d9b90c69..37c3617979da7839ad89883d9800c14c34e8b19b 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -392,7 +392,7 @@ public class PlayerChunk { if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks Chunk chunk = this.getSendingChunk(); // Paper - no-tick view distance @@ -18,7 +18,7 @@ index 9a321c8a0a357ca1fd47d0c7fe4fe7af17204389..48976b1f07aeb0d588d0856f18b6fd07 byte b0 = (byte) SectionPosition.a(blockposition.getY()); if (b0 < 0 || b0 >= this.dirtyBlocks.length) return; // CraftBukkit - SPIGOT-6086, SPIGOT-6296 -@@ -425,7 +425,7 @@ public class PlayerChunk { +@@ -451,7 +451,7 @@ public class PlayerChunk { this.a(world, blockposition, iblockdata); } else { ChunkSection chunksection = chunk.getSections()[sectionposition.getY()]; diff --git a/patches/Tuinity/patches/server/0043-Do-not-allow-ticket-level-changes-while-unloading-pl.patch b/patches/Tuinity/patches/server/0043-Do-not-allow-ticket-level-changes-while-unloading-pl.patch index 5d531f0a..a59853b3 100644 --- a/patches/Tuinity/patches/server/0043-Do-not-allow-ticket-level-changes-while-unloading-pl.patch +++ b/patches/Tuinity/patches/server/0043-Do-not-allow-ticket-level-changes-while-unloading-pl.patch @@ -7,11 +7,11 @@ Subject: [PATCH] Do not allow ticket level changes while unloading Sync loading the chunk at this stage would cause it to load older data, as well as screwing our region state. -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0e5e7a321dc7066444d92387968a7c41cb3a8470..ce0bb4d228a73d8353d67828529879e1c99682f9 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -815,6 +815,7 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index a6185a17606785f1b4893d7d32e0cf1f32d00f4f..a2917fd52d9cde535ca3e6422b6742711584bb09 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -840,6 +840,7 @@ public class ChunkProviderServer extends IChunkProvider { public boolean tickDistanceManager() { // Paper - private -> public if (chunkMapDistance.delayDistanceManagerTick) return false; // Paper @@ -19,11 +19,11 @@ index 0e5e7a321dc7066444d92387968a7c41cb3a8470..ce0bb4d228a73d8353d67828529879e1 co.aikar.timings.MinecraftTimings.distanceManagerTick.startTiming(); try { // Tuinity - add timings for distance manager boolean flag = this.chunkMapDistance.a(this.playerChunkMap); boolean flag1 = this.playerChunkMap.b(); -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index bd1abaa47109abaeafb728cbb9185804927ecbf2..8578cac6a19d9d1b5ac5f12fa369cc54a2436d4e 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -792,6 +792,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index d395a694335f2ffcdfae3abf3884f09fb69b59d7..3b727fcb05074dea7cc1689e8589d4f93d5ccceb 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -846,6 +846,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Nullable private PlayerChunk a(long i, int j, @Nullable PlayerChunk playerchunk, int k) { com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Chunk holder update"); // Tuinity @@ -31,7 +31,7 @@ index bd1abaa47109abaeafb728cbb9185804927ecbf2..8578cac6a19d9d1b5ac5f12fa369cc54 if (k > PlayerChunkMap.GOLDEN_TICKET && j > PlayerChunkMap.GOLDEN_TICKET) { return playerchunk; } else { -@@ -1053,6 +1054,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1107,6 +1108,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end @@ -40,7 +40,7 @@ index bd1abaa47109abaeafb728cbb9185804927ecbf2..8578cac6a19d9d1b5ac5f12fa369cc54 private void a(long i, PlayerChunk playerchunk) { CompletableFuture completablefuture = playerchunk.getChunkSave(); Consumer consumer = (ichunkaccess) -> { // CraftBukkit - decompile error -@@ -1061,6 +1064,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1115,6 +1118,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (completablefuture1 != completablefuture) { this.a(i, playerchunk); } else { @@ -53,7 +53,7 @@ index bd1abaa47109abaeafb728cbb9185804927ecbf2..8578cac6a19d9d1b5ac5f12fa369cc54 // Tuinity start boolean removed; if ((removed = this.pendingUnload.remove(i, playerchunk)) && ichunkaccess != null) { // Tuinity end -@@ -1098,6 +1107,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1152,6 +1161,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Tuinity end } // Tuinity end diff --git a/patches/Tuinity/patches/server/0044-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/Tuinity/patches/server/0044-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch index d49c1b86..3f918cc8 100644 --- a/patches/Tuinity/patches/server/0044-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch +++ b/patches/Tuinity/patches/server/0044-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch @@ -12,16 +12,16 @@ method was not inlined. Paper recently reverted this optimisation, so it's been reintroduced here. -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f40ddc91b6102ce67d5989037c9b9ec822fefa34..dccdbb1c218d9fd8acb81998bd5884dc4aba7c1c 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -289,6 +289,15 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 8d3dbf064df74434988b3c60fcb2b72bece37b7e..6b937f4300b445c5e0a9fd82db7e5dc01e8c6cfe 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -349,6 +349,15 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @Override public final Chunk getChunkAt(int i, int j) { // Paper - final to help inline + // Tuinity start - make sure loaded chunks get the inlined variant of this function -+ ChunkProviderServer cps = ((WorldServer)this).chunkProvider; ++ net.minecraft.server.level.ChunkProviderServer cps = ((WorldServer)this).chunkProvider; + if (cps.serverThread == Thread.currentThread()) { + Chunk ifLoaded = cps.getChunkAtIfLoadedMainThread(i, j); + if (ifLoaded != null) { diff --git a/patches/Tuinity/patches/server/0045-Add-packet-limiter-config.patch b/patches/Tuinity/patches/server/0045-Add-packet-limiter-config.patch index 9fcce973..2deb6bbb 100644 --- a/patches/Tuinity/patches/server/0045-Add-packet-limiter-config.patch +++ b/patches/Tuinity/patches/server/0045-Add-packet-limiter-config.patch @@ -24,7 +24,7 @@ and an action can be defined: DROP or KICK If interval or rate are less-than 0, the limit is ignored diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index a302cda14aa2dd6550cca03b07be21cdcb993061..03a59aabc2a35daf7eee899967b569a8ac3b632e 100644 +index 6473b951788a3ecbeee4811ea0288ff47b48355f..373b36fa36f98f64bb9ffa0dfaecefa3626729f4 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -1,6 +1,7 @@ @@ -32,10 +32,10 @@ index a302cda14aa2dd6550cca03b07be21cdcb993061..03a59aabc2a35daf7eee899967b569a8 import com.destroystokyo.paper.util.SneakyThrow; +import net.minecraft.server.MinecraftServer; - import net.minecraft.server.TicketType; + import net.minecraft.server.level.TicketType; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; -@@ -139,6 +140,89 @@ public final class TuinityConfig { +@@ -139,6 +140,98 @@ public final class TuinityConfig { lagCompensateBlockBreaking = TuinityConfig.getBoolean("lag-compensate-block-breaking", true); } @@ -57,7 +57,7 @@ index a302cda14aa2dd6550cca03b07be21cdcb993061..03a59aabc2a35daf7eee899967b569a8 + + public static String kickMessage; + public static PacketLimit allPacketsLimit; -+ public static java.util.Map>, PacketLimit> packetSpecificLimits = new java.util.HashMap<>(); ++ public static java.util.Map>, PacketLimit> packetSpecificLimits = new java.util.HashMap<>(); + + private static void packetLimiter() { + packetSpecificLimits.clear(); @@ -76,26 +76,35 @@ index a302cda14aa2dd6550cca03b07be21cdcb993061..03a59aabc2a35daf7eee899967b569a8 + + // auto recipe limiting + TuinityConfig.getDouble("packet-limiter.limits." + -+ net.minecraft.server.PacketPlayInAutoRecipe.class.getSimpleName() + ".interval", 4.0); ++ net.minecraft.network.protocol.game.PacketPlayInAutoRecipe.class.getSimpleName() + ".interval", 4.0); + TuinityConfig.getDouble("packet-limiter.limits." + -+ net.minecraft.server.PacketPlayInAutoRecipe.class.getSimpleName() + ".max-packet-rate", 5.0); ++ net.minecraft.network.protocol.game.PacketPlayInAutoRecipe.class.getSimpleName() + ".max-packet-rate", 5.0); + TuinityConfig.getString("packet-limiter.limits." + -+ net.minecraft.server.PacketPlayInAutoRecipe.class.getSimpleName() + ".action", PacketLimit.ViolateAction.DROP.name()); ++ net.minecraft.network.protocol.game.PacketPlayInAutoRecipe.class.getSimpleName() + ".action", PacketLimit.ViolateAction.DROP.name()); + ++ final String canonicalName = MinecraftServer.class.getCanonicalName(); ++ final String nmsPackage = canonicalName.substring(0, canonicalName.lastIndexOf(".")); + for (final String packetClassName : section.getKeys(false)) { + if (packetClassName.equals("all")) { + continue; + } -+ final Class packetClazz; ++ Class packetClazz = null; + + try { -+ packetClazz = Class.forName("net.minecraft.server." + packetClassName); ++ packetClazz = Class.forName(nmsPackage + "." + packetClassName); + } catch (final ClassNotFoundException ex) { -+ MinecraftServer.LOGGER.warn("Packet '" + packetClassName + "' does not exist, cannot limit it! Please update tuinity.yml"); -+ continue; ++ for (final String subpackage : java.util.Arrays.asList("game", "handshake", "login", "status")) { ++ try { ++ packetClazz = Class.forName("net.minecraft.network.protocol." + subpackage + "." + packetClassName); ++ } catch (final ClassNotFoundException ignore) {} ++ } ++ if (packetClazz == null) { ++ MinecraftServer.LOGGER.warn("Packet '" + packetClassName + "' does not exist, cannot limit it! Please update tuinity.yml"); ++ continue; ++ } + } + -+ if (!net.minecraft.server.Packet.class.isAssignableFrom(packetClazz)) { ++ if (!net.minecraft.network.protocol.Packet.class.isAssignableFrom(packetClazz)) { + MinecraftServer.LOGGER.warn("Packet '" + packetClassName + "' does not exist, cannot limit it! Please update tuinity.yml"); + continue; + } @@ -125,12 +134,12 @@ index a302cda14aa2dd6550cca03b07be21cdcb993061..03a59aabc2a35daf7eee899967b569a8 public static final class WorldConfig { public final String worldName; -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index a7530cfe7055017e8a98ee5422b48437c2dd18d1..f9aa04f2980aa5e952d64ae8c9f3629f7e76e2a0 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -178,8 +178,63 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - if (MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index a9637772ead360ee476d59104b50a505e6d0ef4c..2abf64fda6e504a89b2e443af48894023d446cef 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -196,8 +196,64 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + if (net.minecraft.server.MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot } + // Tuinity start - packet limiter @@ -138,7 +147,7 @@ index a7530cfe7055017e8a98ee5422b48437c2dd18d1..f9aa04f2980aa5e952d64ae8c9f3629f + protected final com.tuinity.tuinity.util.IntervalledCounter allPacketCounts = com.tuinity.tuinity.config.TuinityConfig.allPacketsLimit != null ? new com.tuinity.tuinity.util.IntervalledCounter( + (long)(com.tuinity.tuinity.config.TuinityConfig.allPacketsLimit.packetLimitInterval * 1.0e9) + ) : null; -+ protected final java.util.Map>, com.tuinity.tuinity.util.IntervalledCounter> packetSpecificLimits = new java.util.HashMap<>(); ++ protected final java.util.Map>, com.tuinity.tuinity.util.IntervalledCounter> packetSpecificLimits = new java.util.HashMap<>(); + + private boolean stopReadingPackets; + private void killForPacketSpam() { @@ -149,6 +158,7 @@ index a7530cfe7055017e8a98ee5422b48437c2dd18d1..f9aa04f2980aa5e952d64ae8c9f3629f + this.stopReadingPackets = true; + } + // Tuinity end - packet limiter ++ protected void channelRead0(ChannelHandlerContext channelhandlercontext, Packet packet) throws Exception { if (this.channel.isOpen()) { + // Tuinity start - packet limiter diff --git a/patches/Tuinity/patches/server/0046-Optimise-closest-entity-lookup.patch b/patches/Tuinity/patches/server/0046-Optimise-closest-entity-lookup.patch index ca38c4a4..18622d12 100644 --- a/patches/Tuinity/patches/server/0046-Optimise-closest-entity-lookup.patch +++ b/patches/Tuinity/patches/server/0046-Optimise-closest-entity-lookup.patch @@ -15,15 +15,15 @@ designed to be MT-Safe for reads off of other threads. diff --git a/src/main/java/com/tuinity/tuinity/util/CachedLists.java b/src/main/java/com/tuinity/tuinity/util/CachedLists.java -index 387eeb5d770ba9fe564c61df8cc92ac8b1569f61..21e50c75e0bffaa5cc5faf6aa81ae7428caca731 100644 +index 866f6e701c6a10a3ac1e58d12bba966c478d2e77..e0a2f10f92430fd59519e57dee3286035c287bf3 100644 --- a/src/main/java/com/tuinity/tuinity/util/CachedLists.java +++ b/src/main/java/com/tuinity/tuinity/util/CachedLists.java @@ -1,6 +1,7 @@ package com.tuinity.tuinity.util; - import net.minecraft.server.AxisAlignedBB; -+import net.minecraft.server.Chunk; - import net.minecraft.server.Entity; + import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.world.level.chunk.Chunk; + import net.minecraft.world.entity.Entity; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.util.UnsafeList; @@ -46,8 +47,28 @@ public class CachedLists { @@ -57,7 +57,7 @@ index 387eeb5d770ba9fe564c61df8cc92ac8b1569f61..21e50c75e0bffaa5cc5faf6aa81ae742 } diff --git a/src/main/java/com/tuinity/tuinity/world/ChunkEntitySlices.java b/src/main/java/com/tuinity/tuinity/world/ChunkEntitySlices.java new file mode 100644 -index 0000000000000000000000000000000000000000..7aca38ebeb21af1a952e72c7f3906ff4970aca0e +index 0000000000000000000000000000000000000000..57359791192a90b025e5fea38f3ce37e524aed82 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/world/ChunkEntitySlices.java @@ -0,0 +1,399 @@ @@ -65,13 +65,13 @@ index 0000000000000000000000000000000000000000..7aca38ebeb21af1a952e72c7f3906ff4 + +import it.unimi.dsi.fastutil.objects.Reference2ObjectMap; +import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap; -+import net.minecraft.server.AxisAlignedBB; -+import net.minecraft.server.Entity; -+import net.minecraft.server.EntityComplexPart; -+import net.minecraft.server.EntityEnderDragon; -+import net.minecraft.server.EntityTypes; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.World; ++import net.minecraft.world.entity.boss.EntityComplexPart; ++import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon; ++import net.minecraft.world.phys.AxisAlignedBB; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.util.MathHelper; ++import net.minecraft.world.level.World; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; @@ -462,7 +462,7 @@ index 0000000000000000000000000000000000000000..7aca38ebeb21af1a952e72c7f3906ff4 +} diff --git a/src/main/java/com/tuinity/tuinity/world/EntitySliceManager.java b/src/main/java/com/tuinity/tuinity/world/EntitySliceManager.java new file mode 100644 -index 0000000000000000000000000000000000000000..000ab23a48186d6b910c62e6922af3b85c198fca +index 0000000000000000000000000000000000000000..3ec78275494f0f0b7ad3c53467ec6c6395cb257d --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/world/EntitySliceManager.java @@ -0,0 +1,115 @@ @@ -470,7 +470,7 @@ index 0000000000000000000000000000000000000000..000ab23a48186d6b910c62e6922af3b8 + +import com.tuinity.tuinity.util.CoordinateUtils; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -+import net.minecraft.server.WorldServer; ++import net.minecraft.server.level.WorldServer; +import java.util.concurrent.locks.StampedLock; + +public final class EntitySliceManager { @@ -581,11 +581,171 @@ index 0000000000000000000000000000000000000000..000ab23a48186d6b910c62e6922af3b8 + } + } +} -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada365970577a 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -92,54 +92,24 @@ public class Chunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +index e6988f7ea428f1503e3db63876b13e57f898ee30..88972dd8252bd2d2d8e384d616484ff682949fa8 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition.java +@@ -55,6 +55,7 @@ public class PathfinderTargetCondition { + return this; + } + ++ public final boolean test(@Nullable EntityLiving entityliving, EntityLiving entityliving1) { return this.a(entityliving, entityliving1); } // Tuinity - OBFHELPER + public boolean a(@Nullable EntityLiving entityliving, EntityLiving entityliving1) { + if (entityliving == entityliving1) { + return false; +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index 69cc7664089c505eb5cfdc437f16b91e9713eada..7c9ed41ae67bce0e5e45b9c091180ca3c99668fc 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -223,12 +223,12 @@ public interface IEntityAccess { + } + + @Nullable +- default T a(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { ++ default T a(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get closest entity by class that matches path finder target condition" + return this.a(this.a(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix + } + + @Nullable +- default T b(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { ++ default T b(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get closest entity by class that matches path finder target condition" + return this.a(this.b(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix + } + +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 6b937f4300b445c5e0a9fd82db7e5dc01e8c6cfe..9118616e00220715339e31798e29a1871fafbea5 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1246,7 +1246,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper + + if (chunk != null) { +- chunk.a(oclass, axisalignedbb, list, predicate); ++ chunk.getEntitiesClass(oclass, null, axisalignedbb, (Predicate)predicate, (List)list); // Tuinity - optimise lookup by entity class + } + } + } +@@ -1269,7 +1269,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper + + if (chunk != null) { +- chunk.a(oclass, axisalignedbb, list, predicate); ++ chunk.getEntitiesClass(oclass, null, axisalignedbb, (Predicate)predicate, (List)list); // Tuinity - optimise lookup by entity class + } + } + } +@@ -1277,6 +1277,106 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return list; + } + ++ // Tuinity start ++ @Override ++ public T b(Class oclass, net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition pathfindertargetcondition, @Nullable net.minecraft.world.entity.EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { ++ return this.getClosestEntity(oclass, pathfindertargetcondition, entityliving, d0, d1, d2, axisalignedbb); ++ } ++ ++ @Override ++ public T a(Class oclass, net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition pathfindertargetcondition, @Nullable net.minecraft.world.entity.EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { ++ return this.getClosestEntity(oclass, pathfindertargetcondition, entityliving, d0, d1, d2, axisalignedbb); ++ } ++ ++ public final T getClosestEntity(Class clazz, ++ net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition condition, ++ @Nullable net.minecraft.world.entity.EntityLiving source, ++ double x, double y, double z, ++ AxisAlignedBB boundingBox) { ++ org.bukkit.craftbukkit.util.UnsafeList entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); ++ try { ++ int lowerX = MCUtil.fastFloor((boundingBox.minX - 2.0D)) >> 4; ++ int upperX = MCUtil.fastFloor((boundingBox.maxX + 2.0D)) >> 4; ++ int lowerZ = MCUtil.fastFloor((boundingBox.minZ - 2.0D)) >> 4; ++ int upperZ = MCUtil.fastFloor((boundingBox.maxZ + 2.0D)) >> 4; ++ ++ org.bukkit.craftbukkit.util.UnsafeList chunks = com.tuinity.tuinity.util.CachedLists.getTempGetChunksList(); ++ try { ++ T closest = null; ++ double closestDistance = Double.MAX_VALUE; ++ net.minecraft.server.level.ChunkProviderServer chunkProvider = ((WorldServer)this).getChunkProvider(); ++ ++ int centerX = (lowerX + upperX) >> 1; ++ int centerZ = (lowerZ + upperZ) >> 1; ++ // Copied from MCUtil.getSpiralOutChunks ++ Chunk temp; ++ if ((temp = chunkProvider.getChunkAtIfLoadedImmediately(centerX, centerZ)) != null && temp.hasEntitiesMaybe(clazz)) { ++ chunks.add(temp); ++ } ++ int radius = Math.max((upperX - lowerX + 1) >> 1, (upperZ - lowerZ + 1) >> 1); ++ for (int r = 1; r <= radius; r++) { ++ int ox = -r; ++ int oz = r; ++ ++ // Iterates the edge of half of the box; then negates for other half. ++ while (ox <= r && oz > -r) { ++ { ++ int cx = centerX + ox; ++ int cz = centerZ + oz; ++ if (cx >= lowerX && cx <= upperX && cz >= lowerZ && cz <= upperZ && ++ (temp = chunkProvider.getChunkAtIfLoadedImmediately(cx, cz)) != null && ++ temp.hasEntitiesMaybe(clazz)) { ++ chunks.add(temp); ++ } ++ } ++ { ++ int cx = centerX - ox; ++ int cz = centerZ - oz; ++ if (cx >= lowerX && cx <= upperX && cz >= lowerZ && cz <= upperZ && ++ (temp = chunkProvider.getChunkAtIfLoadedImmediately(cx, cz)) != null && ++ temp.hasEntitiesMaybe(clazz)) { ++ chunks.add(temp); ++ } ++ } ++ ++ if (ox < r) { ++ ox++; ++ } else { ++ oz--; ++ } ++ } ++ } ++ ++ Object[] chunkData = chunks.getRawDataArray(); ++ for (int cindex = 0, clen = chunks.size(); cindex < clen; ++cindex) { ++ final Chunk chunk = (Chunk)chunkData[cindex]; ++ ++ chunk.getEntitiesClass(clazz, source, boundingBox, null, entities); ++ ++ Object[] entityData = entities.getRawDataArray(); ++ for (int eindex = 0, entities_len = entities.size(); eindex < entities_len; ++eindex) { ++ T entity = (T)entityData[eindex]; ++ double distance = entity.getDistanceSquared(x, y, z); ++ // check distance first, as it's the least expensive ++ if (distance < closestDistance && condition.test(source, entity)) { ++ closest = entity; ++ closestDistance = distance; ++ } ++ } ++ ++ entities.setSize(0); ++ } ++ ++ return closest; ++ } finally { ++ com.tuinity.tuinity.util.CachedLists.returnTempGetChunksList(chunks); ++ } ++ } finally { ++ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); ++ } ++ } ++ // Tuinity end ++ + @Nullable + public abstract Entity getEntity(int i); + +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index 9293cb1dd27bb3b797e29f6edddf22ba80ff4134..d2f2efa21f8aec3515ae0c4491956916c9ed9500 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -138,54 +138,24 @@ public class Chunk implements IChunkAccess { // Paper end // Tuinity start - optimise hard collision handling @@ -652,7 +812,7 @@ index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada36 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]; -@@ -184,6 +154,7 @@ public class Chunk implements IChunkAccess { +@@ -230,6 +200,7 @@ public class Chunk implements IChunkAccess { // CraftBukkit start this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this); @@ -660,7 +820,7 @@ index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada36 } public org.bukkit.Chunk bukkitChunk; -@@ -644,8 +615,9 @@ public class Chunk implements IChunkAccess { +@@ -690,8 +661,9 @@ public class Chunk implements IChunkAccess { entity.chunkX = this.loc.x; entity.chunkY = k; entity.chunkZ = this.loc.z; @@ -672,7 +832,7 @@ index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada36 // Paper start if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -683,7 +655,8 @@ public class Chunk implements IChunkAccess { +@@ -729,7 +701,8 @@ public class Chunk implements IChunkAccess { entity.entitySlice = null; entity.inChunk = false; } @@ -682,7 +842,7 @@ index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada36 return; } if (entity instanceof EntityItem) { -@@ -926,116 +899,18 @@ public class Chunk implements IChunkAccess { +@@ -972,116 +945,18 @@ public class Chunk implements IChunkAccess { } public void a(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List list, @Nullable Predicate predicate) { @@ -803,166 +963,6 @@ index dface62144bb230c576e9eafad1016d19d211118..3f6dbba68fe7331c97c4e0fe3c8ada36 } -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index c17cbadeff9cb3ea955b9db99ab71d6d7fd8c247..93f2ac996904ddefed04704e554209d047faa59f 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -214,12 +214,12 @@ public interface IEntityAccess { - } - - @Nullable -- default T a(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { -+ default T a(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get closest entity by class that matches path finder target condition" - return this.a(this.a(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix - } - - @Nullable -- default T b(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { -+ default T b(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get closest entity by class that matches path finder target condition" - return this.a(this.b(oclass, axisalignedbb, null), pathfindertargetcondition, entityliving, d0, d1, d2); // Paper - decompile fix - } - -diff --git a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -index 253377c6238594de1f76cafcbf8223592e4d3f6b..3ebe3d0dc4c2c6aee6ea349006a74cbe5aa8e78f 100644 ---- a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -+++ b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -@@ -51,6 +51,7 @@ public class PathfinderTargetCondition { - return this; - } - -+ public final boolean test(@Nullable EntityLiving entityliving, EntityLiving entityliving1) { return this.a(entityliving, entityliving1); } // Tuinity - OBFHELPER - public boolean a(@Nullable EntityLiving entityliving, EntityLiving entityliving1) { - if (entityliving == entityliving1) { - return false; -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index dccdbb1c218d9fd8acb81998bd5884dc4aba7c1c..1d87e7461d28d8a639fafcfdfa5496014e9180f6 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1186,7 +1186,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper - - if (chunk != null) { -- chunk.a(oclass, axisalignedbb, list, predicate); -+ chunk.getEntitiesClass(oclass, null, axisalignedbb, (Predicate)predicate, (List)list); // Tuinity - optimise lookup by entity class - } - } - } -@@ -1209,7 +1209,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - Chunk chunk = (Chunk)this.getChunkIfLoadedImmediately(i1, j1); // Paper - - if (chunk != null) { -- chunk.a(oclass, axisalignedbb, list, predicate); -+ chunk.getEntitiesClass(oclass, null, axisalignedbb, (Predicate)predicate, (List)list); // Tuinity - optimise lookup by entity class - } - } - } -@@ -1217,6 +1217,106 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return list; - } - -+ // Tuinity start -+ @Override -+ public T b(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { -+ return this.getClosestEntity(oclass, pathfindertargetcondition, entityliving, d0, d1, d2, axisalignedbb); -+ } -+ -+ @Override -+ public T a(Class oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { -+ return this.getClosestEntity(oclass, pathfindertargetcondition, entityliving, d0, d1, d2, axisalignedbb); -+ } -+ -+ public final T getClosestEntity(Class clazz, -+ PathfinderTargetCondition condition, -+ @Nullable EntityLiving source, -+ double x, double y, double z, -+ AxisAlignedBB boundingBox) { -+ org.bukkit.craftbukkit.util.UnsafeList entities = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); -+ try { -+ int lowerX = MCUtil.fastFloor((boundingBox.minX - 2.0D)) >> 4; -+ int upperX = MCUtil.fastFloor((boundingBox.maxX + 2.0D)) >> 4; -+ int lowerZ = MCUtil.fastFloor((boundingBox.minZ - 2.0D)) >> 4; -+ int upperZ = MCUtil.fastFloor((boundingBox.maxZ + 2.0D)) >> 4; -+ -+ org.bukkit.craftbukkit.util.UnsafeList chunks = com.tuinity.tuinity.util.CachedLists.getTempGetChunksList(); -+ try { -+ T closest = null; -+ double closestDistance = Double.MAX_VALUE; -+ ChunkProviderServer chunkProvider = ((WorldServer)this).getChunkProvider(); -+ -+ int centerX = (lowerX + upperX) >> 1; -+ int centerZ = (lowerZ + upperZ) >> 1; -+ // Copied from MCUtil.getSpiralOutChunks -+ Chunk temp; -+ if ((temp = chunkProvider.getChunkAtIfLoadedImmediately(centerX, centerZ)) != null && temp.hasEntitiesMaybe(clazz)) { -+ chunks.add(temp); -+ } -+ int radius = Math.max((upperX - lowerX + 1) >> 1, (upperZ - lowerZ + 1) >> 1); -+ for (int r = 1; r <= radius; r++) { -+ int ox = -r; -+ int oz = r; -+ -+ // Iterates the edge of half of the box; then negates for other half. -+ while (ox <= r && oz > -r) { -+ { -+ int cx = centerX + ox; -+ int cz = centerZ + oz; -+ if (cx >= lowerX && cx <= upperX && cz >= lowerZ && cz <= upperZ && -+ (temp = chunkProvider.getChunkAtIfLoadedImmediately(cx, cz)) != null && -+ temp.hasEntitiesMaybe(clazz)) { -+ chunks.add(temp); -+ } -+ } -+ { -+ int cx = centerX - ox; -+ int cz = centerZ - oz; -+ if (cx >= lowerX && cx <= upperX && cz >= lowerZ && cz <= upperZ && -+ (temp = chunkProvider.getChunkAtIfLoadedImmediately(cx, cz)) != null && -+ temp.hasEntitiesMaybe(clazz)) { -+ chunks.add(temp); -+ } -+ } -+ -+ if (ox < r) { -+ ox++; -+ } else { -+ oz--; -+ } -+ } -+ } -+ -+ Object[] chunkData = chunks.getRawDataArray(); -+ for (int cindex = 0, clen = chunks.size(); cindex < clen; ++cindex) { -+ final Chunk chunk = (Chunk)chunkData[cindex]; -+ -+ chunk.getEntitiesClass(clazz, source, boundingBox, null, entities); -+ -+ Object[] entityData = entities.getRawDataArray(); -+ for (int eindex = 0, entities_len = entities.size(); eindex < entities_len; ++eindex) { -+ T entity = (T)entityData[eindex]; -+ double distance = entity.getDistanceSquared(x, y, z); -+ // check distance first, as it's the least expensive -+ if (distance < closestDistance && condition.test(source, entity)) { -+ closest = entity; -+ closestDistance = distance; -+ } -+ } -+ -+ entities.setSize(0); -+ } -+ -+ return closest; -+ } finally { -+ com.tuinity.tuinity.util.CachedLists.returnTempGetChunksList(chunks); -+ } -+ } finally { -+ com.tuinity.tuinity.util.CachedLists.returnTempGetEntitiesList(entities); -+ } -+ } -+ // Tuinity end -+ - @Nullable - public abstract Entity getEntity(int i); - diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java index 50f855b931dba60754fff9c7cdf5e0e744f00fdd..7c0d90552eeb6de7dab174e2ba4acfc89a7b3db0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java diff --git a/patches/Tuinity/patches/server/0047-Optimise-nearby-player-lookups.patch b/patches/Tuinity/patches/server/0047-Optimise-nearby-player-lookups.patch index 99aa777c..35695202 100644 --- a/patches/Tuinity/patches/server/0047-Optimise-nearby-player-lookups.patch +++ b/patches/Tuinity/patches/server/0047-Optimise-nearby-player-lookups.patch @@ -8,11 +8,380 @@ Note that it's important that we cache the distance map value per chunk since the penalty of a map lookup could outweigh the benefits of searching less players (as it basically did in the outside range patch). -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 3f6dbba68fe7331c97c4e0fe3c8ada365970577a..936c392c9faa178b5645ea79b0130e0d3e3e1368 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -111,6 +111,92 @@ public class Chunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index 37c3617979da7839ad89883d9800c14c34e8b19b..e3dc57282a559f783c027780740e8089e022c838 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -82,6 +82,12 @@ public class PlayerChunk { + long key = net.minecraft.server.MCUtil.getCoordinateKey(this.location); + this.playersInMobSpawnRange = this.chunkMap.playerMobSpawnMap.getObjectsInRange(key); + this.playersInChunkTickRange = this.chunkMap.playerChunkTickRangeMap.getObjectsInRange(key); ++ // Tuinity start - optimise checkDespawn ++ Chunk chunk = this.getFullChunkIfCached(); ++ if (chunk != null) { ++ chunk.updateGeneralAreaCache(); ++ } ++ // Tuinity end - optimise checkDespawn + } + // Paper end - optimise isOutsideOfRange + // Paper start - optimize chunk status progression without jumping through thread pool +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 3b727fcb05074dea7cc1689e8589d4f93d5ccceb..7897fe870234ddef12926d855a3f060f9a72b2ba 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -250,6 +250,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerViewDistanceTickMap; + public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerViewDistanceNoTickMap; + // Paper end - no-tick view distance ++ // Tuinity start - optimise checkDespawn ++ public static final int GENERAL_AREA_MAP_SQUARE_RADIUS = 38; ++ public static final double GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE = 16.0 * (GENERAL_AREA_MAP_SQUARE_RADIUS - 1); ++ public static final double GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE_SQUARED = GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE * GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE; ++ public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerGeneralAreaMap; ++ // Tuinity end - optimise checkDespawn + + void addPlayerToDistanceMaps(EntityPlayer player) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update distance maps off of the main thread"); // Tuinity +@@ -280,6 +286,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.playerViewDistanceBroadcastMap.add(player, chunkX, chunkZ, effectiveNoTickViewDistance + 1); // clients need an extra neighbour to render the full view distance configured + player.needsChunkCenterUpdate = false; + // Paper end - no-tick view distance ++ // Tuinity start - optimise checkDespawn ++ this.playerGeneralAreaMap.add(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); ++ // Tuinity end - optimise checkDespawn + } + + void removePlayerFromDistanceMaps(EntityPlayer player) { +@@ -298,6 +307,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.playerViewDistanceTickMap.remove(player); + this.playerViewDistanceNoTickMap.remove(player); + // Paper end - no-tick view distance ++ // Tuinity start - optimise checkDespawn ++ this.playerGeneralAreaMap.remove(player); ++ // Tuinity end - optimise checkDespawn + } + + void updateMaps(EntityPlayer player) { +@@ -329,6 +341,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.playerViewDistanceBroadcastMap.update(player, chunkX, chunkZ, effectiveNoTickViewDistance + 1); // clients need an extra neighbour to render the full view distance configured + player.needsChunkCenterUpdate = false; + // Paper end - no-tick view distance ++ // Tuinity start - optimise checkDespawn ++ this.playerGeneralAreaMap.update(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); ++ // Tuinity end - optimise checkDespawn + } + // Paper end + +@@ -533,6 +548,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.dataRegionManager = new com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager(this.world, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); + this.regionManagers.add(this.dataRegionManager); + // Tuinity end ++ // Tuinity start - optimise checkDespawn ++ this.playerGeneralAreaMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, ++ (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, ++ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { ++ Chunk chunk = PlayerChunkMap.this.world.getChunkProvider().getChunkAtIfCachedImmediately(rangeX, rangeZ); ++ if (chunk != null) { ++ chunk.updateGeneralAreaCache(newState); ++ } ++ }, ++ (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, ++ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { ++ Chunk chunk = PlayerChunkMap.this.world.getChunkProvider().getChunkAtIfCachedImmediately(rangeX, rangeZ); ++ if (chunk != null) { ++ chunk.updateGeneralAreaCache(newState); ++ } ++ }); ++ // Tuinity end - optimise checkDespawn + } + // Paper start - Chunk Prioritization + public void queueHolderUpdate(PlayerChunk playerchunk) { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index e563589ac5622990dc6091f69fde79878d4c8d94..a7f399994fac91a02e608ab0cae99c82a91e4ab4 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -414,6 +414,107 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public long lastMidTickExecuteFailure; + // Tuinity end - execute chunk tasks mid tick + ++ // Tuinity start - optimise checkDespawn ++ public final List playersAffectingSpawning = new java.util.ArrayList<>(); ++ // Tuinity end - optimise checkDespawn ++ // Tuinity start - optimise get nearest players for entity AI ++ public final EntityPlayer getNearestPlayer(net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition condition, @Nullable EntityLiving source, ++ double centerX, double centerY, double centerZ) { ++ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet nearby; ++ if (source != null) { ++ Chunk chunk = source.getCurrentChunk(); ++ if (chunk != null && (MathHelper.floor(centerX) >> 4) == chunk.locX && ++ (MathHelper.floor(centerZ) >> 4) == chunk.locZ) { ++ nearby = chunk.getPlayerGeneralAreaCache(); ++ } else { ++ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); ++ } ++ } else { ++ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); ++ } ++ ++ if (nearby == null) { ++ return null; ++ } ++ ++ Object[] backingSet = nearby.getBackingSet(); ++ ++ double closestDistanceSquared = Double.MAX_VALUE; ++ EntityPlayer closest = null; ++ ++ for (int i = 0, len = backingSet.length; i < len; ++i) { ++ Object _player = backingSet[i]; ++ if (!(_player instanceof EntityPlayer)) { ++ continue; ++ } ++ EntityPlayer player = (EntityPlayer)_player; ++ ++ double distanceSquared = player.getDistanceSquared(centerX, centerY, centerZ); ++ if (distanceSquared < closestDistanceSquared && condition.test(source, player)) { ++ closest = player; ++ closestDistanceSquared = distanceSquared; ++ } ++ } ++ ++ return closest; ++ } ++ ++ @Override ++ public EntityHuman a(net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { ++ return this.getNearestPlayer(pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); ++ } ++ ++ @Override ++ public EntityHuman a(net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2) { ++ return this.getNearestPlayer(pathfindertargetcondition, entityliving, d0, d1, d2); ++ } ++ ++ @Override ++ public EntityHuman a(net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { ++ return this.getNearestPlayer(pathfindertargetcondition, null, d0, d1, d2); ++ } ++ ++ @Override ++ public List a(net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition condition, EntityLiving source, AxisAlignedBB axisalignedbb) { ++ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet nearby; ++ double centerX = (axisalignedbb.maxX + axisalignedbb.minX) * 0.5; ++ double centerZ = (axisalignedbb.maxZ + axisalignedbb.minZ) * 0.5; ++ if (source != null) { ++ Chunk chunk = source.getCurrentChunk(); ++ if (chunk != null && (MathHelper.floor(centerX) >> 4) == chunk.locX && ++ (MathHelper.floor(centerZ) >> 4) == chunk.locZ) { ++ nearby = chunk.getPlayerGeneralAreaCache(); ++ } else { ++ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); ++ } ++ } else { ++ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); ++ } ++ ++ List ret = new java.util.ArrayList<>(); ++ ++ if (nearby == null) { ++ return ret; ++ } ++ ++ Object[] backingSet = nearby.getBackingSet(); ++ ++ for (int i = 0, len = backingSet.length; i < len; ++i) { ++ Object _player = backingSet[i]; ++ if (!(_player instanceof EntityPlayer)) { ++ continue; ++ } ++ EntityPlayer player = (EntityPlayer)_player; ++ ++ if (axisalignedbb.contains(player.locX(), player.locY(), player.locZ()) && condition.test(source, player)) { ++ ret.add(player); ++ } ++ } ++ ++ return ret; ++ } ++ // Tuinity end - optimise get nearest players for entity AI ++ + // Add env and gen to constructor, WorldData -> WorldDataServer + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor +@@ -772,6 +873,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + public void doTick(BooleanSupplier booleansupplier) { + GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); ++ // Tuinity start - optimise checkDespawn ++ this.playersAffectingSpawning.clear(); ++ for (EntityPlayer player : this.getPlayers()) { ++ if (net.minecraft.world.entity.IEntitySelector.affectsSpawning.test(player)) { ++ this.playersAffectingSpawning.add(player); ++ } ++ } ++ // Tuinity end - optimise checkDespawn + + this.ticking = true; + gameprofilerfiller.enter("world border"); +diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +index a246edd09854dabf095da75c9d200f5cf26e7138..aae13c2e6c2a30b69c33417932c6a4d0aefeb7f5 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java ++++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java +@@ -779,7 +779,13 @@ public abstract class EntityInsentient extends EntityLiving { + if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.L()) { + this.die(); + } else if (!this.isPersistent() && !this.isSpecialPersistence()) { +- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning); // Paper ++ // Tuinity start - optimise checkDespawn ++ net.minecraft.world.level.chunk.Chunk chunk = this.getCurrentChunk(); ++ EntityHuman entityhuman = chunk == null || this.world.paperConfig.hardDespawnDistance >= (net.minecraft.server.level.PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE_SQUARED) ? this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning) : chunk.findNearestPlayer(this.locX(), this.locY(), this.locZ(), -1.0, IEntitySelector.affectsSpawning); // Paper ++ if (entityhuman == null) { ++ entityhuman = ((WorldServer)this.world).playersAffectingSpawning.isEmpty() ? null : ((WorldServer)this.world).playersAffectingSpawning.get(0); ++ } ++ // Tuinity end - optimise checkDespawn + + if (entityhuman != null) { + double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error +diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java +index 7c9ed41ae67bce0e5e45b9c091180ca3c99668fc..a7f2304acf8ee0a15d6eae8c42060e003be13ae7 100644 +--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java ++++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java +@@ -107,7 +107,7 @@ public interface IEntityAccess { + + default EntityHuman findNearbyPlayer(Entity entity, double d0, @Nullable Predicate predicate) { return this.findNearbyPlayer(entity.locX(), entity.locY(), entity.locZ(), d0, predicate); } // Paper + @Nullable default EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { return a(d0, d1, d2, d3, predicate); } // Paper - OBFHELPER +- @Nullable default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { // Paper ++ @Nullable default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { // Paper // Tuinity - diff on change, override in World - this should be "get closest player that matches predicate" + double d4 = -1.0D; + EntityHuman entityhuman = null; + Iterator iterator = this.getPlayers().iterator(); +@@ -208,17 +208,17 @@ public interface IEntityAccess { + } + + @Nullable +- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { ++ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" + return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); + } + + @Nullable +- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, double d0, double d1, double d2) { ++ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, double d0, double d1, double d2) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" + return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, d0, d1, d2); + } + + @Nullable +- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { ++ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" + return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, (EntityLiving) null, d0, d1, d2); + } + +@@ -254,7 +254,7 @@ public interface IEntityAccess { + return t0; + } + +- default List a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) { ++ default List a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get players that matches path finder target condition" + List list = Lists.newArrayList(); + Iterator iterator = this.getPlayers().iterator(); + +diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +index 24771c3522ea74ac12058591137eafc21adf3762..b3c73c6b4cffa20813355c5f2132fe3eaa134007 100644 +--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -250,7 +250,7 @@ public final class SpawnerCreature { + blockposition_mutableblockposition.d(l, i, i1); + double d0 = (double) l + 0.5D; + double d1 = (double) i1 + 0.5D; +- EntityHuman entityhuman = worldserver.a(d0, (double) i, d1, -1.0D, false); ++ EntityHuman entityhuman = worldserver.a(d0, (double) i, d1, 576.0D, false); // Tuinity - copied from below method for range, for the love of god we do not need to fucking find the closet player outside of this range - limiting range lets us use the distance map + + if (entityhuman != null) { + double d2 = entityhuman.h(d0, (double) i, d1); +@@ -322,7 +322,7 @@ public final class SpawnerCreature { + } + + private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { +- if (d0 <= 576.0D) { ++ if (d0 <= 576.0D) { // Tuinity - diff on change, copy into caller + return false; + } else if (worldserver.getSpawn().a((IPosition) (new Vec3D((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D)), 24.0D)) { + return false; +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 9118616e00220715339e31798e29a1871fafbea5..1fab6ec02c0aceb56baea5353dbd85b580caf454 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -183,6 +183,65 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return typeKey; + } + ++ // Tuinity start - optimise checkDespawn ++ public final List getNearbyPlayers(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { ++ Chunk chunk; ++ if (source == null || (chunk = source.getCurrentChunk()) == null || maxRange < 0.0 || maxRange >= net.minecraft.server.level.PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE) { ++ return this.getNearbyPlayersSlow(source, sourceX, sourceY, sourceZ, maxRange, predicate); ++ } ++ ++ List ret = new java.util.ArrayList<>(); ++ chunk.getNearestPlayers(sourceX, sourceY, sourceZ, predicate, maxRange, ret); ++ return ret; ++ } ++ ++ private List getNearbyPlayersSlow(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { ++ List ret = new java.util.ArrayList<>(); ++ double maxRangeSquared = maxRange * maxRange; ++ ++ for (EntityPlayer player : (List)this.getPlayers()) { ++ if ((maxRange < 0.0 || player.getDistanceSquared(sourceX, sourceY, sourceZ) < maxRangeSquared)) { ++ if (predicate == null || predicate.test(player)) { ++ ret.add(player); ++ } ++ } ++ } ++ ++ return ret; ++ } ++ ++ private EntityPlayer getNearestPlayerSlow(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { ++ EntityPlayer closest = null; ++ double closestRangeSquared = maxRange < 0.0 ? Double.MAX_VALUE : maxRange * maxRange; ++ ++ for (EntityPlayer player : (List)this.getPlayers()) { ++ double distanceSquared = player.getDistanceSquared(sourceX, sourceY, sourceZ); ++ if (distanceSquared < closestRangeSquared && (predicate == null || predicate.test(player))) { ++ closest = player; ++ closestRangeSquared = distanceSquared; ++ } ++ } ++ ++ return closest; ++ } ++ ++ ++ public final EntityPlayer getNearestPlayer(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { ++ Chunk chunk; ++ if (source == null || (chunk = source.getCurrentChunk()) == null || maxRange < 0.0 || maxRange >= net.minecraft.server.level.PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE) { ++ return this.getNearestPlayerSlow(source, sourceX, sourceY, sourceZ, maxRange, predicate); ++ } ++ ++ return chunk.findNearestPlayer(sourceX, sourceY, sourceZ, maxRange, predicate); ++ } ++ ++ @Override ++ public @Nullable EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { ++ return this.getNearestPlayer(null, d0, d1, d2, d3, predicate); ++ } ++ ++ // Tuinity end - optimise checkDespawn ++ + protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper + this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName()); // Spigot + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index d2f2efa21f8aec3515ae0c4491956916c9ed9500..ec5770453f2c795f09345f2f89209a66625392f3 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -157,6 +157,92 @@ public class Chunk implements IChunkAccess { } // Tuinity end - optimised entity slices @@ -27,11 +396,11 @@ index 3f6dbba68fe7331c97c4e0fe3c8ada365970577a..936c392c9faa178b5645ea79b0130e0d + return this.playerGeneralAreaCache; + } + -+ void updateGeneralAreaCache() { ++ public void updateGeneralAreaCache() { + this.updateGeneralAreaCache(((WorldServer)this.world).getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(this.coordinateKey)); + } + -+ void updateGeneralAreaCache(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet value) { ++ public void updateGeneralAreaCache(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet value) { + this.playerGeneralAreaCacheSet = true; + this.playerGeneralAreaCache = value; + } @@ -105,372 +474,3 @@ index 3f6dbba68fe7331c97c4e0fe3c8ada365970577a..936c392c9faa178b5645ea79b0130e0d 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(); -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index a88521745f9f9b6935a61db52db915ea483af227..a47217c020d2c2a3caddafa0549dc827373798dd 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -711,7 +711,13 @@ public abstract class EntityInsentient extends EntityLiving { - if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.L()) { - this.die(); - } else if (!this.isPersistent() && !this.isSpecialPersistence()) { -- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning); // Paper -+ // Tuinity start - optimise checkDespawn -+ Chunk chunk = this.getCurrentChunk(); -+ EntityHuman entityhuman = chunk == null || this.world.paperConfig.hardDespawnDistance >= (PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE_SQUARED) ? this.world.findNearbyPlayer(this, -1.0D, IEntitySelector.affectsSpawning) : chunk.findNearestPlayer(this.locX(), this.locY(), this.locZ(), -1.0, IEntitySelector.affectsSpawning); // Paper -+ if (entityhuman == null) { -+ entityhuman = ((WorldServer)this.world).playersAffectingSpawning.isEmpty() ? null : ((WorldServer)this.world).playersAffectingSpawning.get(0); -+ } -+ // Tuinity end - optimise checkDespawn - - if (entityhuman != null) { - double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 93f2ac996904ddefed04704e554209d047faa59f..ad286848ddb7803640ef7eeea46b58473dd1d0c4 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -98,7 +98,7 @@ public interface IEntityAccess { - - default EntityHuman findNearbyPlayer(Entity entity, double d0, @Nullable Predicate predicate) { return this.findNearbyPlayer(entity.locX(), entity.locY(), entity.locZ(), d0, predicate); } // Paper - @Nullable default EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { return a(d0, d1, d2, d3, predicate); } // Paper - OBFHELPER -- @Nullable default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { // Paper -+ @Nullable default EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { // Paper // Tuinity - diff on change, override in World - this should be "get closest player that matches predicate" - double d4 = -1.0D; - EntityHuman entityhuman = null; - Iterator iterator = this.getPlayers().iterator(); -@@ -199,17 +199,17 @@ public interface IEntityAccess { - } - - @Nullable -- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { -+ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" - return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); - } - - @Nullable -- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, double d0, double d1, double d2) { -+ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, double d0, double d1, double d2) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" - return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, entityliving, d0, d1, d2); - } - - @Nullable -- default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { -+ default EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { // Tuinity - diff on change, override in World - this should be "get closest player that matches path finder target condition" - return (EntityHuman) this.a(this.getPlayers(), pathfindertargetcondition, (EntityLiving) null, d0, d1, d2); - } - -@@ -245,7 +245,7 @@ public interface IEntityAccess { - return t0; - } - -- default List a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) { -+ default List a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) { // Tuinity - diff on change, override in World - this should be "get players that matches path finder target condition" - List list = Lists.newArrayList(); - Iterator iterator = this.getPlayers().iterator(); - -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 48976b1f07aeb0d588d0856f18b6fd07b2d18e05..a22021766b3bffa4f96d1d4ee546b12e96b5ca58 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -56,6 +56,12 @@ public class PlayerChunk { - long key = net.minecraft.server.MCUtil.getCoordinateKey(this.location); - this.playersInMobSpawnRange = this.chunkMap.playerMobSpawnMap.getObjectsInRange(key); - this.playersInChunkTickRange = this.chunkMap.playerChunkTickRangeMap.getObjectsInRange(key); -+ // Tuinity start - optimise checkDespawn -+ Chunk chunk = this.getFullChunkIfCached(); -+ if (chunk != null) { -+ chunk.updateGeneralAreaCache(); -+ } -+ // Tuinity end - optimise checkDespawn - } - // Paper end - optimise isOutsideOfRange - // Paper start - optimize chunk status progression without jumping through thread pool -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 8578cac6a19d9d1b5ac5f12fa369cc54a2436d4e..d04be5ae54ac543de144eb4ae87a255c467bc637 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -196,6 +196,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerViewDistanceTickMap; - public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerViewDistanceNoTickMap; - // Paper end - no-tick view distance -+ // Tuinity start - optimise checkDespawn -+ public static final int GENERAL_AREA_MAP_SQUARE_RADIUS = 38; -+ public static final double GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE = 16.0 * (GENERAL_AREA_MAP_SQUARE_RADIUS - 1); -+ public static final double GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE_SQUARED = GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE * GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE; -+ public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerGeneralAreaMap; -+ // Tuinity end - optimise checkDespawn - - void addPlayerToDistanceMaps(EntityPlayer player) { - com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update distance maps off of the main thread"); // Tuinity -@@ -226,6 +232,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - this.playerViewDistanceBroadcastMap.add(player, chunkX, chunkZ, effectiveNoTickViewDistance + 1); // clients need an extra neighbour to render the full view distance configured - player.needsChunkCenterUpdate = false; - // Paper end - no-tick view distance -+ // Tuinity start - optimise checkDespawn -+ this.playerGeneralAreaMap.add(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); -+ // Tuinity end - optimise checkDespawn - } - - void removePlayerFromDistanceMaps(EntityPlayer player) { -@@ -244,6 +253,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - this.playerViewDistanceTickMap.remove(player); - this.playerViewDistanceNoTickMap.remove(player); - // Paper end - no-tick view distance -+ // Tuinity start - optimise checkDespawn -+ this.playerGeneralAreaMap.remove(player); -+ // Tuinity end - optimise checkDespawn - } - - void updateMaps(EntityPlayer player) { -@@ -275,6 +287,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - this.playerViewDistanceBroadcastMap.update(player, chunkX, chunkZ, effectiveNoTickViewDistance + 1); // clients need an extra neighbour to render the full view distance configured - player.needsChunkCenterUpdate = false; - // Paper end - no-tick view distance -+ // Tuinity start - optimise checkDespawn -+ this.playerGeneralAreaMap.update(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); -+ // Tuinity end - optimise checkDespawn - } - // Paper end - -@@ -479,6 +494,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - this.dataRegionManager = new com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager(this.world, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); - this.regionManagers.add(this.dataRegionManager); - // Tuinity end -+ // Tuinity start - optimise checkDespawn -+ this.playerGeneralAreaMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, -+ (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { -+ Chunk chunk = PlayerChunkMap.this.world.getChunkProvider().getChunkAtIfCachedImmediately(rangeX, rangeZ); -+ if (chunk != null) { -+ chunk.updateGeneralAreaCache(newState); -+ } -+ }, -+ (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { -+ Chunk chunk = PlayerChunkMap.this.world.getChunkProvider().getChunkAtIfCachedImmediately(rangeX, rangeZ); -+ if (chunk != null) { -+ chunk.updateGeneralAreaCache(newState); -+ } -+ }); -+ // Tuinity end - optimise checkDespawn - } - // Paper start - Chunk Prioritization - public void queueHolderUpdate(PlayerChunk playerchunk) { -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 661ad8f8e67046211e001ea40d97660d7c88f8e5..a77b1d61b9dcb0a2a27d7e50357eaf44c99a661e 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -216,7 +216,7 @@ public final class SpawnerCreature { - blockposition_mutableblockposition.d(l, i, i1); - double d0 = (double) l + 0.5D; - double d1 = (double) i1 + 0.5D; -- EntityHuman entityhuman = worldserver.a(d0, (double) i, d1, -1.0D, false); -+ EntityHuman entityhuman = worldserver.a(d0, (double) i, d1, 576.0D, false); // Tuinity - copied from below method for range, for the love of god we do not need to fucking find the closet player outside of this range - limiting range lets us use the distance map - - if (entityhuman != null) { - double d2 = entityhuman.h(d0, (double) i, d1); -@@ -288,7 +288,7 @@ public final class SpawnerCreature { - } - - private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { -- if (d0 <= 576.0D) { -+ if (d0 <= 576.0D) { // Tuinity - diff on change, copy into caller - return false; - } else if (worldserver.getSpawn().a((IPosition) (new Vec3D((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D)), 24.0D)) { - return false; -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1d87e7461d28d8a639fafcfdfa5496014e9180f6..970c1be5477a01ab9c6d79e84c519e22775564ff 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -123,6 +123,65 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return typeKey; - } - -+ // Tuinity start - optimise checkDespawn -+ public final List getNearbyPlayers(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { -+ Chunk chunk; -+ if (source == null || (chunk = source.getCurrentChunk()) == null || maxRange < 0.0 || maxRange >= PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE) { -+ return this.getNearbyPlayersSlow(source, sourceX, sourceY, sourceZ, maxRange, predicate); -+ } -+ -+ List ret = new java.util.ArrayList<>(); -+ chunk.getNearestPlayers(sourceX, sourceY, sourceZ, predicate, maxRange, ret); -+ return ret; -+ } -+ -+ private List getNearbyPlayersSlow(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { -+ List ret = new java.util.ArrayList<>(); -+ double maxRangeSquared = maxRange * maxRange; -+ -+ for (EntityPlayer player : (List)this.getPlayers()) { -+ if ((maxRange < 0.0 || player.getDistanceSquared(sourceX, sourceY, sourceZ) < maxRangeSquared)) { -+ if (predicate == null || predicate.test(player)) { -+ ret.add(player); -+ } -+ } -+ } -+ -+ return ret; -+ } -+ -+ private EntityPlayer getNearestPlayerSlow(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { -+ EntityPlayer closest = null; -+ double closestRangeSquared = maxRange < 0.0 ? Double.MAX_VALUE : maxRange * maxRange; -+ -+ for (EntityPlayer player : (List)this.getPlayers()) { -+ double distanceSquared = player.getDistanceSquared(sourceX, sourceY, sourceZ); -+ if (distanceSquared < closestRangeSquared && (predicate == null || predicate.test(player))) { -+ closest = player; -+ closestRangeSquared = distanceSquared; -+ } -+ } -+ -+ return closest; -+ } -+ -+ -+ public final EntityPlayer getNearestPlayer(@Nullable Entity source, double sourceX, double sourceY, double sourceZ, double maxRange, @Nullable Predicate predicate) { -+ Chunk chunk; -+ if (source == null || (chunk = source.getCurrentChunk()) == null || maxRange < 0.0 || maxRange >= PlayerChunkMap.GENERAL_AREA_MAP_ACCEPTABLE_SEARCH_RANGE) { -+ return this.getNearestPlayerSlow(source, sourceX, sourceY, sourceZ, maxRange, predicate); -+ } -+ -+ return chunk.findNearestPlayer(sourceX, sourceY, sourceZ, maxRange, predicate); -+ } -+ -+ @Override -+ public @Nullable EntityHuman a(double d0, double d1, double d2, double d3, @Nullable Predicate predicate) { -+ return this.getNearestPlayer(null, d0, d1, d2, d3, predicate); -+ } -+ -+ // Tuinity end - optimise checkDespawn -+ - protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper - this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 3e46e49aebee3c47447419eb784fcf2150f422f2..ac4b2d34824c00b655f9e5dbcc431b0ed8e4d765 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -301,6 +301,107 @@ public class WorldServer extends World implements GeneratorAccessSeed { - long lastMidTickExecuteFailure; - // Tuinity end - execute chunk tasks mid tick - -+ // Tuinity start - optimise checkDespawn -+ final List playersAffectingSpawning = new java.util.ArrayList<>(); -+ // Tuinity end - optimise checkDespawn -+ // Tuinity start - optimise get nearest players for entity AI -+ public final EntityPlayer getNearestPlayer(PathfinderTargetCondition condition, @Nullable EntityLiving source, -+ double centerX, double centerY, double centerZ) { -+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet nearby; -+ if (source != null) { -+ Chunk chunk = source.getCurrentChunk(); -+ if (chunk != null && (MathHelper.floor(centerX) >> 4) == chunk.locX && -+ (MathHelper.floor(centerZ) >> 4) == chunk.locZ) { -+ nearby = chunk.getPlayerGeneralAreaCache(); -+ } else { -+ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); -+ } -+ } else { -+ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); -+ } -+ -+ if (nearby == null) { -+ return null; -+ } -+ -+ Object[] backingSet = nearby.getBackingSet(); -+ -+ double closestDistanceSquared = Double.MAX_VALUE; -+ EntityPlayer closest = null; -+ -+ for (int i = 0, len = backingSet.length; i < len; ++i) { -+ Object _player = backingSet[i]; -+ if (!(_player instanceof EntityPlayer)) { -+ continue; -+ } -+ EntityPlayer player = (EntityPlayer)_player; -+ -+ double distanceSquared = player.getDistanceSquared(centerX, centerY, centerZ); -+ if (distanceSquared < closestDistanceSquared && condition.test(source, player)) { -+ closest = player; -+ closestDistanceSquared = distanceSquared; -+ } -+ } -+ -+ return closest; -+ } -+ -+ @Override -+ public EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving) { -+ return this.getNearestPlayer(pathfindertargetcondition, entityliving, entityliving.locX(), entityliving.locY(), entityliving.locZ()); -+ } -+ -+ @Override -+ public EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2) { -+ return this.getNearestPlayer(pathfindertargetcondition, entityliving, d0, d1, d2); -+ } -+ -+ @Override -+ public EntityHuman a(PathfinderTargetCondition pathfindertargetcondition, double d0, double d1, double d2) { -+ return this.getNearestPlayer(pathfindertargetcondition, null, d0, d1, d2); -+ } -+ -+ @Override -+ public List a(PathfinderTargetCondition condition, EntityLiving source, AxisAlignedBB axisalignedbb) { -+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet nearby; -+ double centerX = (axisalignedbb.maxX + axisalignedbb.minX) * 0.5; -+ double centerZ = (axisalignedbb.maxZ + axisalignedbb.minZ) * 0.5; -+ if (source != null) { -+ Chunk chunk = source.getCurrentChunk(); -+ if (chunk != null && (MathHelper.floor(centerX) >> 4) == chunk.locX && -+ (MathHelper.floor(centerZ) >> 4) == chunk.locZ) { -+ nearby = chunk.getPlayerGeneralAreaCache(); -+ } else { -+ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); -+ } -+ } else { -+ nearby = this.getChunkProvider().playerChunkMap.playerGeneralAreaMap.getObjectsInRange(MathHelper.floor(centerX) >> 4, MathHelper.floor(centerZ) >> 4); -+ } -+ -+ List ret = new java.util.ArrayList<>(); -+ -+ if (nearby == null) { -+ return ret; -+ } -+ -+ Object[] backingSet = nearby.getBackingSet(); -+ -+ for (int i = 0, len = backingSet.length; i < len; ++i) { -+ Object _player = backingSet[i]; -+ if (!(_player instanceof EntityPlayer)) { -+ continue; -+ } -+ EntityPlayer player = (EntityPlayer)_player; -+ -+ if (axisalignedbb.contains(player.locX(), player.locY(), player.locZ()) && condition.test(source, player)) { -+ ret.add(player); -+ } -+ } -+ -+ return ret; -+ } -+ // Tuinity end - optimise get nearest players for entity AI -+ - // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { - super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -659,6 +760,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { - - public void doTick(BooleanSupplier booleansupplier) { - GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); -+ // Tuinity start - optimise checkDespawn -+ this.playersAffectingSpawning.clear(); -+ for (EntityPlayer player : this.getPlayers()) { -+ if (IEntitySelector.affectsSpawning.test(player)) { -+ this.playersAffectingSpawning.add(player); -+ } -+ } -+ // Tuinity end - optimise checkDespawn - - this.ticking = true; - gameprofilerfiller.enter("world border"); diff --git a/patches/Tuinity/patches/server/0048-Remove-streams-for-villager-AI.patch b/patches/Tuinity/patches/server/0048-Remove-streams-for-villager-AI.patch index e2d37e6b..8fc8503d 100644 --- a/patches/Tuinity/patches/server/0048-Remove-streams-for-villager-AI.patch +++ b/patches/Tuinity/patches/server/0048-Remove-streams-for-villager-AI.patch @@ -4,11 +4,23 @@ Date: Thu, 27 Aug 2020 20:51:40 -0700 Subject: [PATCH] Remove streams for villager AI -diff --git a/src/main/java/net/minecraft/server/Behavior.java b/src/main/java/net/minecraft/server/Behavior.java -index 65af976527133ee5c2f52e411e19c4f7f06df3ef..0b9d469a92decfb0632805791868ef7faa88c535 100644 ---- a/src/main/java/net/minecraft/server/Behavior.java -+++ b/src/main/java/net/minecraft/server/Behavior.java -@@ -7,7 +7,7 @@ import java.util.Map.Entry; +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index c5ce10a55de6f611ec65f32382b0082f86e73fe3..d1269c08dc0b4e2caa7289748a894519f5d0a66d 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1681,6 +1681,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne + return d3 * d3 + d4 * d4 + d5 * d5; + } + ++ public final double getDistanceSquared(Entity other) { return this.h(other); } // Tuinity - OBFHELPER + public double h(Entity entity) { + return this.e(entity.getPositionVector()); + } +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java +index a30b92736d8b36f750eb721d4a056bdfc98845b5..717e5f71fb919ac8952a077714d7f4581d546a28 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/Behavior.java +@@ -11,7 +11,7 @@ import net.minecraft.world.entity.ai.memory.MemoryStatus; public abstract class Behavior { protected final Map, MemoryStatus> a; @@ -17,11 +29,11 @@ index 65af976527133ee5c2f52e411e19c4f7f06df3ef..0b9d469a92decfb0632805791868ef7f private long c; private final int d; private final int e; -diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -index 63a761ebef80d4af09cdc2682e496d78492c4a3a..275d4cad8ff0dd64b74ef8f8056cdef093523f97 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java -+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -@@ -84,7 +84,7 @@ public class BehaviorFindPosition extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +index a04d4dc665f34687b5d744fea56bc46263f27235..5fe71380b04600d6cd0bb068d239ff8fdfe2afbb 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +@@ -94,7 +94,7 @@ public class BehaviorFindPosition extends Behavior { villageplace.a(this.b.c(), (blockposition1) -> { return blockposition1.equals(blockposition); }, blockposition, 1); @@ -30,11 +42,11 @@ index 63a761ebef80d4af09cdc2682e496d78492c4a3a..275d4cad8ff0dd64b74ef8f8056cdef0 this.e.ifPresent((obyte) -> { worldserver.broadcastEntityEffect(entitycreature, obyte); }); -diff --git a/src/main/java/net/minecraft/server/BehaviorGate.java b/src/main/java/net/minecraft/server/BehaviorGate.java -index 46e910581210421c8699637431804dc2f43eb4a6..fb967bc03f58fab8cec2732b1890108f2fc66af8 100644 ---- a/src/main/java/net/minecraft/server/BehaviorGate.java -+++ b/src/main/java/net/minecraft/server/BehaviorGate.java -@@ -12,7 +12,7 @@ public class BehaviorGate extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorGate.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorGate.java +index 2d4345de154fb2d31f34695672ebdb4dac31b181..c46cdffe3d877bff70b843766c8189eae06148ff 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorGate.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorGate.java +@@ -17,7 +17,7 @@ public class BehaviorGate extends Behavior { private final Set> b; private final BehaviorGate.Order c; private final BehaviorGate.Execution d; @@ -43,7 +55,7 @@ index 46e910581210421c8699637431804dc2f43eb4a6..fb967bc03f58fab8cec2732b1890108f public BehaviorGate(Map, MemoryStatus> map, Set> set, BehaviorGate.Order behaviorgate_order, BehaviorGate.Execution behaviorgate_execution, List, Integer>> list) { super(map); -@@ -26,11 +26,17 @@ public class BehaviorGate extends Behavior { +@@ -31,11 +31,17 @@ public class BehaviorGate extends Behavior { @Override protected boolean b(WorldServer worldserver, E e0, long i) { @@ -66,7 +78,7 @@ index 46e910581210421c8699637431804dc2f43eb4a6..fb967bc03f58fab8cec2732b1890108f } @Override -@@ -46,20 +52,28 @@ public class BehaviorGate extends Behavior { +@@ -51,20 +57,28 @@ public class BehaviorGate extends Behavior { @Override protected void d(WorldServer worldserver, E e0, long i) { @@ -105,7 +117,7 @@ index 46e910581210421c8699637431804dc2f43eb4a6..fb967bc03f58fab8cec2732b1890108f BehaviorController behaviorcontroller = e0.getBehaviorController(); this.b.forEach(behaviorcontroller::removeMemory); // Paper - decomp fix -@@ -79,21 +93,29 @@ public class BehaviorGate extends Behavior { +@@ -84,21 +98,29 @@ public class BehaviorGate extends Behavior { RUN_ONE { @Override public void a(WeightedList> weightedlist, WorldServer worldserver, E e0, long i) { @@ -145,11 +157,11 @@ index 46e910581210421c8699637431804dc2f43eb4a6..fb967bc03f58fab8cec2732b1890108f } }; -diff --git a/src/main/java/net/minecraft/server/BehaviorLookInteract.java b/src/main/java/net/minecraft/server/BehaviorLookInteract.java -index a33303c31881b6391723e16a06d7841d48679958..ce57e6a4acac97d6da82202094306e7e91f1c87e 100644 ---- a/src/main/java/net/minecraft/server/BehaviorLookInteract.java -+++ b/src/main/java/net/minecraft/server/BehaviorLookInteract.java -@@ -7,7 +7,7 @@ import java.util.function.Predicate; +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorLookInteract.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorLookInteract.java +index f56072c77b9dfd0eeafb7a6970eecf593315f63e..196a5659a1f2c8c20a10f36c3fa81a8edc43a00c 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorLookInteract.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorLookInteract.java +@@ -14,7 +14,7 @@ import net.minecraft.world.entity.ai.memory.MemoryStatus; public class BehaviorLookInteract extends Behavior { private final EntityTypes b; @@ -158,7 +170,7 @@ index a33303c31881b6391723e16a06d7841d48679958..ce57e6a4acac97d6da82202094306e7e private final Predicate d; private final Predicate e; -@@ -29,7 +29,20 @@ public class BehaviorLookInteract extends Behavior { +@@ -36,7 +36,20 @@ public class BehaviorLookInteract extends Behavior { @Override public boolean a(WorldServer worldserver, EntityLiving entityliving) { @@ -180,7 +192,7 @@ index a33303c31881b6391723e16a06d7841d48679958..ce57e6a4acac97d6da82202094306e7e } @Override -@@ -37,16 +50,28 @@ public class BehaviorLookInteract extends Behavior { +@@ -44,16 +57,28 @@ public class BehaviorLookInteract extends Behavior { super.a(worldserver, entityliving, i); BehaviorController behaviorcontroller = entityliving.getBehaviorController(); @@ -217,38 +229,33 @@ index a33303c31881b6391723e16a06d7841d48679958..ce57e6a4acac97d6da82202094306e7e private boolean a(EntityLiving entityliving) { return this.b.equals(entityliving.getEntityType()) && this.d.test(entityliving); } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 99b01cb35e2af2d61688b0b10ad1c655b9f2e4c3..1b56d83bdac536e8189901f03ad58e82d33ac8a3 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1589,6 +1589,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return d3 * d3 + d4 * d4 + d5 * d5; - } +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java +index 1ca9b0595ae9d914d23590ec0b0c2e857c39b250..e2b5d6155bebdbf99b0850de7f9e1f5d342f9e2f 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WeightedList.java +@@ -14,7 +14,7 @@ import java.util.stream.Stream; -+ public final double getDistanceSquared(Entity other) { return this.h(other); } // Tuinity - OBFHELPER - public double h(Entity entity) { - return this.e(entity.getPositionVector()); - } -diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java -index 04256a95108b8182e8f808e856e0d2b62165e242..d9362b74fda2ea937281f897fbc2cb501775a275 100644 ---- a/src/main/java/net/minecraft/server/RegionFileSection.java -+++ b/src/main/java/net/minecraft/server/RegionFileSection.java -@@ -50,8 +50,8 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + public class WeightedList { - } +- protected final List> list; // Paper - decompile conflict ++ protected final List> list; public final List> getList() { return this.list; } // Paper - decompile conflict // Tuinity - OBFHELPER + private final Random b; + private final boolean isUnsafe; // Paper -- @Nullable -- protected Optional c(long i) { -+ @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER -+ @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER - return (Optional) this.c.get(i); - } +@@ -74,7 +74,7 @@ public class WeightedList { -diff --git a/src/main/java/net/minecraft/server/SensorNearestBed.java b/src/main/java/net/minecraft/server/SensorNearestBed.java -index ad3609f2b884f64f1a1a449036cece49a46e933e..83025d69e8a0732f16581fcfeaef5c1a45d70b63 100644 ---- a/src/main/java/net/minecraft/server/SensorNearestBed.java -+++ b/src/main/java/net/minecraft/server/SensorNearestBed.java -@@ -48,7 +48,7 @@ public class SensorNearestBed extends Sensor { + public static class a { + +- private final T a; ++ private final T a; public final T getValue() { return this.a; } // Tuinity - OBFHELPER + private final int b; + private double c; + +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java +index 1e58a06860125243d0f7c062aca095dd2aae98f2..5e4c022bcbf4456bc9020f56fb26fee0c627d722 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java +@@ -55,7 +55,7 @@ public class SensorNearestBed extends Sensor { Optional optional = villageplace.c(blockposition); if (optional.isPresent()) { @@ -257,11 +264,11 @@ index ad3609f2b884f64f1a1a449036cece49a46e933e..83025d69e8a0732f16581fcfeaef5c1a } } else if (this.b < 5) { this.a.long2LongEntrySet().removeIf((entry) -> { -diff --git a/src/main/java/net/minecraft/server/SensorNearestItems.java b/src/main/java/net/minecraft/server/SensorNearestItems.java -index edf7d31e8e06f67be58282b2a76d1ac899b4f3e8..1de170b9fe6f2888da6dcf0151aaf1f865691c6a 100644 ---- a/src/main/java/net/minecraft/server/SensorNearestItems.java -+++ b/src/main/java/net/minecraft/server/SensorNearestItems.java -@@ -18,19 +18,24 @@ public class SensorNearestItems extends Sensor { +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestItems.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestItems.java +index 2e3149a0b15299468079796bd3ea56eabdb4998c..943e269b99321cbd7373181a898dcdfa6cbb6a89 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestItems.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestItems.java +@@ -24,19 +24,24 @@ public class SensorNearestItems extends Sensor { protected void a(WorldServer worldserver, EntityInsentient entityinsentient) { BehaviorController behaviorcontroller = entityinsentient.getBehaviorController(); @@ -295,11 +302,11 @@ index edf7d31e8e06f67be58282b2a76d1ac899b4f3e8..1de170b9fe6f2888da6dcf0151aaf1f8 + behaviorcontroller.setMemory(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, optional); } } -diff --git a/src/main/java/net/minecraft/server/SensorNearestLivingEntities.java b/src/main/java/net/minecraft/server/SensorNearestLivingEntities.java -index b3388d4a665e8f91083a2e746482a9f0bd988da1..83e47ab6eb27847f7260f297d7b04a8e6c82d619 100644 ---- a/src/main/java/net/minecraft/server/SensorNearestLivingEntities.java -+++ b/src/main/java/net/minecraft/server/SensorNearestLivingEntities.java -@@ -22,11 +22,16 @@ public class SensorNearestLivingEntities extends Sensor { +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestLivingEntities.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestLivingEntities.java +index 0bc17d148e91277efdf72541e5470fa56d455670..845ed38e48fe404df1d2b0d5aba657628b1e2056 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestLivingEntities.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestLivingEntities.java +@@ -27,11 +27,16 @@ public class SensorNearestLivingEntities extends Sensor { BehaviorController behaviorcontroller = entityliving.getBehaviorController(); behaviorcontroller.setMemory(MemoryModuleType.MOBS, list); // Paper - decompile error @@ -321,11 +328,11 @@ index b3388d4a665e8f91083a2e746482a9f0bd988da1..83e47ab6eb27847f7260f297d7b04a8e } @Override -diff --git a/src/main/java/net/minecraft/server/SensorNearestPlayers.java b/src/main/java/net/minecraft/server/SensorNearestPlayers.java -index ae946619f10a757171e4217e414d6a5248a45494..fa2d366ca6695c099c29469bf69a7845350b4f07 100644 ---- a/src/main/java/net/minecraft/server/SensorNearestPlayers.java -+++ b/src/main/java/net/minecraft/server/SensorNearestPlayers.java -@@ -19,26 +19,31 @@ public class SensorNearestPlayers extends Sensor { +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestPlayers.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestPlayers.java +index 60e4da9217d4d950b5077baf6b50eaee20f8df09..c2afe3481265eb9390592ad46ba78d5be48d500f 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestPlayers.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestPlayers.java +@@ -26,26 +26,31 @@ public class SensorNearestPlayers extends Sensor { @Override protected void a(WorldServer worldserver, EntityLiving entityliving) { @@ -374,11 +381,11 @@ index ae946619f10a757171e4217e414d6a5248a45494..fa2d366ca6695c099c29469bf69a7845 + // Tuinity end - remove streams } } -diff --git a/src/main/java/net/minecraft/server/SensorVillagerBabies.java b/src/main/java/net/minecraft/server/SensorVillagerBabies.java -index a367bbfde4fbfeca6d01dec49c05f5e185aab43a..794b33a13b7f11b973caf085b0bded9b2135a4d7 100644 ---- a/src/main/java/net/minecraft/server/SensorVillagerBabies.java -+++ b/src/main/java/net/minecraft/server/SensorVillagerBabies.java -@@ -17,11 +17,23 @@ public class SensorVillagerBabies extends Sensor { +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorVillagerBabies.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorVillagerBabies.java +index e5e246143f014d78dac765c97a5d9e3ac91a7793..aaf31114f3e09304db83270f4f521fa7f566da06 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorVillagerBabies.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorVillagerBabies.java +@@ -21,11 +21,23 @@ public class SensorVillagerBabies extends Sensor { @Override protected void a(WorldServer worldserver, EntityLiving entityliving) { @@ -404,11 +411,11 @@ index a367bbfde4fbfeca6d01dec49c05f5e185aab43a..794b33a13b7f11b973caf085b0bded9b } private boolean b(EntityLiving entityliving) { -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 46c4e66566b7206d311653341987b9312dea3e68..0094babbd59cc81554b9480088464d632824ae8e 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -311,6 +311,7 @@ public class VillagePlace extends RegionFileSection { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index dc36d714dfb360ddb203480079d1ab231da0ed45..84843ebbef7a6e56633b35712b1643801dca62dc 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +@@ -324,6 +324,7 @@ public class VillagePlace extends RegionFileSection { this.d = predicate; } @@ -416,11 +423,11 @@ index 46c4e66566b7206d311653341987b9312dea3e68..0094babbd59cc81554b9480088464d63 public Predicate a() { return this.d; } -diff --git a/src/main/java/net/minecraft/server/VillagePlaceRecord.java b/src/main/java/net/minecraft/server/VillagePlaceRecord.java -index 0b40c2f4dada7d8432e3f91e9cf206c2bda3b24b..6eaf9fc9cc93f79a497b07a3549d459ba66be849 100644 ---- a/src/main/java/net/minecraft/server/VillagePlaceRecord.java -+++ b/src/main/java/net/minecraft/server/VillagePlaceRecord.java -@@ -6,7 +6,7 @@ import java.util.Objects; +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceRecord.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceRecord.java +index 3fcbf223c4835b92a7da0df9e5443ca1e5217bb4..29a291bc08d8043e5bd8353798be930582455feb 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceRecord.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceRecord.java +@@ -8,7 +8,7 @@ import net.minecraft.core.IRegistry; public class VillagePlaceRecord { @@ -429,11 +436,11 @@ index 0b40c2f4dada7d8432e3f91e9cf206c2bda3b24b..6eaf9fc9cc93f79a497b07a3549d459b private final VillagePlaceType b; private int c; private final Runnable d; -diff --git a/src/main/java/net/minecraft/server/VillagePlaceSection.java b/src/main/java/net/minecraft/server/VillagePlaceSection.java -index b86963aa34b5ae479f924c5a52afc5b5b66dba76..943a437ff27162eae09211c28bdc0d141fa6a404 100644 ---- a/src/main/java/net/minecraft/server/VillagePlaceSection.java -+++ b/src/main/java/net/minecraft/server/VillagePlaceSection.java -@@ -23,12 +23,12 @@ public class VillagePlaceSection { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java +index a72bd9ce8f683ae3f4d9c08c973292e3433e8f16..41ffad7cbb6c77713736f37b3728b201d315f6d4 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java +@@ -27,12 +27,12 @@ public class VillagePlaceSection { private static final Logger LOGGER = LogManager.getLogger(); private final Short2ObjectMap b; @@ -448,25 +455,18 @@ index b86963aa34b5ae479f924c5a52afc5b5b66dba76..943a437ff27162eae09211c28bdc0d14 return instance.group(RecordCodecBuilder.point(runnable), Codec.BOOL.optionalFieldOf("Valid", false).forGetter((villageplacesection) -> { return villageplacesection.e; }), VillagePlaceRecord.a(runnable).listOf().fieldOf("Records").forGetter((villageplacesection) -> { -diff --git a/src/main/java/net/minecraft/server/WeightedList.java b/src/main/java/net/minecraft/server/WeightedList.java -index 5d9d58411f2fad9d5da703f964d269b4a7c2b205..f0fdfd6891e59891e7370a2d682b65c647b28e9e 100644 ---- a/src/main/java/net/minecraft/server/WeightedList.java -+++ b/src/main/java/net/minecraft/server/WeightedList.java -@@ -14,7 +14,7 @@ import java.util.stream.Stream; +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +index d3b9a9e4695655860c72db5f2188472681e8d37a..0791dcc6c2efda54ce3afb36e8d3b0b022807f67 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +@@ -59,8 +59,8 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - public class WeightedList { + } -- protected final List> list; // Paper - decompile conflict -+ protected final List> list; public final List> getList() { return this.list; } // Paper - decompile conflict // Tuinity - OBFHELPER - private final Random b; - private final boolean isUnsafe; // Paper - -@@ -74,7 +74,7 @@ public class WeightedList { - - public static class a { - -- private final T a; -+ private final T a; public final T getValue() { return this.a; } // Tuinity - OBFHELPER - private final int b; - private double c; +- @Nullable +- protected Optional c(long i) { ++ @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER ++ @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER + return (Optional) this.c.get(i); + } diff --git a/patches/Tuinity/patches/server/0049-Don-t-lookup-fluid-state-when-raytracing.patch b/patches/Tuinity/patches/server/0049-Don-t-lookup-fluid-state-when-raytracing.patch index dd37eb89..f348d263 100644 --- a/patches/Tuinity/patches/server/0049-Don-t-lookup-fluid-state-when-raytracing.patch +++ b/patches/Tuinity/patches/server/0049-Don-t-lookup-fluid-state-when-raytracing.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Don't lookup fluid state when raytracing Just use the iblockdata already retrieved, removes a getType call. -diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index c4a83448ed4513f6e4ab179d1d43e5bb0cb13641..5c3eb4fc7e5aec2ad8d0050673fc8f4d2bff6a71 100644 ---- a/src/main/java/net/minecraft/server/IBlockAccess.java -+++ b/src/main/java/net/minecraft/server/IBlockAccess.java -@@ -55,7 +55,7 @@ public interface IBlockAccess { +diff --git a/src/main/java/net/minecraft/world/level/IBlockAccess.java b/src/main/java/net/minecraft/world/level/IBlockAccess.java +index 21ce19b9caf3150535a3f84027242a93bdd0d263..2e8eea3e8f7973c866a28d15325ed8822c2149ca 100644 +--- a/src/main/java/net/minecraft/world/level/IBlockAccess.java ++++ b/src/main/java/net/minecraft/world/level/IBlockAccess.java +@@ -67,7 +67,7 @@ public interface IBlockAccess { return MovingObjectPositionBlock.a(raytrace1.a(), EnumDirection.a(vec3d.x, vec3d.y, vec3d.z), new BlockPosition(raytrace1.a())); } // Paper end diff --git a/patches/Tuinity/patches/server/0050-Reduce-pathfinder-branches.patch b/patches/Tuinity/patches/server/0050-Reduce-pathfinder-branches.patch index 21faa4e8..d711e7e2 100644 --- a/patches/Tuinity/patches/server/0050-Reduce-pathfinder-branches.patch +++ b/patches/Tuinity/patches/server/0050-Reduce-pathfinder-branches.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Reduce pathfinder branches Reduce static path type detection to simple lazy-init fields -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 85f60b56b5689b77ba3d9e99e29b4f734df5d91e..2760b377d1f68ac5f66e7274317379e2dda8288a 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -309,7 +309,9 @@ public abstract class BlockBase { +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index 19936d615c14c4cb4eeddfaaf8438765f6c0b8b3..a96069c86ef5f5af4820436dd1f24e297bcca73f 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -361,7 +361,9 @@ public abstract class BlockBase { private final BlockBase.e o; private final BlockBase.e p; @Nullable - protected BlockBase.BlockData.Cache a; -+ protected BlockBase.BlockData.Cache a; protected final BlockBase.BlockData.Cache getShapeCache() { return this.a; } // Tuinity - OBFHELPER -+ public PathType staticPathType; // Tuinity - cache static path types -+ public PathType neighbourOverridePathType; // Tuinity - cache static path types ++ protected BlockBase.BlockData.Cache a; public final BlockBase.BlockData.Cache getShapeCache() { return this.a; } // Tuinity - OBFHELPER ++ public net.minecraft.world.level.pathfinder.PathType staticPathType; // Tuinity - cache static path types ++ public net.minecraft.world.level.pathfinder.PathType neighbourOverridePathType; // Tuinity - cache static path types protected BlockData(Block block, ImmutableMap, Comparable> immutablemap, MapCodec mapcodec) { super(block, immutablemap, mapcodec); -@@ -357,6 +359,8 @@ public abstract class BlockBase { +@@ -409,6 +411,8 @@ public abstract class BlockBase { this.a = new BlockBase.BlockData.Cache(this.p()); } this.shapeExceedsCube = this.a == null || this.a.c; // Tuinity - moved from actual method to here @@ -29,10 +29,10 @@ index 85f60b56b5689b77ba3d9e99e29b4f734df5d91e..2760b377d1f68ac5f66e7274317379e2 } -diff --git a/src/main/java/net/minecraft/server/PathType.java b/src/main/java/net/minecraft/server/PathType.java -index fb37f5b500c52f915b4536e5ec35552b75056046..52a2d3db7da3596bfdd6fd51147cc93bbe6c7ed0 100644 ---- a/src/main/java/net/minecraft/server/PathType.java -+++ b/src/main/java/net/minecraft/server/PathType.java +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathType.java b/src/main/java/net/minecraft/world/level/pathfinder/PathType.java +index fd20802155097d4951cbe273f64de4809dee5c96..a07612f68f08aaaf75c3c656b6f90886b587d7ee 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/PathType.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathType.java @@ -4,6 +4,8 @@ public enum PathType { BLOCKED(-1.0F), OPEN(0.0F), WALKABLE(0.0F), WALKABLE_DOOR(0.0F), TRAPDOOR(0.0F), FENCE(-1.0F), LAVA(-1.0F), WATER(8.0F), WATER_BORDER(8.0F), RAIL(0.0F), UNPASSABLE_RAIL(-1.0F), DANGER_FIRE(8.0F), DAMAGE_FIRE(16.0F), DANGER_CACTUS(8.0F), DAMAGE_CACTUS(-1.0F), DANGER_OTHER(8.0F), DAMAGE_OTHER(-1.0F), DOOR_OPEN(0.0F), DOOR_WOOD_CLOSED(-1.0F), DOOR_IRON_CLOSED(-1.0F), BREACH(4.0F), LEAVES(-1.0F), STICKY_HONEY(8.0F), COCOA(0.0F); @@ -42,11 +42,11 @@ index fb37f5b500c52f915b4536e5ec35552b75056046..52a2d3db7da3596bfdd6fd51147cc93b private final float y; private PathType(float f) { -diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 74e81e1e4aea6f74b14a84231ddeb7f2fb845ae7..33804e68931e8b4145b896eedeab79bde78779f2 100644 ---- a/src/main/java/net/minecraft/server/PathfinderNormal.java -+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java -@@ -421,6 +421,12 @@ public class PathfinderNormal extends PathfinderAbstract { +diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java +index a0c7d3ab747ba1a3cf07e716f3591663a8a9e14b..7b92a54cfb64fb77af99e6bf66eacbdb9e769dc1 100644 +--- a/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java ++++ b/src/main/java/net/minecraft/world/level/pathfinder/PathfinderNormal.java +@@ -444,6 +444,12 @@ public class PathfinderNormal extends PathfinderAbstract { if (pathtype == PathType.OPEN && j >= 1) { PathType pathtype1 = b(iblockaccess, blockposition_mutableblockposition.d(i, j - 1, k)); @@ -59,7 +59,7 @@ index 74e81e1e4aea6f74b14a84231ddeb7f2fb845ae7..33804e68931e8b4145b896eedeab79bd pathtype = pathtype1 != PathType.WALKABLE && pathtype1 != PathType.OPEN && pathtype1 != PathType.WATER && pathtype1 != PathType.LAVA ? PathType.WALKABLE : PathType.OPEN; if (pathtype1 == PathType.DAMAGE_FIRE) { pathtype = PathType.DAMAGE_FIRE; -@@ -437,6 +443,7 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -460,6 +466,7 @@ public class PathfinderNormal extends PathfinderAbstract { if (pathtype1 == PathType.STICKY_HONEY) { pathtype = PathType.STICKY_HONEY; } @@ -67,7 +67,7 @@ index 74e81e1e4aea6f74b14a84231ddeb7f2fb845ae7..33804e68931e8b4145b896eedeab79bd } if (pathtype == PathType.WALKABLE) { -@@ -462,22 +469,29 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -485,22 +492,29 @@ public class PathfinderNormal extends PathfinderAbstract { pathtype = PathType.BLOCKED; } else { // Paper end @@ -102,7 +102,7 @@ index 74e81e1e4aea6f74b14a84231ddeb7f2fb845ae7..33804e68931e8b4145b896eedeab79bd } // Paper } } -@@ -490,6 +504,20 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -513,6 +527,20 @@ public class PathfinderNormal extends PathfinderAbstract { protected static PathType b(IBlockAccess iblockaccess, BlockPosition blockposition) { IBlockData iblockdata = iblockaccess.getTypeIfLoaded(blockposition); // Paper if (iblockdata == null) return PathType.BLOCKED; // Paper diff --git a/patches/Tuinity/patches/server/0051-Add-Velocity-natives-for-encryption-and-compression.patch b/patches/Tuinity/patches/server/0051-Add-Velocity-natives-for-encryption-and-compression.patch index 2ddd9aa3..e68149ef 100644 --- a/patches/Tuinity/patches/server/0051-Add-Velocity-natives-for-encryption-and-compression.patch +++ b/patches/Tuinity/patches/server/0051-Add-Velocity-natives-for-encryption-and-compression.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Velocity natives for encryption and compression This patch is licensed under the MIT license. See /licenses/MIT.md. diff --git a/pom.xml b/pom.xml -index 650c6b91440d4ce1c5f82517a00056673750e74e..ddb06df414408461e2ad270e4849514cc7d3ec78 100644 +index 5d5cf802e6b6a0d90bf8326e7761c6d358b63b3f..2daa3e4ede5e941f6c4c1499144e7b04830517d1 100644 --- a/pom.xml +++ b/pom.xml @@ -149,6 +149,13 @@ @@ -22,25 +22,12 @@ index 650c6b91440d4ce1c5f82517a00056673750e74e..ddb06df414408461e2ad270e4849514c + - -diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 6be12b7ae8501c22a7c544638c44fc6faedd5b07..2b4ac8d1f3218e89b73fb9e1d3eed8cb8bf7334d 100644 ---- a/src/main/java/net/minecraft/server/LoginListener.java -+++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -235,7 +235,7 @@ public class LoginListener implements PacketLoginInListener { - - s = (new BigInteger(MinecraftEncryption.a("", this.server.getKeyPair().getPublic(), this.loginKey))).toString(16); - this.g = LoginListener.EnumProtocolState.AUTHENTICATING; -- this.networkManager.a(cipher, cipher1); -+ this.networkManager.a(this.loginKey); // Tuinity - } catch (CryptographyException cryptographyexception) { - throw new IllegalStateException("Protocol error", cryptographyexception); - } -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index f9aa04f2980aa5e952d64ae8c9f3629f7e76e2a0..d63a547bb1ce8e7eb9298127d3ff662f2e1191b7 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -549,10 +549,16 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index 2abf64fda6e504a89b2e443af48894023d446cef..69bfe8d0a9cf745557c3e06141dec1ed3bb7d567 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -568,10 +568,16 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return this.channel instanceof LocalChannel || this.channel instanceof LocalServerChannel; } @@ -60,10 +47,10 @@ index f9aa04f2980aa5e952d64ae8c9f3629f7e76e2a0..d63a547bb1ce8e7eb9298127d3ff662f } public boolean isConnected() { -diff --git a/src/main/java/net/minecraft/server/PacketCompressor.java b/src/main/java/net/minecraft/server/PacketCompressor.java -index 3cdd07cad85ef2d2c4b6c27a55a878695b4a7b12..50b2a8dfbdd0fe60e295d7c7214d7c99bcbeb19a 100644 ---- a/src/main/java/net/minecraft/server/PacketCompressor.java -+++ b/src/main/java/net/minecraft/server/PacketCompressor.java +diff --git a/src/main/java/net/minecraft/network/PacketCompressor.java b/src/main/java/net/minecraft/network/PacketCompressor.java +index 45b9d3d3c84d11e7f27f699506a1036dff9fdc53..43ea54479ba70a5c3f4a0f8e4e5a0d03e93162c1 100644 +--- a/src/main/java/net/minecraft/network/PacketCompressor.java ++++ b/src/main/java/net/minecraft/network/PacketCompressor.java @@ -7,14 +7,18 @@ import java.util.zip.Deflater; public class PacketCompressor extends MessageToByteEncoder { @@ -146,10 +133,10 @@ index 3cdd07cad85ef2d2c4b6c27a55a878695b4a7b12..50b2a8dfbdd0fe60e295d7c7214d7c99 public void a(int i) { this.c = i; } -diff --git a/src/main/java/net/minecraft/server/PacketDecompressor.java b/src/main/java/net/minecraft/server/PacketDecompressor.java -index 23c850be0155c1ece807d244117a196488f0a13b..4bab19a52b400071e69b06b940ab6432dfe59a1b 100644 ---- a/src/main/java/net/minecraft/server/PacketDecompressor.java -+++ b/src/main/java/net/minecraft/server/PacketDecompressor.java +diff --git a/src/main/java/net/minecraft/network/PacketDecompressor.java b/src/main/java/net/minecraft/network/PacketDecompressor.java +index 1932ca55dad37ca773f215eaec23164533d509d3..ce7d7b4e8c1e5de935c83d7db5186ad8a0849e60 100644 +--- a/src/main/java/net/minecraft/network/PacketDecompressor.java ++++ b/src/main/java/net/minecraft/network/PacketDecompressor.java @@ -10,13 +10,17 @@ import java.util.zip.Inflater; public class PacketDecompressor extends ByteToMessageDecoder { @@ -221,10 +208,10 @@ index 23c850be0155c1ece807d244117a196488f0a13b..4bab19a52b400071e69b06b940ab6432 public void a(int i) { this.b = i; } -diff --git a/src/main/java/net/minecraft/server/PacketDecrypter.java b/src/main/java/net/minecraft/server/PacketDecrypter.java -index c85f291c5b22a8e85c7556b220cba698701748f2..771cc0f4fa98be294abba65c83442205b6b0ef0b 100644 ---- a/src/main/java/net/minecraft/server/PacketDecrypter.java -+++ b/src/main/java/net/minecraft/server/PacketDecrypter.java +diff --git a/src/main/java/net/minecraft/network/PacketDecrypter.java b/src/main/java/net/minecraft/network/PacketDecrypter.java +index c8aa02b288d67efe1f9e20e038248a4f032f92dd..4bd7c7db965818054929c9222a0968f6d127cc5c 100644 +--- a/src/main/java/net/minecraft/network/PacketDecrypter.java ++++ b/src/main/java/net/minecraft/network/PacketDecrypter.java @@ -8,13 +8,24 @@ import javax.crypto.Cipher; public class PacketDecrypter extends MessageToMessageDecoder { @@ -254,10 +241,10 @@ index c85f291c5b22a8e85c7556b220cba698701748f2..771cc0f4fa98be294abba65c83442205 } + // Tuinity end } -diff --git a/src/main/java/net/minecraft/server/PacketEncrypter.java b/src/main/java/net/minecraft/server/PacketEncrypter.java -index e35369476839e9622520af1027d7478aa6d1b037..aba14794cc4cb114fea17bb92816ac29a64b44f8 100644 ---- a/src/main/java/net/minecraft/server/PacketEncrypter.java -+++ b/src/main/java/net/minecraft/server/PacketEncrypter.java +diff --git a/src/main/java/net/minecraft/network/PacketEncrypter.java b/src/main/java/net/minecraft/network/PacketEncrypter.java +index 5759f91d5e9dc52b16c8955b8d318da2b53c7af4..0960f415fd3c6c764cf3dd273bb9e9c59d80ab31 100644 +--- a/src/main/java/net/minecraft/network/PacketEncrypter.java ++++ b/src/main/java/net/minecraft/network/PacketEncrypter.java @@ -5,15 +5,38 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; import javax.crypto.Cipher; @@ -303,11 +290,24 @@ index e35369476839e9622520af1027d7478aa6d1b037..aba14794cc4cb114fea17bb92816ac29 } } +// Tuinity end -diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 5f4dacf9c93c2495a07df2647fe0411f796da6af..0668d383db1f3a81d1053954d72678c7ac5aecec 100644 ---- a/src/main/java/net/minecraft/server/ServerConnection.java -+++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -74,6 +74,11 @@ public class ServerConnection { +diff --git a/src/main/java/net/minecraft/server/network/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java +index 185667110cd6f566b23546728d20fc79223f3c92..dc98ef48a664d9ee2a302fff8c611fd16dc704b6 100644 +--- a/src/main/java/net/minecraft/server/network/LoginListener.java ++++ b/src/main/java/net/minecraft/server/network/LoginListener.java +@@ -255,7 +255,7 @@ public class LoginListener implements PacketLoginInListener { + + s = (new BigInteger(MinecraftEncryption.a("", this.server.getKeyPair().getPublic(), this.loginKey))).toString(16); + this.g = LoginListener.EnumProtocolState.AUTHENTICATING; +- this.networkManager.a(cipher, cipher1); ++ this.networkManager.a(this.loginKey); // Tuinity + } catch (CryptographyException cryptographyexception) { + throw new IllegalStateException("Protocol error", cryptographyexception); + } +diff --git a/src/main/java/net/minecraft/server/network/ServerConnection.java b/src/main/java/net/minecraft/server/network/ServerConnection.java +index dc362724ea0cc1b2f9d9ceffff483217b4356c40..70fde7bad2e0a6d7432d8509fdb7c46d9f020d4c 100644 +--- a/src/main/java/net/minecraft/server/network/ServerConnection.java ++++ b/src/main/java/net/minecraft/server/network/ServerConnection.java +@@ -87,6 +87,11 @@ public class ServerConnection { ServerConnection.LOGGER.info("Using default channel type"); } diff --git a/patches/Tuinity/patches/server/0052-Optimise-non-flush-packet-sending.patch b/patches/Tuinity/patches/server/0052-Optimise-non-flush-packet-sending.patch index ecb7ebf0..a1694489 100644 --- a/patches/Tuinity/patches/server/0052-Optimise-non-flush-packet-sending.patch +++ b/patches/Tuinity/patches/server/0052-Optimise-non-flush-packet-sending.patch @@ -20,7 +20,7 @@ up on this optimisation before he came along. Locally this patch drops the entity tracker tick by a full 1.5x. diff --git a/pom.xml b/pom.xml -index ddb06df414408461e2ad270e4849514cc7d3ec78..e83e4241a56fe131a75fe21cc1518992c089da2c 100644 +index 2daa3e4ede5e941f6c4c1499144e7b04830517d1..dad9981b1cd1ca8b27a45972188fd2b92f5146e7 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,13 @@ @@ -50,11 +50,11 @@ index ddb06df414408461e2ad270e4849514cc7d3ec78..e83e4241a56fe131a75fe21cc1518992 com.googlecode.json-simple -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index d63a547bb1ce8e7eb9298127d3ff662f2e1191b7..65de374d485f31f8cd6f4e03941173565074ea0e 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -27,6 +27,8 @@ import org.apache.logging.log4j.Logger; +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index 69bfe8d0a9cf745557c3e06141dec1ed3bb7d567..02ad0611836160a1d0ba6b26476e6bd336d55681 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -45,6 +45,8 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; @@ -63,7 +63,7 @@ index d63a547bb1ce8e7eb9298127d3ff662f2e1191b7..65de374d485f31f8cd6f4e0394117356 public class NetworkManager extends SimpleChannelInboundHandler> { private static final Logger LOGGER = LogManager.getLogger(); -@@ -386,39 +388,83 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -405,39 +407,83 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } // Paper end } else { diff --git a/patches/Tuinity/patches/server/0053-Do-not-retain-playerchunkmap-instance-in-light-threa.patch b/patches/Tuinity/patches/server/0053-Do-not-retain-playerchunkmap-instance-in-light-threa.patch index 34162d3f..9ae212e3 100644 --- a/patches/Tuinity/patches/server/0053-Do-not-retain-playerchunkmap-instance-in-light-threa.patch +++ b/patches/Tuinity/patches/server/0053-Do-not-retain-playerchunkmap-instance-in-light-threa.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Do not retain playerchunkmap instance in light thread factory The executor returned is finalizable and of course that causes issues. -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index d04be5ae54ac543de144eb4ae87a255c467bc637..c7897e1a3655301d848313c26b244c325766253e 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -356,9 +356,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 7897fe870234ddef12926d855a3f060f9a72b2ba..82e28afc75d93c39d6b6517faf6430183cb675fb 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -410,9 +410,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.worldLoadListener = worldloadlistener; // Paper start - use light thread diff --git a/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch b/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch index 6a071718..6823ce8e 100644 --- a/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch +++ b/patches/Tuinity/patches/server/0054-Do-not-load-chunks-during-a-crash-report.patch @@ -9,7 +9,7 @@ crash reports. Fixes https://github.com/Spottedleaf/Tuinity/issues/215 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java b/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java -index 7511e38130f38703164395a670f12d1af648ff04..e602efcb3fad390bb6bff1055e782bba909d7694 100644 +index e50731723d266ba65b2163df2e935afb8b013a93..a6736d15282715d920bab85eb92074cd2b4f57d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftCrashReport.java @@ -37,7 +37,7 @@ public class CraftCrashReport implements CrashReportCallable { @@ -17,12 +17,12 @@ index 7511e38130f38703164395a670f12d1af648ff04..e602efcb3fad390bb6bff1055e782bba for (World world : Bukkit.getWorlds()) { value.append(' ').append(world.getName()).append(": {"); - for (Map.Entry> entry : world.getPluginChunkTickets().entrySet()) { -+ for (Map.Entry> entry : ((CraftWorld)world).getPluginChunkTicketsCoordinates().entrySet()) { // Tuinity - do not load chunks in crash reports ++ for (Map.Entry> entry : ((CraftWorld)world).getPluginChunkTicketsCoordinates().entrySet()) { // Tuinity - do not load chunks in crash reports value.append(' ').append(entry.getKey().getDescription().getFullName()).append(": ").append(Integer.toString(entry.getValue().size())).append(','); } value.append("},"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index eb90c0802e3ca344885ee14fd852e963a66f5f33..3e54e643d28ced3074c4b044bc8a2238de05ccc2 100644 +index 5f83ad77edfa2f7ddd58334a592864185f88e435..89e2ce2e20a9051336c784a48e3b4214379cd77b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -720,6 +720,30 @@ public class CraftWorld implements World { diff --git a/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch b/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch index f049b68e..b9403fdb 100644 --- a/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch +++ b/patches/Tuinity/patches/server/0055-Improve-abnormal-server-shutdown-process.patch @@ -10,24 +10,11 @@ step up the stop() spamming after 15s to really kill the main thread. gui. It looks like during sigint shutdown there can be some deadlock between the server thread and awt shutdown thread here. -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 617ba6fb85c55967360ca270ee8feeff5acbf8e0..2644b190813cc934914aeab78fbd6515d1a37c4a 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -360,7 +360,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - } - - if (this.q != null) { -- this.q.b(); -+ //this.q.b(); // Tuinity - do not wait for AWT, causes deadlock with sigint handler (AWT shutdown will properly clear our resources anyways) - } - - if (this.remoteControlListener != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e64c57fd46f3d5e7989f01f063887e81be0590df..afc22e545df03a38c801362d308d135df90361e2 100644 +index 6b6a90dc07ab126a21d011d1a831019ec1456834..e757cb5c2d50cb3a4dbe50d4726db09ab845fcbb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -756,10 +756,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { worldserver.chunkCheck(entity); entity.az = true; diff --git a/patches/Tuinity/patches/server/0057-Revert-MC-4-fix.patch b/patches/Tuinity/patches/server/0057-Revert-MC-4-fix.patch index 970a81bd..33d666a3 100644 --- a/patches/Tuinity/patches/server/0057-Revert-MC-4-fix.patch +++ b/patches/Tuinity/patches/server/0057-Revert-MC-4-fix.patch @@ -12,11 +12,11 @@ But this patch is going to cause problems on the order of 1.0e-4. I do not want to deal with clipping problems. The very fact it works shows it's causing the clipping to occur serverside. -diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 5dfb54e17fcfe6bd30e6b2a449944606e1a0ef17..9a8b7e06f14f17dfea08d7031c83f77491aaca65 100644 ---- a/src/main/java/net/minecraft/server/EntityItem.java -+++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -527,7 +527,7 @@ public class EntityItem extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +index 575833807ff647f30d7c2b7abcd01701c7dec85b..5dc3670f35b04d933e96c4b42aa9fbcf941e69c7 100644 +--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java ++++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +@@ -553,7 +553,7 @@ public class EntityItem extends Entity { // Paper start - fix MC-4 public void setPositionRaw(double x, double y, double z) { diff --git a/patches/Tuinity/patches/server/0058-Prevent-light-queue-overfill-when-no-players-are-onl.patch b/patches/Tuinity/patches/server/0058-Prevent-light-queue-overfill-when-no-players-are-onl.patch index 578e931e..3daf30ad 100644 --- a/patches/Tuinity/patches/server/0058-Prevent-light-queue-overfill-when-no-players-are-onl.patch +++ b/patches/Tuinity/patches/server/0058-Prevent-light-queue-overfill-when-no-players-are-onl.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Prevent light queue overfill when no players are online block changes don't queue light updates (and they shouldn't) -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index ce0bb4d228a73d8353d67828529879e1c99682f9..18270d44185b0ec41b9b6e1d2135e7aae3b33261 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1221,7 +1221,7 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index a2917fd52d9cde535ca3e6422b6742711584bb09..c1e1b3d53de18579dbe83e7c88d13d44c89fb2d8 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -1246,7 +1246,7 @@ public class ChunkProviderServer extends IChunkProvider { if (ChunkProviderServer.this.tickDistanceManager()) { return true; } else { @@ -18,11 +18,11 @@ index ce0bb4d228a73d8353d67828529879e1c99682f9..18270d44185b0ec41b9b6e1d2135e7aa return super.executeNext() || execChunkTask; // Paper } } finally { -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ac4b2d34824c00b655f9e5dbcc431b0ed8e4d765..d1832cd24667f62026f6f0b8d9d1cec8139aa057 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1164,7 +1164,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index a7f399994fac91a02e608ab0cae99c82a91e4ab4..6b5aa91ddc657443580f2cb82c5aff3ee0180fa6 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1277,7 +1277,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exit(); timings.chunkTicksBlocks.stopTiming(); // Paper diff --git a/patches/Tuinity/patches/server/0059-Don-t-allow-StructureLocateEvent-to-change-worlds.patch b/patches/Tuinity/patches/server/0059-Don-t-allow-StructureLocateEvent-to-change-worlds.patch index 26815c29..4411d55d 100644 --- a/patches/Tuinity/patches/server/0059-Don-t-allow-StructureLocateEvent-to-change-worlds.patch +++ b/patches/Tuinity/patches/server/0059-Don-t-allow-StructureLocateEvent-to-change-worlds.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Don't allow StructureLocateEvent to change worlds Callers and even the function itself aren't expecting this to happen -diff --git a/src/main/java/net/minecraft/server/ChunkGenerator.java b/src/main/java/net/minecraft/server/ChunkGenerator.java -index 097cb9896c525a605c50e83548f828e0c71ab3d5..17cf00dfe8b24adf2fb66eca4710ab7888a894e3 100644 ---- a/src/main/java/net/minecraft/server/ChunkGenerator.java -+++ b/src/main/java/net/minecraft/server/ChunkGenerator.java -@@ -135,7 +135,7 @@ public abstract class ChunkGenerator { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +index f2621f61cb372ec436fe81e7a93f1aef7d360f3f..316287af6e405ff224636255c2964f46003215ce 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +@@ -171,7 +171,7 @@ public abstract class ChunkGenerator { // Get origin location (re)defined by event call. blockposition = new BlockPosition(event.getOrigin().getBlockX(), event.getOrigin().getBlockY(), event.getOrigin().getBlockZ()); // Get world (re)defined by event call. diff --git a/patches/Tuinity/patches/server/0060-Properly-handle-cancellation-of-projectile-hit-event.patch b/patches/Tuinity/patches/server/0060-Properly-handle-cancellation-of-projectile-hit-event.patch index 2743c0b5..2ff8de06 100644 --- a/patches/Tuinity/patches/server/0060-Properly-handle-cancellation-of-projectile-hit-event.patch +++ b/patches/Tuinity/patches/server/0060-Properly-handle-cancellation-of-projectile-hit-event.patch @@ -6,26 +6,25 @@ Subject: [PATCH] Properly handle cancellation of projectile hit event Subclasses override and run logic. Some of this logic destroys the projectile as well, which wouldn't be fitting for cancellation. -diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 1e7f5957d879d1ba8cf2b29cf9397b8e204e4381..f983516b89cdf7ce7fdea8f5a5b1a29dd01ae597 100644 ---- a/src/main/java/net/minecraft/server/EntityArrow.java -+++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -173,8 +173,10 @@ public abstract class EntityArrow extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +index 2f8b3587f527620152609d5be342b328a7621e0f..01679d76405625223869f3fdcb29ffba49f7b69a 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +@@ -211,7 +211,9 @@ public abstract class EntityArrow extends IProjectile { // Paper end if (object != null && !flag) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, (MovingObjectPosition) object)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly this.a((MovingObjectPosition) object); - this.impulse = true; + } // Tuinity - implement cancellation properly + this.impulse = true; } - if (movingobjectpositionentity == null || this.getPierceLevel() <= 0) { -diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java -index 0840fdf3585407ec317f0326359619220c64db78..6b9b64539d2272070b523ed6b927de02d2b00af5 100644 ---- a/src/main/java/net/minecraft/server/EntityFireball.java -+++ b/src/main/java/net/minecraft/server/EntityFireball.java -@@ -67,7 +67,9 @@ public abstract class EntityFireball extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java +index b9680f6f2e30ec9397d6a9c83e79563d9253aff6..546de0ec2b624a781480ac95f65b2cbfbb5dcf2e 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireball.java +@@ -83,7 +83,9 @@ public abstract class EntityFireball extends IProjectile { // Paper end if (movingobjectposition != null && movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { // Paper - add null check in case cancelled @@ -35,26 +34,25 @@ index 0840fdf3585407ec317f0326359619220c64db78..6b9b64539d2272070b523ed6b927de02 // CraftBukkit start - Fire ProjectileHitEvent if (this.dead) { -diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 9bc4d3dbd4c64a6fbf33dcf28afde59ace9171ba..d8faa18724baa240fca78a35c362cf661615ec4d 100644 ---- a/src/main/java/net/minecraft/server/EntityFireworks.java -+++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -125,8 +125,10 @@ public class EntityFireworks extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java +index 9cc59439ae2c4e758c44b2a92b78bc328efdfa1b..f9a355c847d778a9aad1987882fc816af92450ba 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFireworks.java +@@ -149,7 +149,9 @@ public class EntityFireworks extends IProjectile { MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); if (!this.noclip) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly this.a(movingobjectposition); - this.impulse = true; + } // Tuinity - implement cancellation properly + this.impulse = true; } - this.x(); -diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 3580f40b2bb30bceca0ce374edb29608168a00c0..9841c7c27cd296a5156ba79ab734d45922bacaf7 100644 ---- a/src/main/java/net/minecraft/server/EntityFishingHook.java -+++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -227,7 +227,9 @@ public class EntityFishingHook extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java +index addea9c1309a308b76c93ee71e839c915bc773e8..dc6d279766ccc83a8f450028a09491b1c88f524c 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityFishingHook.java +@@ -265,7 +265,9 @@ public class EntityFishingHook extends IProjectile { private void m() { MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); @@ -64,11 +62,11 @@ index 3580f40b2bb30bceca0ce374edb29608168a00c0..9841c7c27cd296a5156ba79ab734d459 } @Override -diff --git a/src/main/java/net/minecraft/server/EntityLlamaSpit.java b/src/main/java/net/minecraft/server/EntityLlamaSpit.java -index 7636a51a7ef0aa05b5b2aaa9d17e7b551dedac96..480a02a8f6ec7110f9af8f2037fdc09a7a54ef01 100644 ---- a/src/main/java/net/minecraft/server/EntityLlamaSpit.java -+++ b/src/main/java/net/minecraft/server/EntityLlamaSpit.java -@@ -19,7 +19,9 @@ public class EntityLlamaSpit extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java b/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java +index 39b34e619cf7ac3ad308f98551c796ac47073484..8aef834a6e8fcf5d44986745affb8f27bc3dfd6b 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityLlamaSpit.java +@@ -34,7 +34,9 @@ public class EntityLlamaSpit extends IProjectile { MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); if (movingobjectposition != null) { @@ -78,11 +76,11 @@ index 7636a51a7ef0aa05b5b2aaa9d17e7b551dedac96..480a02a8f6ec7110f9af8f2037fdc09a } double d0 = this.locX() + vec3d.x; -diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 53a8ea7d1eff84abe6c49464d556aa2788a6abcb..d85a19905efab7189e461a61becb6ca2b8c50803 100644 ---- a/src/main/java/net/minecraft/server/EntityProjectile.java -+++ b/src/main/java/net/minecraft/server/EntityProjectile.java -@@ -48,7 +48,7 @@ public abstract class EntityProjectile extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +index 3b379e83b79bd9b46dbdd4a48ac3842abc4dfbb8..e55061b6c04b4bde92404a6ef58ba9a52cd99c1d 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityProjectile.java +@@ -65,7 +65,7 @@ public abstract class EntityProjectile extends IProjectile { movingobjectposition = null; } } @@ -91,11 +89,11 @@ index 53a8ea7d1eff84abe6c49464d556aa2788a6abcb..d85a19905efab7189e461a61becb6ca2 // Paper end this.a(movingobjectposition); } // Paper -diff --git a/src/main/java/net/minecraft/server/EntityShulkerBullet.java b/src/main/java/net/minecraft/server/EntityShulkerBullet.java -index 23017b5486530bcf76b3934cfa8621e8b4772b27..a4d94385ede0303417d676155c2c0b226681cc59 100644 ---- a/src/main/java/net/minecraft/server/EntityShulkerBullet.java -+++ b/src/main/java/net/minecraft/server/EntityShulkerBullet.java -@@ -206,7 +206,7 @@ public class EntityShulkerBullet extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java b/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java +index c3dcebad0706386e52ef2d28f2074cb6aed9f9e4..1ae528ccd09a6536b3aac320e6218f03c274d6a9 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityShulkerBullet.java +@@ -230,7 +230,7 @@ public class EntityShulkerBullet extends IProjectile { MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); @@ -104,11 +102,11 @@ index 23017b5486530bcf76b3934cfa8621e8b4772b27..a4d94385ede0303417d676155c2c0b22 this.a(movingobjectposition); } } -diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index bbc089b41fcbe0141f13591db2cb44b9e688cac4..dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1 100644 ---- a/src/main/java/net/minecraft/server/IProjectile.java -+++ b/src/main/java/net/minecraft/server/IProjectile.java -@@ -118,7 +118,7 @@ public abstract class IProjectile extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +index 9f2e7d345d98f50e6d47cbf4bb35714852fa42da..2e2e4ee98619cfbeaecffa1ebae78ccc1d7666ca 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java +@@ -130,7 +130,7 @@ public abstract class IProjectile extends Entity { } protected void a(MovingObjectPosition movingobjectposition) { diff --git a/patches/Tuinity/patches/server/0061-Rewrite-the-light-engine.patch b/patches/Tuinity/patches/server/0061-Rewrite-the-light-engine.patch index db7a792d..2708921e 100644 --- a/patches/Tuinity/patches/server/0061-Rewrite-the-light-engine.patch +++ b/patches/Tuinity/patches/server/0061-Rewrite-the-light-engine.patch @@ -37,7 +37,7 @@ by 2x. According to cpu time, the light engine itself spent 10x less time lighting chunks for generation. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 2f2701b9f0aa1a26a3e3eb7a14eac370f509ce1e..9d2ef2639f7a04aaf960be70384df24d8b4daf09 100644 +index 12313a37ceeb6a0b6a539c38fdba67e5e43d7413..848eb25ed0640db61a0f28bc26ddabd0444e9ed4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -219,6 +219,44 @@ public class PaperCommand extends Command { @@ -52,8 +52,8 @@ index 2f2701b9f0aa1a26a3e3eb7a14eac370f509ce1e..9d2ef2639f7a04aaf960be70384df24d + for (java.util.Iterator iterator = chunks.iterator(); iterator.hasNext();) { + final ChunkCoordIntPair chunkPos = iterator.next(); + -+ final net.minecraft.server.IChunkAccess chunk = world.getChunkProvider().getChunkAtImmediately(chunkPos.x, chunkPos.z); -+ if (chunk == null || !chunk.isLit() || !chunk.getChunkStatus().isAtLeastStatus(net.minecraft.server.ChunkStatus.LIGHT)) { ++ final net.minecraft.world.level.chunk.IChunkAccess chunk = world.getChunkProvider().getChunkAtImmediately(chunkPos.x, chunkPos.z); ++ if (chunk == null || !chunk.isLit() || !chunk.getChunkStatus().isAtLeastStatus(net.minecraft.world.level.chunk.ChunkStatus.LIGHT)) { + // cannot relight this chunk + iterator.remove(); + continue; @@ -90,12 +90,12 @@ index 2f2701b9f0aa1a26a3e3eb7a14eac370f509ce1e..9d2ef2639f7a04aaf960be70384df24d if (args.length > 1) { try { - radius = Math.min(5, Integer.parseInt(args[1])); -+ radius = Math.min(15, Integer.parseInt(args[1])); // Tuinity - MOOOOOORE ++ radius = Math.min(32, Integer.parseInt(args[1])); // Tuinity - MOOOOOORE } catch (Exception e) { sender.sendMessage("Not a number"); return; @@ -240,6 +278,13 @@ public class PaperCommand extends Command { - net.minecraft.server.WorldServer world = (WorldServer) handle.world; + WorldServer world = (WorldServer) handle.world; LightEngineThreaded lightengine = world.getChunkProvider().getLightEngine(); + // Tuinity start - rewrite light engine @@ -110,25 +110,25 @@ index 2f2701b9f0aa1a26a3e3eb7a14eac370f509ce1e..9d2ef2639f7a04aaf960be70384df24d updateLight(sender, world, lightengine, queue); 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..43de95779a5472aaf04da11c9f4c5feb7253c6c3 +index 0000000000000000000000000000000000000000..2b939fabcc4cc45d697bfa2f3cda7fc64a4de8ca --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java @@ -0,0 +1,277 @@ +package com.tuinity.tuinity.chunk.light; + -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Chunk; -+import net.minecraft.server.ChunkSection; -+import net.minecraft.server.ChunkStatus; -+import net.minecraft.server.DataPaletteBlock; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.IChunkAccess; -+import net.minecraft.server.ILightAccess; -+import net.minecraft.server.ProtoChunkExtension; -+import net.minecraft.server.VoxelShape; -+import net.minecraft.server.VoxelShapes; -+import net.minecraft.server.World; -+import net.minecraft.server.WorldServer; ++import net.minecraft.core.BlockPosition; ++import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.level.chunk.Chunk; ++import net.minecraft.world.level.chunk.ChunkSection; ++import net.minecraft.world.level.chunk.ChunkStatus; ++import net.minecraft.world.level.chunk.DataPaletteBlock; ++import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.chunk.IChunkAccess; ++import net.minecraft.world.level.chunk.ILightAccess; ++import net.minecraft.world.level.chunk.ProtoChunkExtension; ++import net.minecraft.world.phys.shapes.VoxelShape; ++import net.minecraft.world.phys.shapes.VoxelShapes; ++import net.minecraft.world.level.World; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; @@ -393,13 +393,13 @@ index 0000000000000000000000000000000000000000..43de95779a5472aaf04da11c9f4c5feb +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/SWMRNibbleArray.java b/src/main/java/com/tuinity/tuinity/chunk/light/SWMRNibbleArray.java new file mode 100644 -index 0000000000000000000000000000000000000000..051e2db5349b6f20887841efad7fbc183b190f68 +index 0000000000000000000000000000000000000000..81963ada0eafea91947f4437b22bcad47e4709ed --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/SWMRNibbleArray.java @@ -0,0 +1,325 @@ +package com.tuinity.tuinity.chunk.light; + -+import net.minecraft.server.NibbleArray; ++import net.minecraft.world.level.chunk.NibbleArray; +import java.util.ArrayDeque; +import java.util.Arrays; + @@ -724,7 +724,7 @@ index 0000000000000000000000000000000000000000..051e2db5349b6f20887841efad7fbc18 +} 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..26534e05ff5aac5a963906ba678411c843b132e3 +index 0000000000000000000000000000000000000000..86a880d0f13f0fee70b09626c394c9e25551e672 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/SkyStarLightEngine.java @@ -0,0 +1,706 @@ @@ -733,17 +733,17 @@ index 0000000000000000000000000000000000000000..26534e05ff5aac5a963906ba678411c8 +import com.tuinity.tuinity.util.WorldUtil; +import it.unimi.dsi.fastutil.shorts.ShortCollection; +import it.unimi.dsi.fastutil.shorts.ShortIterator; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.ChunkSection; -+import net.minecraft.server.ChunkStatus; -+import net.minecraft.server.IBlockAccess; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.IChunkAccess; -+import net.minecraft.server.ILightAccess; -+import net.minecraft.server.VoxelShape; -+import net.minecraft.server.VoxelShapes; -+import net.minecraft.server.World; ++import net.minecraft.core.BlockPosition; ++import net.minecraft.world.level.ChunkCoordIntPair; ++import net.minecraft.world.level.chunk.ChunkSection; ++import net.minecraft.world.level.chunk.ChunkStatus; ++import net.minecraft.world.level.IBlockAccess; ++import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.chunk.IChunkAccess; ++import net.minecraft.world.level.chunk.ILightAccess; ++import net.minecraft.world.phys.shapes.VoxelShape; ++import net.minecraft.world.phys.shapes.VoxelShapes; ++import net.minecraft.world.level.World; +import java.util.Arrays; +import java.util.Set; + @@ -1436,7 +1436,7 @@ index 0000000000000000000000000000000000000000..26534e05ff5aac5a963906ba678411c8 +} 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..433c27813bbcddea09b21f7629a0bbce7a658082 +index 0000000000000000000000000000000000000000..e40cf190c945754bd8b5342f76cd7fe2efd127cb --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightEngine.java @@ -0,0 +1,1615 @@ @@ -1448,21 +1448,21 @@ index 0000000000000000000000000000000000000000..433c27813bbcddea09b21f7629a0bbce +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.shorts.ShortCollection; +import it.unimi.dsi.fastutil.shorts.ShortIterator; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Blocks; -+import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.ChunkSection; -+import net.minecraft.server.EnumDirection; -+import net.minecraft.server.EnumSkyBlock; -+import net.minecraft.server.IBlockAccess; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.IChunkAccess; -+import net.minecraft.server.ILightAccess; -+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 net.minecraft.core.BlockPosition; ++import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.level.ChunkCoordIntPair; ++import net.minecraft.world.level.block.Blocks; ++import net.minecraft.world.level.chunk.ChunkSection; ++import net.minecraft.core.EnumDirection; ++import net.minecraft.world.level.EnumSkyBlock; ++import net.minecraft.world.level.IBlockAccess; ++import net.minecraft.world.level.block.state.IBlockData; ++import net.minecraft.world.level.chunk.IChunkAccess; ++import net.minecraft.world.level.chunk.ILightAccess; ++import net.minecraft.core.SectionPosition; ++import net.minecraft.world.phys.shapes.VoxelShape; ++import net.minecraft.world.phys.shapes.VoxelShapes; ++import net.minecraft.world.level.World; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; @@ -3057,7 +3057,7 @@ index 0000000000000000000000000000000000000000..433c27813bbcddea09b21f7629a0bbce +} 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..0fddb331bfcee762da38efea3a36dc6394718519 +index 0000000000000000000000000000000000000000..df686b97460796004cad1477760647a98741d751 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightInterface.java @@ -0,0 +1,490 @@ @@ -3068,15 +3068,15 @@ index 0000000000000000000000000000000000000000..0fddb331bfcee762da38efea3a36dc63 +import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.shorts.ShortCollection; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.ChunkStatus; -+import net.minecraft.server.IChunkAccess; -+import net.minecraft.server.ILightAccess; -+import net.minecraft.server.LightEngineLayerEventListener; -+import net.minecraft.server.NibbleArray; -+import net.minecraft.server.SectionPosition; -+import net.minecraft.server.WorldServer; ++import net.minecraft.core.BlockPosition; ++import net.minecraft.server.level.WorldServer; ++import net.minecraft.world.level.ChunkCoordIntPair; ++import net.minecraft.world.level.chunk.ChunkStatus; ++import net.minecraft.world.level.chunk.IChunkAccess; ++import net.minecraft.world.level.chunk.ILightAccess; ++import net.minecraft.world.level.lighting.LightEngineLayerEventListener; ++import net.minecraft.world.level.chunk.NibbleArray; ++import net.minecraft.core.SectionPosition; +import java.util.ArrayDeque; +import java.util.HashSet; +import java.util.Iterator; @@ -3553,13 +3553,13 @@ index 0000000000000000000000000000000000000000..0fddb331bfcee762da38efea3a36dc63 +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java new file mode 100644 -index 0000000000000000000000000000000000000000..b8a6c59ee3c919e47e4be76fc4e1737d81a5810b +index 0000000000000000000000000000000000000000..b8df658c09a6dc739ff3f4d6e18c9cef7caea6c9 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandler.java @@ -0,0 +1,30 @@ +package com.tuinity.tuinity.chunk.light; + -+import net.minecraft.server.BlockPosition; ++import net.minecraft.core.BlockPosition; +import java.util.Collection; + +/** @@ -3589,7 +3589,7 @@ index 0000000000000000000000000000000000000000..b8a6c59ee3c919e47e4be76fc4e1737d +} diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandlerImpl.java b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandlerImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..125f59826a9b0174039139ed0715a4ed3df3724b +index 0000000000000000000000000000000000000000..0e4442a94559346b19a536d35ce5def612074838 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/VariableBlockLightHandlerImpl.java @@ -0,0 +1,112 @@ @@ -3598,7 +3598,7 @@ index 0000000000000000000000000000000000000000..125f59826a9b0174039139ed0715a4ed +import com.tuinity.tuinity.util.CoordinateUtils; +import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -+import net.minecraft.server.BlockPosition; ++import net.minecraft.core.BlockPosition; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; @@ -3706,10 +3706,10 @@ index 0000000000000000000000000000000000000000..125f59826a9b0174039139ed0715a4ed + } +} diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index 03a59aabc2a35daf7eee899967b569a8ac3b632e..ceeb515f4528551659598d9999917f8596e3eded 100644 +index 373b36fa36f98f64bb9ffa0dfaecefa3626729f4..1fb7a0e44cdbf563a7858003806a57a5cbda445b 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -@@ -223,6 +223,12 @@ public final class TuinityConfig { +@@ -232,6 +232,12 @@ public final class TuinityConfig { } } @@ -3724,17 +3724,17 @@ index 03a59aabc2a35daf7eee899967b569a8ac3b632e..ceeb515f4528551659598d9999917f85 public final String worldName; 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..81fe01c122529f1716a264263957500015476f5f +index 0000000000000000000000000000000000000000..17cece8ee25ad6145bc0bdf7d15c2ea988c85f87 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/util/CoordinateUtils.java @@ -0,0 +1,128 @@ +package com.tuinity.tuinity.util; + -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.Entity; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.SectionPosition; ++import net.minecraft.core.BlockPosition; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.util.MathHelper; ++import net.minecraft.core.SectionPosition; ++import net.minecraft.world.level.ChunkCoordIntPair; + +public final class CoordinateUtils { + @@ -4090,13 +4090,13 @@ index 0000000000000000000000000000000000000000..695444a510e616180734f5fd284f1a00 +} 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 +index 0000000000000000000000000000000000000000..6dca98c5c43126c7b2dea2987b757e3de822c17c --- /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; ++import net.minecraft.world.level.World; + +public final class WorldUtil { + @@ -4142,318 +4142,125 @@ index 0000000000000000000000000000000000000000..141748fe4915eb46671f1d532951f14d + } + +} -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 2760b377d1f68ac5f66e7274317379e2dda8288a..829d4a7508e1656dbdc912096b7eafcf30cbb5b2 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -330,6 +330,7 @@ public abstract class BlockBase { - this.n = blockbase_info.s; - this.o = blockbase_info.t; - this.p = blockbase_info.u; -+ this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Tuinity - } - // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time - private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; -@@ -352,6 +353,19 @@ public abstract class BlockBase { - } - // Tuinity end - -+ // Tuinity start -+ protected int opacityIfCached = -1; -+ // ret -1 if opacity is dynamic, or -1 if the block is conditionally full opaque, else return opacity in [0, 15] -+ public final int getOpacityIfCached() { -+ return this.opacityIfCached; -+ } -+ -+ protected final boolean conditionallyFullOpaque; -+ public final boolean isConditionallyFullOpaque() { -+ return this.conditionallyFullOpaque; -+ } -+ // Tuinity end -+ - public void a() { - this.fluid = this.getBlock().d(this.p()); // Paper - moved from getFluid() - this.isTicking = this.getBlock().isTicking(this.p()); // Paper - moved from isTicking() -@@ -361,6 +375,33 @@ public abstract class BlockBase { - this.shapeExceedsCube = this.a == null || this.a.c; // Tuinity - moved from actual method to here - this.staticPathType = null; // Tuinity - cache static path type - this.neighbourOverridePathType = null; // Tuinity - cache static path types -+ this.opacityIfCached = this.a == null || this.isConditionallyFullOpaque() ? -1 : this.a.getOpacity(); // Tuinity - cache opacity for light -+ // Tuinity start - optimise culling shape cache for light -+ if (this.a != null && this.a.getCullingShapeCache() != null) { -+ for (int i = 0, len = this.a.getCullingShapeCache().length; i < len; ++i) { -+ VoxelShape face = this.a.getCullingShapeCache()[i].simplify(); -+ if (face.isEmpty()) { -+ this.a.getCullingShapeCache()[i] = VoxelShapes.getEmptyShape(); -+ continue; -+ } -+ List boxes = face.getBoundingBoxesRepresentation(); -+ if (boxes.size() == 1) { -+ AxisAlignedBB boundingBox = boxes.get(0); -+ if (boundingBox.equals(VoxelShapes.optimisedFullCube.aabb)) { -+ this.a.getCullingShapeCache()[i] = VoxelShapes.fullCube(); -+ } else { -+ this.a.getCullingShapeCache()[i] = VoxelShapes.of(boundingBox); -+ if (!(this.a.getCullingShapeCache()[i] instanceof com.tuinity.tuinity.voxel.AABBVoxelShape) && -+ this.a.getCullingShapeCache()[i].getBoundingBoxesRepresentation().size() == 1) { -+ this.a.getCullingShapeCache()[i] = new com.tuinity.tuinity.voxel.AABBVoxelShape(boundingBox); -+ } -+ } -+ continue; -+ } -+ this.a.getCullingShapeCache()[i] = face; -+ } -+ } -+ // Tuinity end - optimise culling shape cache for light - - } - -@@ -689,9 +730,9 @@ public abstract class BlockBase { - private static final int f = EnumBlockSupport.values().length; - protected final boolean a; - private final boolean g; -- private final int h; -+ private final int h; private final int getOpacity() { return this.h; } // Tuinity - OBFHELPER - @Nullable -- private final VoxelShape[] i; -+ private final VoxelShape[] i; private final VoxelShape[] getCullingShapeCache () { return this.i; } // Tuinity - OBFHELPER - protected final VoxelShape b; - protected final boolean c; - private final boolean[] j; -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 936c392c9faa178b5645ea79b0130e0d3e3e1368..8fda4702764e80dae93ef9c0eb53abc198642ab1 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -98,6 +98,52 @@ public class Chunk implements IChunkAccess { - this.entitySlicesManager.getHardCollidingEntities(entity, axisalignedbb, into, predicate); // Tuinity +diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java +index 703bdefeb615ef8d15b428a893b5e4939d726f13..7918d830a4aef09c9f517284e83a9376299116ad 100644 +--- a/src/main/java/net/minecraft/core/EnumDirection.java ++++ b/src/main/java/net/minecraft/core/EnumDirection.java +@@ -174,8 +174,8 @@ public enum EnumDirection implements INamable { + return EnumDirection.q[MathHelper.a(i % EnumDirection.q.length)]; } - // Tuinity end - optimise hard collision handling -+ // Tuinity start - rewrite light engine -+ protected volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ protected volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ protected volatile boolean[] skyEmptinessMap; -+ protected volatile boolean[] blockEmptinessMap; -+ -+ @Override -+ public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { -+ return this.blockNibbles; -+ } -+ -+ @Override -+ public void setBlockNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { -+ this.blockNibbles = nibbles; -+ } -+ -+ @Override -+ public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getSkyNibbles() { -+ return this.skyNibbles; -+ } -+ -+ @Override -+ public void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { -+ this.skyNibbles = nibbles; -+ } -+ -+ @Override -+ public boolean[] getSkyEmptinessMap() { -+ return this.skyEmptinessMap; -+ } -+ -+ @Override -+ public void setSkyEmptinessMap(boolean[] emptinessMap) { -+ this.skyEmptinessMap = emptinessMap; -+ } -+ -+ @Override -+ public boolean[] getBlockEmptinessMap() { -+ return this.blockEmptinessMap; -+ } -+ -+ @Override -+ public void setBlockEmptinessMap(boolean[] emptinessMap) { -+ this.blockEmptinessMap = emptinessMap; -+ } -+ // Tuinity end - rewrite light engine - // Tuinity start - optimised entity slices - protected final com.tuinity.tuinity.world.ChunkEntitySlices entitySlicesManager; -@@ -405,6 +451,12 @@ public class Chunk implements IChunkAccess { +- @Nullable +- public static EnumDirection a(int i, int j, int k) { ++ @Nullable public static EnumDirection from(int i, int j, int k) { return a(i, j, k); } // Tuinity - OBFHELPER ++ @Nullable public static EnumDirection a(int i, int j, int k) { + return (EnumDirection) EnumDirection.r.get(BlockPosition.a(i, j, k)); + } - public Chunk(World world, ProtoChunk protochunk) { - this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.getInhabitedTime(), protochunk.getSections(), (Consumer) null); -+ // Tuinity start - copy over protochunk light -+ this.setBlockNibbles(protochunk.getBlockNibbles()); -+ this.setSkyNibbles(protochunk.getSkyNibbles()); -+ this.setSkyEmptinessMap(protochunk.getSkyEmptinessMap()); -+ this.setBlockEmptinessMap(protochunk.getBlockEmptinessMap()); -+ // Tuinity end - copy over protochunk light - Iterator iterator = protochunk.y().iterator(); +diff --git a/src/main/java/net/minecraft/core/SectionPosition.java b/src/main/java/net/minecraft/core/SectionPosition.java +index 7d9a16eb81288b74425319c60525f57c98ad3b69..427413c668865e1660f1d81daf6a3385f08a0e38 100644 +--- a/src/main/java/net/minecraft/core/SectionPosition.java ++++ b/src/main/java/net/minecraft/core/SectionPosition.java +@@ -10,7 +10,7 @@ import net.minecraft.world.level.ChunkCoordIntPair; + + public class SectionPosition extends BaseBlockPosition { + +- private SectionPosition(int i, int j, int k) { ++ public SectionPosition(int i, int j, int k) { // Tuinity - private -> public + super(i, j, k); + } + +diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutLightUpdate.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutLightUpdate.java +index 9050ff7180f63c1f5756570446c4d0a8cc767779..9dd0f34aaede93ce4fdff9b41f76166edeb95e93 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutLightUpdate.java ++++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayOutLightUpdate.java +@@ -35,12 +35,12 @@ public class PacketPlayOutLightUpdate implements Packet { + + @Override + public void onPacketDispatch(EntityPlayer player) { +- remainingSends.incrementAndGet(); ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) remainingSends.incrementAndGet(); + } + + @Override + public void onPacketDispatchFinish(EntityPlayer player, ChannelFuture future) { +- if (remainingSends.decrementAndGet() <= 0) { ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && remainingSends.decrementAndGet() <= 0) { + // incase of any race conditions, schedule this delayed + MCUtil.scheduleTask(5, () -> { + if (remainingSends.get() == 0) { +@@ -53,7 +53,7 @@ public class PacketPlayOutLightUpdate implements Packet { + + @Override + public boolean hasFinishListener() { +- return true; ++ return !com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine; // Tuinity - replace light impl + } - while (iterator.hasNext()) { -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 17a5b5b5bab4412242a18224b366674c25cdf286..076d6c1e1cc049dd312ecb30518e7b25fc2d7371 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -64,6 +64,13 @@ public class ChunkRegionLoader { - private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); // Paper end +@@ -63,8 +63,8 @@ public class PacketPlayOutLightUpdate implements Packet { + this.a = chunkcoordintpair.x; + this.b = chunkcoordintpair.z; + this.i = flag; +- this.g = Lists.newArrayList();cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper +- this.h = Lists.newArrayList();cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper ++ this.g = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage ++ this.h = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage -+ // Tuinity start - rewrite light engine -+ private static final int STARLIGHT_LIGHT_VERSION = 4; -+ -+ private static final String UNINITIALISED_SKYLIGHT_TAG = "starlight.skylight_uninit"; -+ private static final String STARLIGHT_VERSION_TAG = "starlight.light_version"; -+ // Tuinity end - rewrite light engine -+ - public static InProgressChunkHolder loadChunk(WorldServer worldserver, DefinedStructureManager definedstructuremanager, VillagePlace villageplace, ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound, boolean distinguish) { - ArrayDeque tasksToExecuteOnMain = new ArrayDeque<>(); - // Paper end -@@ -93,13 +100,17 @@ public class ChunkRegionLoader { - ProtoChunkTickList protochunkticklist1 = new ProtoChunkTickList<>((fluidtype) -> { - return fluidtype == null || fluidtype == FluidTypes.EMPTY; - }, chunkcoordintpair, nbttagcompound1.getList("LiquidsToBeTicked", 9)); -- boolean flag = nbttagcompound1.getBoolean("isLightOn"); -+ boolean flag = (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nbttagcompound1.getInt(STARLIGHT_VERSION_TAG) == STARLIGHT_LIGHT_VERSION : nbttagcompound1.getBoolean("isLightOn")); boolean canUseSkyLight = flag && getStatus(nbttagcompound).isAtLeastStatus(ChunkStatus.LIGHT); boolean canUseBlockLight = canUseSkyLight; // Tuinity - NBTTagList nbttaglist = nbttagcompound1.getList("Sections", 10); - boolean flag1 = true; - ChunkSection[] achunksection = new ChunkSection[16]; - 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(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 -@@ -127,6 +138,7 @@ public class ChunkRegionLoader { - - if (flag) { - if (nbttagcompound2.hasKeyOfType("BlockLight", 7)) { -+ 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(() -> { -@@ -136,13 +148,14 @@ public class ChunkRegionLoader { + for (int i = 0; i < 18; ++i) { + NibbleArray nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + i)); +@@ -75,7 +75,7 @@ public class PacketPlayOutLightUpdate implements Packet { + this.e |= 1 << i; + } else { + this.c |= 1 << i; +- this.g.add(nibblearray.getCloneIfSet()); // Paper ++ this.g.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again } + } - if (flag2 && nbttagcompound2.hasKeyOfType("SkyLight", 7)) { -+ 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(() -> { - lightengine.a(EnumSkyBlock.SKY, SectionPosition.a(chunkcoordintpair, b0), skyLight, true); - }); - // Paper end - delay this task since we're executing off-main -- } -+ } else if (flag2 && nbttagcompound2.getBoolean(UNINITIALISED_SKYLIGHT_TAG)) skyNibbles[b0 - minSection] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(); // Tuinity - replace light impl +@@ -84,7 +84,7 @@ public class PacketPlayOutLightUpdate implements Packet { + this.f |= 1 << i; + } else { + this.d |= 1 << i; +- this.h.add(nibblearray1.getCloneIfSet()); // Paper ++ this.h.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray1.asBytes() : nibblearray1.getCloneIfSet()); // Paper // Tuinity - don't clone again + } } } +@@ -97,8 +97,8 @@ public class PacketPlayOutLightUpdate implements Packet { + this.i = flag; + this.c = i; + this.d = j; +- this.g = Lists.newArrayList();cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper +- this.h = Lists.newArrayList();cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper ++ this.g = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage ++ this.h = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage -@@ -181,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 -+ ((Chunk)object).setBlockNibbles(blockNibbles); // Tuinity - replace light impl -+ ((Chunk)object).setSkyNibbles(skyNibbles); // Tuinity - replace light impl - } else { - ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray - Add parameter -+ protochunk.setBlockNibbles(blockNibbles); // Tuinity - replace light impl -+ protochunk.setSkyNibbles(skyNibbles); // Tuinity - replace light impl - - protochunk.a(biomestorage); - object = protochunk; -@@ -361,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 - 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) { -+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && blockArray != null) { // Tuinity - data already copied - blockArray = blockArray.copy(); - } -- if (skyArray != null) { -+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && skyArray != null) { // Tuinity - data already copied - skyArray = skyArray.copy(); - } - -@@ -404,6 +426,10 @@ 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(); -@@ -437,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 - 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 -@@ -452,12 +478,12 @@ public class ChunkRegionLoader { - } - + for (int k = 0; k < 18; ++k) { + NibbleArray nibblearray; +@@ -106,7 +106,7 @@ public class PacketPlayOutLightUpdate implements Packet { + if ((this.c & 1 << k) != 0) { + nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + k)); if (nibblearray != null && !nibblearray.c()) { -- nbttagcompound2.setByteArray("BlockLight", nibblearray.asBytesPoolSafe().clone()); // Paper -+ nbttagcompound2.setByteArray("BlockLight", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.asBytesPoolSafe().clone()); // Paper // Tuinity - data is already cloned - } - - if (nibblearray1 != null && !nibblearray1.c()) { -- nbttagcompound2.setByteArray("SkyLight", nibblearray1.asBytesPoolSafe().clone()); // Paper -- } -+ nbttagcompound2.setByteArray("SkyLight", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray1.asBytes() : nibblearray1.asBytesPoolSafe().clone()); // Paper // Tuinity - data is already cloned -+ } else if (nibblearray1 != null && com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) nbttagcompound2.setBoolean(UNINITIALISED_SKYLIGHT_TAG, true); // Tuinity - store uninitialised tags - - nbttaglist.add(nbttagcompound2); - } -@@ -465,7 +491,7 @@ public class ChunkRegionLoader { - - nbttagcompound1.set("Sections", nbttaglist); - if (flag) { -- nbttagcompound1.setBoolean("isLightOn", true); -+ nbttagcompound1.setBoolean("isLightOn", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? false : true); if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) nbttagcompound1.setInt(STARLIGHT_VERSION_TAG, STARLIGHT_LIGHT_VERSION); // Tuinity - } - - BiomeStorage biomestorage = ichunkaccess.getBiomeIndex(); -diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index cebd808e273dbdb88feb16920dd7a2f60390b34f..33b8f4e0f09fdc41c8ea48b6ed77af199136ab92 100644 ---- a/src/main/java/net/minecraft/server/ChunkSection.java -+++ b/src/main/java/net/minecraft/server/ChunkSection.java -@@ -11,7 +11,7 @@ public class ChunkSection { - short nonEmptyBlockCount; // Paper - package-private - short tickingBlockCount; // Paper - private -> package-private - private short e; -- final DataPaletteBlock blockIds; // Paper - package-private -+ public final DataPaletteBlock blockIds; // Paper - package-private // Tuinity - public - - final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d51925612bc3d37164a8e821833ef1721b6e6976..cf14b83ec3c2b9a2812f50f3bca991e029bf7c67 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -531,6 +531,185 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +- this.g.add(nibblearray.getCloneIfSet()); // Paper ++ this.g.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again + } else { + this.c &= ~(1 << k); + if (nibblearray != null) { +@@ -118,7 +118,7 @@ public class PacketPlayOutLightUpdate implements Packet { + if ((this.d & 1 << k) != 0) { + nibblearray = lightengine.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, -1 + k)); + if (nibblearray != null && !nibblearray.c()) { +- this.h.add(nibblearray.getCloneIfSet()); // Paper ++ this.h.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again + } else { + this.d &= ~(1 << k); + if (nibblearray != null) { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 37c9b5fd712e30a9a0faccc840f738f4b2cfc723..b2cd13541bf3486a69e8f3e41e4c90cdc47180d1 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -661,6 +661,185 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } @@ -4639,102 +4446,11 @@ index d51925612bc3d37164a8e821833ef1721b6e6976..cf14b83ec3c2b9a2812f50f3bca991e0 if (this.getHealth() != this.lastHealthSent || this.lastFoodSent != this.foodData.getFoodLevel() || this.foodData.getSaturationLevel() == 0.0F != this.lastSentSaturationZero) { this.playerConnection.sendPacket(new PacketPlayOutUpdateHealth(this.getBukkitEntity().getScaledHealth(), this.foodData.getFoodLevel(), this.foodData.getSaturationLevel())); // CraftBukkit this.lastHealthSent = this.getHealth(); -diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 05b0090ae36cf61f67e26aad478df30c89f31941..30ba21ac1bced18a9d0946b7c3ed55971ada48bb 100644 ---- a/src/main/java/net/minecraft/server/EnumDirection.java -+++ b/src/main/java/net/minecraft/server/EnumDirection.java -@@ -170,8 +170,8 @@ public enum EnumDirection implements INamable { - return EnumDirection.q[MathHelper.a(i % EnumDirection.q.length)]; - } - -- @Nullable -- public static EnumDirection a(int i, int j, int k) { -+ @Nullable public static EnumDirection from(int i, int j, int k) { return a(i, j, k); } // Tuinity - OBFHELPER -+ @Nullable public static EnumDirection a(int i, int j, int k) { - return (EnumDirection) EnumDirection.r.get(BlockPosition.a(i, j, k)); - } - -diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java -index 180b6b58dc5663158db84b6f1257591439b48c31..eb0d794b7275af7f860e7c7b85a9e3b2aa4a863f 100644 ---- a/src/main/java/net/minecraft/server/IChunkAccess.java -+++ b/src/main/java/net/minecraft/server/IChunkAccess.java -@@ -24,6 +24,36 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { - } - // Paper end - -+ // Tuinity start -+ default com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ default void setBlockNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ -+ default com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getSkyNibbles() { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ default void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ public default boolean[] getSkyEmptinessMap() { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ public default void setSkyEmptinessMap(final boolean[] emptinessMap) { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ -+ public default boolean[] getBlockEmptinessMap() { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ -+ public default void setBlockEmptinessMap(final boolean[] emptinessMap) { -+ throw new UnsupportedOperationException(this.getClass().getName()); -+ } -+ // Tuinity end -+ - IBlockData getType(final int x, final int y, final int z); // Paper - @Nullable - IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); -@@ -122,6 +152,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { - @Nullable - NBTTagCompound j(BlockPosition blockposition); - -+ default Stream getLightSources() { return this.m(); } // Tuinity - OBFHELPER - Stream m(); - - TickList n(); -@@ -142,7 +173,9 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { - return ashortlist[i]; - } - -+ default boolean isLit() { return this.r(); } // Tuinity - OBFHELPER - boolean r(); - -+ default void setLit(boolean lit) { this.b(lit); } // Tuinity - OBFHELPER - void b(boolean flag); - } -diff --git a/src/main/java/net/minecraft/server/ILightAccess.java b/src/main/java/net/minecraft/server/ILightAccess.java -index be5384ee41290b24b0c419c3e8f4553db34b2399..df28f7a6bf4c650a22ddf046eae4d5e8ca5879a9 100644 ---- a/src/main/java/net/minecraft/server/ILightAccess.java -+++ b/src/main/java/net/minecraft/server/ILightAccess.java -@@ -4,9 +4,10 @@ import javax.annotation.Nullable; - - public interface ILightAccess { - -- @Nullable -- IBlockAccess c(int i, int j); -+ default @Nullable IBlockAccess getFeaturesReadyChunk(int i, int j) { return this.c(i, j); } // Tuinity - OBFHELPER -+ @Nullable IBlockAccess c(int i, int j); - -+ default void markLightSectionDirty(EnumSkyBlock enumskyblock, SectionPosition sectionposition) { this.a(enumskyblock, sectionposition); } // Tuinity - OBFHELPER - default void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition) {} - - IBlockAccess getWorld(); -diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java -index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375b1a49bd6 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; +diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +index 0b80569648c1df01aab52d0b8d47028cda925d86..381bd11075599d44e4c705a8e754769d29883d75 100644 +--- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java ++++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +@@ -2,6 +2,11 @@ package net.minecraft.server.level; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; // Paper @@ -4746,7 +4462,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; import it.unimi.dsi.fastutil.objects.ObjectListIterator; -@@ -15,11 +20,12 @@ import org.apache.logging.log4j.Logger; +@@ -28,11 +33,12 @@ import org.apache.logging.log4j.Logger; public class LightEngineThreaded extends LightEngine implements AutoCloseable { private static final Logger LOGGER = LogManager.getLogger(); @@ -4760,7 +4476,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 PlayerChunk playerChunk = playerChunkMap.getVisibleChunk(pair); if (playerChunk == null) { return false; -@@ -156,13 +162,218 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -169,13 +175,218 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { private volatile int f = 5; private final AtomicBoolean g = new AtomicBoolean(); @@ -4813,7 +4529,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + + final Long id = Long.valueOf(this.relightCounter++); + -+ this.theLightEngine.getWorld().getChunkProvider().addTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), id); ++ this.theLightEngine.getWorld().getChunkProvider().addTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), id); + ticketIds.put(chunkPos, id); + + ++totalChunks; @@ -4823,8 +4539,8 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + 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)); ++ this.theLightEngine.getWorld().getChunkProvider().playerChunkMap.getUpdatingChunk(chunkPos.pair()).sendPacketToTrackedPlayers(new net.minecraft.network.protocol.game.PacketPlayOutLightUpdate(chunkPos, this, true), false); ++ this.theLightEngine.getWorld().getChunkProvider().removeTicketAtLevel(TicketType.CHUNK_RELIGHT, chunkPos, net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), ticketIds.get(chunkPos)); + }); + }, onComplete); + }); @@ -4837,12 +4553,12 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + protected final LongArrayList postWorkTicketRelease = new LongArrayList(); + + private void addLightWorkTicket(int chunkX, int chunkZ) { -+ final long coordinate = MCUtil.getCoordinateKey(chunkX, chunkZ); ++ final long coordinate = net.minecraft.server.MCUtil.getCoordinateKey(chunkX, chunkZ); + final int current = this.holdingChunks.putIfAbsent(coordinate, 1); + if (current == 0) { + final ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(coordinate); + this.theLightEngine.getWorld().getChunkProvider().addTicketAtLevel(TicketType.LIGHT_UPDATE, chunkPos, -+ MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), chunkPos); ++ net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), chunkPos); + this.theLightEngine.getWorld().getChunkProvider().tickDistanceManager(); + } else { + this.holdingChunks.put(coordinate, current + 1); @@ -4850,13 +4566,13 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + } + + protected final void releaseLightWorkChunk(int chunkX, int chunkZ) { -+ final long coordinate = MCUtil.getCoordinateKey(chunkX, chunkZ); ++ final long coordinate = net.minecraft.server.MCUtil.getCoordinateKey(chunkX, chunkZ); + final int current = this.holdingChunks.get(coordinate); + if (current == 1) { + this.holdingChunks.remove(coordinate); + final ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(coordinate); + this.theLightEngine.getWorld().getChunkProvider().removeTicketAtLevel(TicketType.LIGHT_UPDATE, chunkPos, -+ MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), chunkPos); ++ net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT), chunkPos); + } else { + this.holdingChunks.put(coordinate, current - 1); + } @@ -4865,17 +4581,17 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + protected final CompletableFuture acquireLightWorkChunk(int chunkX, int chunkZ) { + ChunkProviderServer chunkProvider = this.theLightEngine.getWorld().getChunkProvider(); + PlayerChunkMap chunkMap = chunkProvider.playerChunkMap; -+ int targetLevel = MCUtil.getTicketLevelFor(ChunkStatus.LIGHT); ++ int targetLevel = net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT); + + this.addLightWorkTicket(chunkX, chunkZ); + + // light doesn't always load one radius neighbours... + // i.e if they get unloaded + boolean neighboursAtFeatures = true; -+ int targetNeighbourLevel = MCUtil.getTicketLevelFor(ChunkStatus.LIGHT.getPreviousStatus()); ++ int targetNeighbourLevel = net.minecraft.server.MCUtil.getTicketLevelFor(ChunkStatus.LIGHT.getPreviousStatus()); + for (int dx = -1; dx <= 1; ++dx) { + for (int dz = -1; dz <= 1; ++dz) { -+ PlayerChunk neighbour = chunkMap.getUpdatingChunk(MCUtil.getCoordinateKey(dx + chunkX, dz + chunkZ)); ++ PlayerChunk neighbour = chunkMap.getUpdatingChunk(net.minecraft.server.MCUtil.getCoordinateKey(dx + chunkX, dz + chunkZ)); + ChunkStatus status; + if (neighbour == null || neighbour.getTicketLevel() > targetNeighbourLevel || + (status = neighbour.getChunkHolderStatus()) == null || @@ -4886,7 +4602,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + } + } + -+ PlayerChunk playerChunk = chunkMap.getUpdatingChunk(MCUtil.getCoordinateKey(chunkX, chunkZ)); ++ PlayerChunk playerChunk = chunkMap.getUpdatingChunk(net.minecraft.server.MCUtil.getCoordinateKey(chunkX, chunkZ)); + ChunkStatus holderStatus; + if (!neighboursAtFeatures || playerChunk == null || playerChunk.getTicketLevel() > targetLevel || + (holderStatus = playerChunk.getChunkHolderStatus()) == null || @@ -4932,14 +4648,14 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + + this.acquireLightWorkChunk(chunkX, chunkZ).whenCompleteAsync((chunk, throwable) -> { + if (throwable != null) { -+ MinecraftServer.LOGGER.fatal("Failed to load light chunk for light work", throwable); ++ LOGGER.fatal("Failed to load light chunk for light work", throwable); + this.releaseLightWorkChunk(chunkX, chunkZ); + } else { + this.scheduleTask(chunkX, chunkZ, type, () -> { + try { + task.run(); + } finally { -+ this.postWorkTicketRelease.add(MCUtil.getCoordinateKey(chunkX, chunkZ)); ++ this.postWorkTicketRelease.add(net.minecraft.server.MCUtil.getCoordinateKey(chunkX, chunkZ)); + } + }); + } @@ -4954,7 +4670,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + } + + @Override -+ public LightEngineLayerEventListener a(EnumSkyBlock var0) { ++ public net.minecraft.world.level.lighting.LightEngineLayerEventListener a(EnumSkyBlock var0) { + if (this.theLightEngine == null) { + return super.a(var0); + } @@ -4979,7 +4695,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 public void close() {} @Override -@@ -179,6 +390,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -192,6 +403,15 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { public void a(BlockPosition blockposition) { BlockPosition blockposition1 = blockposition.immutableCopy(); @@ -4995,7 +4711,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(blockposition.getX() >> 4, blockposition.getZ() >> 4, LightEngineThreaded.Update.POST_UPDATE, SystemUtils.a(() -> { super.a(blockposition1); }, () -> { -@@ -187,6 +407,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -200,6 +420,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } protected void a(ChunkCoordIntPair chunkcoordintpair) { @@ -5007,7 +4723,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -211,6 +436,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -224,6 +449,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(SectionPosition sectionposition, boolean flag) { @@ -5022,7 +4738,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(sectionposition.a(), sectionposition.c(), () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -222,6 +455,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -235,6 +468,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -5034,7 +4750,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(chunkcoordintpair.x, chunkcoordintpair.z, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { super.a(chunkcoordintpair, flag); }, () -> { -@@ -231,6 +469,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -244,6 +482,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition, @Nullable NibbleArray nibblearray, boolean flag) { @@ -5046,7 +4762,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(sectionposition.a(), sectionposition.c(), () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -240,6 +483,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -253,6 +496,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { })); } @@ -5054,7 +4770,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 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 +496,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -265,6 +509,11 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @Override public void b(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -5066,7 +4782,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.a(chunkcoordintpair.x, chunkcoordintpair.z, () -> { return 0; }, LightEngineThreaded.Update.PRE_UPDATE, SystemUtils.a(() -> { -@@ -264,6 +513,35 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -277,6 +526,35 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { public CompletableFuture a(IChunkAccess ichunkaccess, boolean flag) { ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos(); @@ -5093,7 +4809,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + LightEngineThreaded.this.queueUpdate(); + }).whenComplete((IChunkAccess chunk, Throwable throwable) -> { + if (throwable != null && !(throwable instanceof ThreadDeath)) { -+ MinecraftServer.LOGGER.fatal("Failed to light chunk " + ichunkaccess.getPos().toString() + " in world '" + this.theLightEngine.getWorld().getWorld().getName() + "'"); ++ LOGGER.fatal("Failed to light chunk " + ichunkaccess.getPos().toString() + " in world '" + this.theLightEngine.getWorld().getWorld().getName() + "'"); + } + }); + } @@ -5102,7 +4818,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 // Paper start //ichunkaccess.b(false); // Don't need to disable this long pair = chunkcoordintpair.pair(); -@@ -311,7 +589,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -324,7 +602,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } public void queueUpdate() { @@ -5111,7 +4827,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 this.b.a((() -> { // Paper - decompile error this.b(); this.g.set(false); -@@ -325,17 +603,36 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -338,17 +616,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() { @@ -5138,7 +4854,7 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 + LongIterator iterator = copy.iterator(); + while (iterator.hasNext()) { + long coordinate = iterator.nextLong(); -+ this.releaseLightWorkChunk(MCUtil.getCoordinateX(coordinate), MCUtil.getCoordinateZ(coordinate)); ++ this.releaseLightWorkChunk(net.minecraft.server.MCUtil.getCoordinateX(coordinate), net.minecraft.server.MCUtil.getCoordinateZ(coordinate)); + } + }); + } @@ -5150,136 +4866,11 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..b2f51a6786d4bb92c9cbbceeea812375 } public void a(int i) { -diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java -index 4085426af03f032cf405bdfd1e40a8e5dc27c1d1..348d16ddec3b4da0b6b4e4f49916b966005b5259 100644 ---- a/src/main/java/net/minecraft/server/NibbleArray.java -+++ b/src/main/java/net/minecraft/server/NibbleArray.java -@@ -56,6 +56,7 @@ public class NibbleArray { - boolean poolSafe = false; - public java.lang.Runnable cleaner; - private void registerCleaner() { -+ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) return; // Tuinity - purge cleaner usage - if (!poolSafe) { - cleaner = MCUtil.registerCleaner(this, this.a, NibbleArray::releaseBytes); - } else { -@@ -63,7 +64,7 @@ public class NibbleArray { - } - } - // Paper end -- @Nullable protected byte[] a; -+ @Nullable protected byte[] a; public final byte[] justGiveMeTheFuckingByteArrayNoCleanerBullshitJesusFuckingChrist() { return this.a; } - - - public NibbleArray() {} -@@ -74,7 +75,7 @@ public class NibbleArray { - } - public NibbleArray(byte[] abyte, boolean isSafe) { - this.a = abyte; -- if (!isSafe) this.a = getCloneIfSet(); // Paper - clone for safety -+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && !isSafe) this.a = getCloneIfSet(); // Paper - clone for safety // Tuinity - no need to clone - registerCleaner(); - // Paper end - if (abyte.length != 2048) { -@@ -162,7 +163,7 @@ public class NibbleArray { - - public NibbleArray copy() { return this.b(); } // Paper - OBFHELPER - public NibbleArray b() { -- return this.a == null ? new NibbleArray() : new NibbleArray(this.a); // Paper - clone in ctor -+ return this.a == null ? new NibbleArray() : new NibbleArray(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? this.a.clone() : this.a); // Paper - clone in ctor // Tuinity - no longer clone in constructor - } - - public String toString() { -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java b/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java -index a22f0cccecc85b4e4fe4603bcfa213f15c23db69..6cc4a035c8b1312b59685b20039d5e82bb1e1a3e 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutLightUpdate.java -@@ -26,12 +26,12 @@ public class PacketPlayOutLightUpdate implements Packet { - - @Override - public void onPacketDispatch(EntityPlayer player) { -- remainingSends.incrementAndGet(); -+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) remainingSends.incrementAndGet(); - } - - @Override - public void onPacketDispatchFinish(EntityPlayer player, ChannelFuture future) { -- if (remainingSends.decrementAndGet() <= 0) { -+ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && remainingSends.decrementAndGet() <= 0) { - // incase of any race conditions, schedule this delayed - MCUtil.scheduleTask(5, () -> { - if (remainingSends.get() == 0) { -@@ -44,7 +44,7 @@ public class PacketPlayOutLightUpdate implements Packet { - - @Override - public boolean hasFinishListener() { -- return true; -+ return !com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine; // Tuinity - replace light impl - } - - // Paper end -@@ -54,8 +54,8 @@ public class PacketPlayOutLightUpdate implements Packet { - this.a = chunkcoordintpair.x; - this.b = chunkcoordintpair.z; - this.i = flag; -- this.g = Lists.newArrayList();cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper -- this.h = Lists.newArrayList();cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper -+ this.g = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage -+ this.h = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage - - for (int i = 0; i < 18; ++i) { - NibbleArray nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + i)); -@@ -66,7 +66,7 @@ public class PacketPlayOutLightUpdate implements Packet { - this.e |= 1 << i; - } else { - this.c |= 1 << i; -- this.g.add(nibblearray.getCloneIfSet()); // Paper -+ this.g.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again - } - } - -@@ -75,7 +75,7 @@ public class PacketPlayOutLightUpdate implements Packet { - this.f |= 1 << i; - } else { - this.d |= 1 << i; -- this.h.add(nibblearray1.getCloneIfSet()); // Paper -+ this.h.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray1.asBytes() : nibblearray1.getCloneIfSet()); // Paper // Tuinity - don't clone again - } - } - } -@@ -88,8 +88,8 @@ public class PacketPlayOutLightUpdate implements Packet { - this.i = flag; - this.c = i; - this.d = j; -- this.g = Lists.newArrayList();cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper -- this.h = Lists.newArrayList();cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper -+ this.g = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner1 = MCUtil.registerListCleaner(this, this.g, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage -+ this.h = Lists.newArrayList();if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) cleaner2 = MCUtil.registerListCleaner(this, this.h, NibbleArray::releaseBytes); // Paper // Tuinity - purge cleaner usage - - for (int k = 0; k < 18; ++k) { - NibbleArray nibblearray; -@@ -97,7 +97,7 @@ public class PacketPlayOutLightUpdate implements Packet { - if ((this.c & 1 << k) != 0) { - nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + k)); - if (nibblearray != null && !nibblearray.c()) { -- this.g.add(nibblearray.getCloneIfSet()); // Paper -+ this.g.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again - } else { - this.c &= ~(1 << k); - if (nibblearray != null) { -@@ -109,7 +109,7 @@ public class PacketPlayOutLightUpdate implements Packet { - if ((this.d & 1 << k) != 0) { - nibblearray = lightengine.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, -1 + k)); - if (nibblearray != null && !nibblearray.c()) { -- this.h.add(nibblearray.getCloneIfSet()); // Paper -+ this.h.add(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.getCloneIfSet()); // Paper // Tuinity - don't clone again - } else { - this.d &= ~(1 << k); - if (nibblearray != null) { -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index a22021766b3bffa4f96d1d4ee546b12e96b5ca58..3127fc9dd87e82243e167862cae83ac87b7f4fa0 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -387,13 +387,14 @@ public class PlayerChunk { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index e3dc57282a559f783c027780740e8089e022c838..41a9202fac9fce3bf8cf08682d0545484d46c41d 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -413,13 +413,14 @@ public class PlayerChunk { public void a(EnumSkyBlock enumskyblock, int i) { Chunk chunk = this.getSendingChunk(); // Paper - no-tick view distance @@ -5296,11 +4887,20 @@ index a22021766b3bffa4f96d1d4ee546b12e96b5ca58..3127fc9dd87e82243e167862cae83ac8 } } -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index c7897e1a3655301d848313c26b244c325766253e..ff91f069e5f4a16c069c8a68d8cb55e9ad3627c8 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1350,6 +1350,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 82e28afc75d93c39d6b6517faf6430183cb675fb..e30995df572df6135e159d34cd7646fd08db4a5a 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -1256,7 +1256,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + if (ichunkaccess.getChunkStatus().b(chunkstatus)) { + CompletableFuture> completablefuture1; // Paper + +- if (chunkstatus == ChunkStatus.LIGHT) { ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && chunkstatus == ChunkStatus.LIGHT) { // Tuinity - we use edge checks, so loading 1 radius neighbours isn't necessary + completablefuture1 = this.b(playerchunk, chunkstatus); + } else { + completablefuture1 = chunkstatus.a(this.world, this.definedStructureManager, this.lightEngine, (ichunkaccess1) -> { +@@ -1404,6 +1404,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Tuinity end - force competion on the main thread } @@ -5308,11 +4908,327 @@ index c7897e1a3655301d848313c26b244c325766253e..ff91f069e5f4a16c069c8a68d8cb55e9 protected void c(ChunkCoordIntPair chunkcoordintpair) { this.executor.a(SystemUtils.a(() -> { this.chunkDistanceManager.b(TicketType.LIGHT, chunkcoordintpair, 33 + ChunkStatus.a(ChunkStatus.FEATURES), chunkcoordintpair); -diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index a3ac883500eaebb353ad3108a17b5c740e384b03..d8b759874545293764690b2ba08a4bd7605c76ae 100644 ---- a/src/main/java/net/minecraft/server/ProtoChunk.java -+++ b/src/main/java/net/minecraft/server/ProtoChunk.java -@@ -48,6 +48,54 @@ public class ProtoChunk implements IChunkAccess { +diff --git a/src/main/java/net/minecraft/server/level/TicketType.java b/src/main/java/net/minecraft/server/level/TicketType.java +index 1122df50a7f9cbc489e8da7a91e9af73476eb148..3738c51b5e673c439d88a7ef7f4614f338a61c2a 100644 +--- a/src/main/java/net/minecraft/server/level/TicketType.java ++++ b/src/main/java/net/minecraft/server/level/TicketType.java +@@ -32,6 +32,8 @@ public class TicketType { + public static final TicketType URGENT = a("urgent", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper + public static final TicketType DELAYED_UNLOAD = a("delayed_unload", Long::compareTo); // Tuinity - delay chunk unloads + public static final TicketType REQUIRED_LOAD = a("required_load", Long::compareTo); // Tuinity - make sure getChunkAt does not fail ++ public static final TicketType LIGHT_UPDATE = a("light_update", Comparator.comparingLong(ChunkCoordIntPair::pair)); // Tuinity - ensure chunks stay loaded for lighting ++ public static final TicketType CHUNK_RELIGHT = a("chunk_relight", Long::compareTo); // Tuinity - ensure chunk stays loaded for relighting + + // Tuinity start - delay chunk unloads + boolean delayUnloadViable = true; +@@ -41,6 +43,7 @@ public class TicketType { + TicketType.PRIORITY.delayUnloadViable = false; + TicketType.URGENT.delayUnloadViable = false; + TicketType.DELAYED_UNLOAD.delayUnloadViable = false; ++ TicketType.LIGHT_UPDATE.delayUnloadViable = false; // Tuinity - ensure chunks stay loaded for lighting + } + // Tuinity end - delay chunk unloads + public static TicketType a(String s, Comparator comparator) { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 6b5aa91ddc657443580f2cb82c5aff3ee0180fa6..6ce29205ba4480b19912a7acd393c4198d6a9e35 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -515,6 +515,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + // Tuinity end - optimise get nearest players for entity AI + ++ // Tuinity start - rewrite light engine ++ /** ++ * Cannot be modified during light updates. ++ */ ++ public com.tuinity.tuinity.chunk.light.VariableBlockLightHandler customBlockLightHandlers; ++ // Tuinity end - rewrite light engine ++ + // Add env and gen to constructor, WorldData -> WorldDataServer + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index a96069c86ef5f5af4820436dd1f24e297bcca73f..0b852fa247c65cb1e889ad4e55886e256f89a763 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -382,6 +382,7 @@ public abstract class BlockBase { + this.n = blockbase_info.s; + this.o = blockbase_info.t; + this.p = blockbase_info.u; ++ this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Tuinity + } + // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time + private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; +@@ -404,6 +405,19 @@ public abstract class BlockBase { + } + // Tuinity end + ++ // Tuinity start ++ protected int opacityIfCached = -1; ++ // ret -1 if opacity is dynamic, or -1 if the block is conditionally full opaque, else return opacity in [0, 15] ++ public final int getOpacityIfCached() { ++ return this.opacityIfCached; ++ } ++ ++ protected final boolean conditionallyFullOpaque; ++ public final boolean isConditionallyFullOpaque() { ++ return this.conditionallyFullOpaque; ++ } ++ // Tuinity end ++ + public void a() { + this.fluid = this.getBlock().d(this.p()); // Paper - moved from getFluid() + this.isTicking = this.getBlock().isTicking(this.p()); // Paper - moved from isTicking() +@@ -413,6 +427,34 @@ public abstract class BlockBase { + this.shapeExceedsCube = this.a == null || this.a.c; // Tuinity - moved from actual method to here + this.staticPathType = null; // Tuinity - cache static path type + this.neighbourOverridePathType = null; // Tuinity - cache static path types ++ this.opacityIfCached = this.a == null || this.isConditionallyFullOpaque() ? -1 : this.a.getOpacity(); // Tuinity - cache opacity for light ++ // Tuinity start - optimise culling shape cache for light ++ if (this.a != null && this.a.getCullingShapeCache() != null) { ++ for (int i = 0, len = this.a.getCullingShapeCache().length; i < len; ++i) { ++ VoxelShape face = this.a.getCullingShapeCache()[i].simplify(); ++ if (face.isEmpty()) { ++ this.a.getCullingShapeCache()[i] = VoxelShapes.getEmptyShape(); ++ continue; ++ } ++ List boxes = face.getBoundingBoxesRepresentation(); ++ ++ if (boxes.size() == 1) { ++ net.minecraft.world.phys.AxisAlignedBB boundingBox = boxes.get(0); ++ if (boundingBox.equals(VoxelShapes.optimisedFullCube.aabb)) { ++ this.a.getCullingShapeCache()[i] = VoxelShapes.fullCube(); ++ } else { ++ this.a.getCullingShapeCache()[i] = VoxelShapes.of(boundingBox); ++ if (!(this.a.getCullingShapeCache()[i] instanceof com.tuinity.tuinity.voxel.AABBVoxelShape) && ++ this.a.getCullingShapeCache()[i].getBoundingBoxesRepresentation().size() == 1) { ++ this.a.getCullingShapeCache()[i] = new com.tuinity.tuinity.voxel.AABBVoxelShape(boundingBox); ++ } ++ } ++ continue; ++ } ++ this.a.getCullingShapeCache()[i] = face; ++ } ++ } ++ // Tuinity end - optimise culling shape cache for light + + } + +@@ -741,9 +783,9 @@ public abstract class BlockBase { + private static final int f = EnumBlockSupport.values().length; + protected final boolean a; + private final boolean g; +- private final int h; ++ private final int h; private final int getOpacity() { return this.h; } // Tuinity - OBFHELPER + @Nullable +- private final VoxelShape[] i; ++ private final VoxelShape[] i; private final VoxelShape[] getCullingShapeCache () { return this.i; } // Tuinity - OBFHELPER + protected final VoxelShape b; + protected final boolean c; + private final boolean[] j; +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index ec5770453f2c795f09345f2f89209a66625392f3..8b73ba51dde43e3ddf40ed863cf286042f139a34 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -144,6 +144,52 @@ public class Chunk implements IChunkAccess { + this.entitySlicesManager.getHardCollidingEntities(entity, axisalignedbb, into, predicate); // Tuinity + } + // Tuinity end - optimise hard collision handling ++ // Tuinity start - rewrite light engine ++ protected volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); ++ protected volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); ++ protected volatile boolean[] skyEmptinessMap; ++ protected volatile boolean[] blockEmptinessMap; ++ ++ @Override ++ public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { ++ return this.blockNibbles; ++ } ++ ++ @Override ++ public void setBlockNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { ++ this.blockNibbles = nibbles; ++ } ++ ++ @Override ++ public com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getSkyNibbles() { ++ return this.skyNibbles; ++ } ++ ++ @Override ++ public void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { ++ this.skyNibbles = nibbles; ++ } ++ ++ @Override ++ public boolean[] getSkyEmptinessMap() { ++ return this.skyEmptinessMap; ++ } ++ ++ @Override ++ public void setSkyEmptinessMap(boolean[] emptinessMap) { ++ this.skyEmptinessMap = emptinessMap; ++ } ++ ++ @Override ++ public boolean[] getBlockEmptinessMap() { ++ return this.blockEmptinessMap; ++ } ++ ++ @Override ++ public void setBlockEmptinessMap(boolean[] emptinessMap) { ++ this.blockEmptinessMap = emptinessMap; ++ } ++ // Tuinity end - rewrite light engine + + // Tuinity start - optimised entity slices + protected final com.tuinity.tuinity.world.ChunkEntitySlices entitySlicesManager; +@@ -451,6 +497,12 @@ 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); ++ // Tuinity start - copy over protochunk light ++ this.setBlockNibbles(protochunk.getBlockNibbles()); ++ this.setSkyNibbles(protochunk.getSkyNibbles()); ++ this.setSkyEmptinessMap(protochunk.getSkyEmptinessMap()); ++ this.setBlockEmptinessMap(protochunk.getBlockEmptinessMap()); ++ // Tuinity end - copy over protochunk light + Iterator iterator = protochunk.y().iterator(); + + while (iterator.hasNext()) { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java +index b17bedec0fa10d81273119b04f05f1cb4d908111..b5eb43174d2c2f34bb17bbcdb803aafe58989678 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkSection.java +@@ -18,7 +18,7 @@ public class ChunkSection { + short nonEmptyBlockCount; // Paper - package-private + short tickingBlockCount; // Paper - private -> package-private + private short e; +- final DataPaletteBlock blockIds; // Paper - package-private ++ public final DataPaletteBlock blockIds; // Paper - package-private // Tuinity - public + + public final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper + +diff --git a/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java +index cdf612d7553a8f4aaebb5e0e66bd2a47a280457a..3a7039ceb770e3bb97bf77c9c57e6479ef8224e0 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java ++++ b/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java +@@ -37,6 +37,36 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { + } + // Paper end + ++ // Tuinity start ++ default com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getBlockNibbles() { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ default void setBlockNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ ++ default com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] getSkyNibbles() { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ default void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ public default boolean[] getSkyEmptinessMap() { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ public default void setSkyEmptinessMap(final boolean[] emptinessMap) { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ ++ public default boolean[] getBlockEmptinessMap() { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ ++ public default void setBlockEmptinessMap(final boolean[] emptinessMap) { ++ throw new UnsupportedOperationException(this.getClass().getName()); ++ } ++ // Tuinity end ++ + IBlockData getType(final int x, final int y, final int z); // Paper + @Nullable + IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); +@@ -135,6 +165,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { + @Nullable + NBTTagCompound j(BlockPosition blockposition); + ++ default Stream getLightSources() { return this.m(); } // Tuinity - OBFHELPER + Stream m(); + + TickList n(); +@@ -155,7 +186,9 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { + return ashortlist[i]; + } + ++ default boolean isLit() { return this.r(); } // Tuinity - OBFHELPER + boolean r(); + ++ default void setLit(boolean lit) { this.b(lit); } // Tuinity - OBFHELPER + void b(boolean flag); + } +diff --git a/src/main/java/net/minecraft/world/level/chunk/ILightAccess.java b/src/main/java/net/minecraft/world/level/chunk/ILightAccess.java +index 43b8361e8ad0a8c429406cb6ff538020f670bdbd..bb63ed58e1eaeb474e99992e39d811b2589f88d9 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ILightAccess.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ILightAccess.java +@@ -7,9 +7,10 @@ import net.minecraft.world.level.IBlockAccess; + + public interface ILightAccess { + +- @Nullable +- IBlockAccess c(int i, int j); ++ default @Nullable IBlockAccess getFeaturesReadyChunk(int i, int j) { return this.c(i, j); } // Tuinity - OBFHELPER ++ @Nullable IBlockAccess c(int i, int j); + ++ default void markLightSectionDirty(EnumSkyBlock enumskyblock, SectionPosition sectionposition) { this.a(enumskyblock, sectionposition); } // Tuinity - OBFHELPER + default void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition) {} + + IBlockAccess getWorld(); +diff --git a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java +index 3a85a89be2a736e5b6b7f08032f4becd6bb39ed1..d32369d9a555fd7595df175e56f853ce8b012522 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java ++++ b/src/main/java/net/minecraft/world/level/chunk/NibbleArray.java +@@ -58,6 +58,7 @@ public class NibbleArray { + boolean poolSafe = false; + public java.lang.Runnable cleaner; + private void registerCleaner() { ++ if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) return; // Tuinity - purge cleaner usage + if (!poolSafe) { + cleaner = MCUtil.registerCleaner(this, this.a, NibbleArray::releaseBytes); + } else { +@@ -65,7 +66,7 @@ public class NibbleArray { + } + } + // Paper end +- @Nullable protected byte[] a; ++ @Nullable protected byte[] a; public final byte[] justGiveMeTheFuckingByteArrayNoCleanerBullshitJesusFuckingChrist() { return this.a; } + + + public NibbleArray() {} +@@ -76,7 +77,7 @@ public class NibbleArray { + } + public NibbleArray(byte[] abyte, boolean isSafe) { + this.a = abyte; +- if (!isSafe) this.a = getCloneIfSet(); // Paper - clone for safety ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && !isSafe) this.a = getCloneIfSet(); // Paper - clone for safety // Tuinity - no need to clone + registerCleaner(); + // Paper end + if (abyte.length != 2048) { +@@ -164,7 +165,7 @@ public class NibbleArray { + + public NibbleArray copy() { return this.b(); } // Paper - OBFHELPER + public NibbleArray b() { +- return this.a == null ? new NibbleArray() : new NibbleArray(this.a); // Paper - clone in ctor ++ return this.a == null ? new NibbleArray() : new NibbleArray(com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? this.a.clone() : this.a); // Paper - clone in ctor // Tuinity - no longer clone in constructor + } + + public String toString() { +diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +index 72c258ae5c3cc93e42b86af9426b5e9715dc1599..692658893f9d33938fc4fed854ad31c14c920e95 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +@@ -66,6 +66,54 @@ public class ProtoChunk implements IChunkAccess { private volatile boolean u; final World world; // Paper - Anti-Xray - Add world // Paper - private -> default @@ -5367,7 +5283,7 @@ index a3ac883500eaebb353ad3108a17b5c740e384b03..d8b759874545293764690b2ba08a4bd7 // 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,7 +221,7 @@ public class ProtoChunk implements IChunkAccess { +@@ -191,7 +239,7 @@ public class ProtoChunk implements IChunkAccess { ChunkSection chunksection = this.a(j >> 4); IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata); @@ -5376,11 +5292,11 @@ index a3ac883500eaebb353ad3108a17b5c740e384b03..d8b759874545293764690b2ba08a4bd7 LightEngine lightengine = this.e(); lightengine.a(blockposition); -diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..2d7c86c9a323fb7294607ee5685cef8f9ef52794 100644 ---- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java -+++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -@@ -8,7 +8,50 @@ import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java +index 7a82d43d51d80a3054e0871bf4b9aa7635920efc..980727261b328dc69f133f33906e957aa75f8600 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java ++++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunkExtension.java +@@ -24,7 +24,50 @@ import net.minecraft.world.level.material.FluidTypes; public class ProtoChunkExtension extends ProtoChunk { @@ -5432,45 +5348,157 @@ index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..2d7c86c9a323fb7294607ee5685cef8f public ProtoChunkExtension(Chunk chunk) { super(chunk.getPos(), ChunkConverter.a, chunk.world); // Paper - Anti-Xray - Add parameter -diff --git a/src/main/java/net/minecraft/server/SectionPosition.java b/src/main/java/net/minecraft/server/SectionPosition.java -index f95925f1c5d091f1a129d0437bb6e175c6ac080f..0bb3ad0bffc04eba38cd827eaf5c63e8bf2aee93 100644 ---- a/src/main/java/net/minecraft/server/SectionPosition.java -+++ b/src/main/java/net/minecraft/server/SectionPosition.java -@@ -7,7 +7,7 @@ import java.util.stream.StreamSupport; +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +index 2d6b14345d4fcc803b011235e9798d5db613502a..ec2b238480413ba9c123d9ddeaa787d9520e1b74 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java +@@ -108,6 +108,13 @@ public class ChunkRegionLoader { + private static final boolean JUST_CORRUPT_IT = Boolean.getBoolean("Paper.ignoreWorldDataVersion"); + // Paper end - public class SectionPosition extends BaseBlockPosition { ++ // Tuinity start - rewrite light engine ++ private static final int STARLIGHT_LIGHT_VERSION = 4; ++ ++ private static final String UNINITIALISED_SKYLIGHT_TAG = "starlight.skylight_uninit"; ++ private static final String STARLIGHT_VERSION_TAG = "starlight.light_version"; ++ // Tuinity end - rewrite light engine ++ + public static InProgressChunkHolder loadChunk(WorldServer worldserver, DefinedStructureManager definedstructuremanager, VillagePlace villageplace, ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound, boolean distinguish) { + ArrayDeque tasksToExecuteOnMain = new ArrayDeque<>(); + // Paper end +@@ -137,13 +144,17 @@ public class ChunkRegionLoader { + ProtoChunkTickList protochunkticklist1 = new ProtoChunkTickList<>((fluidtype) -> { + return fluidtype == null || fluidtype == FluidTypes.EMPTY; + }, chunkcoordintpair, nbttagcompound1.getList("LiquidsToBeTicked", 9)); +- boolean flag = nbttagcompound1.getBoolean("isLightOn"); ++ boolean flag = (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nbttagcompound1.getInt(STARLIGHT_VERSION_TAG) == STARLIGHT_LIGHT_VERSION : nbttagcompound1.getBoolean("isLightOn")); boolean canUseSkyLight = flag && getStatus(nbttagcompound).isAtLeastStatus(ChunkStatus.LIGHT); boolean canUseBlockLight = canUseSkyLight; // Tuinity + NBTTagList nbttaglist = nbttagcompound1.getList("Sections", 10); + boolean flag1 = true; + ChunkSection[] achunksection = new ChunkSection[16]; + 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(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); -- private SectionPosition(int i, int j, int k) { -+ public SectionPosition(int i, int j, int k) { // Tuinity - private -> public - super(i, j, k); + if (flag) { + tasksToExecuteOnMain.add(() -> { // Paper - delay this task since we're executing off-main +@@ -171,6 +182,7 @@ public class ChunkRegionLoader { + + if (flag) { + if (nbttagcompound2.hasKeyOfType("BlockLight", 7)) { ++ 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(() -> { +@@ -180,13 +192,14 @@ public class ChunkRegionLoader { + } + + if (flag2 && nbttagcompound2.hasKeyOfType("SkyLight", 7)) { ++ 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(() -> { + lightengine.a(EnumSkyBlock.SKY, SectionPosition.a(chunkcoordintpair, b0), skyLight, true); + }); + // Paper end - delay this task since we're executing off-main +- } ++ } else if (flag2 && nbttagcompound2.getBoolean(UNINITIALISED_SKYLIGHT_TAG)) skyNibbles[b0 - minSection] = new com.tuinity.tuinity.chunk.light.SWMRNibbleArray(); // Tuinity - replace light impl + } + } + +@@ -225,8 +238,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 ++ ((Chunk)object).setBlockNibbles(blockNibbles); // Tuinity - replace light impl ++ ((Chunk)object).setSkyNibbles(skyNibbles); // Tuinity - replace light impl + } else { + ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray - Add parameter ++ protochunk.setBlockNibbles(blockNibbles); // Tuinity - replace light impl ++ protochunk.setSkyNibbles(skyNibbles); // Tuinity - replace light impl + + protochunk.a(biomestorage); + object = protochunk; +@@ -405,15 +422,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 - 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) { ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && blockArray != null) { // Tuinity - data already copied + blockArray = blockArray.copy(); + } +- if (skyArray != null) { ++ if (!com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine && skyArray != null) { // Tuinity - data already copied + skyArray = skyArray.copy(); + } + +@@ -448,6 +470,10 @@ 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(); +@@ -481,8 +507,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 - 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 +@@ -496,12 +522,12 @@ public class ChunkRegionLoader { + } -diff --git a/src/main/java/net/minecraft/server/TicketType.java b/src/main/java/net/minecraft/server/TicketType.java -index 25cff70b45aa2c92a9ffb2cd968ffef5bb1a6c2f..3c964f26592fc84bb5fc11c60808d11c65d93b16 100644 ---- a/src/main/java/net/minecraft/server/TicketType.java -+++ b/src/main/java/net/minecraft/server/TicketType.java -@@ -28,6 +28,8 @@ public class TicketType { - public static final TicketType URGENT = a("urgent", Comparator.comparingLong(ChunkCoordIntPair::pair), 300); // Paper - public static final TicketType DELAYED_UNLOAD = a("delayed_unload", Long::compareTo); // Tuinity - delay chunk unloads - public static final TicketType REQUIRED_LOAD = a("required_load", Long::compareTo); // Tuinity - make sure getChunkAt does not fail -+ public static final TicketType LIGHT_UPDATE = a("light_update", Comparator.comparingLong(ChunkCoordIntPair::pair)); // Tuinity - ensure chunks stay loaded for lighting -+ public static final TicketType CHUNK_RELIGHT = a("chunk_relight", Long::compareTo); // Tuinity - ensure chunk stays loaded for relighting + if (nibblearray != null && !nibblearray.c()) { +- nbttagcompound2.setByteArray("BlockLight", nibblearray.asBytesPoolSafe().clone()); // Paper ++ nbttagcompound2.setByteArray("BlockLight", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray.asBytes() : nibblearray.asBytesPoolSafe().clone()); // Paper // Tuinity - data is already cloned + } - // Tuinity start - delay chunk unloads - boolean delayUnloadViable = true; -@@ -37,6 +39,7 @@ public class TicketType { - TicketType.PRIORITY.delayUnloadViable = false; - TicketType.URGENT.delayUnloadViable = false; - TicketType.DELAYED_UNLOAD.delayUnloadViable = false; -+ TicketType.LIGHT_UPDATE.delayUnloadViable = false; // Tuinity - ensure chunks stay loaded for lighting - } - // Tuinity end - delay chunk unloads - public static TicketType a(String s, Comparator comparator) { -diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 700660dd93b3090334bb3033d5f5fdd6ab684744..e3b72922e2dfad07f3452ec5ee2af379d968c52d 100644 ---- a/src/main/java/net/minecraft/server/VoxelShape.java -+++ b/src/main/java/net/minecraft/server/VoxelShape.java -@@ -57,6 +57,7 @@ public abstract class VoxelShape { + if (nibblearray1 != null && !nibblearray1.c()) { +- nbttagcompound2.setByteArray("SkyLight", nibblearray1.asBytesPoolSafe().clone()); // Paper +- } ++ nbttagcompound2.setByteArray("SkyLight", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? nibblearray1.asBytes() : nibblearray1.asBytesPoolSafe().clone()); // Paper // Tuinity - data is already cloned ++ } else if (nibblearray1 != null && com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) nbttagcompound2.setBoolean(UNINITIALISED_SKYLIGHT_TAG, true); // Tuinity - store uninitialised tags + + nbttaglist.add(nbttagcompound2); + } +@@ -509,7 +535,7 @@ public class ChunkRegionLoader { + + nbttagcompound1.set("Sections", nbttaglist); + if (flag) { +- nbttagcompound1.setBoolean("isLightOn", true); ++ nbttagcompound1.setBoolean("isLightOn", com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine ? false : true); if (com.tuinity.tuinity.config.TuinityConfig.useNewLightEngine) nbttagcompound1.setInt(STARLIGHT_VERSION_TAG, STARLIGHT_LIGHT_VERSION); // Tuinity + } + + BiomeStorage biomestorage = ichunkaccess.getBiomeIndex(); +diff --git a/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java b/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java +index 8ecd4d38334872da8d7d05cdef1fb08cf0ff17d9..9567630593da7c77a0173b93c9a57ceb7887a59b 100644 +--- a/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java ++++ b/src/main/java/net/minecraft/world/phys/shapes/VoxelShape.java +@@ -65,6 +65,7 @@ public abstract class VoxelShape { } // Tuinity end - optimise multi-aabb shapes @@ -5478,21 +5506,3 @@ index 700660dd93b3090334bb3033d5f5fdd6ab684744..e3b72922e2dfad07f3452ec5ee2af379 public VoxelShape c() { VoxelShape[] avoxelshape = new VoxelShape[]{VoxelShapes.a()}; -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d1832cd24667f62026f6f0b8d9d1cec8139aa057..ff9cbb830779b54af3fd3964d559b0d88376681d 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -402,6 +402,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { - } - // Tuinity end - optimise get nearest players for entity AI - -+ // Tuinity start - rewrite light engine -+ /** -+ * Cannot be modified during light updates. -+ */ -+ public com.tuinity.tuinity.chunk.light.VariableBlockLightHandler customBlockLightHandlers; -+ // Tuinity end - rewrite light engine -+ - // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { - super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor diff --git a/patches/Tuinity/patches/server/0062-Optimise-WorldServer-notify.patch b/patches/Tuinity/patches/server/0062-Optimise-WorldServer-notify.patch index 928d90b3..813b4f42 100644 --- a/patches/Tuinity/patches/server/0062-Optimise-WorldServer-notify.patch +++ b/patches/Tuinity/patches/server/0062-Optimise-WorldServer-notify.patch @@ -7,56 +7,11 @@ Iterating over all of the navigators in the world is pretty expensive. Instead, only iterate over navigators in the current region that are eligible for repathing. -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 1558c5f8256f50be6850f1d7f70eee3e8ec76496..6aec5098d346c1b7498fd8b800154cd31ce08a97 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -8,7 +8,7 @@ import javax.annotation.Nullable; - - public abstract class NavigationAbstract { - -- protected final EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER -+ protected final EntityInsentient a; public final EntityInsentient getEntity() { return a; } // Paper - OBFHELPER // Tuinity - match types - protected final World b; - @Nullable - protected PathEntity c; protected final PathEntity getCurrentPath() { return this.c; } // Paper - OBFHELPER -@@ -21,7 +21,7 @@ public abstract class NavigationAbstract { - protected long j; - protected double k; - protected float l; -- protected boolean m; -+ protected boolean m; protected final boolean needsPathRecalculation() { return this.m; } // Tuinity - OBFHELPER - protected long n; - protected PathfinderAbstract o; - private BlockPosition p; -@@ -30,6 +30,13 @@ public abstract class NavigationAbstract { - private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER - private boolean t; - -+ // Tuinity start -+ public boolean isViableForPathRecalculationChecking() { -+ return !this.needsPathRecalculation() && -+ (this.c != null && !this.c.c() && this.c.e() != 0); -+ } -+ // Tuinity end -+ - public NavigationAbstract(EntityInsentient entityinsentient, World world) { - this.g = Vec3D.ORIGIN; - this.h = BaseBlockPosition.ZERO; -@@ -393,7 +400,7 @@ public abstract class NavigationAbstract { - } - - public void b(BlockPosition blockposition) { -- if (this.c != null && !this.c.c() && this.c.e() != 0) { -+ if (this.c != null && !this.c.c() && this.c.e() != 0) { // Tuinity - diff on change - needed for isViableForPathRecalculationChecking() - PathPoint pathpoint = this.c.d(); - Vec3D vec3d = new Vec3D(((double) pathpoint.a + this.a.locX()) / 2.0D, ((double) pathpoint.b + this.a.locY()) / 2.0D, ((double) pathpoint.c + this.a.locZ()) / 2.0D); - -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index ff91f069e5f4a16c069c8a68d8cb55e9ad3627c8..58089180c730ce0bc423cdb20e86f11858543c25 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -299,17 +299,82 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index e30995df572df6135e159d34cd7646fd08db4a5a..b48d419f82f0d9df1f8848d95066bad7e8e5629a 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -353,17 +353,82 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public static final class DataRegionData implements com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager.RegionData { @@ -139,7 +94,7 @@ index ff91f069e5f4a16c069c8a68d8cb55e9ad3627c8..58089180c730ce0bc423cdb20e86f118 } @Override -@@ -319,6 +384,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -373,6 +438,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { final DataRegionSectionData sectionData = (DataRegionSectionData)section.sectionData; final DataRegionData oldRegionData = oldRegion == null ? null : (DataRegionData)oldRegion.regionData; final DataRegionData newRegionData = (DataRegionData)newRegion.regionData; @@ -155,11 +110,11 @@ index ff91f069e5f4a16c069c8a68d8cb55e9ad3627c8..58089180c730ce0bc423cdb20e86f118 } } // Tuiniy end -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cdeb0d0fbe 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -970,6 +970,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 6ce29205ba4480b19912a7acd393c4198d6a9e35..4ffe6c1e791f1a8531525bc053b30629fcc30e82 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1083,6 +1083,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { gameprofilerfiller.enter("checkDespawn"); if (!entity.dead) { entity.checkDespawn(); @@ -175,7 +130,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd } gameprofilerfiller.exit(); -@@ -992,7 +1001,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1105,7 +1114,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.removeEntityFromChunk(entity); this.entitiesById.remove(entity.getId()); // Tuinity this.unregisterEntity(entity); @@ -190,7 +145,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd gameprofilerfiller.exit(); } -@@ -1403,6 +1419,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1516,6 +1532,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { int i = MathHelper.floor(entity.locX() / 16.0D); int j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior int k = MathHelper.floor(entity.locZ() / 16.0D); @@ -203,7 +158,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { // Paper start - remove entity if its in a chunk more correctly. -@@ -1412,6 +1434,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1525,6 +1547,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end @@ -216,7 +171,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd if (entity.inChunk && this.isChunkLoaded(entity.chunkX, entity.chunkZ)) { this.getChunkAt(entity.chunkX, entity.chunkZ).a(entity, entity.chunkY); } -@@ -1425,6 +1453,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1538,6 +1566,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { } else { this.getChunkAt(i, k).a(entity); } @@ -228,7 +183,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd } this.getMethodProfiler().exit(); -@@ -1887,9 +1920,64 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2000,9 +2033,64 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Tuinity end } new com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid @@ -293,7 +248,7 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd private void registerEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot // Paper start - don't double enqueue entity registration -@@ -2070,16 +2158,26 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2183,16 +2271,26 @@ public class WorldServer extends World implements GeneratorAccessSeed { VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition); if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) { @@ -322,3 +277,48 @@ index ff9cbb830779b54af3fd3964d559b0d88376681d..c6d2ab318d711072507ce3667d07a9cd } catch (java.util.ConcurrentModificationException ex) { // This can happen because the pathfinder update below may trigger a chunk load, which in turn may cause more navigators to register // In this case we just run the update again across all the iterators as the chunk will then be loaded +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +index e6ba9b7fbf08ae0dd083a1ebee8eb7ed8a937751..148bdbc2cffb002d8b6dd05e70854ab503804949 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +@@ -30,7 +30,7 @@ import net.minecraft.world.phys.Vec3D; + + public abstract class NavigationAbstract { + +- protected final EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER ++ protected final EntityInsentient a; public final EntityInsentient getEntity() { return a; } // Paper - OBFHELPER // Tuinity - match types + protected final World b; + @Nullable + protected PathEntity c; protected final PathEntity getCurrentPath() { return this.c; } // Paper - OBFHELPER +@@ -43,7 +43,7 @@ public abstract class NavigationAbstract { + protected long j; + protected double k; + protected float l; +- protected boolean m; ++ protected boolean m; protected final boolean needsPathRecalculation() { return this.m; } // Tuinity - OBFHELPER + protected long n; + protected PathfinderAbstract o; + private BlockPosition p; +@@ -52,6 +52,13 @@ public abstract class NavigationAbstract { + private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER + private boolean t; + ++ // Tuinity start ++ public boolean isViableForPathRecalculationChecking() { ++ return !this.needsPathRecalculation() && ++ (this.c != null && !this.c.c() && this.c.e() != 0); ++ } ++ // Tuinity end ++ + public NavigationAbstract(EntityInsentient entityinsentient, World world) { + this.g = Vec3D.ORIGIN; + this.h = BaseBlockPosition.ZERO; +@@ -415,7 +422,7 @@ public abstract class NavigationAbstract { + } + + public void b(BlockPosition blockposition) { +- if (this.c != null && !this.c.c() && this.c.e() != 0) { ++ if (this.c != null && !this.c.c() && this.c.e() != 0) { // Tuinity - diff on change - needed for isViableForPathRecalculationChecking() + PathPoint pathpoint = this.c.d(); + Vec3D vec3d = new Vec3D(((double) pathpoint.a + this.a.locX()) / 2.0D, ((double) pathpoint.b + this.a.locY()) / 2.0D, ((double) pathpoint.c + this.a.locZ()) / 2.0D); + diff --git a/patches/Tuinity/patches/server/0063-Actually-unload-POI-data.patch b/patches/Tuinity/patches/server/0063-Actually-unload-POI-data.patch index d75b5cc1..9e9cfac1 100644 --- a/patches/Tuinity/patches/server/0063-Actually-unload-POI-data.patch +++ b/patches/Tuinity/patches/server/0063-Actually-unload-POI-data.patch @@ -9,11 +9,11 @@ sometimes it is. This patch also prevents the saving/unloading of POI data when world saving is disabled. -diff --git a/src/main/java/net/minecraft/server/LightEngineGraphSection.java b/src/main/java/net/minecraft/server/LightEngineGraphSection.java -index 13d067f48647dea63ef1bf3a2a3e0868074ba75f..04afd7f285db2f281a038e0be6f557b8a692936b 100644 ---- a/src/main/java/net/minecraft/server/LightEngineGraphSection.java -+++ b/src/main/java/net/minecraft/server/LightEngineGraphSection.java -@@ -74,8 +74,10 @@ public abstract class LightEngineGraphSection extends LightEngineGraph { +diff --git a/src/main/java/net/minecraft/server/level/LightEngineGraphSection.java b/src/main/java/net/minecraft/server/level/LightEngineGraphSection.java +index 4ee7070364a8989eece4fa4237b529926821f9c9..f22ab98d2e250081df8949be8a99737069c83d34 100644 +--- a/src/main/java/net/minecraft/server/level/LightEngineGraphSection.java ++++ b/src/main/java/net/minecraft/server/level/LightEngineGraphSection.java +@@ -77,8 +77,10 @@ public abstract class LightEngineGraphSection extends LightEngineGraph { return i == Long.MAX_VALUE ? this.b(j) : k + 1; } @@ -24,11 +24,11 @@ index 13d067f48647dea63ef1bf3a2a3e0868074ba75f..04afd7f285db2f281a038e0be6f557b8 public void b(long i, int j, boolean flag) { this.a(Long.MAX_VALUE, i, j, flag); } -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 58089180c730ce0bc423cdb20e86f11858543c25..6ac16c7252f5f9e7259eed2bae74a14d57a9bd37 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -928,6 +928,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index b48d419f82f0d9df1f8848d95066bad7e8e5629a..7136e2adc5844280471fd392a3d49da7295ef006 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -982,6 +982,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Tuinity end } @@ -36,16 +36,16 @@ index 58089180c730ce0bc423cdb20e86f11858543c25..6ac16c7252f5f9e7259eed2bae74a14d this.updatingChunks.put(i, playerchunk); this.updatingChunksModified = true; -@@ -1053,7 +1054,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1107,7 +1108,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } - private static final double UNLOAD_QUEUE_RESIZE_FACTOR = 0.90; // Spigot // Paper - unload more -+ static final double UNLOAD_QUEUE_RESIZE_FACTOR = 0.90; // Spigot // Paper - unload more // Tuinity - private -> package private ++ public static final double UNLOAD_QUEUE_RESIZE_FACTOR = 0.90; // Spigot // Paper - unload more // Tuinity - private -> public protected void unloadChunks(BooleanSupplier booleansupplier) { GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); -@@ -1185,6 +1186,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1239,6 +1240,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.regionManagers.get(index).removeChunk(playerchunk.location.x, playerchunk.location.z); } // Tuinity end @@ -53,7 +53,7 @@ index 58089180c730ce0bc423cdb20e86f11858543c25..6ac16c7252f5f9e7259eed2bae74a14d if (ichunkaccess instanceof Chunk) { ((Chunk) ichunkaccess).setLoaded(false); } -@@ -1213,6 +1215,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1267,6 +1269,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.regionManagers.get(index).removeChunk(playerchunk.location.x, playerchunk.location.z); } // Tuinity end @@ -61,7 +61,7 @@ index 58089180c730ce0bc423cdb20e86f11858543c25..6ac16c7252f5f9e7259eed2bae74a14d } // Tuinity end } finally { this.unloadingPlayerChunk = unloadingBefore; } // Tuinity - do not allow ticket level changes while unloading chunks -@@ -1306,6 +1309,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1360,6 +1363,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData); chunkHolder.tasks.forEach(Runnable::run); @@ -69,82 +69,10 @@ index 58089180c730ce0bc423cdb20e86f11858543c25..6ac16c7252f5f9e7259eed2bae74a14d // Paper end if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async -diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java -index d9362b74fda2ea937281f897fbc2cb501775a275..79a11d17a2822b192dec5981d0344ae689c3d385 100644 ---- a/src/main/java/net/minecraft/server/RegionFileSection.java -+++ b/src/main/java/net/minecraft/server/RegionFileSection.java -@@ -25,8 +25,8 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - - private static final Logger LOGGER = LogManager.getLogger(); - // Paper - nuke IOWorker -- private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); -- protected final LongLinkedOpenHashSet d = new LongLinkedOpenHashSet(); // Paper - private -> protected -+ private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); protected final Long2ObjectMap> getDataBySection() { return this.c; } // Tuinity - OBFHELPER -+ protected final LongLinkedOpenHashSet d = new LongLinkedOpenHashSet(); protected final LongLinkedOpenHashSet getDirtySections() { return this.d; } // Paper - private -> protected // Tuinity - OBFHELPER - private final Function> e; - private final Function f; - private final DataFixer g; -@@ -50,6 +50,40 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - - } - -+ // Tuinity start - actually unload POI data -+ public void unloadData(long coordinate) { -+ ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(coordinate); -+ this.writeDirtyData(chunkPos); -+ -+ Long2ObjectMap> data = this.getDataBySection(); -+ int before = data.size(); -+ -+ for (int section = 0; section < 16; ++section) { -+ data.remove(SectionPosition.asLong(chunkPos.x, section, chunkPos.z)); -+ } -+ -+ if (before != data.size()) { -+ this.onUnload(coordinate); -+ } -+ } -+ -+ protected void onUnload(long coordinate) {} -+ -+ public boolean isEmpty(long coordinate) { -+ Long2ObjectMap> data = this.getDataBySection(); -+ int x = MCUtil.getCoordinateX(coordinate); -+ int z = MCUtil.getCoordinateZ(coordinate); -+ for (int section = 0; section < 16; ++section) { -+ Optional optional = data.get(SectionPosition.asLong(x, section, z)); -+ if (optional != null && optional.orElse(null) != null) { -+ return false; -+ } -+ } -+ -+ return true; -+ } -+ // Tuinity end - actually unload POI data -+ - @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER - @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER - return (Optional) this.c.get(i); -@@ -150,6 +184,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - }); - } - } -+ if (this instanceof VillagePlace) { ((VillagePlace)this).queueUnload(chunkcoordintpair.pair(), MinecraftServer.currentTickLong + 1); } // Tuinity - unload POI data - - } - -@@ -221,6 +256,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - return dynamic.get("DataVersion").asInt(1945); - } - -+ public final void writeDirtyData(ChunkCoordIntPair chunkcoordintpair) { this.a(chunkcoordintpair); } // Tuinity - OBFHELPER - public void a(ChunkCoordIntPair chunkcoordintpair) { - if (!this.d.isEmpty()) { - for (int i = 0; i < 16; ++i) { -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296f001ec61 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index 84843ebbef7a6e56633b35712b1643801dca62dc..a5edfaa41156fc03181f38a8813eb5bcc8c08e48 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java @@ -4,6 +4,7 @@ import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.longs.Long2ByteMap; @@ -153,7 +81,7 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import it.unimi.dsi.fastutil.longs.LongSet; import java.io.File; -@@ -22,8 +23,24 @@ import java.util.stream.Stream; +@@ -35,8 +36,24 @@ import net.minecraft.world.level.chunk.storage.RegionFileSection; public class VillagePlace extends RegionFileSection { @@ -180,7 +108,7 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 private final WorldServer world; // Paper -@@ -34,9 +51,124 @@ public class VillagePlace extends RegionFileSection { +@@ -47,9 +64,124 @@ public class VillagePlace extends RegionFileSection { public VillagePlace(File file, DataFixer datafixer, boolean flag, WorldServer world) { super(file, VillagePlaceSection::a, VillagePlaceSection::new, datafixer, DataFixTypes.POI_CHUNK, flag); this.world = world; @@ -257,11 +185,11 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 + + public void pollUnloads(BooleanSupplier canSleepForTick) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("async poi unload"); -+ long currentTick = MinecraftServer.currentTickLong; -+ ChunkProviderServer chunkProvider = this.world.getChunkProvider(); -+ PlayerChunkMap playerChunkMap = chunkProvider.playerChunkMap; ++ long currentTick = net.minecraft.server.MinecraftServer.currentTickLong; ++ net.minecraft.server.level.ChunkProviderServer chunkProvider = this.world.getChunkProvider(); ++ net.minecraft.server.level.PlayerChunkMap playerChunkMap = chunkProvider.playerChunkMap; + // copied target determination from PlayerChunkMap -+ int target = Math.min(this.queuedUnloads.size() - 100, (int) (this.queuedUnloads.size() * PlayerChunkMap.UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Make more aggressive ++ int target = Math.min(this.queuedUnloads.size() - 100, (int) (this.queuedUnloads.size() * net.minecraft.server.level.PlayerChunkMap.UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Make more aggressive + for (java.util.Iterator iterator = this.queuedUnloads.iterator(); + iterator.hasNext() && (this.queuedUnloads.size() > target || canSleepForTick.getAsBoolean());) { + QueuedUnload unload = iterator.next(); @@ -274,7 +202,7 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 + iterator.remove(); + this.queuedUnloadsByCoordinate.remove(coordinate); + -+ if (playerChunkMap.getUnloadingPlayerChunk(MCUtil.getCoordinateX(coordinate), MCUtil.getCoordinateZ(coordinate)) != null ++ if (playerChunkMap.getUnloadingPlayerChunk(net.minecraft.server.MCUtil.getCoordinateX(coordinate), net.minecraft.server.MCUtil.getCoordinateZ(coordinate)) != null + || playerChunkMap.getUpdatingChunk(coordinate) != null) { + continue; + } @@ -293,8 +221,8 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 + protected void onUnload(long coordinate) { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("async poi unload callback"); + this.getLoadedChunks().remove(coordinate); -+ int chunkX = MCUtil.getCoordinateX(coordinate); -+ int chunkZ = MCUtil.getCoordinateZ(coordinate); ++ int chunkX = net.minecraft.server.MCUtil.getCoordinateX(coordinate); ++ int chunkZ = net.minecraft.server.MCUtil.getCoordinateZ(coordinate); + for (int section = 0; section < 16; ++section) { + long sectionPos = SectionPosition.asLong(chunkX, section, chunkZ); + this.updateDistanceTracking(sectionPos); @@ -305,21 +233,21 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 public void a(BlockPosition blockposition, VillagePlaceType villageplacetype) { ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition, villageplacetype); } -@@ -140,10 +272,11 @@ public class VillagePlace extends RegionFileSection { +@@ -153,10 +285,11 @@ public class VillagePlace extends RegionFileSection { } public int a(SectionPosition sectionposition) { - this.a.a(); - return this.a.c(sectionposition.s()); + this.villageDistanceTracker.propagateUpdates(); // Tuinity - replace distance tracking util -+ return convertBetweenLevels(this.villageDistanceTracker.getLevel(MCUtil.getSectionKey(sectionposition))); // Tuinity - replace distance tracking util ++ return convertBetweenLevels(this.villageDistanceTracker.getLevel(net.minecraft.server.MCUtil.getSectionKey(sectionposition))); // Tuinity - replace distance tracking util } + private boolean isSectionDistanceTrackerSource(long section) { return this.f(section); } // Tuinity - OBFHELPER private boolean f(long i) { Optional optional = this.c(i); -@@ -159,7 +292,7 @@ public class VillagePlace extends RegionFileSection { +@@ -172,7 +305,7 @@ public class VillagePlace extends RegionFileSection { super.a(booleansupplier); } else { //super.a(booleansupplier); // re-implement below @@ -328,7 +256,7 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 ChunkCoordIntPair chunkcoordintpair = SectionPosition.a(((RegionFileSection)this).d.firstLong()).r(); NBTTagCompound data; -@@ -170,19 +303,24 @@ public class VillagePlace extends RegionFileSection { +@@ -183,19 +316,24 @@ public class VillagePlace extends RegionFileSection { chunkcoordintpair.x, chunkcoordintpair.z, data, null, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY); // Tuinity - use normal priority } } @@ -356,7 +284,7 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 } public void a(ChunkCoordIntPair chunkcoordintpair, ChunkSection chunksection) { -@@ -247,7 +385,7 @@ public class VillagePlace extends RegionFileSection { +@@ -260,7 +398,7 @@ public class VillagePlace extends RegionFileSection { @Override protected int b(long i) { @@ -365,3 +293,75 @@ index 0094babbd59cc81554b9480088464d632824ae8e..fce9967912628c232fe41ccc17fe2296 } @Override +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +index 0791dcc6c2efda54ce3afb36e8d3b0b022807f67..3628b62b8021bbb9b03b3236830b6dccef2d8419 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +@@ -34,8 +34,8 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + + private static final Logger LOGGER = LogManager.getLogger(); + // Paper - nuke IOWorker +- private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); +- public final LongLinkedOpenHashSet d = new LongLinkedOpenHashSet(); // Paper - private -> public ++ private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); protected final Long2ObjectMap> getDataBySection() { return this.c; } // Tuinity - OBFHELPER ++ public final LongLinkedOpenHashSet d = new LongLinkedOpenHashSet(); protected final LongLinkedOpenHashSet getDirtySections() { return this.d; } // Paper - private -> public // Tuinity - OBFHELPER + private final Function> e; + private final Function f; + private final DataFixer g; +@@ -59,6 +59,40 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + + } + ++ // Tuinity start - actually unload POI data ++ public void unloadData(long coordinate) { ++ ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(coordinate); ++ this.writeDirtyData(chunkPos); ++ ++ Long2ObjectMap> data = this.getDataBySection(); ++ int before = data.size(); ++ ++ for (int section = 0; section < 16; ++section) { ++ data.remove(SectionPosition.asLong(chunkPos.x, section, chunkPos.z)); ++ } ++ ++ if (before != data.size()) { ++ this.onUnload(coordinate); ++ } ++ } ++ ++ protected void onUnload(long coordinate) {} ++ ++ public boolean isEmpty(long coordinate) { ++ Long2ObjectMap> data = this.getDataBySection(); ++ int x = net.minecraft.server.MCUtil.getCoordinateX(coordinate); ++ int z = net.minecraft.server.MCUtil.getCoordinateZ(coordinate); ++ for (int section = 0; section < 16; ++section) { ++ Optional optional = data.get(SectionPosition.asLong(x, section, z)); ++ if (optional != null && optional.orElse(null) != null) { ++ return false; ++ } ++ } ++ ++ return true; ++ } ++ // Tuinity end - actually unload POI data ++ + @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER + @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER + return (Optional) this.c.get(i); +@@ -159,6 +193,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + }); + } + } ++ if (this instanceof net.minecraft.world.entity.ai.village.poi.VillagePlace) { ((net.minecraft.world.entity.ai.village.poi.VillagePlace)this).queueUnload(chunkcoordintpair.pair(), net.minecraft.server.MinecraftServer.currentTickLong + 1); } // Tuinity - unload POI data + + } + +@@ -230,6 +265,7 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + return dynamic.get("DataVersion").asInt(1945); + } + ++ public final void writeDirtyData(ChunkCoordIntPair chunkcoordintpair) { this.a(chunkcoordintpair); } // Tuinity - OBFHELPER + public void a(ChunkCoordIntPair chunkcoordintpair) { + if (!this.d.isEmpty()) { + for (int i = 0; i < 16; ++i) { diff --git a/patches/Tuinity/patches/server/0064-Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/Tuinity/patches/server/0064-Send-full-pos-packets-for-hard-colliding-entities.patch index 5d23ef25..df132f29 100644 --- a/patches/Tuinity/patches/server/0064-Send-full-pos-packets-for-hard-colliding-entities.patch +++ b/patches/Tuinity/patches/server/0064-Send-full-pos-packets-for-hard-colliding-entities.patch @@ -9,10 +9,10 @@ Configurable under `send-full-pos-for-hard-colliding-entities` diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index ceeb515f4528551659598d9999917f8596e3eded..0959aa6855a150b121b9b75885216c46b151179e 100644 +index 1fb7a0e44cdbf563a7858003806a57a5cbda445b..edb9b246bf327f67a8500f77f81b46eb9e04c9b0 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -@@ -229,6 +229,12 @@ public final class TuinityConfig { +@@ -238,6 +238,12 @@ public final class TuinityConfig { useNewLightEngine = TuinityConfig.getBoolean("use-new-light-engine", true); } @@ -25,11 +25,11 @@ index ceeb515f4528551659598d9999917f8596e3eded..0959aa6855a150b121b9b75885216c46 public static final class WorldConfig { public final String worldName; -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 798ebfdcd8e06ffb576964da006e77bd188ad274..2402c18e6a18221a43bea9fc68278da9d19eede4 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -157,7 +157,7 @@ public class EntityTrackerEntry { +diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +index 8d792f96ca655c7f5d66d19af9c37efbf40fa556..a1512ee8422fa39a95e4f19c86fe71b77af54ca0 100644 +--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java +@@ -186,7 +186,7 @@ public class EntityTrackerEntry { // Paper end - remove allocation of Vec3D here boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; diff --git a/patches/Tuinity/patches/server/0065-Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/Tuinity/patches/server/0065-Fix-chunks-refusing-to-unload-at-low-TPS.patch index 463c9586..b72bc269 100644 --- a/patches/Tuinity/patches/server/0065-Fix-chunks-refusing-to-unload-at-low-TPS.patch +++ b/patches/Tuinity/patches/server/0065-Fix-chunks-refusing-to-unload-at-low-TPS.patch @@ -9,11 +9,11 @@ the empty chunk access, so the chunk save must wait for the full chunk future to complete. We can simply schedule to the immediate executor to get this effect, rather than the main mailbox. -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6ac16c7252f5f9e7259eed2bae74a14d57a9bd37..74408c70f896bffba3d021f601db2aa58f93b506 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1595,9 +1595,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 7136e2adc5844280471fd392a3d49da7295ef006..ece674f47c034e38b2fe9acff6b471f2301a6570 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -1649,9 +1649,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { chunk.B(); return chunk; }); diff --git a/patches/Tuinity/patches/server/0066-Fix-incorrect-isRealPlayer-init.patch b/patches/Tuinity/patches/server/0066-Fix-incorrect-isRealPlayer-init.patch index 0640e292..c9576bd9 100644 --- a/patches/Tuinity/patches/server/0066-Fix-incorrect-isRealPlayer-init.patch +++ b/patches/Tuinity/patches/server/0066-Fix-incorrect-isRealPlayer-init.patch @@ -8,11 +8,11 @@ paper placed their logic. So it wont correctly set in this case. Fix by moving it to a different place. -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 184a0d30f4a1d4a6a07449fdd1375a8582da9332..d03d0c13cca1762078617744253a9757b388958f 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -96,6 +96,7 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 92ed4938d5fe6b76e3a9ac5491d6e9c004ade843..26109830d5535e973dabfe758e5b55571a2d71e3 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -178,6 +178,7 @@ public abstract class PlayerList { abstract public void loadAndSaveFiles(); // Paper - moved from DedicatedPlayerList constructor public void a(NetworkManager networkmanager, EntityPlayer entityplayer) { @@ -20,7 +20,7 @@ index 184a0d30f4a1d4a6a07449fdd1375a8582da9332..d03d0c13cca1762078617744253a9757 EntityPlayer prev = pendingPlayers.put(entityplayer.getUniqueID(), entityplayer);// Paper if (prev != null) { disconnectPendingPlayer(prev); -@@ -636,7 +637,7 @@ public abstract class PlayerList { +@@ -720,7 +721,7 @@ public abstract class PlayerList { SocketAddress socketaddress = loginlistener.networkManager.getSocketAddress(); EntityPlayer entity = new EntityPlayer(this.server, this.server.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(this.server.getWorldServer(World.OVERWORLD))); diff --git a/patches/Tuinity/patches/server/0067-Do-not-run-raytrace-logic-for-AIR.patch b/patches/Tuinity/patches/server/0067-Do-not-run-raytrace-logic-for-AIR.patch index c56ebb03..55b846b0 100644 --- a/patches/Tuinity/patches/server/0067-Do-not-run-raytrace-logic-for-AIR.patch +++ b/patches/Tuinity/patches/server/0067-Do-not-run-raytrace-logic-for-AIR.patch @@ -8,11 +8,11 @@ raytracing tends to go through air and returning early is an easy win. The remaining problems with this function are mostly with the block getting itself. -diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index 5c3eb4fc7e5aec2ad8d0050673fc8f4d2bff6a71..5ccf6b483fe15d4ad12ce2d3d11e9440ee9e8ab7 100644 ---- a/src/main/java/net/minecraft/server/IBlockAccess.java -+++ b/src/main/java/net/minecraft/server/IBlockAccess.java -@@ -55,6 +55,7 @@ public interface IBlockAccess { +diff --git a/src/main/java/net/minecraft/world/level/IBlockAccess.java b/src/main/java/net/minecraft/world/level/IBlockAccess.java +index 2e8eea3e8f7973c866a28d15325ed8822c2149ca..e612e1d30f76e217b1aa23488ab025adce048f57 100644 +--- a/src/main/java/net/minecraft/world/level/IBlockAccess.java ++++ b/src/main/java/net/minecraft/world/level/IBlockAccess.java +@@ -67,6 +67,7 @@ public interface IBlockAccess { return MovingObjectPositionBlock.a(raytrace1.a(), EnumDirection.a(vec3d.x, vec3d.y, vec3d.z), new BlockPosition(raytrace1.a())); } // Paper end diff --git a/patches/Tuinity/patches/server/0068-Make-entity-tracker-use-highest-range-of-passengers.patch b/patches/Tuinity/patches/server/0068-Make-entity-tracker-use-highest-range-of-passengers.patch index 77d76fd3..14a6f01d 100644 --- a/patches/Tuinity/patches/server/0068-Make-entity-tracker-use-highest-range-of-passengers.patch +++ b/patches/Tuinity/patches/server/0068-Make-entity-tracker-use-highest-range-of-passengers.patch @@ -7,24 +7,46 @@ This should prevent people from having to up their animal range just so players riding horses or whatever can be seen at the configured player range. -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 50c61b633faaa47a86172315b53899d3747c8e27..2ec48858be8eb2c522c9685b43bd36b3b581cf8b 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -225,8 +225,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index ece674f47c034e38b2fe9acff6b471f2301a6570..7a9cb2d44cb09746ff5bf1579a09fc95b9e7f9a5 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -217,7 +217,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + // inlined EnumMap, TrackingRange.TrackingRangeType + static final org.spigotmc.TrackingRange.TrackingRangeType[] TRACKING_RANGE_TYPES = org.spigotmc.TrackingRange.TrackingRangeType.values(); + public final com.destroystokyo.paper.util.misc.PlayerAreaMap[] playerEntityTrackerTrackMaps; +- final int[] entityTrackerTrackRanges; ++ final int[] entityTrackerTrackRanges; public int getEntityTrackerRange(final int ordinal) { return this.entityTrackerTrackRanges[ordinal]; } // Tuinity - public read + + private int convertSpigotRangeToVanilla(final int vanilla) { + return MinecraftServer.getServer().applyTrackingRangeScale(vanilla); +@@ -2694,7 +2694,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + int j = entity.getEntityType().getChunkRange() * 16; + j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper + +- if (j < i) { // Paper - we need the lowest range thanks to the fact that our tracker doesn't account for passenger logic ++ if (j > i) { // Paper - we need the lowest range thanks to the fact that our tracker doesn't account for passenger logic // Tuinity - not anymore! + i = j; + } + } +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 275df19f44da1a05f60b190994d4a0f9d6c21b18..feab0ae1930b5271fe0d06a40c180317dcbc9d1d 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -317,8 +317,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne } - final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet getPlayersInTrackRange() { + public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet getPlayersInTrackRange() { - return ((WorldServer)this.world).getChunkProvider().playerChunkMap.playerEntityTrackerTrackMaps[this.trackingRangeType.ordinal()] - .getObjectsInRange(MCUtil.getCoordinateKey(this)); + Collection passengers = this.getAllPassengers(); -+ PlayerChunkMap chunkMap = ((WorldServer)this.world).getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = ((WorldServer)this.world).getChunkProvider().playerChunkMap; + org.spigotmc.TrackingRange.TrackingRangeType type = this.trackingRangeType; -+ int range = chunkMap.entityTrackerTrackRanges[type.ordinal()]; ++ int range = chunkMap.getEntityTrackerRange(type.ordinal()); + + for (Entity passenger : passengers) { + org.spigotmc.TrackingRange.TrackingRangeType passengerType = passenger.trackingRangeType; -+ int passengerRange = chunkMap.entityTrackerTrackRanges[passengerType.ordinal()]; ++ int passengerRange = chunkMap.getEntityTrackerRange(passengerType.ordinal()); + if (passengerRange > range) { + type = passengerType; + range = passengerRange; @@ -35,16 +57,3 @@ index 50c61b633faaa47a86172315b53899d3747c8e27..2ec48858be8eb2c522c9685b43bd36b3 } // Paper end - optimise entity tracking -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 74408c70f896bffba3d021f601db2aa58f93b506..9129a720e4d85ffbeaa4c76473de6786ffd816fd 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -2640,7 +2640,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially - int j = entity.getEntityType().getChunkRange() * 16; - j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper - -- if (j < i) { // Paper - we need the lowest range thanks to the fact that our tracker doesn't account for passenger logic -+ if (j > i) { // Paper - we need the lowest range thanks to the fact that our tracker doesn't account for passenger logic // Tuinity - not anymore! - i = j; - } - } diff --git a/patches/Tuinity/patches/server/0069-Do-not-allow-the-server-to-unload-chunks-at-request-.patch b/patches/Tuinity/patches/server/0069-Do-not-allow-the-server-to-unload-chunks-at-request-.patch index 758be811..35d6327a 100644 --- a/patches/Tuinity/patches/server/0069-Do-not-allow-the-server-to-unload-chunks-at-request-.patch +++ b/patches/Tuinity/patches/server/0069-Do-not-allow-the-server-to-unload-chunks-at-request-.patch @@ -9,11 +9,11 @@ especially if it is called during a chunk load. The chunks pushed to be unloaded will simply be unloaded next tick, rather than immediately. -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 18270d44185b0ec41b9b6e1d2135e7aae3b33261..e26389d8d9ee4fedb32767fce3aed071af412304 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -901,6 +901,7 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index c1e1b3d53de18579dbe83e7c88d13d44c89fb2d8..94c47f26ad5f521c46cf29c5b7271598a0dfc075 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -926,6 +926,7 @@ public class ChunkProviderServer extends IChunkProvider { // CraftBukkit start - modelled on below public void purgeUnload() { diff --git a/patches/Tuinity/patches/server/0070-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/Tuinity/patches/server/0070-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index 8bbb3916..5fd67eb5 100644 --- a/patches/Tuinity/patches/server/0070-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/Tuinity/patches/server/0070-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -8,28 +8,11 @@ want to avoid close logic because it's possible to load the chunk through it. This should also be OK from a leak prevention/ state desync POV because the TE is getting unloaded anyways. -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index cc2127b26e41182c14fa95afde878e9b5100a117..f034977f4666385d6e7c7288e453d058c270be01 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -356,6 +356,12 @@ public abstract class EntityHuman extends EntityLiving { - this.activeContainer = this.defaultContainer; - } - // Paper end -+ // Tuinity start - special close for unloaded inventory -+ public void closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) { -+ closeInventory(); -+ this.activeContainer = this.defaultContainer; -+ } -+ // Tuinity end - special close for unloaded inventory - - public void closeInventory() { - this.activeContainer = this.defaultContainer; -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index cf14b83ec3c2b9a2812f50f3bca991e029bf7c67..f40c24b6e2f7bea21d1cb2b58ed3da45ffcfc866 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1588,6 +1588,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index b2cd13541bf3486a69e8f3e41e4c90cdc47180d1..553ad54e5d657a840d3dbd3b48a8b21f1855c18a 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -1718,6 +1718,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.o(); } @@ -47,22 +30,40 @@ index cf14b83ec3c2b9a2812f50f3bca991e029bf7c67..f40c24b6e2f7bea21d1cb2b58ed3da45 public void broadcastCarriedItem() { if (!this.e) { -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c6d2ab318d711072507ce3667d07a9cdeb0d0fbe..658d74b8ab1698fa2832facc6d8e9678af958c85 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1794,9 +1794,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 4ffe6c1e791f1a8531525bc053b30629fcc30e82..b4a22a1bb8001437d0eae48d7284eca0a1b30ad4 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1907,10 +1907,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Spigot Start for (TileEntity tileentity : chunk.getTileEntities().values()) { - if (tileentity instanceof IInventory) { + if (tileentity instanceof net.minecraft.world.IInventory) { + // Tuinity start - this area looks like it can load chunks, change the behavior + // chests for example can apply physics to the world + // so instead we just change the active container and call the event - for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((IInventory) tileentity).getViewers())) { + for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((net.minecraft.world.IInventory) tileentity).getViewers())) { - h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper -+ ((org.bukkit.craftbukkit.entity.CraftHumanEntity)h).getHandle().closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper ++ ((org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper } -+ // Tuiniy end } ++ // Tuiniy end } // Spigot End + this.tileEntityListUnload.addAll(chunk.getTileEntities().values()); +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index ec0956a98c133bcd3d4f92f696c667eab6ff98f1..44038dd278b988508047023107683e5370af54ad 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -453,6 +453,12 @@ public abstract class EntityHuman extends EntityLiving { + this.activeContainer = this.defaultContainer; + } + // Paper end ++ // Tuinity start - special close for unloaded inventory ++ public void closeUnloadedInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) { ++ closeInventory(); ++ this.activeContainer = this.defaultContainer; ++ } ++ // Tuinity end - special close for unloaded inventory + + public void closeInventory() { + this.activeContainer = this.defaultContainer; diff --git a/patches/Tuinity/patches/server/0071-Fix-NPE-in-pickup-logic-for-arrow.patch b/patches/Tuinity/patches/server/0071-Fix-NPE-in-pickup-logic-for-arrow.patch index 5d17a80f..05b58351 100644 --- a/patches/Tuinity/patches/server/0071-Fix-NPE-in-pickup-logic-for-arrow.patch +++ b/patches/Tuinity/patches/server/0071-Fix-NPE-in-pickup-logic-for-arrow.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Fix NPE in pickup logic for arrow Apparently the shooter can be null for tridents returning to players. -diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index f983516b89cdf7ce7fdea8f5a5b1a29dd01ae597..77ddda8bd5b8a37ed51324e9769da4978173e744 100644 ---- a/src/main/java/net/minecraft/server/EntityArrow.java -+++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -509,7 +509,8 @@ public abstract class EntityArrow extends IProjectile { +diff --git a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +index 01679d76405625223869f3fdcb29ffba49f7b69a..e440d26c920c4efddf958c61bfdfa508273062cc 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/EntityArrow.java +@@ -547,7 +547,8 @@ public abstract class EntityArrow extends IProjectile { } itemstack = item.getItemStack(); } diff --git a/patches/Tuinity/patches/server/0072-Remove-chunk-lookup-lambda-allocation-from-counting-.patch b/patches/Tuinity/patches/server/0072-Remove-chunk-lookup-lambda-allocation-from-counting-.patch index ad456b1c..4200c60d 100644 --- a/patches/Tuinity/patches/server/0072-Remove-chunk-lookup-lambda-allocation-from-counting-.patch +++ b/patches/Tuinity/patches/server/0072-Remove-chunk-lookup-lambda-allocation-from-counting-.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Remove chunk lookup & lambda allocation from counting mobs The chunk lookup doesn't look cheap. -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index e26389d8d9ee4fedb32767fce3aed071af412304..cce750fd5725a232db16cd8ec4603d5cf09da3df 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -991,9 +991,9 @@ public class ChunkProviderServer extends IChunkProvider { +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index 94c47f26ad5f521c46cf29c5b7271598a0dfc075..118b21b15e12de491a9cfc2b68c6da7bb10b1fee 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -1016,9 +1016,9 @@ public class ChunkProviderServer extends IChunkProvider { for (EntityPlayer player : this.world.players) { Arrays.fill(player.mobCounts, 0); } @@ -21,11 +21,11 @@ index e26389d8d9ee4fedb32767fce3aed071af412304..cce750fd5725a232db16cd8ec4603d5c } // Paper end this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings -diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index a77b1d61b9dcb0a2a27d7e50357eaf44c99a661e..53fd0549c965b2252ad80648d61ff1f7cd2b837a 100644 ---- a/src/main/java/net/minecraft/server/SpawnerCreature.java -+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -30,9 +30,9 @@ public final class SpawnerCreature { +diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +index b3c73c6b4cffa20813355c5f2132fe3eaa134007..d497006f05f79015cd791849888832bb53f4a414 100644 +--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java +@@ -64,9 +64,9 @@ public final class SpawnerCreature { public static SpawnerCreature.d a(int i, Iterable iterable, SpawnerCreature.b spawnercreature_b) { // Paper start - add countMobs parameter @@ -33,11 +33,11 @@ index a77b1d61b9dcb0a2a27d7e50357eaf44c99a661e..53fd0549c965b2252ad80648d61ff1f7 + return countMobs(i, iterable, spawnercreature_b, false, null); // Tuinity - it'll still be broken no matter what } - public static SpawnerCreature.d countMobs(int i, Iterable iterable, SpawnerCreature.b spawnercreature_b, boolean countMobs) { -+ public static SpawnerCreature.d countMobs(int i, Iterable iterable, SpawnerCreature.b spawnercreature_b, boolean countMobs, ChunkProviderServer chunkProvider) { // Tuinity - add CPS param ++ public static SpawnerCreature.d countMobs(int i, Iterable iterable, SpawnerCreature.b spawnercreature_b, boolean countMobs, net.minecraft.server.level.ChunkProviderServer chunkProvider) { // Tuinity - add CPS param // Paper end - add countMobs parameter SpawnerCreatureProbabilities spawnercreatureprobabilities = new SpawnerCreatureProbabilities(); Object2IntOpenHashMap object2intopenhashmap = new Object2IntOpenHashMap(); -@@ -63,7 +63,16 @@ public final class SpawnerCreature { +@@ -97,7 +97,16 @@ public final class SpawnerCreature { BlockPosition blockposition = entity.getChunkCoordinates(); long j = ChunkCoordIntPair.pair(blockposition.getX() >> 4, blockposition.getZ() >> 4); @@ -55,7 +55,7 @@ index a77b1d61b9dcb0a2a27d7e50357eaf44c99a661e..53fd0549c965b2252ad80648d61ff1f7 BiomeSettingsMobs.b biomesettingsmobs_b = b(blockposition, chunk).b().a(entity.getEntityType()); if (biomesettingsmobs_b != null) { -@@ -73,10 +82,10 @@ public final class SpawnerCreature { +@@ -107,10 +116,10 @@ public final class SpawnerCreature { object2intopenhashmap.addTo(enumcreaturetype, 1); // Paper start if (countMobs) { diff --git a/patches/Tuinity/patches/server/0073-Optimise-snow-ice-in-chunk-ticking.patch b/patches/Tuinity/patches/server/0073-Optimise-snow-ice-in-chunk-ticking.patch index ae00f357..187b8509 100644 --- a/patches/Tuinity/patches/server/0073-Optimise-snow-ice-in-chunk-ticking.patch +++ b/patches/Tuinity/patches/server/0073-Optimise-snow-ice-in-chunk-ticking.patch @@ -10,11 +10,62 @@ Soften some of the block gets by passing the chunk to the biome methods, removing the need to invoke a chunk lookup. -diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 0854ac9ef586b378420d9899f3afd2755e6f9f33..3fc101552e3c229076c91a1cfa45206b4cc7a04c 100644 ---- a/src/main/java/net/minecraft/server/BiomeBase.java -+++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -145,14 +145,33 @@ public final class BiomeBase { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index b4a22a1bb8001437d0eae48d7284eca0a1b30ad4..943f72ed96549e1a495af984670ed3efe8707f6a 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1196,6 +1196,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private final BlockPosition.MutableBlockPosition chunkTickMutablePosition = new BlockPosition.MutableBlockPosition(); + private final com.destroystokyo.paper.util.math.ThreadUnsafeRandom randomTickRandom = new com.destroystokyo.paper.util.math.ThreadUnsafeRandom(); + // Paper end ++ // Tuinity start - optimise chunk ice snow ticking ++ private final BiomeBase[] biomeBaseCache = new BiomeBase[1]; ++ // Tuinity end - optimise chunk ice snow ticking + + public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper + ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); +@@ -1233,28 +1236,32 @@ public class WorldServer extends World implements GeneratorAccessSeed { + gameprofilerfiller.exitEnter("iceandsnow"); + if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking + // Paper start - optimise chunk ticking ++ // Tuinity start - optimise chunk ice snow ticking ++ BiomeBase[] biomeCache = this.biomeBaseCache; ++ biomeCache[0] = null; ++ // Tuinity start - optimise chunk ice snow ticking + this.getRandomBlockPosition(j, 0, k, 15, blockposition); + int normalY = chunk.getHighestBlockY(HeightMap.Type.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15); + int downY = normalY - 1; + blockposition.setY(normalY); + // Paper end +- BiomeBase biomebase = this.getBiome(blockposition); ++ //BiomeBase biomebase = this.getBiome(blockposition); // Tuinity - lazily-get biome + + // Paper start - optimise chunk ticking + blockposition.setY(downY); +- if (biomebase.a(this, blockposition)) { ++ if (BiomeBase.canTurnWaterIntoIce(this, blockposition, true, chunk, biomeCache)) { // Tuinity - add chunk parameter, avoid biome lookup + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.ICE.getBlockData(), null); // CraftBukkit + // Paper end + } + + blockposition.setY(normalY); // Paper +- if (flag && biomebase.b(this, blockposition)) { ++ if (flag && BiomeBase.canTurnAirIntoSnow(this, blockposition, chunk, biomeCache)) { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.getBlockData(), null); // CraftBukkit + } + + // Paper start - optimise chunk ticking + blockposition.setY(downY); +- if (flag && this.getBiome(blockposition).c() == BiomeBase.Precipitation.RAIN) { ++ if (flag && chunk.getType(blockposition).getBlock() instanceof net.minecraft.world.level.block.BlockCauldron && this.getBiome(blockposition).c() == BiomeBase.Precipitation.RAIN) { // Tuinity - only cauldron uses that method, and it's not likely to hit. So, avoid the expensive biome lookup and replace it with a block lookup TODO check on update for overrides + chunk.getType(blockposition).getBlock().c((World) this, blockposition); + // Paper end + } +diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeBase.java b/src/main/java/net/minecraft/world/level/biome/BiomeBase.java +index 15096a9c2719b8b4c099f62d0a1c808e56b63a8e..9bbd175f7e20591bbefdbddcb5e998e7098c5adb 100644 +--- a/src/main/java/net/minecraft/world/level/biome/BiomeBase.java ++++ b/src/main/java/net/minecraft/world/level/biome/BiomeBase.java +@@ -175,14 +175,33 @@ public final class BiomeBase { } public boolean a(IWorldReader iworldreader, BlockPosition blockposition, boolean flag) { @@ -51,7 +102,7 @@ index 0854ac9ef586b378420d9899f3afd2755e6f9f33..3fc101552e3c229076c91a1cfa45206b if (!flag) { return true; } -@@ -170,13 +189,32 @@ public final class BiomeBase { +@@ -200,13 +219,32 @@ public final class BiomeBase { } public boolean b(IWorldReader iworldreader, BlockPosition blockposition) { @@ -86,54 +137,3 @@ index 0854ac9ef586b378420d9899f3afd2755e6f9f33..3fc101552e3c229076c91a1cfa45206b return true; } } -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 658d74b8ab1698fa2832facc6d8e9678af958c85..a77fceac7c9e79a6bac05becc21bcb6bf2a1a7c7 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1083,6 +1083,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { - private final BlockPosition.MutableBlockPosition chunkTickMutablePosition = new BlockPosition.MutableBlockPosition(); - private final com.destroystokyo.paper.util.math.ThreadUnsafeRandom randomTickRandom = new com.destroystokyo.paper.util.math.ThreadUnsafeRandom(); - // Paper end -+ // Tuinity start - optimise chunk ice snow ticking -+ private final BiomeBase[] biomeBaseCache = new BiomeBase[1]; -+ // Tuinity end - optimise chunk ice snow ticking - - public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper - ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); -@@ -1120,28 +1123,32 @@ public class WorldServer extends World implements GeneratorAccessSeed { - gameprofilerfiller.exitEnter("iceandsnow"); - if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking - // Paper start - optimise chunk ticking -+ // Tuinity start - optimise chunk ice snow ticking -+ BiomeBase[] biomeCache = this.biomeBaseCache; -+ biomeCache[0] = null; -+ // Tuinity start - optimise chunk ice snow ticking - this.getRandomBlockPosition(j, 0, k, 15, blockposition); - int normalY = chunk.getHighestBlockY(HeightMap.Type.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15); - int downY = normalY - 1; - blockposition.setY(normalY); - // Paper end -- BiomeBase biomebase = this.getBiome(blockposition); -+ //BiomeBase biomebase = this.getBiome(blockposition); // Tuinity - lazily-get biome - - // Paper start - optimise chunk ticking - blockposition.setY(downY); -- if (biomebase.a(this, blockposition)) { -+ if (BiomeBase.canTurnWaterIntoIce(this, blockposition, true, chunk, biomeCache)) { // Tuinity - add chunk parameter, avoid biome lookup - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.ICE.getBlockData(), null); // CraftBukkit - // Paper end - } - - blockposition.setY(normalY); // Paper -- if (flag && biomebase.b(this, blockposition)) { -+ if (flag && BiomeBase.canTurnAirIntoSnow(this, blockposition, chunk, biomeCache)) { - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.getBlockData(), null); // CraftBukkit - } - - // Paper start - optimise chunk ticking - blockposition.setY(downY); -- if (flag && this.getBiome(blockposition).c() == BiomeBase.Precipitation.RAIN) { -+ if (flag && chunk.getType(blockposition).getBlock() instanceof BlockCauldron && this.getBiome(blockposition).c() == BiomeBase.Precipitation.RAIN) { // Tuinity - only cauldron uses that method, and it's not likely to hit. So, avoid the expensive biome lookup and replace it with a block lookup TODO check on update for overrides - chunk.getType(blockposition).getBlock().c((World) this, blockposition); - // Paper end - } diff --git a/patches/Tuinity/patches/server/0074-Oprimise-map-impl-for-tracked-players.patch b/patches/Tuinity/patches/server/0074-Oprimise-map-impl-for-tracked-players.patch index d2d46ca1..106fbf51 100644 --- a/patches/Tuinity/patches/server/0074-Oprimise-map-impl-for-tracked-players.patch +++ b/patches/Tuinity/patches/server/0074-Oprimise-map-impl-for-tracked-players.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Oprimise map impl for tracked players Reference2BooleanOpenHashMap is going to have better lookups than HashMap. -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9129a720e4d85ffbeaa4c76473de6786ffd816fd..fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -49,6 +49,7 @@ import java.util.stream.Collectors; - import java.util.stream.Stream; - import javax.annotation.Nullable; +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 7a9cb2d44cb09746ff5bf1579a09fc95b9e7f9a5..1e627159cbb35fac47d4d158299ec3da7c1f9bf5 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -103,6 +103,7 @@ import net.minecraft.world.level.storage.WorldDataServer; + import net.minecraft.world.level.storage.WorldPersistentData; + import net.minecraft.world.phys.Vec3D; import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; // Paper +import it.unimi.dsi.fastutil.objects.Reference2BooleanOpenHashMap; // Tuinity import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -2489,7 +2490,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2543,7 +2544,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially // Paper start // Replace trackedPlayers Set with a Map. The value is true until the player receives // their first update (which is forced to have absolute coordinates), false afterward. diff --git a/patches/Tuinity/patches/server/0075-Use-hash-table-for-maintaing-changed-block-set.patch b/patches/Tuinity/patches/server/0075-Use-hash-table-for-maintaing-changed-block-set.patch index 8fa1f788..ddf9091a 100644 --- a/patches/Tuinity/patches/server/0075-Use-hash-table-for-maintaing-changed-block-set.patch +++ b/patches/Tuinity/patches/server/0075-Use-hash-table-for-maintaing-changed-block-set.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Use hash table for maintaing changed block set When a lot of block changes occur the iteration for checking can add up a bit and cause a small performance impact. -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 3127fc9dd87e82243e167862cae83ac87b7f4fa0..c3e466ae9a2f4d9c168b4ace6902550e54cad875 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -3,6 +3,7 @@ package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index 41a9202fac9fce3bf8cf08682d0545484d46c41d..a8edac296cbdb053bca4b56a890c3e9e5544d3a6 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -3,6 +3,7 @@ package net.minecraft.server.level; import com.mojang.datafixers.util.Either; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper import it.unimi.dsi.fastutil.shorts.ShortArraySet; @@ -18,7 +18,7 @@ index 3127fc9dd87e82243e167862cae83ac87b7f4fa0..c3e466ae9a2f4d9c168b4ace6902550e import it.unimi.dsi.fastutil.shorts.ShortSet; import java.util.List; import java.util.Optional; -@@ -378,7 +379,7 @@ public class PlayerChunk { +@@ -404,7 +405,7 @@ public class PlayerChunk { if (b0 < 0 || b0 >= this.dirtyBlocks.length) return; // CraftBukkit - SPIGOT-6086, SPIGOT-6296 if (this.dirtyBlocks[b0] == null) { this.p = true; diff --git a/patches/Tuinity/patches/server/0076-Replace-player-chunk-loader-system.patch b/patches/Tuinity/patches/server/0076-Replace-player-chunk-loader-system.patch index 82c27254..84d2c75c 100644 --- a/patches/Tuinity/patches/server/0076-Replace-player-chunk-loader-system.patch +++ b/patches/Tuinity/patches/server/0076-Replace-player-chunk-loader-system.patch @@ -63,7 +63,7 @@ index 5dfa0658838c4801cdf260eae8b98163f729e5af..35810f42d7a0cd50a4cbe90e8d698fe5 diff --git a/src/main/java/com/tuinity/tuinity/chunk/PlayerChunkLoader.java b/src/main/java/com/tuinity/tuinity/chunk/PlayerChunkLoader.java new file mode 100644 -index 0000000000000000000000000000000000000000..afdaa263dd4aa7bb5132b3bcd16ac23f0739c2b8 +index 0000000000000000000000000000000000000000..1fbd220b8a2c77ba85e98349b012b293ee7686a8 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/PlayerChunkLoader.java @@ -0,0 +1,955 @@ @@ -77,18 +77,18 @@ index 0000000000000000000000000000000000000000..afdaa263dd4aa7bb5132b3bcd16ac23f +import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap; +import it.unimi.dsi.fastutil.objects.Reference2ObjectLinkedOpenHashMap; +import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet; -+import net.minecraft.server.Chunk; -+import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.EntityPlayer; ++import net.minecraft.network.protocol.game.PacketPlayOutViewCentre; ++import net.minecraft.network.protocol.game.PacketPlayOutViewDistance; ++import net.minecraft.server.level.EntityPlayer; ++import net.minecraft.world.level.ChunkCoordIntPair; ++import net.minecraft.world.level.chunk.Chunk; +import net.minecraft.server.MCUtil; -+import net.minecraft.server.MathHelper; ++import net.minecraft.util.MathHelper; +import net.minecraft.server.MinecraftServer; -+import net.minecraft.server.Packet; -+import net.minecraft.server.PacketPlayOutViewCentre; -+import net.minecraft.server.PacketPlayOutViewDistance; -+import net.minecraft.server.PlayerChunk; -+import net.minecraft.server.PlayerChunkMap; -+import net.minecraft.server.TicketType; ++import net.minecraft.network.protocol.Packet; ++import net.minecraft.server.level.PlayerChunk; ++import net.minecraft.server.level.PlayerChunkMap; ++import net.minecraft.server.level.TicketType; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.List; @@ -1023,10 +1023,10 @@ index 0000000000000000000000000000000000000000..afdaa263dd4aa7bb5132b3bcd16ac23f + } +} diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index 0959aa6855a150b121b9b75885216c46b151179e..eb53f0a9012884ce2ab6b6d8cfeefaffa3a48ead 100644 +index edb9b246bf327f67a8500f77f81b46eb9e04c9b0..d29b537bbe4f852162b720d6b23b741829af21f9 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -@@ -235,6 +235,25 @@ public final class TuinityConfig { +@@ -244,6 +244,25 @@ public final class TuinityConfig { sendFullPosForHardCollidingEntities = TuinityConfig.getBoolean("send-full-pos-for-hard-colliding-entities", true); } @@ -1052,255 +1052,11 @@ index 0959aa6855a150b121b9b75885216c46b151179e..eb53f0a9012884ce2ab6b6d8cfeefaff public static final class WorldConfig { public final String worldName; -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8fda4702764e80dae93ef9c0eb53abc198642ab1..8e59a794f6190930cb7bb81a2fe1a1d374dacce7 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -360,12 +360,12 @@ public class Chunk implements IChunkAccess { - PlayerChunkMap chunkMap = chunkProviderServer.playerChunkMap; - // this code handles the addition of ticking tickets - the distance map handles the removal - if (!areNeighboursLoaded(bitsetBefore, 2) && areNeighboursLoaded(bitsetAfter, 2)) { -- if (chunkMap.playerViewDistanceTickMap.getObjectsInRange(this.coordinateKey) != null) { -+ if (chunkMap.playerChunkManager.tickMap.getObjectsInRange(this.coordinateKey) != null) { // Tuinity - replace old player chunk loading system - // now we're ready for entity ticking - chunkProviderServer.serverThreadQueue.execute(() -> { - // double check that this condition still holds. -- if (Chunk.this.areNeighboursLoaded(2) && chunkMap.playerViewDistanceTickMap.getObjectsInRange(Chunk.this.coordinateKey) != null) { -- chunkProviderServer.addTicketAtLevel(TicketType.PLAYER, Chunk.this.loc, 31, Chunk.this.loc); // 31 -> entity ticking, TODO check on update -+ if (Chunk.this.areNeighboursLoaded(2) && chunkMap.playerChunkManager.tickMap.getObjectsInRange(Chunk.this.coordinateKey) != null) { // Tuinity - replace old player chunk loading system -+ chunkMap.playerChunkManager.onChunkPlayerTickReady(this.loc.x, this.loc.z); // Tuinity - replace old player chunk loading system - } - }); - } -@@ -373,31 +373,7 @@ public class Chunk implements IChunkAccess { - - // this code handles the chunk sending - if (!areNeighboursLoaded(bitsetBefore, 1) && areNeighboursLoaded(bitsetAfter, 1)) { -- if (chunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(this.coordinateKey) != null) { -- // now we're ready to send -- chunkMap.mailboxMain.a(ChunkTaskQueueSorter.a(chunkMap.getUpdatingChunk(this.coordinateKey), (() -> { // Copied frm PlayerChunkMap -- // double check that this condition still holds. -- if (!Chunk.this.areNeighboursLoaded(1)) { -- return; -- } -- com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet inRange = chunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(Chunk.this.coordinateKey); -- if (inRange == null) { -- return; -- } -- -- // broadcast -- Object[] backingSet = inRange.getBackingSet(); -- Packet[] chunkPackets = new Packet[10]; -- for (int index = 0, len = backingSet.length; index < len; ++index) { -- Object temp = backingSet[index]; -- if (!(temp instanceof EntityPlayer)) { -- continue; -- } -- EntityPlayer player = (EntityPlayer)temp; -- chunkMap.sendChunk(player, chunkPackets, Chunk.this); -- } -- }))); -- } -+ chunkMap.playerChunkManager.onChunkSendReady(this.loc.x, this.loc.z); // Tuinity - replace old player chunk loading system - } - // Paper end - no-tick view distance - } -@@ -973,6 +949,7 @@ public class Chunk implements IChunkAccess { - // Paper end - neighbour cache - org.bukkit.Server server = this.world.getServer(); - ((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper -+ ((WorldServer)this.world).getChunkProvider().playerChunkMap.playerChunkManager.onChunkLoad(this.loc.x, this.loc.z); // Tuinity - rewrite player chunk management - if (server != null) { - /* - * If it's a new world, the first few chunks are generated inside -diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 7f3887b0894aca0f972922f434382646a6ad6174..5973c3a89ca5d57629376247a7636e694048a0fd 100644 ---- a/src/main/java/net/minecraft/server/ChunkMapDistance.java -+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -33,7 +33,7 @@ public abstract class ChunkMapDistance { - public final Long2ObjectOpenHashMap>> tickets = new Long2ObjectOpenHashMap(); - private final ChunkMapDistance.a ticketLevelTracker = new ChunkMapDistance.a(); final ChunkMapDistance.a getTicketTracker() { return this.ticketLevelTracker; } // Tuinity - OBFHELPER - public static final int MOB_SPAWN_RANGE = 8; // private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used -- private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); -+ //private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); // Tuinity - no longer used - // Paper start use a queue, but still keep unique requirement - public final java.util.Queue pendingChunkUpdates = new java.util.ArrayDeque() { - @Override -@@ -166,7 +166,7 @@ public abstract class ChunkMapDistance { - com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot tick ChunkMapDistance off of the main-thread");// Tuinity - //this.f.a(); // Paper - no longer used - AsyncCatcher.catchOp("DistanceManagerTick"); // Paper -- this.g.a(); -+ //this.g.a(); // Tuinity - no longer used - int i = Integer.MAX_VALUE - this.ticketLevelTracker.a(Integer.MAX_VALUE); - boolean flag = i != 0; - -@@ -313,7 +313,7 @@ public abstract class ChunkMapDistance { - AsyncCatcher.catchOp("ChunkMapDistance::addPriorityTicket"); - long pair = coords.pair(); - PlayerChunk chunk = chunkMap.getUpdatingChunk(pair); -- boolean needsTicket = chunkMap.playerViewDistanceNoTickMap.getObjectsInRange(pair) != null && !hasPlayerTicket(coords, 33); -+ boolean needsTicket = false; // Tuinity - replace old loader system - - if (needsTicket) { - Ticket ticket = new Ticket<>(TicketType.PLAYER, 33, coords); -@@ -445,7 +445,7 @@ public abstract class ChunkMapDistance { - return new ObjectOpenHashSet(); - })).add(entityplayer); - //this.f.update(i, 0, true); // Paper - no longer used -- this.g.update(i, 0, true); -+ //this.g.update(i, 0, true); // Tuinity - no longer used - } - - public void b(SectionPosition sectionposition, EntityPlayer entityplayer) { -@@ -458,7 +458,7 @@ public abstract class ChunkMapDistance { - if (objectset == null || objectset.isEmpty()) { // Paper - this.c.remove(i); - //this.f.update(i, Integer.MAX_VALUE, false); // Paper - no longer used -- this.g.update(i, Integer.MAX_VALUE, false); -+ //this.g.update(i, Integer.MAX_VALUE, false); // Tuinity - no longer used - } - - } -@@ -477,7 +477,7 @@ public abstract class ChunkMapDistance { - } - - protected void setNoTickViewDistance(int i) { // Paper - force abi breakage on usage change -- this.g.a(i); -+ throw new UnsupportedOperationException(); // Tuinity - no longer relevant - } - - public int b() { -@@ -564,6 +564,7 @@ public abstract class ChunkMapDistance { - } - } - -+ /* Tuinity - replace old loader system - class c extends ChunkMapDistance.b { - - private int e = 0; -@@ -778,6 +779,7 @@ public abstract class ChunkMapDistance { - return i <= this.e - 2; - } - } -+ */ // Tuinity - replace old loader system - - class b extends ChunkMap { - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index cce750fd5725a232db16cd8ec4603d5cf09da3df..b55f7dece329dbb3ff27d57a39c32c69e5baea74 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -921,6 +921,7 @@ public class ChunkProviderServer extends IChunkProvider { - this.world.timings.doChunkMap.stopTiming(); // Spigot - this.world.getMethodProfiler().exitEnter("chunks"); - this.world.timings.chunks.startTiming(); // Paper - timings -+ this.playerChunkMap.playerChunkManager.tick(); // Tuinity - this is mostly is to account for view distance changes - this.tickChunks(); - this.world.timings.chunks.stopTiming(); // Paper - timings - this.world.timings.doChunkUnload.startTiming(); // Spigot -@@ -1216,6 +1217,7 @@ public class ChunkProviderServer extends IChunkProvider { - @Override - protected boolean executeNext() { - com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot execute chunk tasks off-main thread");// Tuinity -+ ChunkProviderServer.this.playerChunkMap.playerChunkManager.tickMidTick(); // Tuinity - // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task - try { - boolean execChunkTask = com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue() || ChunkProviderServer.this.world.asyncChunkTaskManager.pollNextChunkTask(); // Paper -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 7289d6c706b6c845584bac616c9babea80f8e885..50b93c93cfede2d64a996a22b811994b352149af 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -576,9 +576,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - if (this.deathAnimationTicks == 1 && !this.isSilent()) { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1028, this.getChunkCoordinates(), 0); -- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ // int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API // Tuinity - apply view distance patch - for (EntityPlayer player : (List) ((WorldServer)world).getPlayers()) { -- // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch - // Paper end - double deltaX = this.locX() - player.locX(); - double deltaZ = this.locZ() - player.locZ(); -diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index 5200b0396ee41edb42ff727c78cf3b5fce091d6b..239f504430b6c59923fd677d1be0121be5022604 100644 ---- a/src/main/java/net/minecraft/server/EntityLightning.java -+++ b/src/main/java/net/minecraft/server/EntityLightning.java -@@ -61,8 +61,9 @@ public class EntityLightning extends Entity { - // CraftBukkit start - Use relative location for far away sounds - // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); - float pitch = 0.8F + this.random.nextFloat() * 0.2F; -- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; -+ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Tuinity - apply view distance patch - for (EntityPlayer player : (List) (List) this.world.getPlayers()) { -+ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch - double deltaX = this.locX() - player.locX(); - double deltaZ = this.locZ() - player.locZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f40c24b6e2f7bea21d1cb2b58ed3da45ffcfc866..c086579073c785b3b7cd556bbb629b91560bd449 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -131,7 +131,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - - double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks - -- boolean needsChunkCenterUpdate; // Paper - no-tick view distance -+ public boolean needsChunkCenterUpdate; // Paper - no-tick view distance // Tuinity - package-private -> public - public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event - - public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { -diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index b1159f0258eca2bee52ec0939ba86792d24a1f99..3230c5454ccc39a2e3c89fdf8ca015cf7a15f380 100644 ---- a/src/main/java/net/minecraft/server/EntityWither.java -+++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -214,9 +214,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { - if (!this.isSilent()) { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1023, new BlockPosition(this), 0); -- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API // Tuinity - apply view distance patch - for (EntityPlayer player : (List)this.world.getPlayers()) { -- // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch - double deltaX = this.locX() - player.locX(); - double deltaZ = this.locZ() - player.locZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/net/minecraft/server/ItemEnderEye.java b/src/main/java/net/minecraft/server/ItemEnderEye.java -index 3296d888a66e8d0ad861ed093cd62b0d2da6ff0b..bc6e2d7dda6c85e89967d06649558aafd8f2624b 100644 ---- a/src/main/java/net/minecraft/server/ItemEnderEye.java -+++ b/src/main/java/net/minecraft/server/ItemEnderEye.java -@@ -36,9 +36,10 @@ public class ItemEnderEye extends Item { - - // CraftBukkit start - Use relative location for far away sounds - // world.b(1038, blockposition1.b(1, 0, 1), 0); -- int viewDistance = world.getServer().getViewDistance() * 16; -+ //int viewDistance = world.getServer().getViewDistance() * 16; // Tuinity - apply view distance patch - BlockPosition soundPos = blockposition1.b(1, 0, 1); - for (EntityPlayer player : world.getServer().getServer().getPlayerList().players) { -+ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch - double deltaX = soundPos.getX() - player.locX(); - double deltaZ = soundPos.getZ() - player.locZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index e79e773f2219f9a9ae076fcbc8108b792201b11a..7438ed7671acb181fe88abd2db415cb09873db4f 100644 ---- a/src/main/java/net/minecraft/server/MCUtil.java -+++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -680,7 +680,7 @@ public final class MCUtil { - - worldData.addProperty("name", world.getWorld().getName()); - worldData.addProperty("view-distance", world.getChunkProvider().playerChunkMap.getEffectiveViewDistance()); -- worldData.addProperty("no-view-distance", world.getChunkProvider().playerChunkMap.getRawNoTickViewDistance()); -+ worldData.addProperty("no-view-distance", world.getChunkProvider().playerChunkMap.playerChunkManager.getTargetNoTickViewDistance()); // Tuinity - replace old player chunk management - worldData.addProperty("keep-spawn-loaded", world.keepSpawnInMemory); - worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange); - worldData.addProperty("visible-chunk-count", visibleChunks.size()); -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 65de374d485f31f8cd6f4e03941173565074ea0e..d93634391501da01cb1afe70fedd5247c654e8fc 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -105,6 +105,28 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index 02ad0611836160a1d0ba6b26476e6bd336d55681..e101b1dccec98d5c7b9ee9a2c8aa2e3b911de652 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -123,6 +123,28 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } } // Tuinity end - allow controlled flushing @@ -1329,7 +1085,7 @@ index 65de374d485f31f8cd6f4e03941173565074ea0e..d93634391501da01cb1afe70fedd5247 public NetworkManager(EnumProtocolDirection enumprotocoldirection) { this.h = enumprotocoldirection; -@@ -486,6 +508,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -505,6 +527,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return false; } private boolean processQueue() { @@ -1337,7 +1093,7 @@ index 65de374d485f31f8cd6f4e03941173565074ea0e..d93634391501da01cb1afe70fedd5247 if (this.packetQueue.isEmpty()) return true; final boolean needsFlush = this.canFlush; // Tuinity - make only one flush call per sendPacketQueue() call boolean hasWrotePacket = false; -@@ -515,6 +538,12 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -534,6 +557,12 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } } return true; @@ -1350,11 +1106,131 @@ index 65de374d485f31f8cd6f4e03941173565074ea0e..d93634391501da01cb1afe70fedd5247 } // Paper end -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index c3e466ae9a2f4d9c168b4ace6902550e54cad875..dcf13e62264f97384fb2f6c30cbc183a63cf3f97 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -475,7 +475,7 @@ public class PlayerChunk { +diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java +index e832ea0497b2d6af7556bda7f6728e72c48d80a8..b7399d17dd64ca8b1f1fab405cb0ac914dc53b98 100644 +--- a/src/main/java/net/minecraft/server/MCUtil.java ++++ b/src/main/java/net/minecraft/server/MCUtil.java +@@ -697,7 +697,7 @@ public final class MCUtil { + + worldData.addProperty("name", world.getWorld().getName()); + worldData.addProperty("view-distance", world.getChunkProvider().playerChunkMap.getEffectiveViewDistance()); +- worldData.addProperty("no-view-distance", world.getChunkProvider().playerChunkMap.getRawNoTickViewDistance()); ++ worldData.addProperty("no-view-distance", world.getChunkProvider().playerChunkMap.playerChunkManager.getTargetNoTickViewDistance()); // Tuinity - replace old player chunk management + worldData.addProperty("keep-spawn-loaded", world.keepSpawnInMemory); + worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange); + worldData.addProperty("visible-chunk-count", visibleChunks.size()); +diff --git a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +index 8d4944fa1c761bb3ab299ec639663e7f52b512a3..db8532c42fcb2e96f4b3491352d1b9a25a8efe49 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkMapDistance.java ++++ b/src/main/java/net/minecraft/server/level/ChunkMapDistance.java +@@ -42,7 +42,7 @@ public abstract class ChunkMapDistance { + public final Long2ObjectOpenHashMap>> tickets = new Long2ObjectOpenHashMap(); + private final ChunkMapDistance.a ticketLevelTracker = new ChunkMapDistance.a(); final ChunkMapDistance.a getTicketTracker() { return this.ticketLevelTracker; } // Tuinity - OBFHELPER + public static final int MOB_SPAWN_RANGE = 8; // private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); // Paper - no longer used +- private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); ++ //private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); // Tuinity - no longer used + // Paper start use a queue, but still keep unique requirement + public final java.util.Queue pendingChunkUpdates = new java.util.ArrayDeque() { + @Override +@@ -175,7 +175,7 @@ public abstract class ChunkMapDistance { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot tick ChunkMapDistance off of the main-thread");// Tuinity + //this.f.a(); // Paper - no longer used + AsyncCatcher.catchOp("DistanceManagerTick"); // Paper +- this.g.a(); ++ //this.g.a(); // Tuinity - no longer used + int i = Integer.MAX_VALUE - this.ticketLevelTracker.a(Integer.MAX_VALUE); + boolean flag = i != 0; + +@@ -322,7 +322,7 @@ public abstract class ChunkMapDistance { + AsyncCatcher.catchOp("ChunkMapDistance::addPriorityTicket"); + long pair = coords.pair(); + PlayerChunk chunk = chunkMap.getUpdatingChunk(pair); +- boolean needsTicket = chunkMap.playerViewDistanceNoTickMap.getObjectsInRange(pair) != null && !hasPlayerTicket(coords, 33); ++ boolean needsTicket = false; // Tuinity - replace old loader system + + if (needsTicket) { + Ticket ticket = new Ticket<>(TicketType.PLAYER, 33, coords); +@@ -454,7 +454,7 @@ public abstract class ChunkMapDistance { + return new ObjectOpenHashSet(); + })).add(entityplayer); + //this.f.update(i, 0, true); // Paper - no longer used +- this.g.update(i, 0, true); ++ //this.g.update(i, 0, true); // Tuinity - no longer used + } + + public void b(SectionPosition sectionposition, EntityPlayer entityplayer) { +@@ -467,7 +467,7 @@ public abstract class ChunkMapDistance { + if (objectset == null || objectset.isEmpty()) { // Paper + this.c.remove(i); + //this.f.update(i, Integer.MAX_VALUE, false); // Paper - no longer used +- this.g.update(i, Integer.MAX_VALUE, false); ++ //this.g.update(i, Integer.MAX_VALUE, false); // Tuinity - no longer used + } + + } +@@ -486,7 +486,7 @@ public abstract class ChunkMapDistance { + } + + protected void setNoTickViewDistance(int i) { // Paper - force abi breakage on usage change +- this.g.a(i); ++ throw new UnsupportedOperationException(); // Tuinity - no longer relevant + } + + public int b() { +@@ -573,6 +573,7 @@ public abstract class ChunkMapDistance { + } + } + ++ /* Tuinity - replace old loader system + class c extends ChunkMapDistance.b { + + private int e = 0; +@@ -787,6 +788,7 @@ public abstract class ChunkMapDistance { + return i <= this.e - 2; + } + } ++ */ // Tuinity - replace old loader system + + class b extends ChunkMap { + +diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +index 118b21b15e12de491a9cfc2b68c6da7bb10b1fee..cb83f1152c52a99d25e4e80cc8bf18c6793e8b50 100644 +--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java +@@ -946,6 +946,7 @@ public class ChunkProviderServer extends IChunkProvider { + this.world.timings.doChunkMap.stopTiming(); // Spigot + this.world.getMethodProfiler().exitEnter("chunks"); + this.world.timings.chunks.startTiming(); // Paper - timings ++ this.playerChunkMap.playerChunkManager.tick(); // Tuinity - this is mostly is to account for view distance changes + this.tickChunks(); + this.world.timings.chunks.stopTiming(); // Paper - timings + this.world.timings.doChunkUnload.startTiming(); // Spigot +@@ -1241,6 +1242,7 @@ public class ChunkProviderServer extends IChunkProvider { + @Override + protected boolean executeNext() { + com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot execute chunk tasks off-main thread");// Tuinity ++ ChunkProviderServer.this.playerChunkMap.playerChunkManager.tickMidTick(); // Tuinity + // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task + try { + boolean execChunkTask = com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue() || ChunkProviderServer.this.world.asyncChunkTaskManager.pollNextChunkTask(); // Paper +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index 553ad54e5d657a840d3dbd3b48a8b21f1855c18a..59989db6dcf96a8ab5a75775bb588c31cec3418a 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -261,7 +261,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks + +- boolean needsChunkCenterUpdate; // Paper - no-tick view distance ++ public boolean needsChunkCenterUpdate; // Paper - no-tick view distance // Tuinity - package-private -> public + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event + + public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunk.java b/src/main/java/net/minecraft/server/level/PlayerChunk.java +index a8edac296cbdb053bca4b56a890c3e9e5544d3a6..d9b134302f739efd93f50e93c8730b474f9a8ccf 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunk.java +@@ -501,7 +501,7 @@ public class PlayerChunk { // Paper start - per player view distance // there can be potential desync with player's last mapped section and the view distance map, so use the // view distance map here. @@ -1363,7 +1239,7 @@ index c3e466ae9a2f4d9c168b4ace6902550e54cad875..dcf13e62264f97384fb2f6c30cbc183a com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet players = viewDistanceMap.getObjectsInRange(this.location); if (players == null) { return; -@@ -489,6 +489,7 @@ public class PlayerChunk { +@@ -515,6 +515,7 @@ public class PlayerChunk { continue; } EntityPlayer player = (EntityPlayer)temp; @@ -1371,7 +1247,7 @@ index c3e466ae9a2f4d9c168b4ace6902550e54cad875..dcf13e62264f97384fb2f6c30cbc183a int viewDistance = viewDistanceMap.getLastViewDistance(player); long lastPosition = viewDistanceMap.getLastCoordinate(player); -@@ -508,6 +509,7 @@ public class PlayerChunk { +@@ -534,6 +535,7 @@ public class PlayerChunk { continue; } EntityPlayer player = (EntityPlayer)temp; @@ -1379,11 +1255,11 @@ index c3e466ae9a2f4d9c168b4ace6902550e54cad875..dcf13e62264f97384fb2f6c30cbc183a player.playerConnection.sendPacket(packet); } } -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558fd722f4b 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -182,20 +182,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +index 1e627159cbb35fac47d4d158299ec3da7c1f9bf5..d7eede51f1c4ebbe8e00b16efd6331c87db53bb4 100644 +--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java +@@ -236,20 +236,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap; // Paper end - optimise PlayerChunkMap#isOutsideRange // Paper start - no-tick view distance @@ -1405,7 +1281,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - no-tick view distance // Tuinity start - optimise checkDespawn public static final int GENERAL_AREA_MAP_SQUARE_RADIUS = 38; -@@ -214,24 +201,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -268,24 +255,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { com.destroystokyo.paper.util.misc.PlayerAreaMap trackMap = this.playerEntityTrackerTrackMaps[i]; int trackRange = this.entityTrackerTrackRanges[i]; @@ -1432,7 +1308,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - no-tick view distance // Tuinity start - optimise checkDespawn this.playerGeneralAreaMap.add(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); -@@ -250,9 +227,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -304,9 +281,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerChunkTickRangeMap.remove(player); // Paper end - optimise PlayerChunkMap#isOutsideRange // Paper start - no-tick view distance @@ -1443,7 +1319,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - no-tick view distance // Tuinity start - optimise checkDespawn this.playerGeneralAreaMap.remove(player); -@@ -269,24 +244,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -323,24 +298,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { com.destroystokyo.paper.util.misc.PlayerAreaMap trackMap = this.playerEntityTrackerTrackMaps[i]; int trackRange = this.entityTrackerTrackRanges[i]; @@ -1470,7 +1346,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - no-tick view distance // Tuinity start - optimise checkDespawn this.playerGeneralAreaMap.update(player, chunkX, chunkZ, GENERAL_AREA_MAP_SQUARE_RADIUS); -@@ -524,47 +489,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -578,47 +543,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end - optimise PlayerChunkMap#isOutsideRange // Paper start - no-tick view distance this.setNoTickViewDistance(this.world.paperConfig.noTickViewDistance); @@ -1519,7 +1395,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - no-tick view distance // Tuinity start this.dataRegionManager = new com.tuinity.tuinity.chunk.SingleThreadChunkRegionManager(this.world, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); -@@ -619,6 +544,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -673,6 +598,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } public void checkHighPriorityChunks(EntityPlayer player) { @@ -1527,7 +1403,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 int currentTick = MinecraftServer.currentTick; if (currentTick - player.lastHighPriorityChecked < 20 || !player.isRealPlayer) { // weed out fake players return; -@@ -626,7 +552,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -680,7 +606,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { player.lastHighPriorityChecked = currentTick; Long2IntOpenHashMap priorities = new Long2IntOpenHashMap(); @@ -1536,7 +1412,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); // Prioritize circular near -@@ -692,7 +618,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -746,7 +672,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } private boolean shouldSkipPrioritization(ChunkCoordIntPair coord) { @@ -1545,7 +1421,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 PlayerChunk chunk = getUpdatingChunk(coord.pair()); return chunk != null && (chunk.isFullChunkReady()); } -@@ -1684,7 +1610,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1738,7 +1664,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { int k = this.viewDistance; this.viewDistance = j; @@ -1554,7 +1430,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 } } -@@ -1693,25 +1619,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1747,25 +1673,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final void setNoTickViewDistance(int viewDistance) { com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Cannot update view distance off of the main thread"); // Tuinity viewDistance = viewDistance == -1 ? -1 : MathHelper.clamp(viewDistance, 2, 32); @@ -1582,7 +1458,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 if (entityplayer.world == this.world) { if (flag1 && !flag) { PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair()); -@@ -2105,6 +2017,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2159,6 +2071,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }*/ // Paper end - replaced by distance map this.updateMaps(entityplayer); // Paper - distance maps @@ -1590,7 +1466,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 } -@@ -2113,7 +2026,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2167,7 +2080,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - per player view distance // there can be potential desync with player's last mapped section and the view distance map, so use the // view distance map here. @@ -1599,7 +1475,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 if (inRange == null) { return Stream.empty(); -@@ -2129,8 +2042,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2183,8 +2096,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { continue; } EntityPlayer player = (EntityPlayer)temp; @@ -1611,7 +1487,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 int distX = Math.abs(MCUtil.getCoordinateX(lastPosition) - chunkcoordintpair.x); int distZ = Math.abs(MCUtil.getCoordinateZ(lastPosition) - chunkcoordintpair.z); -@@ -2145,6 +2059,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2199,6 +2113,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { continue; } EntityPlayer player = (EntityPlayer)temp; @@ -1619,7 +1495,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 players.add(player); } } -@@ -2363,6 +2278,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2417,6 +2332,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially apacket[1] = new PacketPlayOutLightUpdate(chunk.getPos(), this.lightEngine, true); // Paper start - Fix MC-162253 @@ -1627,7 +1503,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 final int lightMask = getLightMask(chunk); int i = 1; for (int x = -1; x <= 1; x++) { -@@ -2387,10 +2303,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2441,10 +2357,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially apacket[i] = new PacketPlayOutLightUpdate(new ChunkCoordIntPair(chunk.getPos().x + x, chunk.getPos().z + z), lightEngine, updateLightMask, 0, true); } } @@ -1642,7 +1518,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 int j = 1; for (int x = -1; x <= 1; x++) { -@@ -2415,6 +2333,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2469,6 +2387,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially entityplayer.playerConnection.sendPacket(packet); } } @@ -1650,7 +1526,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 // Paper end - Fix MC-162253 entityplayer.a(chunk.getPos(), apacket[0], apacket[1]); -@@ -2591,7 +2510,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2645,7 +2564,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially double vec3d_dy = entityplayer.locY() - this.tracker.locY(); double vec3d_dz = entityplayer.locZ() - this.tracker.locZ(); // Paper end - remove allocation of Vec3D here @@ -1659,7 +1535,7 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 boolean flag = vec3d_dx >= (double) (-i) && vec3d_dx <= (double) i && vec3d_dz >= (double) (-i) && vec3d_dz <= (double) i && this.tracker.a(entityplayer); // Paper - remove allocation of Vec3D here if (flag) { -@@ -2601,7 +2520,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially +@@ -2655,7 +2574,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); @@ -1668,11 +1544,11 @@ index fd7d403b7aac37f5b97a8c73bc6f0c4c587ac546..3e0bf6df7c4608a5b19024612db52558 flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance; } } -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d03d0c13cca1762078617744253a9757b388958f..a12e58668e74f2287ddff5bedc00daf2b0a416c1 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -185,7 +185,7 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 26109830d5535e973dabfe758e5b55571a2d71e3..ac98a3122ee30971b31761f3bc564b41d5ac879f 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -269,7 +269,7 @@ public abstract class PlayerList { boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO); // Spigot - view distance @@ -1681,7 +1557,7 @@ index d03d0c13cca1762078617744253a9757b388958f..a12e58668e74f2287ddff5bedc00daf2 entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -857,7 +857,7 @@ public abstract class PlayerList { +@@ -941,7 +941,7 @@ public abstract class PlayerList { // CraftBukkit start WorldData worlddata = worldserver1.getWorldData(); entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), BiomeManager.a(worldserver1.getSeed()), entityplayer1.playerInteractManager.getGameMode(), entityplayer1.playerInteractManager.c(), worldserver1.isDebugWorld(), worldserver1.isFlatWorld(), flag)); @@ -1690,7 +1566,7 @@ index d03d0c13cca1762078617744253a9757b388958f..a12e58668e74f2287ddff5bedc00daf2 entityplayer1.spawnIn(worldserver1); entityplayer1.dead = false; entityplayer1.playerConnection.teleport(new Location(worldserver1.getWorld(), entityplayer1.locX(), entityplayer1.locY(), entityplayer1.locZ(), entityplayer1.yaw, entityplayer1.pitch)); -@@ -1126,7 +1126,7 @@ public abstract class PlayerList { +@@ -1210,7 +1210,7 @@ public abstract class PlayerList { // Really shouldn't happen... backingSet = world != null ? world.players.toArray() : players.toArray(); } else { @@ -1699,11 +1575,148 @@ index d03d0c13cca1762078617744253a9757b388958f..a12e58668e74f2287ddff5bedc00daf2 if (nearbyPlayers == null) { return; } -diff --git a/src/main/java/net/minecraft/server/Vec3D.java b/src/main/java/net/minecraft/server/Vec3D.java -index 5af554870bcf36e47aef43b966b141b9eda6c4d5..7190316a38e6b4edf5501bfedbb12be79e990797 100644 ---- a/src/main/java/net/minecraft/server/Vec3D.java -+++ b/src/main/java/net/minecraft/server/Vec3D.java -@@ -9,6 +9,12 @@ public class Vec3D implements IPosition { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLightning.java b/src/main/java/net/minecraft/world/entity/EntityLightning.java +index 85f571a791bce63989890f277857bc7bdeec0cb5..9e4137768c7d8966759324a4b368330c35faa8a5 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLightning.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLightning.java +@@ -81,8 +81,9 @@ public class EntityLightning extends Entity { + // CraftBukkit start - Use relative location for far away sounds + // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_LIGHTNING_BOLT_THUNDER, SoundCategory.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F); + float pitch = 0.8F + this.random.nextFloat() * 0.2F; +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; ++ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Tuinity - apply view distance patch + for (EntityPlayer player : (List) (List) this.world.getPlayers()) { ++ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +index c296fcf80c2f3f210fa020416973ec8d5db541ba..07160de8725787551df327c0790b2d6e0876524f 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java ++++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java +@@ -625,9 +625,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + if (this.deathAnimationTicks == 1 && !this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1028, this.getChunkCoordinates(), 0); +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API // Tuinity - apply view distance patch + for (net.minecraft.server.level.EntityPlayer player : (List) ((WorldServer)world).getPlayers()) { +- // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch ++ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch + // Paper end + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); +diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +index 229eabe0510e6c3660236ed0fb3e80d41074642c..930fc752ec0a988b17bc556cd428161638a14f27 100644 +--- a/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java ++++ b/src/main/java/net/minecraft/world/entity/boss/wither/EntityWither.java +@@ -264,9 +264,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + if (!this.isSilent()) { + // CraftBukkit start - Use relative location for far away sounds + // this.world.b(1023, new BlockPosition(this), 0); +- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API ++ //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API // Tuinity - apply view distance patch + for (EntityPlayer player : (List)this.world.getPlayers()) { +- // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch ++ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch + double deltaX = this.locX() - player.locX(); + double deltaZ = this.locZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +diff --git a/src/main/java/net/minecraft/world/item/ItemEnderEye.java b/src/main/java/net/minecraft/world/item/ItemEnderEye.java +index f74685a7cdb905af8e9712ca8597e7ed3dc8b120..feedbd8c97c1b1c56eaff359e6a940696d416906 100644 +--- a/src/main/java/net/minecraft/world/item/ItemEnderEye.java ++++ b/src/main/java/net/minecraft/world/item/ItemEnderEye.java +@@ -60,9 +60,10 @@ public class ItemEnderEye extends Item { + + // CraftBukkit start - Use relative location for far away sounds + // world.b(1038, blockposition1.b(1, 0, 1), 0); +- int viewDistance = world.getServer().getViewDistance() * 16; ++ //int viewDistance = world.getServer().getViewDistance() * 16; // Tuinity - apply view distance patch + BlockPosition soundPos = blockposition1.b(1, 0, 1); + for (EntityPlayer player : world.getServer().getServer().getPlayerList().players) { ++ final int viewDistance = player.getBukkitEntity().getViewDistance(); // Tuinity - apply view distance patch + double deltaX = soundPos.getX() - player.locX(); + double deltaZ = soundPos.getZ() - player.locZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 1fab6ec02c0aceb56baea5353dbd85b580caf454..c8a5d4972431ce9615312280f36181a2b9645df7 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -606,7 +606,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + this.notify(blockposition, iblockdata1, iblockdata, i); + // Paper start - per player view distance - allow block updates for non-ticking chunks in player view distance + // if copied from above +- } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((WorldServer)this).getChunkProvider().playerChunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { ++ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((WorldServer)this).getChunkProvider().playerChunkMap.playerChunkManager.broadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { // Tuinity - replace old player chunk management + ((WorldServer)this).getChunkProvider().flagDirty(blockposition); + // Paper end - per player view distance + } +diff --git a/src/main/java/net/minecraft/world/level/chunk/Chunk.java b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +index 8b73ba51dde43e3ddf40ed863cf286042f139a34..259d4ac89e84fd334ff65ea8a606e1fc50cc882b 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/Chunk.java ++++ b/src/main/java/net/minecraft/world/level/chunk/Chunk.java +@@ -406,12 +406,12 @@ public class Chunk implements IChunkAccess { + PlayerChunkMap chunkMap = chunkProviderServer.playerChunkMap; + // this code handles the addition of ticking tickets - the distance map handles the removal + if (!areNeighboursLoaded(bitsetBefore, 2) && areNeighboursLoaded(bitsetAfter, 2)) { +- if (chunkMap.playerViewDistanceTickMap.getObjectsInRange(this.coordinateKey) != null) { ++ if (chunkMap.playerChunkManager.tickMap.getObjectsInRange(this.coordinateKey) != null) { // Tuinity - replace old player chunk loading system + // now we're ready for entity ticking + chunkProviderServer.serverThreadQueue.execute(() -> { + // double check that this condition still holds. +- if (Chunk.this.areNeighboursLoaded(2) && chunkMap.playerViewDistanceTickMap.getObjectsInRange(Chunk.this.coordinateKey) != null) { +- chunkProviderServer.addTicketAtLevel(TicketType.PLAYER, Chunk.this.loc, 31, Chunk.this.loc); // 31 -> entity ticking, TODO check on update ++ if (Chunk.this.areNeighboursLoaded(2) && chunkMap.playerChunkManager.tickMap.getObjectsInRange(Chunk.this.coordinateKey) != null) { // Tuinity - replace old player chunk loading system ++ chunkMap.playerChunkManager.onChunkPlayerTickReady(this.loc.x, this.loc.z); // Tuinity - replace old player chunk loading system + } + }); + } +@@ -419,31 +419,7 @@ public class Chunk implements IChunkAccess { + + // this code handles the chunk sending + if (!areNeighboursLoaded(bitsetBefore, 1) && areNeighboursLoaded(bitsetAfter, 1)) { +- if (chunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(this.coordinateKey) != null) { +- // now we're ready to send +- chunkMap.mailboxMain.a(ChunkTaskQueueSorter.a(chunkMap.getUpdatingChunk(this.coordinateKey), (() -> { // Copied frm PlayerChunkMap +- // double check that this condition still holds. +- if (!Chunk.this.areNeighboursLoaded(1)) { +- return; +- } +- com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet inRange = chunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(Chunk.this.coordinateKey); +- if (inRange == null) { +- return; +- } +- +- // broadcast +- Object[] backingSet = inRange.getBackingSet(); +- Packet[] chunkPackets = new Packet[10]; +- for (int index = 0, len = backingSet.length; index < len; ++index) { +- Object temp = backingSet[index]; +- if (!(temp instanceof EntityPlayer)) { +- continue; +- } +- EntityPlayer player = (EntityPlayer)temp; +- chunkMap.sendChunk(player, chunkPackets, Chunk.this); +- } +- }))); +- } ++ chunkMap.playerChunkManager.onChunkSendReady(this.loc.x, this.loc.z); // Tuinity - replace old player chunk loading system + } + // Paper end - no-tick view distance + } +@@ -1019,6 +995,7 @@ public class Chunk implements IChunkAccess { + // Paper end - neighbour cache + org.bukkit.Server server = this.world.getServer(); + ((WorldServer)this.world).getChunkProvider().addLoadedChunk(this); // Paper ++ ((WorldServer)this.world).getChunkProvider().playerChunkMap.playerChunkManager.onChunkLoad(this.loc.x, this.loc.z); // Tuinity - rewrite player chunk management + if (server != null) { + /* + * If it's a new world, the first few chunks are generated inside +diff --git a/src/main/java/net/minecraft/world/phys/Vec3D.java b/src/main/java/net/minecraft/world/phys/Vec3D.java +index 3fe1508b091e1fd0325eae50138d02fa6445c9ff..a19a26a88f247d359354902efeece9923f3e0e0b 100644 +--- a/src/main/java/net/minecraft/world/phys/Vec3D.java ++++ b/src/main/java/net/minecraft/world/phys/Vec3D.java +@@ -14,6 +14,12 @@ public class Vec3D implements IPosition { public final double y; public final double z; @@ -1716,24 +1729,19 @@ index 5af554870bcf36e47aef43b966b141b9eda6c4d5..7190316a38e6b4edf5501bfedbb12be7 public static Vec3D a(BaseBlockPosition baseblockposition) { return new Vec3D((double) baseblockposition.getX() + 0.5D, (double) baseblockposition.getY() + 0.5D, (double) baseblockposition.getZ() + 0.5D); } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 970c1be5477a01ab9c6d79e84c519e22775564ff..bf06ef09cfd4d7618365249d1332d264d8ff1377 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -546,7 +546,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.notify(blockposition, iblockdata1, iblockdata, i); - // Paper start - per player view distance - allow block updates for non-ticking chunks in player view distance - // if copied from above -- } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((WorldServer)this).getChunkProvider().playerChunkMap.playerViewDistanceBroadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { -+ } else if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && (this.isClientSide || chunk == null || ((WorldServer)this).getChunkProvider().playerChunkMap.playerChunkManager.broadcastMap.getObjectsInRange(MCUtil.getCoordinateKey(blockposition)) != null)) { // Tuinity - replace old player chunk management - ((WorldServer)this).getChunkProvider().flagDirty(blockposition); - // Paper end - per player view distance - } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3e54e643d28ced3074c4b044bc8a2238de05ccc2..902aaee6a53dbb4dccd7a34b3d6283769604d309 100644 +index 89e2ce2e20a9051336c784a48e3b4214379cd77b..292bd2187eb08fe535a8c1f8047be2bb29f55c53 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2639,7 +2639,7 @@ public class CraftWorld implements World { +@@ -2632,14 +2632,14 @@ public class CraftWorld implements World { + throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); + } + PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; +- if (viewDistance != chunkMap.getEffectiveViewDistance()) { ++ if (true) { // Tuinity - replace old player chunk management + chunkMap.setViewDistance(viewDistance); + } + } @Override public int getNoTickViewDistance() { @@ -1745,7 +1753,7 @@ index 3e54e643d28ced3074c4b044bc8a2238de05ccc2..902aaee6a53dbb4dccd7a34b3d628376 @@ -2648,11 +2648,22 @@ public class CraftWorld implements World { throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); } - net.minecraft.server.PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; + PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; - if (viewDistance != chunkMap.getRawNoTickViewDistance()) { + if (true) { // Tuinity - replace old player chunk management chunkMap.setNoTickViewDistance(viewDistance); @@ -1767,17 +1775,17 @@ index 3e54e643d28ced3074c4b044bc8a2238de05ccc2..902aaee6a53dbb4dccd7a34b3d628376 // Spigot start private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1208f9951 100644 +index e5549439b3d4d608cf37dd33b6c8c9e10dfe9328..45e786565ac988abadffda2e7ba3ff1e2880b786 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2248,15 +2248,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2257,15 +2257,70 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } + // Tuinity start - implement view distances + @Override + public int getSendViewDistance() { -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + return chunkMap.playerChunkManager.getTargetSendDistance(); @@ -1787,7 +1795,7 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1 + + @Override + public void setSendViewDistance(int viewDistance) { -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + throw new IllegalStateException("Player is not attached to world"); @@ -1798,7 +1806,7 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1 + + @Override + public int getNoTickViewDistance() { -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + return chunkMap.playerChunkManager.getTargetNoTickViewDistance(); @@ -1808,7 +1816,7 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1 + + @Override + public void setNoTickViewDistance(int viewDistance) { -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + throw new IllegalStateException("Player is not attached to world"); @@ -1820,7 +1828,7 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1 @Override public int getViewDistance() { - throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + return chunkMap.playerChunkManager.getTargetViewDistance(); @@ -1831,7 +1839,7 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..b3636032fd36efe2e7e546dbebdfd5c1 @Override public void setViewDistance(int viewDistance) { - throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ net.minecraft.server.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; ++ net.minecraft.server.level.PlayerChunkMap chunkMap = this.getHandle().getWorldServer().getChunkProvider().playerChunkMap; + com.tuinity.tuinity.chunk.PlayerChunkLoader.PlayerLoaderData data = chunkMap.playerChunkManager.getData(this.getHandle()); + if (data == null) { + throw new IllegalStateException("Player is not attached to world"); diff --git a/patches/Tuinity/patches/server/0077-Optimise-general-POI-access.patch b/patches/Tuinity/patches/server/0077-Optimise-general-POI-access.patch index 5ce80f72..76bee4d6 100644 --- a/patches/Tuinity/patches/server/0077-Optimise-general-POI-access.patch +++ b/patches/Tuinity/patches/server/0077-Optimise-general-POI-access.patch @@ -32,7 +32,7 @@ had to be specifically modified. diff --git a/src/main/java/com/tuinity/tuinity/util/PoiAccess.java b/src/main/java/com/tuinity/tuinity/util/PoiAccess.java new file mode 100644 -index 0000000000000000000000000000000000000000..ef0b766709fd9369b5ae458148259291583fe565 +index 0000000000000000000000000000000000000000..5018a3378680d98605e0e4a79bf112e032c98925 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/util/PoiAccess.java @@ -0,0 +1,812 @@ @@ -41,13 +41,13 @@ index 0000000000000000000000000000000000000000..ef0b766709fd9369b5ae458148259291 +import it.unimi.dsi.fastutil.doubles.Double2ObjectMap; +import it.unimi.dsi.fastutil.doubles.Double2ObjectRBTreeMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.MathHelper; -+import net.minecraft.server.SectionPosition; -+import net.minecraft.server.VillagePlace; -+import net.minecraft.server.VillagePlaceRecord; -+import net.minecraft.server.VillagePlaceSection; -+import net.minecraft.server.VillagePlaceType; ++import net.minecraft.core.BlockPosition; ++import net.minecraft.util.MathHelper; ++import net.minecraft.core.SectionPosition; ++import net.minecraft.world.entity.ai.village.poi.VillagePlace; ++import net.minecraft.world.entity.ai.village.poi.VillagePlaceRecord; ++import net.minecraft.world.entity.ai.village.poi.VillagePlaceSection; ++import net.minecraft.world.entity.ai.village.poi.VillagePlaceType; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; @@ -848,11 +848,11 @@ index 0000000000000000000000000000000000000000..ef0b766709fd9369b5ae458148259291 + throw new RuntimeException(); + } +} -diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -index 275d4cad8ff0dd64b74ef8f8056cdef093523f97..83702e07dff72b639af32c8ba9e831e58da92a10 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java -+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -@@ -74,7 +74,11 @@ public class BehaviorFindPosition extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +index 5fe71380b04600d6cd0bb068d239ff8fdfe2afbb..bc8786e2aaeab4dbae4e9c7666ad816bc5bfac3f 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +@@ -84,7 +84,11 @@ public class BehaviorFindPosition extends Behavior { return true; } }; @@ -865,78 +865,11 @@ index 275d4cad8ff0dd64b74ef8f8056cdef093523f97..83702e07dff72b639af32c8ba9e831e5 PathEntity pathentity = entitycreature.getNavigation().a(set, this.b.d()); if (pathentity != null && pathentity.j()) { -diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index e10995ec30dd9a10d781b3c1709fd2db5a9becdd..77aa805267497f91231d63067d62ad3f10508216 100644 ---- a/src/main/java/net/minecraft/server/PortalTravelAgent.java -+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java -@@ -22,16 +22,34 @@ public class PortalTravelAgent { - // int i = flag ? 16 : 128; - // CraftBukkit end - -- villageplace.a(this.world, blockposition, i); -- Optional optional = villageplace.b((villageplacetype) -> { -- return villageplacetype == VillagePlaceType.v; -- }, blockposition, i, VillagePlace.Occupancy.ANY).sorted(Comparator.comparingDouble((VillagePlaceRecord villageplacerecord) -> { // CraftBukkit - decompile error -- return villageplacerecord.f().j(blockposition); -- }).thenComparingInt((villageplacerecord) -> { -- return villageplacerecord.f().getY(); -- })).filter((villageplacerecord) -> { -- return this.world.getType(villageplacerecord.f()).b(BlockProperties.E); -- }).findFirst(); -+ // Tuinity start - optimise portals -+ //villageplace.a(this.world, blockposition, i); -+ Optional optional; -+ java.util.List records = new java.util.ArrayList<>(); -+ com.tuinity.tuinity.util.PoiAccess.findClosestPoiDataRecords(villageplace, -+ (VillagePlaceType villageplacetype) -> { -+ return villageplacetype == VillagePlaceType.v; // this should break this entire diff on update if it changes, so TODO check that on diff break -+ }, -+ (BlockPosition pos) -> { -+ IChunkAccess lowest = this.world.getChunkAt(pos.getX() >> 4, pos.getZ() >> 4, ChunkStatus.EMPTY); -+ if (!lowest.getChunkStatus().isAtLeastStatus(ChunkStatus.FULL)) { -+ // why would we generate the chunk? -+ return false; -+ } -+ return lowest.getType(pos).contains(BlockProperties.E); // this should break this entire diff on update if it changes, so TODO check that on diff break -+ }, blockposition, i, Double.MAX_VALUE, VillagePlace.Occupancy.ANY, true, records); -+ // this gets us most of the way there, but we bias towards lower y values. -+ VillagePlaceRecord lowestYRecord = null; -+ for (VillagePlaceRecord record : records) { -+ if (lowestYRecord == null) { -+ lowestYRecord = record; -+ } else if (lowestYRecord.getPosition().getY() > record.getPosition().getY()) { -+ lowestYRecord = record; -+ } -+ } -+ // now we're done -+ optional = Optional.ofNullable(lowestYRecord); -+ // Tuinity end - optimise portals - - return optional.map((villageplacerecord) -> { - BlockPosition blockposition1 = villageplacerecord.f(); -diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java -index 79a11d17a2822b192dec5981d0344ae689c3d385..d1ea47654db190e7cb7fa4ec1ac002f64277cb47 100644 ---- a/src/main/java/net/minecraft/server/RegionFileSection.java -+++ b/src/main/java/net/minecraft/server/RegionFileSection.java -@@ -84,11 +84,12 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab - } - // Tuinity end - actually unload POI data - -- @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER -+ @Nullable public final Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER // Tuinity - OBFHELPER - @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER - return (Optional) this.c.get(i); - } - -+ public final Optional getOrLoad(long coordinate) { return this.d(coordinate); } // Tuinity - OBFHELPER - protected Optional d(long i) { - SectionPosition sectionposition = SectionPosition.a(i); - -diff --git a/src/main/java/net/minecraft/server/SensorNearestBed.java b/src/main/java/net/minecraft/server/SensorNearestBed.java -index 83025d69e8a0732f16581fcfeaef5c1a45d70b63..89f8ce32225bc560b9927273f5984c6206360ac7 100644 ---- a/src/main/java/net/minecraft/server/SensorNearestBed.java -+++ b/src/main/java/net/minecraft/server/SensorNearestBed.java -@@ -40,8 +40,12 @@ public class SensorNearestBed extends Sensor { +diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java +index 5e4c022bcbf4456bc9020f56fb26fee0c627d722..9427072575df9c0f1b9dfb065b6bef43df1f8fc5 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java ++++ b/src/main/java/net/minecraft/world/entity/ai/sensing/SensorNearestBed.java +@@ -47,8 +47,12 @@ public class SensorNearestBed extends Sensor { return true; } }; @@ -951,11 +884,11 @@ index 83025d69e8a0732f16581fcfeaef5c1a45d70b63..89f8ce32225bc560b9927273f5984c62 if (pathentity != null && pathentity.j()) { BlockPosition blockposition = pathentity.m(); -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index fce9967912628c232fe41ccc17fe2296f001ec61..245bdedd17b844dcd13aa0b60dffb1cac6a5bdb8 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -227,31 +227,47 @@ public class VillagePlace extends RegionFileSection { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index a5edfaa41156fc03181f38a8813eb5bcc8c08e48..13d94ecd703b3cd0412e138532d2dd74e5bf250d 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +@@ -240,31 +240,47 @@ public class VillagePlace extends RegionFileSection { } public Optional c(Predicate predicate, Predicate predicate1, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { @@ -1019,3 +952,70 @@ index fce9967912628c232fe41ccc17fe2296f001ec61..245bdedd17b844dcd13aa0b60dffb1ca } public boolean b(BlockPosition blockposition) { +diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +index 3628b62b8021bbb9b03b3236830b6dccef2d8419..f70c14385c95763b5f270a6e2ce372cf047ba7bb 100644 +--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java ++++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSection.java +@@ -93,11 +93,12 @@ public class RegionFileSection extends RegionFileCache implements AutoCloseab + } + // Tuinity end - actually unload POI data + +- @Nullable protected Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER ++ @Nullable public final Optional getIfLoaded(long value) { return this.c(value); } // Tuinity - OBFHELPER // Tuinity - OBFHELPER + @Nullable protected Optional c(long i) { // Tuinity - OBFHELPER + return (Optional) this.c.get(i); + } + ++ public final Optional getOrLoad(long coordinate) { return this.d(coordinate); } // Tuinity - OBFHELPER + protected Optional d(long i) { + SectionPosition sectionposition = SectionPosition.a(i); + +diff --git a/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java b/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java +index 77dfa7eaf178baa55041a829c9dec4851efeedfc..0de6225e11b98cc3d22c002d5f27748cde42a5a0 100644 +--- a/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java ++++ b/src/main/java/net/minecraft/world/level/portal/PortalTravelAgent.java +@@ -39,16 +39,34 @@ public class PortalTravelAgent { + // int i = flag ? 16 : 128; + // CraftBukkit end + +- villageplace.a(this.world, blockposition, i); +- Optional optional = villageplace.b((villageplacetype) -> { +- return villageplacetype == VillagePlaceType.v; +- }, blockposition, i, VillagePlace.Occupancy.ANY).sorted(Comparator.comparingDouble((VillagePlaceRecord villageplacerecord) -> { // CraftBukkit - decompile error +- return villageplacerecord.f().j(blockposition); +- }).thenComparingInt((villageplacerecord) -> { +- return villageplacerecord.f().getY(); +- })).filter((villageplacerecord) -> { +- return this.world.getType(villageplacerecord.f()).b(BlockProperties.E); +- }).findFirst(); ++ // Tuinity start - optimise portals ++ //villageplace.a(this.world, blockposition, i); ++ Optional optional; ++ java.util.List records = new java.util.ArrayList<>(); ++ com.tuinity.tuinity.util.PoiAccess.findClosestPoiDataRecords(villageplace, ++ (VillagePlaceType villageplacetype) -> { ++ return villageplacetype == VillagePlaceType.v; // this should break this entire diff on update if it changes, so TODO check that on diff break ++ }, ++ (BlockPosition pos) -> { ++ net.minecraft.world.level.chunk.IChunkAccess lowest = this.world.getChunkAt(pos.getX() >> 4, pos.getZ() >> 4, net.minecraft.world.level.chunk.ChunkStatus.EMPTY); ++ if (!lowest.getChunkStatus().isAtLeastStatus(net.minecraft.world.level.chunk.ChunkStatus.FULL)) { ++ // why would we generate the chunk? ++ return false; ++ } ++ return lowest.getType(pos).contains(BlockProperties.E); // this should break this entire diff on update if it changes, so TODO check that on diff break ++ }, blockposition, i, Double.MAX_VALUE, VillagePlace.Occupancy.ANY, true, records); ++ // this gets us most of the way there, but we bias towards lower y values. ++ VillagePlaceRecord lowestYRecord = null; ++ for (VillagePlaceRecord record : records) { ++ if (lowestYRecord == null) { ++ lowestYRecord = record; ++ } else if (lowestYRecord.getPosition().getY() > record.getPosition().getY()) { ++ lowestYRecord = record; ++ } ++ } ++ // now we're done ++ optional = Optional.ofNullable(lowestYRecord); ++ // Tuinity end - optimise portals + + return optional.map((villageplacerecord) -> { + BlockPosition blockposition1 = villageplacerecord.f(); diff --git a/patches/Tuinity/patches/server/0078-Be-aware-of-entity-teleports-when-chunk-checking-ent.patch b/patches/Tuinity/patches/server/0078-Be-aware-of-entity-teleports-when-chunk-checking-ent.patch new file mode 100644 index 00000000..5d543eeb --- /dev/null +++ b/patches/Tuinity/patches/server/0078-Be-aware-of-entity-teleports-when-chunk-checking-ent.patch @@ -0,0 +1,50 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Mon, 15 Mar 2021 22:25:48 -0700 +Subject: [PATCH] Be aware of entity teleports when chunk checking entities + +If an entity were to be teleported via the sync load +that occured from the getChunkAt call, we would either +add to the wrong chunk or add to both chunks! not good. + +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 943f72ed96549e1a495af984670ed3efe8707f6a..46f960b9276dced41deb8f741454b6cce5a81529 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1571,7 +1571,35 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + entity.inChunk = false; + } else { +- this.getChunkAt(i, k).a(entity); ++ // Tuinity start - gotta be careful here, sync load can teleport entity. ++ Chunk chunk = this.getChunkIfLoaded(i, k); ++ if (chunk == null) { ++ // might teleport the entity, so be prepared. ++ // at this point, we are NOT in a chunk. so CLEARLY mark that for a recursive call to see. ++ entity.inChunk = false; ++ // now load ++ chunk = this.getChunkAt(i, k); ++ // are we in a chunk now? ++ if (entity.inChunk) { ++ // yup we teleported and were added to another chunk. do not add to the current one! ++ return; ++ } ++ // did we teleport but did not add to a chunk? ++ // copied from start ++ int in = MathHelper.floor(entity.locX() / 16.0D); ++ int jn = Math.min(15, Math.max(0, MathHelper.floor(entity.locY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior ++ int kn = MathHelper.floor(entity.locZ() / 16.0D); ++ if (in != i || jn != j || kn != k) { ++ // teleported but were not added to a chunk. try now, let the new call try to add again ++ this.chunkCheck(entity); ++ return; ++ } ++ ++ // only now at this point have we verified the new load did not screw up our position, so ++ // now we can add to the chunk ++ } ++ chunk.a(entity); ++ // Tuinity end - gotta be careful here, sync load can teleport entity. + } + // Tuinity start + if (entity.inChunk && (oldRegionX != newRegionX || oldRegionZ != newRegionZ)) { diff --git a/patches/api/0001-Modify-POM.patch b/patches/api/0001-Modify-POM.patch index f45ad630..a1d55aaf 100644 --- a/patches/api/0001-Modify-POM.patch +++ b/patches/api/0001-Modify-POM.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM diff --git a/pom.xml b/pom.xml -index 821df3413345c613eccff158f8081cf9ba848a14..78524688e28e5393a9ff2d2007785a093f8aa0c3 100644 +index 6c200882954adc4831307f3d6dfa3202571fb30b..4aefa793f1db26908e5476f03d89858b5925e3cb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,18 @@ @@ -50,5 +50,5 @@ index 821df3413345c613eccff158f8081cf9ba848a14..78524688e28e5393a9ff2d2007785a09 + + - +@@ -59,6 +63,13 @@ diff --git a/patches/api/0004-Add-last-tick-time-API.patch b/patches/api/0004-Add-last-tick-time-API.patch index e74a88ee..8d3e43ed 100644 --- a/patches/api/0004-Add-last-tick-time-API.patch +++ b/patches/api/0004-Add-last-tick-time-API.patch @@ -7,7 +7,7 @@ Original patch by: Co-authored-by: tr7zw diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 801bef2a060962b5c4f92234401e5bc34a62141a..96ea91b296749ab3ed06ab1e6f3c70c60f9d1307 100644 +index d754200879bda29d582998433e1a304a6988bbbb..d2d554492ec8fb2d253dd4855c31850bc380b218 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -1963,4 +1963,14 @@ public final class Bukkit { @@ -26,7 +26,7 @@ index 801bef2a060962b5c4f92234401e5bc34a62141a..96ea91b296749ab3ed06ab1e6f3c70c6 + // Yatopia end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1d65eedf20bc6414202a2bcb2f375a8b23446ddf..2b2d4f9fefd1a5e74dee2ddc20c8228d0ddf0da6 100644 +index 199d42622c2e891631c696a92df00abc6e6c3219..be7e1d46c52f8c94a56e31096d4fad81b70f4d61 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1754,4 +1754,24 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi diff --git a/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch b/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch index 77f1cb2e..5595fb02 100644 --- a/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add NBT API as a first-class lib diff --git a/pom.xml b/pom.xml -index 61670767a97a9f9e6285961555fed3b7cedf56b0..62a8c9c0f7d66eb51416c1fe723821a082cdfc95 100644 +index 42004d8b2028a2bf62435b708aa7a47cba223f0d..9d1e72fa2e5c1fd46c341e7c76be85b8f6ef63e0 100644 --- a/pom.xml +++ b/pom.xml -@@ -56,6 +56,11 @@ +@@ -46,6 +46,11 @@ mojang https://libraries.minecraft.net/ @@ -19,8 +19,8 @@ index 61670767a97a9f9e6285961555fed3b7cedf56b0..62a8c9c0f7d66eb51416c1fe723821a0 + - -@@ -202,6 +207,11 @@ + +@@ -185,6 +190,11 @@ asm-commons 9.0 @@ -32,7 +32,7 @@ index 61670767a97a9f9e6285961555fed3b7cedf56b0..62a8c9c0f7d66eb51416c1fe723821a0 -@@ -277,6 +287,12 @@ +@@ -259,6 +269,12 @@ ${project.build.directory}/dependency-reduced-pom.xml true @@ -129,10 +129,10 @@ index 1e25f387e053b648477a3e9dace1a6c95e7f8cba..02c5967dcc8591d4324d1218eb8c2ff0 + // Yatopia end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index f0c17f1342d9c70cb4fe1fc46dd8b9006037e860..24a3521d074471c0024a8d23acb7963af3e293e1 100644 +index 314658c7dac1b1fbb440ec85133e6670e52ba684..714070dcb1fc35ba4aa42a3ecece810599777c22 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -1445,4 +1445,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor +@@ -1478,4 +1478,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor } // Purpur end diff --git a/patches/server/0001-Modify-POM.patch b/patches/server/0001-Modify-POM.patch index f4215f52..eb7290ec 100644 --- a/patches/server/0001-Modify-POM.patch +++ b/patches/server/0001-Modify-POM.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM diff --git a/pom.xml b/pom.xml -index 02bbe784d0a062dd643e37f3ad04b77a78144828..ac2d01ce61a890469867e0b422f953e9652e5a95 100644 +index cf6e53e9f483d21b17e2782816be4403fa5be717..dc7bca7a09cb173af53c916d8f231249af8b1cdb 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ @@ -125,7 +125,7 @@ index 02bbe784d0a062dd643e37f3ad04b77a78144828..ac2d01ce61a890469867e0b422f953e9 -@@ -186,6 +201,19 @@ +@@ -176,19 +191,32 @@ jitpack.io https://jitpack.io @@ -144,9 +144,6 @@ index 02bbe784d0a062dd643e37f3ad04b77a78144828..ac2d01ce61a890469867e0b422f953e9 + - -@@ -197,15 +225,15 @@ - - tuinity-${minecraft.version} diff --git a/patches/server/0002-Brandings.patch b/patches/server/0002-Brandings.patch index cda2484c..b30bf422 100644 --- a/patches/server/0002-Brandings.patch +++ b/patches/server/0002-Brandings.patch @@ -27,7 +27,7 @@ index 4d8740678049aa749b42618470e9cc838555528d..159f72efe20f8fee940bd00ae7af00f0 metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index c1280478ee4565003883df9607d4a8a0e8fe4faa..c6cfdea783eaa40d4eb581a9208d6cdb72dace5b 100644 +index 4d9e685c691a37078ff7452e50ab8c13999dbe10..0751ce5b578eff8b1dad44e976b656b6cfa7daf3 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { @@ -40,10 +40,10 @@ index c1280478ee4565003883df9607d4a8a0e8fe4faa..c6cfdea783eaa40d4eb581a9208d6cdb .completer(new ConsoleCommandCompleter(this.server)) ); diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java -index 03d5a9f923597c07d050465e261efe9a8bc935a6..439842cb08e600e007a4b447daac182e59d1a1b2 100644 +index 322cecf1a7316fb8fe00ff538fe3a2dd21708819..6292e6d46c6627d5d38c600cac5ac12627da3881 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java -@@ -182,7 +182,7 @@ public class PurpurConfig { +@@ -183,7 +183,7 @@ public class PurpurConfig { if (!TimingsManager.hiddenConfigs.contains("settings.seed.end-spike")) TimingsManager.hiddenConfigs.add("settings.seed.end-spike"); } @@ -53,23 +53,23 @@ index 03d5a9f923597c07d050465e261efe9a8bc935a6..439842cb08e600e007a4b447daac182e serverModName = getString("settings.server-mod-name", serverModName); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 12b92ee0491c82a72d1646d14116e187dd965fe6..d5c2fa2363ec898e6fdf16699c3e3e3fef98410c 100644 +index 298b0dfc67906a96d61b4d40919d3363cede0401..7771fa5c98809b6c3aeff78ab9d0b8ec2178accc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { -- private final String serverName = "Purpur"; // Paper // Tuinity // Purpur -+ private final String serverName = "Yatopia"; // Paper // Tuinity // Purpur // Yatopia +- private final String serverName = "Purpur"; // Paper // Tuinity // Airplane // Purpur ++ private final String serverName = "Yatopia"; // Paper // Tuinity // Airplane // Purpur // Yatopia private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 448538cc8a3d16b028a0a6f0f05c9370a02f4259..e51dcb259d511c369806a83b96c2820f316e1401 100644 +index 655d45b9c664baee77f356d315baacd40209280f..9d22236808d89183fd1a0a85465533a0b2de4358 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -275,7 +275,7 @@ public class Main { +@@ -277,7 +277,7 @@ public class Main { if (buildDate.before(deadline.getTime())) { // Paper start - This is some stupid bullshit System.err.println("*** Warning, you've not updated in a while! ***"); @@ -79,7 +79,7 @@ index 448538cc8a3d16b028a0a6f0f05c9370a02f4259..e51dcb259d511c369806a83b96c2820f //Thread.sleep(TimeUnit.SECONDS.toMillis(20)); // Paper End diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 980696490709d04741c1617f528357100696d0e5..c8221a59faae602e870bd14f3b74ac94ca71bd77 100644 +index 609eda567751b2f1cf74e9f090ca5cb0c1d771cc..ced87bb10dcc0bd1fdfd99d6f05de079e6ec6eee 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -377,7 +377,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -92,20 +92,20 @@ index 980696490709d04741c1617f528357100696d0e5..c8221a59faae602e870bd14f3b74ac94 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 13b98439320ac1401a920c01d7cf5a4b3a23deff..d2f272fd733f7eee9a89029baecccfac7e45baf4 100644 +index 191f5331f0c7871f80f0da9cc38345ce33353577..4776d0f496fb2ed492545ffb53ecf05e79ae2afb 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { public static String getBukkitVersion() { String result = "Unknown-Version"; -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Purpur -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.yatopiamc/yatopia-api/pom.properties"); // Tuinity // Purpur // Yatopia +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Airplane // Purpur ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.yatopiamc/yatopia-api/pom.properties"); // Tuinity // Airplane // Purpur // Yatopia Properties properties = new Properties(); if (stream != null) { diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 089ddda8892c3660c5dcb62d0fd56544857a2eba..8ee165d1c752e53601254f734507370b91ad7b73 100644 +index 00c728704a1a7aa8b3a2e7679eaa0d2f604da087..1b92b3d2c696fa4ef86a2d2a58eeb447bb3d2739 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -26,7 +26,7 @@ public class WatchdogThread extends Thread @@ -133,7 +133,7 @@ index 089ddda8892c3660c5dcb62d0fd56544857a2eba..8ee165d1c752e53601254f734507370b - log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() ); + log.log( Level.SEVERE, "Yatopia version: " + Bukkit.getServer().getVersion() ); // Yatopia // - if ( net.minecraft.server.World.lastPhysicsProblem != null ) + if ( net.minecraft.world.level.World.lastPhysicsProblem != null ) { @@ -186,12 +186,12 @@ public class WatchdogThread extends Thread // Paper end diff --git a/patches/server/0003-Utilities.patch b/patches/server/0003-Utilities.patch index 98dc117b..1d196842 100644 --- a/patches/server/0003-Utilities.patch +++ b/patches/server/0003-Utilities.patch @@ -9,7 +9,7 @@ Co-authored-by: Mykyta Komarnytskyy Co-authored-by: Ivan Pekov diff --git a/pom.xml b/pom.xml -index ac2d01ce61a890469867e0b422f953e9652e5a95..05c5ab1e3bc2f6c527332736013d77bb65f29f6d 100644 +index dc7bca7a09cb173af53c916d8f231249af8b1cdb..16234696393f0d61bdaa7009c80fa0996a7f1712 100644 --- a/pom.xml +++ b/pom.xml @@ -183,6 +183,12 @@ diff --git a/patches/server/0004-Add-GameProfileLookupEvent.patch b/patches/server/0004-Add-GameProfileLookupEvent.patch index e87cb40b..56167a53 100644 --- a/patches/server/0004-Add-GameProfileLookupEvent.patch +++ b/patches/server/0004-Add-GameProfileLookupEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add GameProfileLookupEvent diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -index 6ae316109c8e35fbb6b0aebdee3075beb1445f1b..0c35eefa4abed27b9ca8f4a77a641565f3c54148 100644 +index 040fd0c3fc4bc3a04fe5dff919a41fe9b474708e..21d92c3e8e2e953bfc85c1ba3ed54ca0dae751fb 100644 --- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -187,13 +187,24 @@ public class CraftPlayerProfile implements PlayerProfile { @@ -39,11 +39,11 @@ index 6ae316109c8e35fbb6b0aebdee3075beb1445f1b..0c35eefa4abed27b9ca8f4a77a641565 } return profile.isComplete() && (!onlineMode || !textures || hasTextures()); } -diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 579a81e521fdfabfa0318d06c6760a8ab7a88c1e..ab553f408b31cb7e2d281cc3d8fe42e19dc717d9 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySkull.java -+++ b/src/main/java/net/minecraft/server/TileEntitySkull.java -@@ -77,7 +77,18 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java +index 1d1d708d1cbebb5a3ee50d5f46d9d953f22447dc..ef1a882e4414ccc6fa9791f8eb83bde00ee4f29d 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntitySkull.java +@@ -86,7 +86,18 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa if ( property == null ) { diff --git a/patches/server/0005-Add-last-tick-time-API.patch b/patches/server/0005-Add-last-tick-time-API.patch index d451ba90..2d96c090 100644 --- a/patches/server/0005-Add-last-tick-time-API.patch +++ b/patches/server/0005-Add-last-tick-time-API.patch @@ -7,10 +7,10 @@ Original patch by: Co-authored-by: tr7zw diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 806c699ce25525bc8a382a52e95644479e8ad708..0773f4baffe9dda40441e312e7cc58186f59a9ff 100644 +index 34552a2bd96428013dba6f2bead737af75a28d0d..e283960750cff2f45695117ef873cf1f941c27bf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -943,6 +943,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant list = com.tuinity.tuinity.util.CachedLists.getTempGetEntitiesList(); @@ -73,7 +73,7 @@ index 424e0a1c31561aa06229a13b68d0cc367f392545..86493a37a1ca5d35e660dadf1d6005af diff --git a/src/main/java/org/yatopiamc/yatopia/server/EntityFilter.java b/src/main/java/org/yatopiamc/yatopia/server/EntityFilter.java new file mode 100644 -index 0000000000000000000000000000000000000000..cb6bab603dcb20521868a482c872f65dd5733c15 +index 0000000000000000000000000000000000000000..77df98d9b622e66ce47d1640819a5d20e5651fdc --- /dev/null +++ b/src/main/java/org/yatopiamc/yatopia/server/EntityFilter.java @@ -0,0 +1,145 @@ @@ -81,11 +81,11 @@ index 0000000000000000000000000000000000000000..cb6bab603dcb20521868a482c872f65d + +import de.minebench.origami.OrigamiConfig; +import java.util.function.Predicate; -+import net.minecraft.server.Entity; -+import net.minecraft.server.EntityTypes; -+import net.minecraft.server.EnumCreatureType; -+import net.minecraft.server.IEntitySelector; -+import net.minecraft.server.ScoreboardTeamBase; ++import net.minecraft.world.entity.Entity; ++import net.minecraft.world.entity.EntityTypes; ++import net.minecraft.world.entity.EnumCreatureType; ++import net.minecraft.world.entity.IEntitySelector; ++import net.minecraft.world.scores.ScoreboardTeamBase; + +public class EntityFilter { + diff --git a/patches/server/0008-Allow-to-change-the-piston-push-limit.patch b/patches/server/0008-Allow-to-change-the-piston-push-limit.patch index 8d3c0132..5528fa7d 100644 --- a/patches/server/0008-Allow-to-change-the-piston-push-limit.patch +++ b/patches/server/0008-Allow-to-change-the-piston-push-limit.patch @@ -4,11 +4,11 @@ Date: Fri, 31 Jul 2020 21:28:00 -0500 Subject: [PATCH] Allow to change the piston push limit -diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java -index 95aeaaf0bb07c5ecf7117dae3382b0f0aac6426f..ae28b1f6ef56ab2199e1cf8d4f7d3f3e12496545 100644 ---- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java -+++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java -@@ -79,7 +79,7 @@ public class PistonExtendsChecker { +diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java +index 6c9c4ab65b7e42efa68027057242e25b70313081..fe1612a8210fcd42c901d0cf3ec7fe6cfea9ff1b 100644 +--- a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java ++++ b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java +@@ -86,7 +86,7 @@ public class PistonExtendsChecker { } else { int i = 1; @@ -17,7 +17,7 @@ index 95aeaaf0bb07c5ecf7117dae3382b0f0aac6426f..ae28b1f6ef56ab2199e1cf8d4f7d3f3e return false; } else { while (a(block)) { -@@ -93,7 +93,7 @@ public class PistonExtendsChecker { +@@ -100,7 +100,7 @@ public class PistonExtendsChecker { } ++i; @@ -26,7 +26,7 @@ index 95aeaaf0bb07c5ecf7117dae3382b0f0aac6426f..ae28b1f6ef56ab2199e1cf8d4f7d3f3e return false; } } -@@ -141,7 +141,7 @@ public class PistonExtendsChecker { +@@ -148,7 +148,7 @@ public class PistonExtendsChecker { return true; } diff --git a/patches/server/0009-Add-NBT-API-as-a-first-class-lib.patch b/patches/server/0009-Add-NBT-API-as-a-first-class-lib.patch index ff551714..1cd130dc 100644 --- a/patches/server/0009-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/server/0009-Add-NBT-API-as-a-first-class-lib.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add NBT API as a first-class lib diff --git a/pom.xml b/pom.xml -index 05c5ab1e3bc2f6c527332736013d77bb65f29f6d..6b235ff5227c8292435bad8720c6bb0ac1c4adf7 100644 +index 16234696393f0d61bdaa7009c80fa0996a7f1712..3145f04489622e37defab2e4be83c3221eea213f 100644 --- a/pom.xml +++ b/pom.xml -@@ -369,6 +369,10 @@ - net.minecraft.server - net.minecraft.server.v${minecraft_version} +@@ -358,6 +358,10 @@ + net/minecraft/server/v${minecraft_version}/$2 + true + + de.tr7zw.changeme.nbtapi diff --git a/patches/server/0010-Modify-default-configs.patch b/patches/server/0010-Modify-default-configs.patch index 1ec03737..9a3b3e26 100644 --- a/patches/server/0010-Modify-default-configs.patch +++ b/patches/server/0010-Modify-default-configs.patch @@ -18,7 +18,7 @@ index 4b9fdb4f04b333ce32f7fca8f279bf989e6fd728..992eb7b286becc03549136d031b677db TimingsManager.privacy = getBoolean("timings.server-name-privacy", false); TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret")); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9f5edd3285bd477a73e18cfe3af51b441b3eeae1..0894428d25ad7ab9a8a05d0bfd93e0e43e7e8c9c 100644 +index 319e12c843305e62c34b1b6e2fd198d02491ca12..cb2d35dbfa9e307fa098a66670a1126906ccaed2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -633,7 +633,7 @@ public class PaperWorldConfig { diff --git a/patches/server/0011-lithium-MixinDirection.patch b/patches/server/0011-lithium-MixinDirection.patch index 586ff4d2..eb7d78e0 100644 --- a/patches/server/0011-lithium-MixinDirection.patch +++ b/patches/server/0011-lithium-MixinDirection.patch @@ -6,11 +6,11 @@ Subject: [PATCH] lithium MixinDirection Original code by JellySquid, licensed under GNU Lesser General Public License v3.0 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 814b168eaa4b74dce2b83bc8aa557b33aebf35fa..74e95bfcae5212c77383f7b8780dce293fda02dc 100644 ---- a/src/main/java/net/minecraft/server/EnumDirection.java -+++ b/src/main/java/net/minecraft/server/EnumDirection.java -@@ -20,13 +20,13 @@ public enum EnumDirection implements INamable { +diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java +index 9f1ea11d0bc15b8b0069fcf46ea2f6751c5e3064..b8fe75b8c37ef1968519e69e078444b1a3c5c359 100644 +--- a/src/main/java/net/minecraft/core/EnumDirection.java ++++ b/src/main/java/net/minecraft/core/EnumDirection.java +@@ -24,13 +24,13 @@ public enum EnumDirection implements INamable { DOWN(0, 1, -1, "down", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.Y, new BaseBlockPosition(0, -1, 0)), UP(1, 0, -1, "up", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.Y, new BaseBlockPosition(0, 1, 0)), NORTH(2, 3, 2, "north", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.Z, new BaseBlockPosition(0, 0, -1)), SOUTH(3, 2, 0, "south", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.Z, new BaseBlockPosition(0, 0, 1)), WEST(4, 5, 1, "west", EnumDirection.EnumAxisDirection.NEGATIVE, EnumDirection.EnumAxis.X, new BaseBlockPosition(-1, 0, 0)), EAST(5, 4, 3, "east", EnumDirection.EnumAxisDirection.POSITIVE, EnumDirection.EnumAxis.X, new BaseBlockPosition(1, 0, 0)); private final int g; @@ -26,7 +26,7 @@ index 814b168eaa4b74dce2b83bc8aa557b33aebf35fa..74e95bfcae5212c77383f7b8780dce29 private static final Map o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> { return enumdirection; })); -@@ -108,8 +108,12 @@ public enum EnumDirection implements INamable { +@@ -112,8 +112,12 @@ public enum EnumDirection implements INamable { return this.l; } @@ -40,7 +40,7 @@ index 814b168eaa4b74dce2b83bc8aa557b33aebf35fa..74e95bfcae5212c77383f7b8780dce29 } public EnumDirection rotateCW() { return g(); } // Purpur - OBFHELPER -@@ -210,8 +214,12 @@ public enum EnumDirection implements INamable { +@@ -214,8 +218,12 @@ public enum EnumDirection implements INamable { return (float) ((this.i & 3) * 90); } diff --git a/patches/server/0012-lithium-MixinBox.patch b/patches/server/0012-lithium-MixinBox.patch index b1735e03..b84765fd 100644 --- a/patches/server/0012-lithium-MixinBox.patch +++ b/patches/server/0012-lithium-MixinBox.patch @@ -6,11 +6,11 @@ Subject: [PATCH] lithium MixinBox Original code by JellySquid, licensed under GNU Lesser General Public License v3.0 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 5c3d5b22b833d9f835e17803295b87893fd05e62..e1d2e5f61b01f812d53a41cd8ba5d45b5f8c7f19 100644 ---- a/src/main/java/net/minecraft/server/AxisAlignedBB.java -+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java -@@ -193,12 +193,38 @@ public class AxisAlignedBB { +diff --git a/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java b/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java +index 0248ff18bf3f2dede4d0dda90df5e0eea56b7708..7a3577f919a250eb61b2dfb8d65e668f7af45220 100644 +--- a/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java ++++ b/src/main/java/net/minecraft/world/phys/AxisAlignedBB.java +@@ -197,12 +197,38 @@ public class AxisAlignedBB { return new AxisAlignedBB(vec3d.x, vec3d.y, vec3d.z, vec3d.x + 1.0D, vec3d.y + 1.0D, vec3d.z + 1.0D); } diff --git a/patches/server/0013-lithium-enum_values.patch b/patches/server/0013-lithium-enum_values.patch index c12c6e89..eeeaf01e 100644 --- a/patches/server/0013-lithium-enum_values.patch +++ b/patches/server/0013-lithium-enum_values.patch @@ -6,60 +6,10 @@ Subject: [PATCH] lithium enum_values Original code by JellySquid, licensed under GNU Lesser General Public License v3.0 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index 5d3bb5f393a1e0e4a2e8b9a466530a91279697a9..7f084e7f11a829c10d113c7fb39eec0b8ad77080 100644 ---- a/src/main/java/net/minecraft/server/BlockPiston.java -+++ b/src/main/java/net/minecraft/server/BlockPiston.java -@@ -127,9 +127,10 @@ public class BlockPiston extends BlockDirectional { - } - - } -+ private static final EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia - - private boolean a(World world, BlockPosition blockposition, EnumDirection enumdirection) { -- EnumDirection[] aenumdirection = EnumDirection.values(); -+ //EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia - int i = aenumdirection.length; - - int j; -@@ -146,12 +147,12 @@ public class BlockPiston extends BlockDirectional { - return true; - } else { - BlockPosition blockposition1 = blockposition.up(); -- EnumDirection[] aenumdirection1 = EnumDirection.values(); -+ //EnumDirection[] aenumdirection1 = EnumDirection.values(); // Yatopia - -- j = aenumdirection1.length; -+ j = aenumdirection.length; // Yatopia - - for (int k = 0; k < j; ++k) { -- EnumDirection enumdirection2 = aenumdirection1[k]; -+ EnumDirection enumdirection2 = aenumdirection[k]; // Yatopia - - if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) { - return true; -diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 86493a37a1ca5d35e660dadf1d6005af55f67144..5745ac2e932ba934604072951a33edf2fa16b3cb 100644 ---- a/src/main/java/net/minecraft/server/EntityLiving.java -+++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2640,10 +2640,12 @@ public abstract class EntityLiving extends Entity { - - } - -+ private static final EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia -+ - @Nullable - private Map q() { - Map map = null; -- EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); -+ //EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia - int i = aenumitemslot.length; - - for (int j = 0; j < i; ++j) { -diff --git a/src/main/java/net/minecraft/server/EnumAxisCycle.java b/src/main/java/net/minecraft/server/EnumAxisCycle.java -index a7c2543fdd4d5f6a04c45ec42472837ccaea9619..92ab79532d29341e8840341ff5ee8f5203cb4aad 100644 ---- a/src/main/java/net/minecraft/server/EnumAxisCycle.java -+++ b/src/main/java/net/minecraft/server/EnumAxisCycle.java +diff --git a/src/main/java/net/minecraft/core/EnumAxisCycle.java b/src/main/java/net/minecraft/core/EnumAxisCycle.java +index 8078e4f5b79eaada03508265ba6b81db636e822a..b2d26289a6f501b093ec229394f75864531c978a 100644 +--- a/src/main/java/net/minecraft/core/EnumAxisCycle.java ++++ b/src/main/java/net/minecraft/core/EnumAxisCycle.java @@ -26,12 +26,24 @@ public enum EnumAxisCycle { @Override @@ -114,11 +64,61 @@ index a7c2543fdd4d5f6a04c45ec42472837ccaea9619..92ab79532d29341e8840341ff5ee8f52 } }; -diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java -index ae28b1f6ef56ab2199e1cf8d4f7d3f3e12496545..b684f2b297eda2014962bed36087d08bfcddb119 100644 ---- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java -+++ b/src/main/java/net/minecraft/server/PistonExtendsChecker.java -@@ -166,10 +166,11 @@ public class PistonExtendsChecker { +diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java +index 64b3790f66bef5cd5774497fa15a6612e0363915..5d60bd3d65f0bee901d72363b6ba21a55b8abf8c 100644 +--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java ++++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java +@@ -2736,10 +2736,12 @@ public abstract class EntityLiving extends Entity { + + } + ++ private static final EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia ++ + @Nullable + private Map q() { + Map map = null; +- EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); ++ //EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); // Yatopia + int i = aenumitemslot.length; + + for (int j = 0; j < i; ++j) { +diff --git a/src/main/java/net/minecraft/world/level/block/piston/BlockPiston.java b/src/main/java/net/minecraft/world/level/block/piston/BlockPiston.java +index 8aa51fb207820a7629d50b80ea821ec6cccf8b54..96ec55a705cf372ba1943710362898b73a1464de 100644 +--- a/src/main/java/net/minecraft/world/level/block/piston/BlockPiston.java ++++ b/src/main/java/net/minecraft/world/level/block/piston/BlockPiston.java +@@ -156,9 +156,10 @@ public class BlockPiston extends BlockDirectional { + } + + } ++ private static final EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia + + private boolean a(World world, BlockPosition blockposition, EnumDirection enumdirection) { +- EnumDirection[] aenumdirection = EnumDirection.values(); ++ //EnumDirection[] aenumdirection = EnumDirection.values(); // Yatopia + int i = aenumdirection.length; + + int j; +@@ -175,12 +176,12 @@ public class BlockPiston extends BlockDirectional { + return true; + } else { + BlockPosition blockposition1 = blockposition.up(); +- EnumDirection[] aenumdirection1 = EnumDirection.values(); ++ //EnumDirection[] aenumdirection1 = EnumDirection.values(); // Yatopia + +- j = aenumdirection1.length; ++ j = aenumdirection.length; // Yatopia + + for (int k = 0; k < j; ++k) { +- EnumDirection enumdirection2 = aenumdirection1[k]; ++ EnumDirection enumdirection2 = aenumdirection[k]; // Yatopia + + if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) { + return true; +diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java +index fe1612a8210fcd42c901d0cf3ec7fe6cfea9ff1b..dc76b629e0d0209bfcdfbc5764ba8405e5bf3e27 100644 +--- a/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java ++++ b/src/main/java/net/minecraft/world/level/block/piston/PistonExtendsChecker.java +@@ -173,10 +173,11 @@ public class PistonExtendsChecker { this.f.addAll(list1); this.f.addAll(list2); } diff --git a/patches/server/0014-lithium-MixinGoalSelector.patch b/patches/server/0014-lithium-MixinGoalSelector.patch index a4384ba5..9e7a68e1 100644 --- a/patches/server/0014-lithium-MixinGoalSelector.patch +++ b/patches/server/0014-lithium-MixinGoalSelector.patch @@ -8,19 +8,19 @@ Only replaces the set type, might want to also port the logic rewrite in the fut Original code by JellySquid, licensed under GNU Lesser General Public License v3.0 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -index 2ce5e07f4dcd0c76073840c35be66b7c65c6e7e8..44f3fc1e57a6287b12b281643c8e9ae734aebaf8 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -@@ -11,6 +11,7 @@ import java.util.function.Supplier; - import java.util.stream.Stream; +diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +index f303c5d6b2e55fc9fd8b49ec21121805e7351034..0e76758fb85870d0030e7a06a384f6411080dd01 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java ++++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java +@@ -12,6 +12,7 @@ import java.util.stream.Stream; + import net.minecraft.util.profiling.GameProfilerFiller; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; // Yatopia public class PathfinderGoalSelector { -@@ -27,7 +28,7 @@ public class PathfinderGoalSelector { +@@ -28,7 +29,7 @@ public class PathfinderGoalSelector { } }; private final Map c = new EnumMap(PathfinderGoal.Type.class); diff --git a/patches/server/0016-Item-stuck-sleep-config.patch b/patches/server/0016-Item-stuck-sleep-config.patch index d4d3a5d2..4aa05b47 100644 --- a/patches/server/0016-Item-stuck-sleep-config.patch +++ b/patches/server/0016-Item-stuck-sleep-config.patch @@ -4,11 +4,11 @@ Date: Fri, 31 Jul 2020 21:48:14 -0500 Subject: [PATCH] Item stuck sleep config -diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 7d2c2e6e58741a6da10117c62a809ae47ee341ee..65280c4b88f01d893acd8bc84f9ab502c0275b76 100644 ---- a/src/main/java/net/minecraft/server/EntityItem.java -+++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -86,7 +86,7 @@ public class EntityItem extends Entity { +diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +index 15aaff4797f0343b5aba0302a3dc1e5fae459b5d..eb115279d9d4730c06a1a70b8503756bc1a3b4ae 100644 +--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java ++++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java +@@ -114,7 +114,7 @@ public class EntityItem extends Entity { if (this.world.isClientSide) { this.noclip = false; diff --git a/patches/server/0017-Option-for-simpler-Villagers.patch b/patches/server/0017-Option-for-simpler-Villagers.patch index 432d14a4..7e0551dc 100644 --- a/patches/server/0017-Option-for-simpler-Villagers.patch +++ b/patches/server/0017-Option-for-simpler-Villagers.patch @@ -4,11 +4,11 @@ Date: Fri, 31 Jul 2020 21:58:24 -0500 Subject: [PATCH] Option for simpler Villagers -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a3801558e518 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -29,6 +29,7 @@ import org.bukkit.event.entity.VillagerReplenishTradeEvent; +diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +index 6ad608a795e85daf7425f26041b5e4a86cadc033..2cfc33128e5212c6d4907e4ff6276f6be443d223 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java +@@ -103,6 +103,7 @@ import org.bukkit.event.entity.VillagerReplenishTradeEvent; public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder { @@ -16,7 +16,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 private static final DataWatcherObject br = DataWatcher.a(EntityVillager.class, DataWatcherRegistry.q); public static final Map bp = ImmutableMap.of(Items.BREAD, 4, Items.POTATO, 1, Items.CARROT, 1, Items.BEETROOT, 1); private static final Set bs = ImmutableSet.of(Items.BREAD, Items.POTATO, Items.CARROT, Items.WHEAT, Items.WHEAT_SEEDS, Items.BEETROOT, new Item[]{Items.BEETROOT_SEEDS}); -@@ -65,8 +66,14 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -139,8 +140,14 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation public EntityVillager(EntityTypes entitytypes, World world, VillagerType villagertype) { super(entitytypes, world); this.by = new Reputation(); @@ -31,7 +31,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 this.setCanPickupLoot(true); this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE)); this.brainTickOffset = getRandom().nextInt(100); // Purpur -@@ -87,6 +94,38 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -161,6 +168,38 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void initPathfinder() { this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS)); @@ -40,37 +40,37 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 + // safety + return; + } -+ this.goalSelector.a(0, new PathfinderGoalFloat(this)); ++ this.goalSelector.a(0, new net.minecraft.world.entity.ai.goal.PathfinderGoalFloat(this)); + if (org.yatopiamc.yatopia.server.YatopiaConfig.villagersHideAtNight) { -+ this.goalSelector.a(0, new PathfinderGoalUseItem<>(this, PotionUtil.a(new ItemStack(Items.POTION), Potions.INVISIBILITY), SoundEffects.ENTITY_WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { ++ this.goalSelector.a(0, new net.minecraft.world.entity.ai.goal.PathfinderGoalUseItem<>(this, net.minecraft.world.item.alchemy.PotionUtil.a(new ItemStack(Items.POTION), net.minecraft.world.item.alchemy.Potions.INVISIBILITY), SoundEffects.ENTITY_WANDERING_TRADER_DISAPPEARED, (entityvillagertrader) -> { + return !this.world.isDay() && !entityvillagertrader.isInvisible(); + })); -+ this.goalSelector.a(0, new PathfinderGoalUseItem<>(this, new ItemStack(Items.MILK_BUCKET), SoundEffects.ENTITY_WANDERING_TRADER_REAPPEARED, (entityvillagertrader) -> { ++ this.goalSelector.a(0, new net.minecraft.world.entity.ai.goal.PathfinderGoalUseItem<>(this, new ItemStack(Items.MILK_BUCKET), SoundEffects.ENTITY_WANDERING_TRADER_REAPPEARED, (entityvillagertrader) -> { + return this.world.isDay() && entityvillagertrader.isInvisible(); + })); + } -+ this.goalSelector.a(1, new PathfinderGoalTradeWithPlayer(this)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityZombie.class, 8.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityEvoker.class, 12.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityVindicator.class, 8.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityVex.class, 8.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityPillager.class, 15.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalAvoidTarget<>(this, EntityIllagerIllusioner.class, 12.0F, 0.5D, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalPanic(this, 0.5D)); -+ this.goalSelector.a(1, new PathfinderGoalLookAtTradingPlayer(this)); -+ this.goalSelector.a(2, new PathfinderGoalStrollVillageGolem(this, 0.6D)); -+ this.goalSelector.a(3, new PathfinderGoalMoveThroughVillage(this, 0.6D, false, 4, () -> { ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalTradeWithPlayer(this)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityZombie.class, 8.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityEvoker.class, 12.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityVindicator.class, 8.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityVex.class, 8.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityPillager.class, 15.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget<>(this, net.minecraft.world.entity.monster.EntityIllagerIllusioner.class, 12.0F, 0.5D, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalPanic(this, 0.5D)); ++ this.goalSelector.a(1, new net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtTradingPlayer(this)); ++ this.goalSelector.a(2, new net.minecraft.world.entity.ai.goal.PathfinderGoalStrollVillageGolem(this, 0.6D)); ++ this.goalSelector.a(3, new net.minecraft.world.entity.ai.goal.PathfinderGoalMoveThroughVillage(this, 0.6D, false, 4, () -> { + return false; + })); -+ this.goalSelector.a(4, new PathfinderGoalMoveTowardsRestriction(this, 0.35D)); -+ this.goalSelector.a(8, new PathfinderGoalRandomStrollLand(this, 0.35D)); -+ this.goalSelector.a(9, new PathfinderGoalInteract(this, EntityHuman.class, 3.0F, 1.0F)); -+ this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); ++ this.goalSelector.a(4, new net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsRestriction(this, 0.35D)); ++ this.goalSelector.a(8, new net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand(this, 0.35D)); ++ this.goalSelector.a(9, new net.minecraft.world.entity.ai.goal.PathfinderGoalInteract(this, EntityHuman.class, 3.0F, 1.0F)); ++ this.goalSelector.a(10, new net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F)); + // Yatopia End } @Override -@@ -112,6 +151,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -186,6 +225,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @Override protected BehaviorController a(Dynamic dynamic) { @@ -78,8 +78,8 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 BehaviorController behaviorcontroller = this.cK().a(dynamic); this.a(behaviorcontroller); -@@ -211,11 +251,39 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - // Purpur end +@@ -265,6 +305,27 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + // Spigot End private int behaviorTick = 0; + // Yatopia start @@ -104,7 +104,9 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 + } + // Yatopia end - @Override + // Purpur start + boolean lobotomized = false; +@@ -290,6 +351,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void mobTick() { mobTick(false); } protected void mobTick(boolean inactive) { this.world.getMethodProfiler().enter("villagerBrain"); @@ -118,7 +120,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 // Purpur start if (world.purpurConfig.villagerLobotomizeEnabled) inactive = inactive || isLobotomized(); boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; -@@ -342,6 +410,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -416,6 +484,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation this.fl(); } @@ -126,7 +128,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 private void fl() { Iterator iterator = this.getOffers().iterator(); -@@ -416,6 +485,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -490,6 +559,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation return this.fn() && this.fm(); } @@ -134,7 +136,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 private void fo() { int i = 2 - this.bD; -@@ -648,6 +718,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -722,6 +792,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } private void a(Entity entity) { @@ -142,7 +144,7 @@ index 9b30273d59eb7f0d40cd54eb9e1d2ebe24b48fca..8ec27653d1c55faeac499ee52117a380 if (this.world instanceof WorldServer) { Optional> optional = this.bg.getMemory(MemoryModuleType.VISIBLE_MOBS); -@@ -664,6 +735,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -738,6 +809,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } public void a(MemoryModuleType memorymoduletype) { diff --git a/patches/server/0018-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch b/patches/server/0018-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch index cb68d81a..4e799108 100644 --- a/patches/server/0018-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch +++ b/patches/server/0018-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Heavily optimize furnance fuel and recipe lookups Co-authored-by: Mykyta Komarn -diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 48359a7e79b64026e38e7cd17505d8944106e089..9ff95817cc1ec4f28070e8e91bf8ab64cad7b23c 100644 ---- a/src/main/java/net/minecraft/server/TileEntityFurnace.java -+++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -300,7 +300,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java +index cd7bcedf8474dcb565b5b1157e167706c031a7f1..8a1425f565204fedd1007862b2af9db4c9217461 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnace.java +@@ -331,7 +331,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); } } else { @@ -21,7 +21,7 @@ index 48359a7e79b64026e38e7cd17505d8944106e089..9ff95817cc1ec4f28070e8e91bf8ab64 if (!this.isBurning() && this.canBurn(irecipe)) { // CraftBukkit start -@@ -632,4 +635,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -663,4 +666,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I } } diff --git a/patches/server/0019-Optimize-TileEntity-load-unload.patch b/patches/server/0019-Optimize-TileEntity-load-unload.patch index fcd49e62..9dd0c0b6 100644 --- a/patches/server/0019-Optimize-TileEntity-load-unload.patch +++ b/patches/server/0019-Optimize-TileEntity-load-unload.patch @@ -4,11 +4,11 @@ Date: Wed, 5 Aug 2020 08:08:44 -0500 Subject: [PATCH] Optimize TileEntity load/unload -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e280afce30ddc0c2ec54945543ad65b4ebfa71f2..c3909bc3ec2601010b28949258cf52fd8e8446a9 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -42,8 +42,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 171c6e0e9e4718246b81bb9d7514d1f3290bf852..421c141f24d3b640d97505565bd39fc14fc4ca08 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -105,8 +105,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public static final ResourceKey THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end")); private static final EnumDirection[] a = EnumDirection.values(); //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list diff --git a/patches/server/0020-Global-Eula-file.patch b/patches/server/0020-Global-Eula-file.patch index 0dba7244..daf1727c 100644 --- a/patches/server/0020-Global-Eula-file.patch +++ b/patches/server/0020-Global-Eula-file.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Global Eula file diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java -index f88cf526d272fe47b5a474c0b344b748ee4009fa..4216448c4cb645fa6c61bad07c99abab5c9cd829 100644 +index 87891161f5b06bb8be0e2016b490484e6daca9d7..b6d94005cb2d7f28fc4f0b78191ef1ba13190e56 100644 --- a/src/main/java/net/minecraft/server/EULA.java +++ b/src/main/java/net/minecraft/server/EULA.java -@@ -15,12 +15,25 @@ public class EULA { +@@ -17,12 +17,25 @@ public class EULA { - public EULA(java.nio.file.Path java_nio_file_path) { - this.b = java_nio_file_path; + public EULA(Path path) { + this.b = path; - this.c = SharedConstants.d || this.b(); + this.c = SharedConstants.d || globalEula() || this.b(this.b); // Yatopia } diff --git a/patches/server/0021-Redirect-Configs.patch b/patches/server/0021-Redirect-Configs.patch index a975f739..16e7e249 100644 --- a/patches/server/0021-Redirect-Configs.patch +++ b/patches/server/0021-Redirect-Configs.patch @@ -38,11 +38,11 @@ index 2457b240f3b49dbd5fe0eb603d86418fd65f0205..fa6637caf388c5ed1d3371c6433c8ede for (final Method method : clazz.getDeclaredMethods()) { if (method.getReturnType() != void.class || method.getParameterCount() != 0 || -diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index af7784790fcddc58509f07586f7fd8d2e42e9eee..be95dbd80b1d06795158fd51e66f98154ce490ed 100644 ---- a/src/main/java/net/minecraft/server/DedicatedServer.java -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -196,7 +196,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +index 78f7155c8bbeb2b93d42fc2b108ff4135038ea72..cdd1d1f77f6b48fae9f7dcca4a69505c644f9085 100644 +--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +@@ -235,7 +235,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return false; } // Yatopia end @@ -52,10 +52,10 @@ index af7784790fcddc58509f07586f7fd8d2e42e9eee..be95dbd80b1d06795158fd51e66f9815 this.setAllowFlight(dedicatedserverproperties.allowFlight); this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba()); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e65f4b990c24e6cee850521f9ad02c2bf4c85ad6..756be0886856aabc31e436f82948d3d069f66fef 100644 +index 207df35734bdb333a0a2ef56e7041120620c1817..4fd607eb52637e0626afcba1ba449c3784a85568 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -303,7 +303,7 @@ public class Main { +@@ -305,7 +305,7 @@ public class Main { } // Paper end System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows diff --git a/patches/server/0022-lithium-DataTrackerMixin.patch b/patches/server/0022-lithium-DataTrackerMixin.patch index cb08d67f..0c34583a 100644 --- a/patches/server/0022-lithium-DataTrackerMixin.patch +++ b/patches/server/0022-lithium-DataTrackerMixin.patch @@ -8,11 +8,11 @@ you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ Co-authored-by: tr7zw -diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index e69093b411f76ea4090789576f8fb6635bd02ca5..4a14431b198c227eb6f0f68eaac14f5c09fc3036 100644 ---- a/src/main/java/net/minecraft/server/DataWatcher.java -+++ b/src/main/java/net/minecraft/server/DataWatcher.java -@@ -27,6 +27,77 @@ public class DataWatcher { +diff --git a/src/main/java/net/minecraft/network/syncher/DataWatcher.java b/src/main/java/net/minecraft/network/syncher/DataWatcher.java +index bb09b7be91b488ebc336b2b6f5deafc0ccab27a4..c03f1293848192cada5e3a6238f7a5c11cd4ab10 100644 +--- a/src/main/java/net/minecraft/network/syncher/DataWatcher.java ++++ b/src/main/java/net/minecraft/network/syncher/DataWatcher.java +@@ -32,6 +32,77 @@ public class DataWatcher { private boolean f = true; private boolean g; @@ -90,7 +90,7 @@ index e69093b411f76ea4090789576f8fb6635bd02ca5..4a14431b198c227eb6f0f68eaac14f5c public DataWatcher(Entity entity) { this.entity = entity; } -@@ -91,7 +162,8 @@ public class DataWatcher { +@@ -96,7 +167,8 @@ public class DataWatcher { DataWatcher.Item datawatcher_item = new DataWatcher.Item<>(datawatcherobject, t0); // this.lock.writeLock().lock(); // Spigot - not required @@ -100,7 +100,7 @@ index e69093b411f76ea4090789576f8fb6635bd02ca5..4a14431b198c227eb6f0f68eaac14f5c this.f = false; // this.lock.writeLock().unlock(); // Spigot - not required } -@@ -122,7 +194,8 @@ public class DataWatcher { +@@ -127,7 +199,8 @@ public class DataWatcher { } public T get(DataWatcherObject datawatcherobject) { diff --git a/patches/server/0023-Fix-lead-fall-dmg-config.patch b/patches/server/0023-Fix-lead-fall-dmg-config.patch index 57961414..d6adc34e 100644 --- a/patches/server/0023-Fix-lead-fall-dmg-config.patch +++ b/patches/server/0023-Fix-lead-fall-dmg-config.patch @@ -4,11 +4,11 @@ Date: Tue, 4 Aug 2020 22:08:09 +0200 Subject: [PATCH] Fix lead fall dmg config -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b8ae3f65ba8a923ad2b72e6d6b1db7a17fd08cb8..ce13a7e41d596f0f6396a9954b84970974076bf8 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1303,6 +1303,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 590a2274c5c414c03e37219dca9cd10e9d3f8b89..729b846612ec4e96e818723b39cac27d46091377 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -1396,6 +1396,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne this.fallDistance = 0.0F; } else if (d0 < 0.0D) { this.fallDistance = (float) ((double) this.fallDistance - d0); diff --git a/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch b/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch index e141acd8..62767c80 100644 --- a/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch +++ b/patches/server/0024-Optimize-some-stuff-in-WorldServer-ticking.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Optimize some stuff in WorldServer ticking Replaced some streams and some array lists with glue lists -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4e7700443c4f0725c0d032b620f84fcfadbde7a1..e695cf764cab6d64ea5bb00af03b25f4930946dd 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -885,12 +885,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index 6f3d76b5e0d2fffdf59a07fbdf865a35e1860f90..fdc5bfeb36d306046d259d22dcd8653c2936d6ea 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -1005,12 +1005,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.i, this.thunderLevel)); } // */ @@ -34,7 +34,7 @@ index 4e7700443c4f0725c0d032b620f84fcfadbde7a1..e695cf764cab6d64ea5bb00af03b25f4 if (flag != this.isRaining()) { // Only send weather packets to those affected for (int idx = 0; idx < this.players.size(); ++idx) { -@@ -905,11 +914,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1025,11 +1034,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } // CraftBukkit end @@ -48,7 +48,7 @@ index 4e7700443c4f0725c0d032b620f84fcfadbde7a1..e695cf764cab6d64ea5bb00af03b25f4 long l = this.worldData.getDayTime() + 24000L; TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (l - l % 24000L) - this.getDayTime()); if (this.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) { -@@ -1115,9 +1122,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1235,9 +1242,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { } private void wakeupPlayers() { @@ -60,7 +60,7 @@ index 4e7700443c4f0725c0d032b620f84fcfadbde7a1..e695cf764cab6d64ea5bb00af03b25f4 } // Paper start - optimise random block ticking -@@ -1920,8 +1927,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2068,8 +2075,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Spigot start if ( entity instanceof EntityHuman ) { @@ -71,7 +71,7 @@ index 4e7700443c4f0725c0d032b620f84fcfadbde7a1..e695cf764cab6d64ea5bb00af03b25f4 for (Object o : worldData.data.values() ) { if ( o instanceof WorldMap ) -@@ -1938,7 +1946,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -2086,7 +2094,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } } diff --git a/patches/server/0025-Optimize-BehaviorController.patch b/patches/server/0025-Optimize-BehaviorController.patch index 2ddba0b8..64b50f7b 100644 --- a/patches/server/0025-Optimize-BehaviorController.patch +++ b/patches/server/0025-Optimize-BehaviorController.patch @@ -4,11 +4,11 @@ Date: Sun, 9 Aug 2020 22:27:52 +0300 Subject: [PATCH] Optimize BehaviorController -diff --git a/src/main/java/net/minecraft/server/BehaviorController.java b/src/main/java/net/minecraft/server/BehaviorController.java -index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6c15fa53c 100644 ---- a/src/main/java/net/minecraft/server/BehaviorController.java -+++ b/src/main/java/net/minecraft/server/BehaviorController.java -@@ -53,13 +53,16 @@ public class BehaviorController { +diff --git a/src/main/java/net/minecraft/world/entity/ai/BehaviorController.java b/src/main/java/net/minecraft/world/entity/ai/BehaviorController.java +index fc4216cafbd3a81cac319b11ee093bec38827742..e38cdf81e3f3ba1a2ee86c3a202e5643dd9c0fd1 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/BehaviorController.java ++++ b/src/main/java/net/minecraft/world/entity/ai/BehaviorController.java +@@ -65,13 +65,16 @@ public class BehaviorController { mutableobject.setValue((new MapCodec>() { public Stream keys(DynamicOps dynamicops) { @@ -32,7 +32,7 @@ index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6 } public DataResult> decode(DynamicOps dynamicops, MapLike maplike) { -@@ -71,23 +74,17 @@ public class BehaviorController { +@@ -83,23 +86,17 @@ public class BehaviorController { return this.a(memorymoduletype, dynamicops, pair.getSecond()); }); @@ -61,7 +61,7 @@ index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6 return DataResult.error("No codec for memory: " + memorymoduletype); })).flatMap((codec) -> { return codec.parse(dynamicops, t0); -@@ -97,9 +94,9 @@ public class BehaviorController { +@@ -109,9 +106,9 @@ public class BehaviorController { } public RecordBuilder encode(BehaviorController behaviorcontroller, DynamicOps dynamicops, RecordBuilder recordbuilder) { @@ -73,7 +73,7 @@ index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6 return recordbuilder; } }).fieldOf("memories").codec()); -@@ -158,6 +155,15 @@ public class BehaviorController { +@@ -170,6 +167,15 @@ public class BehaviorController { return ((Codec) this.b.get()).encodeStart(dynamicops, this); } @@ -89,7 +89,7 @@ index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6 private Stream> j() { return this.memories.entrySet().stream().map((entry) -> { return BehaviorController.a.b((MemoryModuleType) entry.getKey(), (Optional) entry.getValue()); -@@ -196,7 +202,7 @@ public class BehaviorController { +@@ -208,7 +214,7 @@ public class BehaviorController { } public Optional getMemory(MemoryModuleType memorymoduletype) { @@ -98,7 +98,7 @@ index ae2905b403a63396d9cdc61444586ea5548f2974..4ad7f42158bb945088a4d1c574c63dd6 } public boolean b(MemoryModuleType memorymoduletype, U u0) { -@@ -535,7 +541,7 @@ public class BehaviorController { +@@ -547,7 +553,7 @@ public class BehaviorController { private final MemoryModuleType a; private final Optional> b; diff --git a/patches/server/0026-Add-timings-for-Pathfinder.patch b/patches/server/0026-Add-timings-for-Pathfinder.patch index 2d31e0c0..b91874da 100644 --- a/patches/server/0026-Add-timings-for-Pathfinder.patch +++ b/patches/server/0026-Add-timings-for-Pathfinder.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add timings for Pathfinder diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java -index 68ab5ccb2fcfe1de0503c9336572f28e11832b2d..4d4c25cb328b0ca2e16d3c823214aca5854e4deb 100644 +index 67980e1dc186c0b458eca9f00acfea7d2b26d575..e5df5045c7fb9faf692fed894e1a64fe6e1449af 100644 --- a/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java -@@ -54,6 +54,8 @@ public final class MinecraftTimings { +@@ -57,6 +57,8 @@ public final class MinecraftTimings { return Timings.ofSafe(taskName); } @@ -17,11 +17,11 @@ index 68ab5ccb2fcfe1de0503c9336572f28e11832b2d..4d4c25cb328b0ca2e16d3c823214aca5 /** * Gets a timer associated with a plugins tasks. * @param bukkitTask -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 88368ae1633cf8bfb845d52b38110a6828fcf699..21898e1d3884a3e92c49814ecf2b666a008f74ed 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -29,6 +29,7 @@ public abstract class NavigationAbstract { +diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +index ac7bad10697c6fde7d512753992d59710aa1e032..0c8f3e424a631aca98f83f570aff91c833aaf4b9 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java +@@ -51,6 +51,7 @@ public abstract class NavigationAbstract { private float r; private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER private boolean t; @@ -29,7 +29,7 @@ index 88368ae1633cf8bfb845d52b38110a6828fcf699..21898e1d3884a3e92c49814ecf2b666a // Tuinity start public boolean isViableForPathRecalculationChecking() { -@@ -47,6 +48,7 @@ public abstract class NavigationAbstract { +@@ -69,6 +70,7 @@ public abstract class NavigationAbstract { int i = MathHelper.floor(entityinsentient.b(GenericAttributes.FOLLOW_RANGE) * 16.0D); this.s = this.a(i); @@ -37,7 +37,7 @@ index 88368ae1633cf8bfb845d52b38110a6828fcf699..21898e1d3884a3e92c49814ecf2b666a } public void g() { -@@ -231,6 +233,10 @@ public abstract class NavigationAbstract { +@@ -253,6 +255,10 @@ public abstract class NavigationAbstract { } public void c() { @@ -48,7 +48,7 @@ index 88368ae1633cf8bfb845d52b38110a6828fcf699..21898e1d3884a3e92c49814ecf2b666a ++this.e; if (this.m) { this.j(); -@@ -258,6 +264,11 @@ public abstract class NavigationAbstract { +@@ -280,6 +286,11 @@ public abstract class NavigationAbstract { this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a((IBlockAccess) this.b, blockposition), vec3d.z, this.d); } } diff --git a/patches/server/0027-Highly-optimize-VillagePlace-filtering.patch b/patches/server/0027-Highly-optimize-VillagePlace-filtering.patch index 3fb1c7fa..d9ff4422 100644 --- a/patches/server/0027-Highly-optimize-VillagePlace-filtering.patch +++ b/patches/server/0027-Highly-optimize-VillagePlace-filtering.patch @@ -66,11 +66,11 @@ index 0000000000000000000000000000000000000000..e647624f4c9afe8bc603792ad88c807e + return (Producer) EMPTY_PRODUCER; + } +} -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index bc61aaff65a7dc1e7534452b285953b83adb7000..7fddef0afbcf1f9f391c540b8fce1bebf8faa452 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -341,6 +341,16 @@ public class BlockPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java +index a01b69c43acf4beb65c8b7a8a800c44121068d46..bb520b56d797cabec86fce42dd4afff018e66fdd 100644 +--- a/src/main/java/net/minecraft/core/BlockPosition.java ++++ b/src/main/java/net/minecraft/core/BlockPosition.java +@@ -348,6 +348,16 @@ public class BlockPosition extends BaseBlockPosition { return a(MathHelper.floor(axisalignedbb.minX), MathHelper.floor(axisalignedbb.minY), MathHelper.floor(axisalignedbb.minZ), MathHelper.floor(axisalignedbb.maxX), MathHelper.floor(axisalignedbb.maxY), MathHelper.floor(axisalignedbb.maxZ)); } @@ -87,71 +87,11 @@ index bc61aaff65a7dc1e7534452b285953b83adb7000..7fddef0afbcf1f9f391c540b8fce1beb public static Stream a(int i, int j, int k, int l, int i1, int j1) { return StreamSupport.stream(b(i, j, k, l, i1, j1).spliterator(), false); } -diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 271fddbbf73ca5c0e4e2722d7246c14b778d6072..860943989b10a4f65c0de345a56aaa00f0959214 100644 ---- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -+++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -@@ -118,6 +118,15 @@ public class ChunkCoordIntPair { - return a(new ChunkCoordIntPair(chunkcoordintpair.x - i, chunkcoordintpair.z - i), new ChunkCoordIntPair(chunkcoordintpair.x + i, chunkcoordintpair.z + i)); - } - -+ // Yatopia start -+ public static java.util.List streamList(ChunkCoordIntPair center, int radius) { -+ return streamList(new ChunkCoordIntPair(center.x - radius, center.z - radius), new ChunkCoordIntPair(center.x + radius, center.z + radius)); -+ } -+ public static java.util.List streamList(ChunkCoordIntPair pos1, ChunkCoordIntPair pos2) { -+ return org.yatopiamc.yatopia.server.YatopiaChunkPos.asList(pos1, pos2); -+ } -+ // Yatopia end -+ - public static Stream a(final ChunkCoordIntPair chunkcoordintpair, final ChunkCoordIntPair chunkcoordintpair1) { - int i = Math.abs(chunkcoordintpair.x - chunkcoordintpair1.x) + 1; - int j = Math.abs(chunkcoordintpair.z - chunkcoordintpair1.z) + 1; -diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index bef806bfc60792a990209b57f3cd4b9da0c24acc..6aee58fb0c6b9c1ae4ac6157e02a5050cd835536 100644 ---- a/src/main/java/net/minecraft/server/EntityBee.java -+++ b/src/main/java/net/minecraft/server/EntityBee.java -@@ -781,15 +781,19 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB - private List j() { - BlockPosition blockposition = EntityBee.this.getChunkCoordinates(); - VillagePlace villageplace = ((WorldServer) EntityBee.this.world).y(); -- Stream stream = villageplace.c((villageplacetype) -> { -+ List stream = villageplace.cListPositions((villageplacetype) -> { // Yatopia - return villageplacetype == VillagePlaceType.t || villageplacetype == VillagePlaceType.u; -- }, blockposition, 20, VillagePlace.Occupancy.ANY); -- -+ }, (record) -> i(record.getPosition()), blockposition, 20, VillagePlace.Occupancy.ANY); // Yatopia -+ // Yatopia start -+ stream.sort(Comparator.comparingDouble((pos1) -> pos1.distanceSquared(blockposition))); -+ return stream; -+ /* - return (List) stream.map(VillagePlaceRecord::f).filter((blockposition1) -> { - return EntityBee.this.i(blockposition1); - }).sorted(Comparator.comparingDouble((blockposition1) -> { - return blockposition1.j(blockposition); - })).collect(Collectors.toList()); -+ */ // Yatopia end - } - } - -diff --git a/src/main/java/net/minecraft/server/PersistentRaid.java b/src/main/java/net/minecraft/server/PersistentRaid.java -index 807910c60e6cad58b91474b0477e6fc109eaf281..f003f95aca2c9a41b548c8ca2de1194818268c80 100644 ---- a/src/main/java/net/minecraft/server/PersistentRaid.java -+++ b/src/main/java/net/minecraft/server/PersistentRaid.java -@@ -80,7 +80,7 @@ public class PersistentRaid extends PersistentBase { - return null; - } else { - BlockPosition blockposition = entityplayer.getChunkCoordinates(); -- List list = (List) this.b.y().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList()); -+ List list = this.b.y().cList(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED); // Yatopia - int i = 0; - Vec3D vec3d = Vec3D.ORIGIN; - -diff --git a/src/main/java/net/minecraft/server/SectionPosition.java b/src/main/java/net/minecraft/server/SectionPosition.java -index 0bb3ad0bffc04eba38cd827eaf5c63e8bf2aee93..8e90fabb0681457ec140f8553799463023a7a03b 100644 ---- a/src/main/java/net/minecraft/server/SectionPosition.java -+++ b/src/main/java/net/minecraft/server/SectionPosition.java -@@ -159,6 +159,7 @@ public class SectionPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/core/SectionPosition.java b/src/main/java/net/minecraft/core/SectionPosition.java +index 427413c668865e1660f1d81daf6a3385f08a0e38..a206a729b3afa01bf591fa4da1e5c14902da4778 100644 +--- a/src/main/java/net/minecraft/core/SectionPosition.java ++++ b/src/main/java/net/minecraft/core/SectionPosition.java +@@ -162,6 +162,7 @@ public class SectionPosition extends BaseBlockPosition { return this.p().b(8, 8, 8); } @@ -159,7 +99,7 @@ index 0bb3ad0bffc04eba38cd827eaf5c63e8bf2aee93..8e90fabb0681457ec140f85537994630 public ChunkCoordIntPair r() { return new ChunkCoordIntPair(this.a(), this.c()); } -@@ -173,10 +174,12 @@ public class SectionPosition extends BaseBlockPosition { +@@ -176,10 +177,12 @@ public class SectionPosition extends BaseBlockPosition { return (((long) i & 4194303L) << 42) | (((long) j & 1048575L)) | (((long) k & 4194303L) << 20); // Paper - Simplify to reduce instruction count } @@ -172,7 +112,7 @@ index 0bb3ad0bffc04eba38cd827eaf5c63e8bf2aee93..8e90fabb0681457ec140f85537994630 public Stream t() { return BlockPosition.a(this.d(), this.e(), this.f(), this.g(), this.h(), this.i()); } -@@ -189,6 +192,18 @@ public class SectionPosition extends BaseBlockPosition { +@@ -192,6 +195,18 @@ public class SectionPosition extends BaseBlockPosition { return a(chunkcoordintpair.x - i, 0, chunkcoordintpair.z - i, chunkcoordintpair.x + i, 15, chunkcoordintpair.z + i); // Paper - simplify/inline } @@ -191,11 +131,11 @@ index 0bb3ad0bffc04eba38cd827eaf5c63e8bf2aee93..8e90fabb0681457ec140f85537994630 public static Stream a(final int i, final int j, final int k, final int l, final int i1, final int j1) { return StreamSupport.stream(new AbstractSpliterator((long) ((l - i + 1) * (i1 - j + 1) * (j1 - k + 1)), 64) { final CursorPosition a = new CursorPosition(i, j, k, l, i1, j1); -diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81910ed8c1 100644 ---- a/src/main/java/net/minecraft/server/VillagePlace.java -+++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -180,7 +180,7 @@ public class VillagePlace extends RegionFileSection { +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +index 6082eed2d28f3be65daa7e7eb6f2c2a89bb28ff1..29cd71efe86eea2227f373c15c39dc530e9e8199 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlace.java +@@ -193,7 +193,7 @@ public class VillagePlace extends RegionFileSection { public long count(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return a(predicate, blockposition, i, villageplace_occupancy); } // Purpur - OBFHELPER public long a(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { @@ -204,7 +144,7 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 } public boolean a(VillagePlaceType villageplacetype, BlockPosition blockposition) { -@@ -201,6 +201,39 @@ public class VillagePlace extends RegionFileSection { +@@ -214,6 +214,39 @@ public class VillagePlace extends RegionFileSection { }); } @@ -244,7 +184,7 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 public Stream c(Predicate predicate, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { int j = i * i; -@@ -217,10 +250,28 @@ public class VillagePlace extends RegionFileSection { +@@ -230,10 +263,28 @@ public class VillagePlace extends RegionFileSection { }); } @@ -273,7 +213,7 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 public Stream b(Predicate predicate, Predicate predicate1, BlockPosition blockposition, int i, VillagePlace.Occupancy villageplace_occupancy) { return this.a(predicate, predicate1, blockposition, i, villageplace_occupancy).sorted(Comparator.comparingDouble((blockposition1) -> { return blockposition1.j(blockposition); -@@ -368,7 +419,7 @@ public class VillagePlace extends RegionFileSection { +@@ -381,7 +432,7 @@ public class VillagePlace extends RegionFileSection { } private void a(ChunkSection chunksection, SectionPosition sectionposition, BiConsumer biconsumer) { @@ -282,7 +222,7 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 IBlockData iblockdata = chunksection.getType(SectionPosition.b(blockposition.getX()), SectionPosition.b(blockposition.getY()), SectionPosition.b(blockposition.getZ())); VillagePlaceType.b(iblockdata).ifPresent((villageplacetype) -> { -@@ -378,6 +429,16 @@ public class VillagePlace extends RegionFileSection { +@@ -391,6 +442,16 @@ public class VillagePlace extends RegionFileSection { } public void a(IWorldReader iworldreader, BlockPosition blockposition, int i) { @@ -299,7 +239,7 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> { return Pair.of(sectionposition, this.d(sectionposition.s())); }).filter((pair) -> { -@@ -389,6 +450,7 @@ public class VillagePlace extends RegionFileSection { +@@ -402,6 +463,7 @@ public class VillagePlace extends RegionFileSection { }).forEach((chunkcoordintpair) -> { iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.EMPTY); }); @@ -307,10 +247,10 @@ index 64e251fb63e67b9ebf11779580b1bff6def6d1c6..4b631a2f4e464e9ee397cf6d12534b81 } final class a extends LightEngineGraphSection { -diff --git a/src/main/java/net/minecraft/server/VillagePlaceSection.java b/src/main/java/net/minecraft/server/VillagePlaceSection.java -index 943a437ff27162eae09211c28bdc0d141fa6a404..b4ae140eeddb7e31b6d530e74f3c0736529e00d4 100644 ---- a/src/main/java/net/minecraft/server/VillagePlaceSection.java -+++ b/src/main/java/net/minecraft/server/VillagePlaceSection.java +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java +index 41ffad7cbb6c77713736f37b3728b201d315f6d4..866e9a434423702d2edaf9b52fa0e6219e13c2d7 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceSection.java @@ -5,6 +5,10 @@ import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.mojang.serialization.Codec; @@ -322,7 +262,7 @@ index 943a437ff27162eae09211c28bdc0d141fa6a404..b4ae140eeddb7e31b6d530e74f3c0736 import it.unimi.dsi.fastutil.shorts.Short2ObjectMap; import it.unimi.dsi.fastutil.shorts.Short2ObjectOpenHashMap; import java.util.List; -@@ -49,12 +53,23 @@ public class VillagePlaceSection { +@@ -53,12 +57,23 @@ public class VillagePlaceSection { private VillagePlaceSection(Runnable runnable, boolean flag, List list) { this.b = new Short2ObjectOpenHashMap(); @@ -347,7 +287,7 @@ index 943a437ff27162eae09211c28bdc0d141fa6a404..b4ae140eeddb7e31b6d530e74f3c0736 public Stream a(Predicate predicate, VillagePlace.Occupancy villageplace_occupancy) { return this.c.entrySet().stream().filter((entry) -> { return predicate.test(entry.getKey()); -@@ -97,7 +112,7 @@ public class VillagePlaceSection { +@@ -101,7 +116,7 @@ public class VillagePlaceSection { this.b.put(short0, villageplacerecord); ((Set) this.c.computeIfAbsent(villageplacetype, (villageplacetype1) -> { @@ -356,9 +296,69 @@ index 943a437ff27162eae09211c28bdc0d141fa6a404..b4ae140eeddb7e31b6d530e74f3c0736 })).add(villageplacerecord); return true; } +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +index c39a7a6d7f391debd632a199eeec8ded6189ad76..052960fde2318495e68dd3ea97b987e01e8c5547 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityBee.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityBee.java +@@ -857,15 +857,19 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB + private List j() { + BlockPosition blockposition = EntityBee.this.getChunkCoordinates(); + VillagePlace villageplace = ((WorldServer) EntityBee.this.world).y(); +- Stream stream = villageplace.c((villageplacetype) -> { ++ List stream = villageplace.cListPositions((villageplacetype) -> { // Yatopia + return villageplacetype == VillagePlaceType.t || villageplacetype == VillagePlaceType.u; +- }, blockposition, 20, VillagePlace.Occupancy.ANY); +- ++ }, (record) -> i(record.getPosition()), blockposition, 20, VillagePlace.Occupancy.ANY); // Yatopia ++ // Yatopia start ++ stream.sort(Comparator.comparingDouble((pos1) -> pos1.distanceSquared(blockposition))); ++ return stream; ++ /* + return (List) stream.map(VillagePlaceRecord::f).filter((blockposition1) -> { + return EntityBee.this.i(blockposition1); + }).sorted(Comparator.comparingDouble((blockposition1) -> { + return blockposition1.j(blockposition); + })).collect(Collectors.toList()); ++ */ // Yatopia end + } + } + +diff --git a/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java b/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java +index 11271762dcf5783c3179de1afc6a882c5330b4dd..a0321663a1cb410505e2b57397c6d0020433e6e1 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java ++++ b/src/main/java/net/minecraft/world/entity/raid/PersistentRaid.java +@@ -98,7 +98,7 @@ public class PersistentRaid extends PersistentBase { + return null; + } else { + BlockPosition blockposition = entityplayer.getChunkCoordinates(); +- List list = (List) this.b.y().c(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED).collect(Collectors.toList()); ++ List list = this.b.y().cList(VillagePlaceType.b, blockposition, 64, VillagePlace.Occupancy.IS_OCCUPIED); // Yatopia + int i = 0; + Vec3D vec3d = Vec3D.ORIGIN; + +diff --git a/src/main/java/net/minecraft/world/level/ChunkCoordIntPair.java b/src/main/java/net/minecraft/world/level/ChunkCoordIntPair.java +index 53eb5b65683a2ab208edfc3f3bbf78ffee61bc85..ab169a113e69305f97c69541bcd4beabd05f9ed8 100644 +--- a/src/main/java/net/minecraft/world/level/ChunkCoordIntPair.java ++++ b/src/main/java/net/minecraft/world/level/ChunkCoordIntPair.java +@@ -119,6 +119,15 @@ public class ChunkCoordIntPair { + return a(new ChunkCoordIntPair(chunkcoordintpair.x - i, chunkcoordintpair.z - i), new ChunkCoordIntPair(chunkcoordintpair.x + i, chunkcoordintpair.z + i)); + } + ++ // Yatopia start ++ public static java.util.List streamList(ChunkCoordIntPair center, int radius) { ++ return streamList(new ChunkCoordIntPair(center.x - radius, center.z - radius), new ChunkCoordIntPair(center.x + radius, center.z + radius)); ++ } ++ public static java.util.List streamList(ChunkCoordIntPair pos1, ChunkCoordIntPair pos2) { ++ return org.yatopiamc.yatopia.server.YatopiaChunkPos.asList(pos1, pos2); ++ } ++ // Yatopia end ++ + public static Stream a(final ChunkCoordIntPair chunkcoordintpair, final ChunkCoordIntPair chunkcoordintpair1) { + int i = Math.abs(chunkcoordintpair.x - chunkcoordintpair1.x) + 1; + int j = Math.abs(chunkcoordintpair.z - chunkcoordintpair1.z) + 1; diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkPos.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkPos.java new file mode 100644 -index 0000000000000000000000000000000000000000..de95cf5ca20abdc8f200806287fb0ba03eec1e7c +index 0000000000000000000000000000000000000000..09700214355375b59697577253ac5df97608690b --- /dev/null +++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkPos.java @@ -0,0 +1,54 @@ @@ -368,7 +368,7 @@ index 0000000000000000000000000000000000000000..de95cf5ca20abdc8f200806287fb0ba0 +import java.util.List; +import java.util.function.Consumer; +import me.jellysquid.mods.lithium.common.util.Producer; -+import net.minecraft.server.ChunkCoordIntPair; ++import net.minecraft.world.level.ChunkCoordIntPair; + +public class YatopiaChunkPos { + @@ -418,7 +418,7 @@ index 0000000000000000000000000000000000000000..de95cf5ca20abdc8f200806287fb0ba0 +} diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkSectionPos.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkSectionPos.java new file mode 100644 -index 0000000000000000000000000000000000000000..d298cf985def6d7adcc6156b1476f86c085ad5e7 +index 0000000000000000000000000000000000000000..7dc7ef3b652ad7a4cbb1c08f25d938a79a8b0030 --- /dev/null +++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaChunkSectionPos.java @@ -0,0 +1,32 @@ @@ -428,8 +428,8 @@ index 0000000000000000000000000000000000000000..d298cf985def6d7adcc6156b1476f86c +import java.util.List; +import java.util.function.Consumer; +import me.jellysquid.mods.lithium.common.util.Producer; -+import net.minecraft.server.CursorPosition; -+import net.minecraft.server.SectionPosition; ++import net.minecraft.core.CursorPosition; ++import net.minecraft.core.SectionPosition; + +public class YatopiaChunkSectionPos { + diff --git a/patches/server/0028-Nuke-streams-off-BlockPosition.patch b/patches/server/0028-Nuke-streams-off-BlockPosition.patch index e24c8032..9a7d6cac 100644 --- a/patches/server/0028-Nuke-streams-off-BlockPosition.patch +++ b/patches/server/0028-Nuke-streams-off-BlockPosition.patch @@ -4,23 +4,11 @@ Date: Tue, 1 Sep 2020 19:11:50 +0300 Subject: [PATCH] Nuke streams off BlockPosition -diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 8724ad342bec7c733b3c825bd62dbfa5c28c06dd..9907047028b754fe0e314a7d5c5238ce4286c373 100644 ---- a/src/main/java/net/minecraft/server/BlockBase.java -+++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -681,6 +681,7 @@ public abstract class BlockBase { - return this.getBlock().getInventory(this.p(), world, blockposition); - } - -+ public final boolean hasTag(Tag tag) { return a(tag); } // Yatopia - OBFHELPER - public boolean a(Tag tag) { - return this.getBlock().a(tag); - } -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7fddef0afbcf1f9f391c540b8fce1bebf8faa452..f13b4e6ec815792c2f2b49193707da94df427424 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -318,7 +318,15 @@ public class BlockPosition extends BaseBlockPosition { +diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java +index bb520b56d797cabec86fce42dd4afff018e66fdd..9c508cc41575175d442cd51d75706830351a24f2 100644 +--- a/src/main/java/net/minecraft/core/BlockPosition.java ++++ b/src/main/java/net/minecraft/core/BlockPosition.java +@@ -325,7 +325,15 @@ public class BlockPosition extends BaseBlockPosition { } public static Optional a(BlockPosition blockposition, int i, int j, Predicate predicate) { @@ -37,3 +25,15 @@ index 7fddef0afbcf1f9f391c540b8fce1bebf8faa452..f13b4e6ec815792c2f2b49193707da94 } public static Stream b(BlockPosition blockposition, int i, int j, int k) { +diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +index 052ca0f8292a30dda3cc02ed54ae550174de86a7..324359fb5c479072bde27bcbaa4b15749204171a 100644 +--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java ++++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java +@@ -734,6 +734,7 @@ public abstract class BlockBase { + return this.getBlock().getInventory(this.p(), world, blockposition); + } + ++ public final boolean hasTag(Tag tag) { return a(tag); } // Yatopia - OBFHELPER + public boolean a(Tag tag) { + return this.getBlock().a(tag); + } diff --git a/patches/server/0029-Nuke-streams-off-SectionPosition.patch b/patches/server/0029-Nuke-streams-off-SectionPosition.patch index 42ffca94..ecf37888 100644 --- a/patches/server/0029-Nuke-streams-off-SectionPosition.patch +++ b/patches/server/0029-Nuke-streams-off-SectionPosition.patch @@ -4,11 +4,11 @@ Date: Tue, 1 Sep 2020 19:21:52 +0300 Subject: [PATCH] Nuke streams off SectionPosition -diff --git a/src/main/java/net/minecraft/server/BehaviorUtil.java b/src/main/java/net/minecraft/server/BehaviorUtil.java -index d0e7c6b4c0b1e5993f0019e7a448423e048a8af5..b788685331bc28e0d339e6600b5805a2bed4cf27 100644 ---- a/src/main/java/net/minecraft/server/BehaviorUtil.java -+++ b/src/main/java/net/minecraft/server/BehaviorUtil.java -@@ -84,12 +84,25 @@ public class BehaviorUtil { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java +index 30d14b559f49d8fcaaf519500a6eeeba3d2ce649..e1cfed99747f7220bc2eb306e0eab0106cfe1b0d 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorUtil.java +@@ -100,12 +100,25 @@ public class BehaviorUtil { public static SectionPosition a(WorldServer worldserver, SectionPosition sectionposition, int i) { int j = worldserver.b(sectionposition); @@ -34,11 +34,11 @@ index d0e7c6b4c0b1e5993f0019e7a448423e048a8af5..b788685331bc28e0d339e6600b5805a2 } public static boolean a(EntityInsentient entityinsentient, EntityLiving entityliving, int i) { -diff --git a/src/main/java/net/minecraft/server/Raid.java b/src/main/java/net/minecraft/server/Raid.java -index 78f818bc7542868ec9e7caeb10a75180fb0b5e07..11f768e04d71b96350fdb586a280c52e062dfcf2 100644 ---- a/src/main/java/net/minecraft/server/Raid.java -+++ b/src/main/java/net/minecraft/server/Raid.java -@@ -355,6 +355,18 @@ public class Raid { +diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java +index 457cbdab3fa96fdf7fad1b0206bec9c0aa7847d8..f9d03b6d11ad5ffbfe5be072e8631f046bcd1646 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java ++++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java +@@ -397,6 +397,18 @@ public class Raid { } private void z() { @@ -57,7 +57,7 @@ index 78f818bc7542868ec9e7caeb10a75180fb0b5e07..11f768e04d71b96350fdb586a280c52e Stream stream = SectionPosition.a(SectionPosition.a(this.center), 2); WorldServer worldserver = this.world; -@@ -362,6 +374,7 @@ public class Raid { +@@ -404,6 +416,7 @@ public class Raid { stream.filter(worldserver::a).map(SectionPosition::q).min(Comparator.comparingDouble((blockposition) -> { return blockposition.j(this.center); })).ifPresent(this::c); diff --git a/patches/server/0030-Stop-wasting-resources-on-JsonList-get.patch b/patches/server/0030-Stop-wasting-resources-on-JsonList-get.patch index 7f0c5a70..02576edf 100644 --- a/patches/server/0030-Stop-wasting-resources-on-JsonList-get.patch +++ b/patches/server/0030-Stop-wasting-resources-on-JsonList-get.patch @@ -13,11 +13,11 @@ Our changes are the following: 2. Only if a player joins and his ban has expired, remove his ban which triggers a save which then triggers removing of all stale entries. -diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index 8da5f976109accc84b26ec4045776aa8a9799f3d..b97931b9234bb0fb95fef4e03f003c63f8da5b88 100644 ---- a/src/main/java/net/minecraft/server/JsonList.java -+++ b/src/main/java/net/minecraft/server/JsonList.java -@@ -69,9 +69,13 @@ public abstract class JsonList> { +diff --git a/src/main/java/net/minecraft/server/players/JsonList.java b/src/main/java/net/minecraft/server/players/JsonList.java +index c960852dc60d0598012c5eef0d139fe38bde63fb..96fbb1a3d216302aa937e07bf88fdb19c6ccc764 100644 +--- a/src/main/java/net/minecraft/server/players/JsonList.java ++++ b/src/main/java/net/minecraft/server/players/JsonList.java +@@ -71,9 +71,13 @@ public abstract class JsonList> { // Paper start // this.g(); // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error @@ -31,7 +31,7 @@ index 8da5f976109accc84b26ec4045776aa8a9799f3d..b97931b9234bb0fb95fef4e03f003c63 // Paper end } -@@ -149,12 +153,22 @@ public abstract class JsonList> { +@@ -151,12 +155,22 @@ public abstract class JsonList> { this.removeStaleEntries(); // Paper - remove expired values before saving JsonArray jsonarray = new JsonArray(); @@ -54,11 +54,11 @@ index 8da5f976109accc84b26ec4045776aa8a9799f3d..b97931b9234bb0fb95fef4e03f003c63 BufferedWriter bufferedwriter = Files.newWriter(this.c, StandardCharsets.UTF_8); Throwable throwable = null; -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7cad3e754a8c0398ad6394edd0cb767566b09c88..5feadb8bebaace44efa854ac8bfb9def9d7393a5 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -647,6 +647,7 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 5bc9a7683c039c1e67d1614a3e588ca027be8b6e..9d8bf308e01df5e13418959f83f78b3c3f0dec98 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -731,6 +731,7 @@ public abstract class PlayerList { GameProfileBanEntry gameprofilebanentry; if (getProfileBans().isBanned(gameprofile) && (gameprofilebanentry = getProfileBans().get(gameprofile)) != null) { // Paper end @@ -66,7 +66,7 @@ index 7cad3e754a8c0398ad6394edd0cb767566b09c88..5feadb8bebaace44efa854ac8bfb9def chatmessage = new ChatMessage("multiplayer.disconnect.banned.reason", new Object[]{gameprofilebanentry.getReason()}); if (gameprofilebanentry.getExpires() != null) { -@@ -654,7 +655,11 @@ public abstract class PlayerList { +@@ -738,7 +739,11 @@ public abstract class PlayerList { } // return chatmessage; diff --git a/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch b/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch index 232038ee..c2fdbbdf 100644 --- a/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch +++ b/patches/server/0031-Fix-LightEngineThreaded-memory-leak.patch @@ -4,11 +4,11 @@ Date: Thu, 10 Sep 2020 21:02:26 +0300 Subject: [PATCH] Fix LightEngineThreaded memory leak -diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java -index b2f51a6786d4bb92c9cbbceeea812375b1a49bd6..d16157dcbc6f36fa0c8284784641e54413d249be 100644 ---- a/src/main/java/net/minecraft/server/LightEngineThreaded.java -+++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java -@@ -110,6 +110,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +diff --git a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +index 381bd11075599d44e4c705a8e754769d29883d75..e36d11ffb3e66e6ce6f64d2e771661f8b29c95a8 100644 +--- a/src/main/java/net/minecraft/server/level/LightEngineThreaded.java ++++ b/src/main/java/net/minecraft/server/level/LightEngineThreaded.java +@@ -123,6 +123,8 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } } @@ -17,11 +17,11 @@ index b2f51a6786d4bb92c9cbbceeea812375b1a49bd6..d16157dcbc6f36fa0c8284784641e544 public final boolean isEmpty() { return this.size == 0 && this.pendingTasks.isEmpty(); } -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index e695cf764cab6d64ea5bb00af03b25f4930946dd..c528641620e296daf67e381287167d7632d8fe29 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1906,6 +1906,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java +index fdc5bfeb36d306046d259d22dcd8653c2936d6ea..2339408eef835090a0e4f873395c84704592a8f5 100644 +--- a/src/main/java/net/minecraft/server/level/WorldServer.java ++++ b/src/main/java/net/minecraft/server/level/WorldServer.java +@@ -2054,6 +2054,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end diff --git a/patches/server/0032-Shutdown-Bootstrap-thread-pool.patch b/patches/server/0032-Shutdown-Bootstrap-thread-pool.patch index 1c73af14..60250a34 100644 --- a/patches/server/0032-Shutdown-Bootstrap-thread-pool.patch +++ b/patches/server/0032-Shutdown-Bootstrap-thread-pool.patch @@ -4,11 +4,24 @@ Date: Sat, 12 Sep 2020 11:12:23 +0800 Subject: [PATCH] Shutdown Bootstrap thread pool -diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java -index 48e31e9142ffeb2725af6b1f483de67410e25694..b149e32aac86ce2f7521958fa7394e4f5b852174 100644 ---- a/src/main/java/net/minecraft/server/DataConverterRegistry.java -+++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java -@@ -15,14 +15,16 @@ public class DataConverterRegistry { +diff --git a/src/main/java/net/minecraft/SystemUtils.java b/src/main/java/net/minecraft/SystemUtils.java +index 61b4c42e95994343772a91640b243b8e8224e09b..ce440ae5cc843fc6101dd11fd45d9089795411e4 100644 +--- a/src/main/java/net/minecraft/SystemUtils.java ++++ b/src/main/java/net/minecraft/SystemUtils.java +@@ -55,7 +55,7 @@ import org.apache.logging.log4j.Logger; + public class SystemUtils { + + private static final AtomicInteger c = new AtomicInteger(1); +- private static final ExecutorService d = a("Bootstrap", -2); // Paper - add -2 priority ++ public static final ExecutorService d = a("Bootstrap", -2); // Paper - add -2 priority // Yatopia - private -> public + private static final ExecutorService e = a("Main", -1); // Paper - add -1 priority + private static final ExecutorService f = n(); + public static LongSupplier a = System::nanoTime; +diff --git a/src/main/java/net/minecraft/util/datafix/DataConverterRegistry.java b/src/main/java/net/minecraft/util/datafix/DataConverterRegistry.java +index 28e36ee76da533f8aa0a09cfc4f1fc0f744af715..625dcfaeffb83a0b8b53778c32287cac8daae540 100644 +--- a/src/main/java/net/minecraft/util/datafix/DataConverterRegistry.java ++++ b/src/main/java/net/minecraft/util/datafix/DataConverterRegistry.java +@@ -199,14 +199,16 @@ public class DataConverterRegistry { private static final BiFunction a = Schema::new; private static final BiFunction b = DataConverterSchemaNamed::new; @@ -29,16 +42,3 @@ index 48e31e9142ffeb2725af6b1f483de67410e25694..b149e32aac86ce2f7521958fa7394e4f public static DataFixer getDataFixer() { return a(); } // Paper - OBFHELPER public static DataFixer a() { -diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 916a6a1fc1ccc73e4fb974ad77310d16fd8bd7e6..61d399077f87fc1f198811ee31fc779b6f0ecfa9 100644 ---- a/src/main/java/net/minecraft/server/SystemUtils.java -+++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -48,7 +48,7 @@ import org.apache.logging.log4j.Logger; - public class SystemUtils { - - private static final AtomicInteger c = new AtomicInteger(1); -- private static final ExecutorService d = a("Bootstrap", -2); // Paper - add -2 priority -+ public static final ExecutorService d = a("Bootstrap", -2); // Paper - add -2 priority // Yatopia - private -> public - private static final ExecutorService e = a("Main", -1); // Paper - add -1 priority - private static final ExecutorService f = n(); - public static LongSupplier a = System::nanoTime; diff --git a/patches/server/0033-Optimize-Villagers.patch b/patches/server/0033-Optimize-Villagers.patch index 17fd3790..319d32cb 100644 --- a/patches/server/0033-Optimize-Villagers.patch +++ b/patches/server/0033-Optimize-Villagers.patch @@ -13,11 +13,11 @@ The following has been done to fix the mentioned problems: - Made sure that chunks are loaded for the POIs (Points Of Interest) that are gonna be tried. - Added a profession cache, which followed by a stream removal. -diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -index a48f2f82517bc391d5d5b7961e3c7a75175abb65..490a1d4d53a6180ac4c40f1f51d4704825c01ed7 100644 ---- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java -+++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java -@@ -48,7 +48,7 @@ public class BehaviorFindPosition extends Behavior { +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +index 09133c5822bc1386bc3d8a5f3c94196420bbfaea..5397a74e244e9cd6886068e0dfe283ec12ccd922 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorFindPosition.java +@@ -58,7 +58,7 @@ public class BehaviorFindPosition extends Behavior { if (this.d && entitycreature.isBaby()) { return false; } else if (this.f == 0L) { @@ -26,7 +26,7 @@ index a48f2f82517bc391d5d5b7961e3c7a75175abb65..490a1d4d53a6180ac4c40f1f51d47048 return false; } else { return worldserver.getTime() >= this.f; -@@ -56,7 +56,7 @@ public class BehaviorFindPosition extends Behavior { +@@ -66,7 +66,7 @@ public class BehaviorFindPosition extends Behavior { } protected void a(WorldServer worldserver, EntityCreature entitycreature, long i) { @@ -35,7 +35,7 @@ index a48f2f82517bc391d5d5b7961e3c7a75175abb65..490a1d4d53a6180ac4c40f1f51d47048 if (entitycreature.getNavigation().isStuck()) this.f += 200L; // Airplane - wait an additional 10s to check again if they're stuck VillagePlace villageplace = worldserver.y(); -@@ -67,12 +67,20 @@ public class BehaviorFindPosition extends Behavior { +@@ -77,12 +77,20 @@ public class BehaviorFindPosition extends Behavior { BehaviorFindPosition.a behaviorfindposition_a = (BehaviorFindPosition.a) this.g.get(blockposition.asLong()); if (behaviorfindposition_a == null) { @@ -59,7 +59,7 @@ index a48f2f82517bc391d5d5b7961e3c7a75175abb65..490a1d4d53a6180ac4c40f1f51d47048 } }; // Tuinity start - optimise POI access -@@ -103,7 +111,7 @@ public class BehaviorFindPosition extends Behavior { +@@ -113,7 +121,7 @@ public class BehaviorFindPosition extends Behavior { BlockPosition blockposition1 = (BlockPosition) iterator.next(); this.g.computeIfAbsent(blockposition1.asLong(), (j) -> { @@ -68,15 +68,15 @@ index a48f2f82517bc391d5d5b7961e3c7a75175abb65..490a1d4d53a6180ac4c40f1f51d47048 }); } } -diff --git a/src/main/java/net/minecraft/server/VillagePlaceType.java b/src/main/java/net/minecraft/server/VillagePlaceType.java -index b6b4c8c491d692f93d2c38d602ff99b0611b72aa..082b060407f2424c10f865e23feb60b970b851cb 100644 ---- a/src/main/java/net/minecraft/server/VillagePlaceType.java -+++ b/src/main/java/net/minecraft/server/VillagePlaceType.java -@@ -14,11 +14,20 @@ import java.util.stream.Collectors; +diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java +index 6a45ab049a4beeeaf7b3b5acf2946767f6e1198f..4af526ecbed506161cb021ea320b0f21112d7bf0 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java ++++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/VillagePlaceType.java +@@ -23,11 +23,20 @@ import net.minecraft.world.level.block.state.properties.BlockPropertyBedPart; public class VillagePlaceType { -+ static Set professionCache; // Yatopia ++ public static Set professionCache; // Yatopia private static final Supplier> y = Suppliers.memoize(() -> { return (Set) IRegistry.VILLAGER_PROFESSION.g().map(VillagerProfession::b).collect(Collectors.toSet()); }); @@ -94,11 +94,11 @@ index b6b4c8c491d692f93d2c38d602ff99b0611b72aa..082b060407f2424c10f865e23feb60b9 }; public static final Predicate b = (villageplacetype) -> { return true; -diff --git a/src/main/java/net/minecraft/server/VillagerProfession.java b/src/main/java/net/minecraft/server/VillagerProfession.java -index 6493f220a0cf627e82e5f3f3c85e9934d9a9ebae..f4c8ba2d94e5875197b674a0e39e997b45186d63 100644 ---- a/src/main/java/net/minecraft/server/VillagerProfession.java -+++ b/src/main/java/net/minecraft/server/VillagerProfession.java -@@ -35,6 +35,7 @@ public class VillagerProfession { +diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java +index dd9b678481620856fb7eaaa04c3b812c861e892a..d8fc1795b07945b41bd7368529db92fe5cdc4c19 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java ++++ b/src/main/java/net/minecraft/world/entity/npc/VillagerProfession.java +@@ -44,6 +44,7 @@ public class VillagerProfession { this.t = soundeffect; } @@ -106,7 +106,7 @@ index 6493f220a0cf627e82e5f3f3c85e9934d9a9ebae..f4c8ba2d94e5875197b674a0e39e997b public VillagePlaceType b() { return this.q; } -@@ -61,6 +62,7 @@ public class VillagerProfession { +@@ -70,6 +71,7 @@ public class VillagerProfession { } static VillagerProfession a(String s, VillagePlaceType villageplacetype, ImmutableSet immutableset, ImmutableSet immutableset1, @Nullable SoundEffect soundeffect) { diff --git a/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch b/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch index bcf7815e..86858698 100644 --- a/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch +++ b/patches/server/0034-Optimize-whitelist-command-for-multiple-additions-re.patch @@ -9,11 +9,23 @@ added. These changes aim to reduce that load whenever you are using the /whitelist command. -diff --git a/src/main/java/net/minecraft/server/CommandWhitelist.java b/src/main/java/net/minecraft/server/CommandWhitelist.java -index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab891a90d9 100644 ---- a/src/main/java/net/minecraft/server/CommandWhitelist.java -+++ b/src/main/java/net/minecraft/server/CommandWhitelist.java -@@ -12,8 +12,8 @@ public class CommandWhitelist { +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index e283960750cff2f45695117ef873cf1f941c27bf..16d8d7760ca0348ee0cf1edec1650cac536e21d0 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -2108,6 +2108,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant com_mojang_brigadier_commanddispatcher) { - com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("whitelist").requires((commandlistenerwrapper) -> { -@@ -27,11 +27,25 @@ public class CommandWhitelist { - }))).then(CommandDispatcher.a("add").then(CommandDispatcher.a("targets", (ArgumentType) ArgumentProfile.a()).suggests((commandcontext, suggestionsbuilder) -> { + public static void a(CommandDispatcher commanddispatcher) { + commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) ((LiteralArgumentBuilder) net.minecraft.commands.CommandDispatcher.a("whitelist").requires((commandlistenerwrapper) -> { +@@ -36,11 +36,25 @@ public class CommandWhitelist { + }))).then(net.minecraft.commands.CommandDispatcher.a("add").then(net.minecraft.commands.CommandDispatcher.a("targets", (ArgumentType) ArgumentProfile.a()).suggests((commandcontext, suggestionsbuilder) -> { PlayerList playerlist = ((CommandListenerWrapper) commandcontext.getSource()).getServer().getPlayerList(); + // Yatopia start - optimize this @@ -36,7 +48,7 @@ index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab return entityplayer.getProfile().getName(); }), suggestionsbuilder); + */ -+ for (EntityPlayer player : playerlist.getPlayers()) { ++ for (net.minecraft.server.level.EntityPlayer player : playerlist.getPlayers()) { + if (!playerlist.getWhitelist().isWhitelisted(player.getProfile())) { + String remaining = suggestionsbuilder.getRemainingLowercase(); + String playerName = player.getName(); @@ -49,8 +61,8 @@ index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab + // Yatopia end }).executes((commandcontext) -> { return a((CommandListenerWrapper) commandcontext.getSource(), ArgumentProfile.a(commandcontext, "targets")); - })))).then(CommandDispatcher.a("remove").then(CommandDispatcher.a("targets", (ArgumentType) ArgumentProfile.a()).suggests((commandcontext, suggestionsbuilder) -> { -@@ -52,6 +66,8 @@ public class CommandWhitelist { + })))).then(net.minecraft.commands.CommandDispatcher.a("remove").then(net.minecraft.commands.CommandDispatcher.a("targets", (ArgumentType) ArgumentProfile.a()).suggests((commandcontext, suggestionsbuilder) -> { +@@ -61,6 +75,8 @@ public class CommandWhitelist { private static int a(CommandListenerWrapper commandlistenerwrapper, Collection collection) throws CommandSyntaxException { WhiteList whitelist = commandlistenerwrapper.getServer().getPlayerList().getWhitelist(); @@ -59,7 +71,7 @@ index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab int i = 0; Iterator iterator = collection.iterator(); -@@ -72,10 +88,27 @@ public class CommandWhitelist { +@@ -81,10 +97,27 @@ public class CommandWhitelist { } else { return i; } @@ -87,12 +99,12 @@ index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab int i = 0; Iterator iterator = collection.iterator(); -@@ -97,6 +130,22 @@ public class CommandWhitelist { +@@ -106,6 +139,22 @@ public class CommandWhitelist { commandlistenerwrapper.getServer().a(commandlistenerwrapper); return i; } + */ -+ java.util.List> toRemove = new java.util.ArrayList<>(); ++ java.util.List> toRemove = new java.util.ArrayList<>(); + for (GameProfile profile : collection) { + if (whitelist.isWhitelisted(profile)) { + toRemove.add(new WhiteListEntry(profile)); @@ -110,39 +122,11 @@ index 893d2c1c74ed28dcdb83b71762ccdcbfd50a8f9d..107091a4cae0e4eaba93f69ae91239ab } private static int b(CommandListenerWrapper commandlistenerwrapper) throws CommandSyntaxException { -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 708f9c5d0b6e30512b3d3ea45ec2b2baf9482669..b7125495b1fd4207a96078ca2aff565fccd78569 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -79,6 +79,7 @@ public abstract class EntityHuman extends EntityLiving { - // CraftBukkit start - public boolean fauxSleeping; - public int oldLevel = -1; -+ private String nameLowercase = null; // Yatopia - - @Override - public CraftHumanEntity getBukkitEntity() { -@@ -1929,6 +1930,15 @@ public abstract class EntityHuman extends EntityLiving { - return this.getProfile().getName(); - } - -+ // Yatopia start -+ public String getNameLowercase() { -+ if (nameLowercase == null) { -+ nameLowercase = getProfile().getName().toLowerCase(java.util.Locale.ROOT); -+ } -+ return nameLowercase; -+ } -+ // Yatopia end -+ - @Override - public float b(EntityPose entitypose, EntitySize entitysize) { - switch (entitypose) { -diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index b97931b9234bb0fb95fef4e03f003c63f8da5b88..3a44d9876fc973f18432dd3294d585dbc65f755f 100644 ---- a/src/main/java/net/minecraft/server/JsonList.java -+++ b/src/main/java/net/minecraft/server/JsonList.java -@@ -64,6 +64,20 @@ public abstract class JsonList> { +diff --git a/src/main/java/net/minecraft/server/players/JsonList.java b/src/main/java/net/minecraft/server/players/JsonList.java +index 96fbb1a3d216302aa937e07bf88fdb19c6ccc764..0521fa09488ef501cc5bcdf6c3134ac920a2e94a 100644 +--- a/src/main/java/net/minecraft/server/players/JsonList.java ++++ b/src/main/java/net/minecraft/server/players/JsonList.java +@@ -66,6 +66,20 @@ public abstract class JsonList> { } @@ -163,7 +147,7 @@ index b97931b9234bb0fb95fef4e03f003c63f8da5b88..3a44d9876fc973f18432dd3294d585db @Nullable public V get(K k0) { // Paper start -@@ -94,6 +108,20 @@ public abstract class JsonList> { +@@ -96,6 +110,20 @@ public abstract class JsonList> { this.remove(jsonlistentry.getKey()); } @@ -184,15 +168,31 @@ index b97931b9234bb0fb95fef4e03f003c63f8da5b88..3a44d9876fc973f18432dd3294d585db public String[] getEntries() { return (String[]) this.d.keySet().toArray(new String[this.d.size()]); } -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0773f4baffe9dda40441e312e7cc58186f59a9ff..2f83ba794f25f92722a737e3b1f2342b4b9fc94f 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1996,6 +1996,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant new Thread(r, "User Authenticator #" + threadId.incrementAndGet()) -+ r -> { // Yatopia start - make sure produced threads are daemon ones -+ Thread thread = new Thread(r, "User Authenticator #" + threadId.incrementAndGet()); -+ thread.setDaemon(true); -+ return thread; -+ } // Yatopia end - ); - // Paper end - // Spigot start diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 7438ed7671acb181fe88abd2db415cb09873db4f..e77e8b228195cfb6375804d2bbcb8438e6fbcf5c 100644 +index b7399d17dd64ca8b1f1fab405cb0ac914dc53b98..add92c6ba9556b0a2695b007e0d83d7334412c2d 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -42,12 +42,12 @@ public final class MCUtil { +@@ -59,12 +59,12 @@ public final class MCUtil { public static final ThreadPoolExecutor asyncExecutor = new ThreadPoolExecutor( 0, 2, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue(), @@ -42,3 +25,20 @@ index 7438ed7671acb181fe88abd2db415cb09873db4f..e77e8b228195cfb6375804d2bbcb8438 ); public static final long INVALID_CHUNK_KEY = getCoordinateKey(Integer.MAX_VALUE, Integer.MAX_VALUE); +diff --git a/src/main/java/net/minecraft/server/network/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java +index dc98ef48a664d9ee2a302fff8c611fd16dc704b6..c65ff6a11a5570e9c39dcd2512374d5e8a2625b5 100644 +--- a/src/main/java/net/minecraft/server/network/LoginListener.java ++++ b/src/main/java/net/minecraft/server/network/LoginListener.java +@@ -129,7 +129,11 @@ public class LoginListener implements PacketLoginInListener { + // Paper start - Cache authenticator threads + private static final AtomicInteger threadId = new AtomicInteger(0); + private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool( +- r -> new Thread(r, "User Authenticator #" + threadId.incrementAndGet()) ++ r -> { // Yatopia start - make sure produced threads are daemon ones ++ Thread thread = new Thread(r, "User Authenticator #" + threadId.incrementAndGet()); ++ thread.setDaemon(true); ++ return thread; ++ } // Yatopia end + ); + // Paper end + // Spigot start diff --git a/patches/server/0038-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch b/patches/server/0038-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch index ce407145..b5fa2cd1 100644 --- a/patches/server/0038-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch +++ b/patches/server/0038-Fix-IndexOutOfBoundsException-when-sending-too-many-.patch @@ -4,11 +4,11 @@ Date: Tue, 29 Sep 2020 19:25:49 +0300 Subject: [PATCH] Fix IndexOutOfBoundsException when sending too many changes -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java b/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java -index f260459d70053ffd17952aebf3e0410666f9bcd0..a28b6a44e744f16598419d20f4fe5d55016213e4 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutMultiBlockChange.java -@@ -20,12 +20,16 @@ public class PacketPlayOutMultiBlockChange implements Packet Co-authored-by: ishland -diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java -index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2e40f604a 100644 ---- a/src/main/java/net/minecraft/server/CraftingManager.java -+++ b/src/main/java/net/minecraft/server/CraftingManager.java -@@ -24,6 +24,7 @@ import org.apache.logging.log4j.LogManager; +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 26fff0540e3d8863e83b0a60df2205422d50f1e1..dbfa9584c11296bf78afef52c2d0c5e682961761 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -640,6 +640,7 @@ public final class ItemStack { + return !this.e() ? this.doMaterialsMatch(itemstack) : !itemstack.isEmpty() && this.getItem() == itemstack.getItem(); + } + ++ public final String getTranslationKey() { return j(); } // Yatopia - OBFHELPER + public String j() { + return this.getItem().f(this); + } +diff --git a/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java b/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java +index 5ba58bf1a47c696235e6e7a4a6815104bc23de80..f1180c57a76883c007393bc187de680618f60de3 100644 +--- a/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java ++++ b/src/main/java/net/minecraft/world/item/crafting/CraftingManager.java +@@ -35,6 +35,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; // CraftBukkit @@ -22,7 +34,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 public class CraftingManager extends ResourceDataJson { -@@ -31,6 +32,10 @@ public class CraftingManager extends ResourceDataJson { +@@ -42,6 +43,10 @@ public class CraftingManager extends ResourceDataJson { private static final Logger LOGGER = LogManager.getLogger(); public Map, Object2ObjectLinkedOpenHashMap>> recipes = ImmutableMap.of(); // CraftBukkit private boolean d; @@ -33,7 +45,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 public CraftingManager() { super(CraftingManager.a, "recipes"); -@@ -38,6 +43,7 @@ public class CraftingManager extends ResourceDataJson { +@@ -49,6 +54,7 @@ public class CraftingManager extends ResourceDataJson { protected void a(Map map, IResourceManager iresourcemanager, GameProfilerFiller gameprofilerfiller) { this.d = false; @@ -41,7 +53,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 // CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable Map, Object2ObjectLinkedOpenHashMap>> map1 = Maps.newHashMap(); for (Recipes recipeType : IRegistry.RECIPE_TYPE) { -@@ -63,9 +69,17 @@ public class CraftingManager extends ResourceDataJson { +@@ -74,9 +80,17 @@ public class CraftingManager extends ResourceDataJson { } } @@ -59,7 +71,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 CraftingManager.LOGGER.info("Loaded {} recipes", map1.size()); } -@@ -79,33 +93,65 @@ public class CraftingManager extends ResourceDataJson { +@@ -90,33 +104,65 @@ public class CraftingManager extends ResourceDataJson { } else { map.putAndMoveToFirst(irecipe.getKey(), irecipe); // CraftBukkit - SPIGOT-4638: last recipe gets priority } @@ -125,7 +137,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 private > Map> b(Recipes recipes) { return (Map) this.recipes.getOrDefault(recipes, new Object2ObjectLinkedOpenHashMap<>()); // CraftBukkit } -@@ -127,15 +173,26 @@ public class CraftingManager extends ResourceDataJson { +@@ -138,15 +184,26 @@ public class CraftingManager extends ResourceDataJson { } public Optional> getRecipe(MinecraftKey minecraftkey) { @@ -155,7 +167,7 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 } public Stream d() { -@@ -155,6 +212,10 @@ public class CraftingManager extends ResourceDataJson { +@@ -166,6 +223,10 @@ public class CraftingManager extends ResourceDataJson { // CraftBukkit start public void clearRecipes() { this.recipes = Maps.newHashMap(); @@ -166,15 +178,3 @@ index 58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a..6f3754d88e6d98fce5859fd2d58a9fc2 for (Recipes recipeType : IRegistry.RECIPE_TYPE) { this.recipes.put(recipeType, new Object2ObjectLinkedOpenHashMap<>()); -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 47e3ac6bcebacd9c424ddcc49774e06e05f02fe2..cf3e4382aecd4c44c45877386eaf8fcc49657029 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -585,6 +585,7 @@ public final class ItemStack { - return !this.e() ? this.doMaterialsMatch(itemstack) : !itemstack.isEmpty() && this.getItem() == itemstack.getItem(); - } - -+ public final String getTranslationKey() { return j(); } // Yatopia - OBFHELPER - public String j() { - return this.getItem().f(this); - } diff --git a/patches/server/0042-Optimize-advancement-loading.patch b/patches/server/0042-Optimize-advancement-loading.patch index 37a28865..b6ad3f2a 100644 --- a/patches/server/0042-Optimize-advancement-loading.patch +++ b/patches/server/0042-Optimize-advancement-loading.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Optimize advancement loading Removed some object allocations and reduced loops -diff --git a/src/main/java/net/minecraft/server/Advancement.java b/src/main/java/net/minecraft/server/Advancement.java -index 384d4090f8ff1ea718de16affa5c146a2f58d28a..486034a826b67c71dc7d07852013dc07fefadb0f 100644 ---- a/src/main/java/net/minecraft/server/Advancement.java -+++ b/src/main/java/net/minecraft/server/Advancement.java -@@ -68,6 +68,7 @@ public class Advancement { +diff --git a/src/main/java/net/minecraft/advancements/Advancement.java b/src/main/java/net/minecraft/advancements/Advancement.java +index 8bfd20ff9a3c96fa9ff5cc618ca7e858e62943a0..12b542dd8b84a5f2c24d47f5ae9fff34a1f980c2 100644 +--- a/src/main/java/net/minecraft/advancements/Advancement.java ++++ b/src/main/java/net/minecraft/advancements/Advancement.java +@@ -81,6 +81,7 @@ public class Advancement { return this.display; } @@ -18,10 +18,10 @@ index 384d4090f8ff1ea718de16affa5c146a2f58d28a..486034a826b67c71dc7d07852013dc07 return this.rewards; } diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index eaa1063ff2bc5621e93043c4de41ca62f1323fde..96069438ad3f4b00e2996247c222153228cbc2e1 100644 +index 59d781b5e61c5d2c004bc92300d8d42e81821308..606e22bc402af1f10e3208b91014af24994c368e 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -@@ -160,11 +160,16 @@ public class AdvancementDataPlayer { +@@ -179,11 +179,16 @@ public class AdvancementDataPlayer { throw new JsonParseException("Found null for advancements"); } @@ -38,7 +38,7 @@ index eaa1063ff2bc5621e93043c4de41ca62f1323fde..96069438ad3f4b00e2996247c2221532 Advancement advancement = advancementdataworld.a((MinecraftKey) entry.getKey()); if (advancement == null) { -@@ -202,11 +207,37 @@ public class AdvancementDataPlayer { +@@ -221,11 +226,37 @@ public class AdvancementDataPlayer { } } @@ -76,7 +76,7 @@ index eaa1063ff2bc5621e93043c4de41ca62f1323fde..96069438ad3f4b00e2996247c2221532 public void b() { if (org.spigotmc.SpigotConfig.disableAdvancementSaving) return; // Spigot Map map = Maps.newHashMap(); -@@ -331,6 +362,11 @@ public class AdvancementDataPlayer { +@@ -350,6 +381,11 @@ public class AdvancementDataPlayer { AdvancementProgress advancementprogress = this.getProgress(advancement); if (!advancementprogress.isDone()) { @@ -88,7 +88,7 @@ index eaa1063ff2bc5621e93043c4de41ca62f1323fde..96069438ad3f4b00e2996247c2221532 Iterator iterator = advancement.getCriteria().entrySet().iterator(); while (iterator.hasNext()) { -@@ -350,7 +386,7 @@ public class AdvancementDataPlayer { +@@ -369,7 +405,7 @@ public class AdvancementDataPlayer { } } @@ -97,7 +97,7 @@ index eaa1063ff2bc5621e93043c4de41ca62f1323fde..96069438ad3f4b00e2996247c2221532 } private void d(Advancement advancement) { -@@ -445,6 +481,7 @@ public class AdvancementDataPlayer { +@@ -464,6 +500,7 @@ public class AdvancementDataPlayer { this.data.put(advancement, advancementprogress); } diff --git a/patches/server/0043-lithium-PerlinNoiseSamplerMixin.patch b/patches/server/0043-lithium-PerlinNoiseSamplerMixin.patch index 3618261f..e2e49766 100644 --- a/patches/server/0043-lithium-PerlinNoiseSamplerMixin.patch +++ b/patches/server/0043-lithium-PerlinNoiseSamplerMixin.patch @@ -9,19 +9,18 @@ you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ Co-authored-by: Bud Gidiere -diff --git a/src/main/java/net/minecraft/server/NoiseGeneratorPerlin.java b/src/main/java/net/minecraft/server/NoiseGeneratorPerlin.java -index d7ca619b228e2a5a461085e0c5222e6a36a66fe0..ea157542df2617eec6b5a62331e1daa3c086ffae 100644 ---- a/src/main/java/net/minecraft/server/NoiseGeneratorPerlin.java -+++ b/src/main/java/net/minecraft/server/NoiseGeneratorPerlin.java -@@ -1,6 +1,7 @@ - package net.minecraft.server; +diff --git a/src/main/java/net/minecraft/world/level/levelgen/synth/NoiseGeneratorPerlin.java b/src/main/java/net/minecraft/world/level/levelgen/synth/NoiseGeneratorPerlin.java +index 6f5745c8bc17ce3e45ad07fc6ba02ff7aac5a9f1..e27269813f7c617b59abc01a0b890c6b4aaadd62 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/synth/NoiseGeneratorPerlin.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/synth/NoiseGeneratorPerlin.java +@@ -1,5 +1,6 @@ + package net.minecraft.world.level.levelgen.synth; - import java.util.Random; +import org.apache.commons.math3.util.FastMath; // Yatopia + import java.util.Random; + import net.minecraft.util.MathHelper; - public final class NoiseGeneratorPerlin { - -@@ -8,6 +9,12 @@ public final class NoiseGeneratorPerlin { +@@ -9,6 +10,12 @@ public final class NoiseGeneratorPerlin { public final double a; public final double b; public final double c; @@ -34,7 +33,7 @@ index d7ca619b228e2a5a461085e0c5222e6a36a66fe0..ea157542df2617eec6b5a62331e1daa3 public NoiseGeneratorPerlin(Random random) { this.a = random.nextDouble() * 256.0D; -@@ -29,8 +36,19 @@ public final class NoiseGeneratorPerlin { +@@ -30,8 +37,19 @@ public final class NoiseGeneratorPerlin { this.d[i + j] = b0; } @@ -54,7 +53,7 @@ index d7ca619b228e2a5a461085e0c5222e6a36a66fe0..ea157542df2617eec6b5a62331e1daa3 public double a(double d0, double d1, double d2, double d3, double d4) { double d5 = d0 + this.a; double d6 = d1 + this.b; -@@ -55,6 +73,125 @@ public final class NoiseGeneratorPerlin { +@@ -56,6 +74,125 @@ public final class NoiseGeneratorPerlin { } return this.a(i, j, k, d8, d9 - d14, d10, d11, d12, d13); diff --git a/patches/server/0044-lithium-VoronoiBiomeAccessTypeMixin.patch b/patches/server/0044-lithium-VoronoiBiomeAccessTypeMixin.patch index ce7ac556..82dbc426 100644 --- a/patches/server/0044-lithium-VoronoiBiomeAccessTypeMixin.patch +++ b/patches/server/0044-lithium-VoronoiBiomeAccessTypeMixin.patch @@ -6,11 +6,11 @@ Subject: [PATCH] lithium VoronoiBiomeAccessTypeMixin Original code by JellySquid, licensed under LGPLv3 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/GenLayerZoomVoronoi.java b/src/main/java/net/minecraft/server/GenLayerZoomVoronoi.java -index 70ea171edc419f8614004b6e50fc34b8fd9b4a20..47415b738c83541f76d504ad4d5f619ccd023feb 100644 ---- a/src/main/java/net/minecraft/server/GenLayerZoomVoronoi.java -+++ b/src/main/java/net/minecraft/server/GenLayerZoomVoronoi.java -@@ -8,6 +8,8 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { +diff --git a/src/main/java/net/minecraft/world/level/biome/GenLayerZoomVoronoi.java b/src/main/java/net/minecraft/world/level/biome/GenLayerZoomVoronoi.java +index 821adbf2c7c32ab659d23974b3871e2d11762ee6..715d6a21d1a1a84dd92b375cce13834f0eff3dbb 100644 +--- a/src/main/java/net/minecraft/world/level/biome/GenLayerZoomVoronoi.java ++++ b/src/main/java/net/minecraft/world/level/biome/GenLayerZoomVoronoi.java +@@ -10,6 +10,8 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { @Override public BiomeBase a(long i, int j, int k, int l, BiomeManager.Provider biomemanager_provider) { @@ -19,7 +19,7 @@ index 70ea171edc419f8614004b6e50fc34b8fd9b4a20..47415b738c83541f76d504ad4d5f619c int i1 = j - 2; int j1 = k - 2; int k1 = l - 2; -@@ -54,6 +56,75 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { +@@ -56,6 +58,75 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { l2 = (k2 & 2) == 0 ? i2 : i2 + 1; i3 = (k2 & 1) == 0 ? j2 : j2 + 1; return biomemanager_provider.getBiome(k3, l2, i3); @@ -95,7 +95,7 @@ index 70ea171edc419f8614004b6e50fc34b8fd9b4a20..47415b738c83541f76d504ad4d5f619c } private static double a(long i, int j, int k, int l, double d0, double d1, double d2) { -@@ -76,9 +147,14 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { +@@ -78,9 +149,14 @@ public enum GenLayerZoomVoronoi implements GenLayerZoomer { } private static double a(long i) { diff --git a/patches/server/0045-lithium-NoiseChunkGeneratorMixin.patch b/patches/server/0045-lithium-NoiseChunkGeneratorMixin.patch index c090f730..15256915 100644 --- a/patches/server/0045-lithium-NoiseChunkGeneratorMixin.patch +++ b/patches/server/0045-lithium-NoiseChunkGeneratorMixin.patch @@ -7,10 +7,10 @@ Additional Optimizations By YatopiaMC, Original code by SuperCoder79, licensed under LGPLv3 you can find the original code on https://github.com/CaffeineMC/lithium-fabric/ (Yarn mappings) -diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f504dd34bd 100644 ---- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -+++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +diff --git a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java +index 369fb0bda22f02e76b901b6eb8990651c53c7577..916e893cf771a2ea825d60104115282295529119 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java @@ -5,6 +5,8 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; @@ -20,7 +20,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 import java.util.Iterator; import java.util.List; import java.util.Random; -@@ -111,7 +113,15 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -146,7 +148,15 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { return this.w == i && ((GeneratorSettingBase) this.h.get()).a(resourcekey); } @@ -36,7 +36,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 double d4 = 0.0D; double d5 = 0.0D; double d6 = 0.0D; -@@ -147,7 +157,85 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -182,7 +192,85 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { } return MathHelper.b(d4 / 512.0D, d5 / 512.0D, (d6 / 10.0D + 1.0D) / 2.0D); @@ -122,7 +122,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 private double[] b(int i, int j) { double[] adouble = new double[this.o + 1]; -@@ -273,7 +361,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -308,7 +396,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { double d2 = d1 * 24.575625D - 2.0D; @@ -131,7 +131,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 } @Override -@@ -290,10 +378,10 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -325,10 +413,10 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { } private int a(int i, int j, @Nullable IBlockData[] aiblockdata, @Nullable Predicate predicate) { @@ -146,7 +146,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 double d0 = (double) i1 / (double) this.m; double d1 = (double) j1 / (double) this.m; double[][] adouble = new double[][]{this.b(k, l), this.b(k, l + 1), this.b(k + 1, l), this.b(k + 1, l + 1)}; -@@ -532,9 +620,9 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -567,9 +655,9 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { StructurePiece structurepiece = (StructurePiece) objectlistiterator.next(); StructureBoundingBox structureboundingbox = structurepiece.g(); @@ -158,7 +158,7 @@ index 321ebe8891defb46f3ad3dfea37c9bb6e2025ad7..fa60285c0c48147ad09b9197bfe577f5 } objectlistiterator.back(objectlist.size()); -@@ -589,7 +677,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -624,7 +712,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { double d0 = (double) (i * i + k * k); double d1 = (double) j + 0.5D; double d2 = d1 * d1; diff --git a/patches/server/0046-lithium-reduce-allocations.patch b/patches/server/0046-lithium-reduce-allocations.patch index 8fdfa3fc..41d32b31 100644 --- a/patches/server/0046-lithium-reduce-allocations.patch +++ b/patches/server/0046-lithium-reduce-allocations.patch @@ -10,11 +10,11 @@ Portions of this patch that were sourced from Lithium were remapped from Yarn ma Co-authored-by: Mykyta Komarnytskyy -diff --git a/src/main/java/net/minecraft/server/BlockComposter.java b/src/main/java/net/minecraft/server/BlockComposter.java -index 115eb270c5b5f19432e30eec41a652939a61dd94..03e8a7abbe6567ee0ecd8a8e4ea85b9bebb7dc4f 100644 ---- a/src/main/java/net/minecraft/server/BlockComposter.java -+++ b/src/main/java/net/minecraft/server/BlockComposter.java -@@ -306,7 +306,7 @@ public class BlockComposter extends Block implements IInventoryHolder { +diff --git a/src/main/java/net/minecraft/world/level/block/BlockComposter.java b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +index 2d6abc0b8b3c9860110f0b5f1df1b3b3bbf30673..21d56458e17cd791b2c9e63799a15ffbc86e6afb 100644 +--- a/src/main/java/net/minecraft/world/level/block/BlockComposter.java ++++ b/src/main/java/net/minecraft/world/level/block/BlockComposter.java +@@ -357,7 +357,7 @@ public class BlockComposter extends Block implements IInventoryHolder { @Override public int[] getSlotsForFace(EnumDirection enumdirection) { @@ -23,7 +23,7 @@ index 115eb270c5b5f19432e30eec41a652939a61dd94..03e8a7abbe6567ee0ecd8a8e4ea85b9b } @Override -@@ -356,7 +356,7 @@ public class BlockComposter extends Block implements IInventoryHolder { +@@ -407,7 +407,7 @@ public class BlockComposter extends Block implements IInventoryHolder { @Override public int[] getSlotsForFace(EnumDirection enumdirection) { @@ -32,7 +32,7 @@ index 115eb270c5b5f19432e30eec41a652939a61dd94..03e8a7abbe6567ee0ecd8a8e4ea85b9b } @Override -@@ -392,7 +392,7 @@ public class BlockComposter extends Block implements IInventoryHolder { +@@ -443,7 +443,7 @@ public class BlockComposter extends Block implements IInventoryHolder { @Override public int[] getSlotsForFace(EnumDirection enumdirection) { diff --git a/patches/server/0047-Smarter-statistics-ticking.patch b/patches/server/0047-Smarter-statistics-ticking.patch index da544a55..c8882ec1 100644 --- a/patches/server/0047-Smarter-statistics-ticking.patch +++ b/patches/server/0047-Smarter-statistics-ticking.patch @@ -7,11 +7,11 @@ In vanilla, statistics that count time spent for an action (i.e. time played or With an interval of 20, this patch saves roughly 3ms per tick on a server w/ 80 players online. -diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 41681fa979e49ae19855055e4234fc891aee800e..3669fbbb68c4e3b5e09069ee53e4ebe19efb8ee2 100644 ---- a/src/main/java/net/minecraft/server/EntityHuman.java -+++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -176,18 +176,23 @@ public abstract class EntityHuman extends EntityLiving { +diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +index e8d2184eec6d3d844bb9066ef8c1259c66fffbe2..c02364c0b049e084db01aa2fa4ed88befd60c701 100644 +--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java ++++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java +@@ -273,18 +273,23 @@ public abstract class EntityHuman extends EntityLiving { this.p(); if (!this.world.isClientSide) { this.foodData.a(this); diff --git a/patches/server/0048-Configurable-criterion-triggers.patch b/patches/server/0048-Configurable-criterion-triggers.patch index b7b2c3d3..a9b888bc 100644 --- a/patches/server/0048-Configurable-criterion-triggers.patch +++ b/patches/server/0048-Configurable-criterion-triggers.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Configurable criterion triggers This patch adds toggles for three criterion triggers that are called every tick. These can be very unnecessary, and especially in the case of CriterionTriggerEnterBlock, quite heavy. -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 8071e8ec7bb505e026ceead84377e61063864bc5..bf143aae623305b716eb1ee8e190d3e0e694f328 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -439,6 +439,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java +index b4dbc59faff3fd6ceb74d829762eb68e649975c5..e6bc64037f79a1380bcb99ff3c4455e0d9cb8d5d 100644 +--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java +@@ -571,6 +571,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected void a(IBlockData iblockdata) { @@ -17,7 +17,7 @@ index 8071e8ec7bb505e026ceead84377e61063864bc5..bf143aae623305b716eb1ee8e190d3e0 CriterionTriggers.d.a(this, iblockdata); } -@@ -769,7 +770,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -901,7 +902,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.playerConnection.sendPacket(new PacketPlayOutExperience(this.exp, this.expTotal, this.expLevel)); } diff --git a/patches/server/0049-Configurable-BlockPhysicsEvent.patch b/patches/server/0049-Configurable-BlockPhysicsEvent.patch index 21004c54..40b9da86 100644 --- a/patches/server/0049-Configurable-BlockPhysicsEvent.patch +++ b/patches/server/0049-Configurable-BlockPhysicsEvent.patch @@ -8,10 +8,10 @@ Paper does alleviate this quite well by only firing if plugins are listening, bu This patch implements a hard toggle for the event. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2f83ba794f25f92722a737e3b1f2342b4b9fc94f..15aaa636f4478991b2b48db05255b7b888a4011e 100644 +index 16d8d7760ca0348ee0cf1edec1650cac536e21d0..856e55727eb28277f3d0ae37b35b5d24e0637819 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1425,7 +1425,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant builder = ImmutableMap.builder(); BiConsumer biconsumer = builder::put; // Paper - decompile fix @@ -30,7 +30,7 @@ index 29d55483510d3644a1edd3a01d7314232c358ac6..9909dd07d47ec86b71b74f66ab0e252d Throwable throwable = null; try { -@@ -55,7 +65,11 @@ public abstract class LocaleLanguage { +@@ -56,7 +66,11 @@ public abstract class LocaleLanguage { } } catch (JsonParseException | IOException ioexception) { diff --git a/patches/server/0051-Configurable-movement-checks.patch b/patches/server/0051-Configurable-movement-checks.patch index 023105ca..8315b7c7 100644 --- a/patches/server/0051-Configurable-movement-checks.patch +++ b/patches/server/0051-Configurable-movement-checks.patch @@ -4,11 +4,11 @@ Date: Sun, 8 Nov 2020 19:07:14 +0200 Subject: [PATCH] Configurable movement checks -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index eb4aa659a928d241d17cf1b2a5c414ec43209de5..0364c923792acb30dc600db8ed4f05f8d5597e1d 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -453,7 +453,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java +index 5f3723537f3862c494b7d5be2e0d81ce42b4d351..44a5eacbc4f7f5d6f47f32ec9401023aa664e000 100644 +--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java +@@ -598,7 +598,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } // Paper end @@ -17,7 +17,7 @@ index eb4aa659a928d241d17cf1b2a5c414ec43209de5..0364c923792acb30dc600db8ed4f05f8 // CraftBukkit end PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); -@@ -480,7 +480,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -625,7 +625,7 @@ public class PlayerConnection implements PacketListenerPlayIn { d10 = d6 * d6 + d7 * d7 + d8 * d8; boolean flag1 = false; @@ -26,7 +26,7 @@ index eb4aa659a928d241d17cf1b2a5c414ec43209de5..0364c923792acb30dc600db8ed4f05f8 flag1 = true; // Tuinity - diff on change, this should be moved wrongly PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), Math.sqrt(d10)); } -@@ -1228,7 +1228,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1373,7 +1373,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean(GameRules.DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isGliding())) { float f2 = this.player.isGliding() ? 300.0F : 100.0F; @@ -35,7 +35,7 @@ index eb4aa659a928d241d17cf1b2a5c414ec43209de5..0364c923792acb30dc600db8ed4f05f8 // CraftBukkit end PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9); this.a(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch); -@@ -1294,7 +1294,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1439,7 +1439,7 @@ public class PlayerConnection implements PacketListenerPlayIn { d11 = d7 * d7 + d8 * d8 + d9 * d9; boolean flag1 = false; diff --git a/patches/server/0052-Configurable-enchanting-table-tick.patch b/patches/server/0052-Configurable-enchanting-table-tick.patch index 0a45e230..e8058f1a 100644 --- a/patches/server/0052-Configurable-enchanting-table-tick.patch +++ b/patches/server/0052-Configurable-enchanting-table-tick.patch @@ -6,11 +6,11 @@ Subject: [PATCH] Configurable enchanting table tick Also don't tick blockentity beehive if there are no bees in it. This patch is a leftover from the original tile entity optimisations, which was majorly flawed. -diff --git a/src/main/java/net/minecraft/server/TileEntityBeehive.java b/src/main/java/net/minecraft/server/TileEntityBeehive.java -index 598f78502cd7ad15bc0f678df277f91b3ae376d4..69ef94e887fa9da1b3ddaf0a345fecc49d2866b5 100644 ---- a/src/main/java/net/minecraft/server/TileEntityBeehive.java -+++ b/src/main/java/net/minecraft/server/TileEntityBeehive.java -@@ -285,6 +285,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java +index 3cbcbb028b864f1d14e004628bbc0829f71ab476..d97acd72c30e1051f3e14c3c23b1a6b6e6fa42f0 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeehive.java +@@ -304,6 +304,7 @@ public class TileEntityBeehive extends TileEntity implements ITickable { @Override public void tick() { @@ -18,11 +18,11 @@ index 598f78502cd7ad15bc0f678df277f91b3ae376d4..69ef94e887fa9da1b3ddaf0a345fecc4 if (!this.world.isClientSide) { this.y(); BlockPosition blockposition = this.getPosition(); -diff --git a/src/main/java/net/minecraft/server/TileEntityEnchantTable.java b/src/main/java/net/minecraft/server/TileEntityEnchantTable.java -index 9b0c75332d9815657d96183e51e40cf14ee3ed75..e3de65b58a599b375b3be7470d918038b5379471 100644 ---- a/src/main/java/net/minecraft/server/TileEntityEnchantTable.java -+++ b/src/main/java/net/minecraft/server/TileEntityEnchantTable.java -@@ -43,6 +43,7 @@ public class TileEntityEnchantTable extends TileEntity implements INamableTileEn +diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java +index 7d81c45f8b514df1a9dafd3b1294a9ad852251f8..4b1cb089355b455c6210f2df1af797cc363997cf 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityEnchantTable.java +@@ -50,6 +50,7 @@ public class TileEntityEnchantTable extends TileEntity implements INamableTileEn @Override public void tick() { diff --git a/patches/server/0053-Optimised-hallowen-checker.patch b/patches/server/0053-Optimised-hallowen-checker.patch index 5e149fd2..c4949120 100644 --- a/patches/server/0053-Optimised-hallowen-checker.patch +++ b/patches/server/0053-Optimised-hallowen-checker.patch @@ -4,11 +4,23 @@ Date: Mon, 4 Jan 2021 20:12:36 +0200 Subject: [PATCH] Optimised hallowen checker -diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java -index 5ba96d6073d2f30c22c1fa28fdea30857b6f2d59..e384eef05faa449c442334910069d163170a9dcd 100644 ---- a/src/main/java/net/minecraft/server/EntityBat.java -+++ b/src/main/java/net/minecraft/server/EntityBat.java -@@ -281,11 +281,16 @@ public class EntityBat extends EntityAmbient { +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 856e55727eb28277f3d0ae37b35b5d24e0637819..57ff84a76b7d8fe496133950c8cf0687bca819d3 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1465,6 +1465,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= generatoraccess.getSeaLevel()) { return false; } else { @@ -17,7 +17,7 @@ index e384eef05faa449c442334910069d163170a9dcd..c090e0bb941f3d62efed4a0f5676c440 byte b0 = 4; if (eJ()) { -@@ -276,6 +276,7 @@ public class EntityBat extends EntityAmbient { +@@ -302,6 +302,7 @@ public class EntityBat extends EntityAmbient { return false; } diff --git a/patches/server/0055-add-config-for-logging-login-location.patch b/patches/server/0055-add-config-for-logging-login-location.patch index 1b781638..95a1760b 100644 --- a/patches/server/0055-add-config-for-logging-login-location.patch +++ b/patches/server/0055-add-config-for-logging-login-location.patch @@ -4,11 +4,11 @@ Date: Wed, 20 Jan 2021 16:36:48 -0500 Subject: [PATCH] add config for logging login location -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 5feadb8bebaace44efa854ac8bfb9def9d7393a5..9f0481959cde6c2461b073bd0b67d4079d2d66c2 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -395,7 +395,14 @@ public abstract class PlayerList { +diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java +index 9d8bf308e01df5e13418959f83f78b3c3f0dec98..6de75353a3e50411f06e3baa570d4c5ccdc129f1 100644 +--- a/src/main/java/net/minecraft/server/players/PlayerList.java ++++ b/src/main/java/net/minecraft/server/players/PlayerList.java +@@ -479,7 +479,14 @@ public abstract class PlayerList { } // Paper end // CraftBukkit - Moved from above, added world diff --git a/patches/server/0056-Preload-ProtocolLib-EnumWrappers.patch b/patches/server/0056-Preload-ProtocolLib-EnumWrappers.patch index c7af436a..8f283250 100644 --- a/patches/server/0056-Preload-ProtocolLib-EnumWrappers.patch +++ b/patches/server/0056-Preload-ProtocolLib-EnumWrappers.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Preload ProtocolLib EnumWrappers Currently, ProtocolLib load EnumWrappers lazily and causing memory effects issues. This patch preloads EnumWrappers to prevent further NPE. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5c25abc1ce8d26203e8ce1ad692d1d6e93f86827..103a1c560d99cfd7b47b2f6199ba0a6935142140 100644 +index 57ff84a76b7d8fe496133950c8cf0687bca819d3..9c991ee900a306f19d613b1d0511b89496267286 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -967,6 +967,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant d = RecordCodecBuilder.create((instance) -> { return instance.group(WorldChunkManager.a.fieldOf("biome_source").forGetter((chunkgeneratorabstract) -> { return chunkgeneratorabstract.b; -@@ -101,6 +102,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -136,6 +137,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { } else { this.v = null; } @@ -29,7 +29,7 @@ index fa60285c0c48147ad09b9197bfe577f504dd34bd..de469f9b4f0fecc05dca7a5aacd1308d } -@@ -688,10 +690,18 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -723,10 +725,18 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { return this.x; } diff --git a/patches/server/0058-New-nbt-cache.patch b/patches/server/0058-New-nbt-cache.patch index 666f80f6..d7d0d383 100644 --- a/patches/server/0058-New-nbt-cache.patch +++ b/patches/server/0058-New-nbt-cache.patch @@ -8,10 +8,10 @@ The goal of this patch is to reduce I/O operations from the main thread while sa Co-authored-by: ishland diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 103a1c560d99cfd7b47b2f6199ba0a6935142140..232f3f74d0c5eb2603496188efea8684482a61ef 100644 +index 9c991ee900a306f19d613b1d0511b89496267286..1b0add2400c8e518953add4cc100f227ebae0703 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -830,7 +830,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0) { stringbuilder.append("-- Head --\n"); @@ -18,11 +18,67 @@ index cc6e6f245ee5e73bd570cf42381bf55ee0b364d3..2f8ec64c26f5ed239b4dd9f9532c402d stringbuilder.append("Stacktrace:\n"); StackTraceElement[] astacktraceelement = this.h; int i = astacktraceelement.length; +diff --git a/src/main/java/net/minecraft/network/NetworkManager.java b/src/main/java/net/minecraft/network/NetworkManager.java +index 2214b116d1e548eca3c2e70e8b23d7c7913c361d..0afde1d6c6c5e5944a40f9367cef6d1654941ca8 100644 +--- a/src/main/java/net/minecraft/network/NetworkManager.java ++++ b/src/main/java/net/minecraft/network/NetworkManager.java +@@ -423,6 +423,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + // Paper start + } catch (Exception e) { ++ // Yatopia - detailed report ++ LOGGER.error("Encountered unexpected exception sending packets"); ++ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); ++ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); ++ // Yatopia end + LOGGER.error("NetworkException: " + player, e); + close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; + packet.onPacketDispatchFinish(player, null); +@@ -462,6 +467,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + // Paper start + } catch (Exception e) { ++ // Yatopia start - detailed report ++ LOGGER.error("Encountered unexpected exception sending packets"); ++ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); ++ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); ++ // Yatopia end + LOGGER.error("NetworkException: " + player, e); + close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; + packet.onPacketDispatchFinish(player, null); +@@ -497,6 +507,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { + channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); + // Paper start + } catch (Exception e) { ++ // Yatopia start - detailed report ++ LOGGER.error("Encountered unexpected exception sending packets"); ++ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); ++ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); ++ // Yatopia end + LOGGER.error("NetworkException: " + player, e); + close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; + packet.onPacketDispatchFinish(player, null); +diff --git a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java +index 71a000edfab27c9965d1929af78582821d5af97a..5c5ac70b4dae5d51303ab974261055aaefb5aec2 100644 +--- a/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java ++++ b/src/main/java/net/minecraft/network/protocol/PlayerConnectionUtils.java +@@ -57,6 +57,11 @@ public class PlayerConnectionUtils { + // Paper start + catch (Exception e) { + NetworkManager networkmanager = t0.a(); ++ // Yatopia start - detailed report ++ LOGGER.error("Encountered unexpected exception sending packets"); ++ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); ++ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); ++ // Yatopia end + if (networkmanager.getPlayer() != null) { + LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getName(), networkmanager.getSocketAddress(), e); + } else { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 232f3f74d0c5eb2603496188efea8684482a61ef..e98779a3b8569b62c88c59bb8c5a95994f641f51 100644 +index 1b0add2400c8e518953add4cc100f227ebae0703..46b4763026677b6d440fef2c33abae2a90104bb5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1047,7 +1047,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> { - channelfuture.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); - // Paper start - } catch (Exception e) { -+ // Yatopia - detailed report -+ LOGGER.error("Encountered unexpected exception sending packets"); -+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); -+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); -+ // Yatopia end - LOGGER.error("NetworkException: " + player, e); - close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; - packet.onPacketDispatchFinish(player, null); -@@ -443,6 +448,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); - // Paper start - } catch (Exception e) { -+ // Yatopia start - detailed report -+ LOGGER.error("Encountered unexpected exception sending packets"); -+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); -+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); -+ // Yatopia end - LOGGER.error("NetworkException: " + player, e); - close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; - packet.onPacketDispatchFinish(player, null); -@@ -478,6 +488,11 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - channelfuture1.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); - // Paper start - } catch (Exception e) { -+ // Yatopia start - detailed report -+ LOGGER.error("Encountered unexpected exception sending packets"); -+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); -+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); -+ // Yatopia end - LOGGER.error("NetworkException: " + player, e); - close(new ChatMessage("disconnect.genericReason", "Internal Exception: " + e.getMessage()));; - packet.onPacketDispatchFinish(player, null); -diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -index 8112b01f15c33f50fe5ec9aebf75d8091d440994..eb7e229ba4a2e4701a5a7a599f5e18da403a638b 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -@@ -45,6 +45,11 @@ public class PlayerConnectionUtils { - // Paper start - catch (Exception e) { - NetworkManager networkmanager = t0.a(); -+ // Yatopia start - detailed report -+ LOGGER.error("Encountered unexpected exception sending packets"); -+ org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(e, LOGGER::error); -+ LOGGER.error(org.yatopiamc.yatopia.api.internal.StackTraceUtils.EXCEPTION_DETAILS_BELOW); -+ // Yatopia end - if (networkmanager.getPlayer() != null) { - LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getName(), networkmanager.getSocketAddress(), e); - } else { -diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 0668d383db1f3a81d1053954d72678c7ac5aecec..7b9f83e63d0f9cd83a246be33af4ab91da6b2151 100644 ---- a/src/main/java/net/minecraft/server/ServerConnection.java -+++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -153,6 +153,11 @@ public class ServerConnection { +diff --git a/src/main/java/net/minecraft/server/network/ServerConnection.java b/src/main/java/net/minecraft/server/network/ServerConnection.java +index 70fde7bad2e0a6d7432d8509fdb7c46d9f020d4c..0798f27656cf9fedf61e7ff83879cecb7d12e6c7 100644 +--- a/src/main/java/net/minecraft/server/network/ServerConnection.java ++++ b/src/main/java/net/minecraft/server/network/ServerConnection.java +@@ -166,6 +166,11 @@ public class ServerConnection { throw new ReportedException(CrashReport.a(exception, "Ticking memory connection")); } @@ -107,13 +107,13 @@ index 0668d383db1f3a81d1053954d72678c7ac5aecec..7b9f83e63d0f9cd83a246be33af4ab91 ServerConnection.LOGGER.warn("Failed to handle packet for {}", networkmanager.getSocketAddress(), exception); ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error"); -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c3909bc3ec2601010b28949258cf52fd8e8446a9..a4b8505705061bd01a50e68d04e620a000f6084f 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1024,6 +1024,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java +index 421c141f24d3b640d97505565bd39fc14fc4ca08..c5ae979c9f38a61480390274b31afffd94d8a02d 100644 +--- a/src/main/java/net/minecraft/world/level/World.java ++++ b/src/main/java/net/minecraft/world/level/World.java +@@ -1087,6 +1087,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // Paper start - Prevent tile entity and entity crashes - String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ(); + String msg = "TileEntity threw exception at " + tileentity.getWorld().getWorld().getName() + ":" + tileentity.getPosition().getX() + "," + tileentity.getPosition().getY() + "," + tileentity.getPosition().getZ(); System.err.println(msg); + // Yatopia start - detailed report + org.yatopiamc.yatopia.api.internal.StackTraceUtils.print(throwable, System.err::println); @@ -175,7 +175,7 @@ index 0be39dac4b9dd69d7d73d86d64cf1e33e4086e81..c53531bc769ecd39c4f03b7a10c5bc6a + // Yatopia end } diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 8ee165d1c752e53601254f734507370b91ad7b73..4a81dde40e2534d99001a02adac12031c26c8104 100644 +index 1b92b3d2c696fa4ef86a2d2a58eeb447bb3d2739..d29bdfc2288189e43e2ddbfae1b794c6c9a27333 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -134,6 +134,15 @@ public class WatchdogThread extends Thread diff --git a/upstream/Airplane b/upstream/Airplane index cc00c697..f94d3994 160000 --- a/upstream/Airplane +++ b/upstream/Airplane @@ -1 +1 @@ -Subproject commit cc00c69755b5e461b591fc7dcdf4ed4d9aa4cfdf +Subproject commit f94d39947e98d209b68fa25243e9b88c4e434da5 diff --git a/upstream/Empirecraft b/upstream/Empirecraft index 81545aaf..1b579407 160000 --- a/upstream/Empirecraft +++ b/upstream/Empirecraft @@ -1 +1 @@ -Subproject commit 81545aafc639dfb2cfa8827a649b5e9f0dea110b +Subproject commit 1b579407fc58913b483d42da15686e77b13b50d0 diff --git a/upstream/Purpur b/upstream/Purpur index 37591fe6..75b07a03 160000 --- a/upstream/Purpur +++ b/upstream/Purpur @@ -1 +1 @@ -Subproject commit 37591fe6042989f3bc8f2021faf74b830056673e +Subproject commit 75b07a03d2d816ab2039021fdc13c175ef809292 diff --git a/upstream/Tuinity b/upstream/Tuinity index aea6b834..9bdcb9b8 160000 --- a/upstream/Tuinity +++ b/upstream/Tuinity @@ -1 +1 @@ -Subproject commit aea6b8347c8048e509f61e704a116c7a52177333 +Subproject commit 9bdcb9b8ebdb4058b781d9e388433eb383aec2ee diff --git a/upstreamCommits/Airplane b/upstreamCommits/Airplane index efca1da2..f36bbaf2 100644 --- a/upstreamCommits/Airplane +++ b/upstreamCommits/Airplane @@ -1 +1 @@ -cc00c69755b5e461b591fc7dcdf4ed4d9aa4cfdf \ No newline at end of file +f94d39947e98d209b68fa25243e9b88c4e434da5 \ No newline at end of file diff --git a/upstreamCommits/Empirecraft b/upstreamCommits/Empirecraft index 6c98d93f..f14bc1a3 100644 --- a/upstreamCommits/Empirecraft +++ b/upstreamCommits/Empirecraft @@ -1 +1 @@ -81545aafc639dfb2cfa8827a649b5e9f0dea110b \ No newline at end of file +1b579407fc58913b483d42da15686e77b13b50d0 \ No newline at end of file diff --git a/upstreamCommits/Purpur b/upstreamCommits/Purpur index 3f6118cb..c7addea7 100644 --- a/upstreamCommits/Purpur +++ b/upstreamCommits/Purpur @@ -1 +1 @@ -37591fe6042989f3bc8f2021faf74b830056673e \ No newline at end of file +75b07a03d2d816ab2039021fdc13c175ef809292 \ No newline at end of file diff --git a/upstreamCommits/Tuinity b/upstreamCommits/Tuinity index 0869d525..943c9302 100644 --- a/upstreamCommits/Tuinity +++ b/upstreamCommits/Tuinity @@ -1 +1 @@ -aea6b8347c8048e509f61e704a116c7a52177333 \ No newline at end of file +9bdcb9b8ebdb4058b781d9e388433eb383aec2ee \ No newline at end of file diff --git a/upstreamConfig/0002-Airplane.properties b/upstreamConfig/0002-Airplane.properties new file mode 100644 index 00000000..0028dce2 --- /dev/null +++ b/upstreamConfig/0002-Airplane.properties @@ -0,0 +1,4 @@ +name=Airplane +useBlackList=True +list=server/Disable-Paper-timings-by-default.patch,server/Only-check-for-spooky-season-once-an-hour.patch,server/Reduce-memory-allocations.patch +branch=origin/master diff --git a/upstreamConfig/0003-Airplane.properties b/upstreamConfig/0003-Airplane.properties deleted file mode 100644 index 1d781c7b..00000000 --- a/upstreamConfig/0003-Airplane.properties +++ /dev/null @@ -1,4 +0,0 @@ -name=Airplane -useBlackList=True -list=server/Airplane-Branding-Changes.patch,server/Disable-Paper-timings-by-default.patch,server/Only-check-for-spooky-season-once-an-hour.patch,server/Reduce-memory-allocations.patch -branch=origin/master diff --git a/upstreamConfig/0002-Purpur.properties b/upstreamConfig/0003-Purpur.properties similarity index 100% rename from upstreamConfig/0002-Purpur.properties rename to upstreamConfig/0003-Purpur.properties