From 643d9681ff2d06283d4266341c0c65a531ea55fa Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Wed, 20 Jan 2021 23:52:09 -0600 Subject: [PATCH] Updated Upstream (Paper & Tuinity) Upstream has released updates that appear to apply and compile correctly Paper Changes: 8fa15382b [Auto] Updated Upstream (CraftBukkit) 732b2f6b5 [CI-SKIP] [Auto] Rebuild Patches c5a39ffa2 Add BlockPreDispenseEvent (#5075) 8aeb4c9c3 Correctly skip pathfinder ticks for inactive entities (#5085) 0e420049c Fix console spam when removing chests in water 56b7935bb Add PlayerChangeBeaconEffectEvent 2eda45c34 added Wither API 97d0c571b Added Vanilla Entity Tags fccac282a fix NPE in getDisplayNameComponent 24e140372 Configurable max leash distance Tuinity Changes: d3ee22224 Merge dev/lighting --- Paper | 2 +- .../server/0001-Tuinity-Server-Changes.patch | 758 ++++++++++++------ patches/server/0002-Rebrand.patch | 6 +- patches/server/0003-Purpur-config-files.patch | 4 +- patches/server/0009-AFK-API.patch | 10 +- .../server/0010-Bring-back-server-name.patch | 4 +- patches/server/0013-Lagging-threshold.patch | 4 +- .../0018-Player-invulnerabilities.patch | 4 +- .../0021-Alternative-Keepalive-Handling.patch | 4 +- patches/server/0027-Giants-AI-settings.patch | 2 +- .../server/0039-Cat-spawning-options.patch | 2 +- patches/server/0041-Cows-eat-mushrooms.patch | 4 +- .../server/0048-Signs-allow-color-codes.patch | 4 +- ...0055-Fix-the-dead-lagging-the-server.patch | 4 +- .../0070-Add-canSaveToDisk-to-Entity.patch | 2 +- ...0071-Configurable-void-damage-height.patch | 2 +- ...0076-Add-5-second-tps-average-in-tps.patch | 4 +- .../server/0078-Item-entity-immunities.patch | 4 +- ...ed-to-crystals-and-crystals-shoot-ph.patch | 4 +- .../0086-Allow-color-codes-in-books.patch | 8 +- patches/server/0087-Entity-lifespan.patch | 4 +- ...s-vanilla-scoreboard-colors-patch-to.patch | 6 +- ...Stop-squids-floating-on-top-of-water.patch | 4 +- patches/server/0108-Ridables.patch | 58 +- ...tities-can-use-portals-configuration.patch | 6 +- ...stomizable-wither-health-and-healing.patch | 8 +- ...e-config-options-per-projectile-type.patch | 20 +- ...ows-should-not-reset-despawn-counter.patch | 4 +- ...e-animal-breeding-times-configurable.patch | 2 +- ...-check-to-EntityDamagedByEntityEvent.patch | 4 +- ...g-option-for-Piglins-guarding-chests.patch | 4 +- .../0150-Lobotomize-stuck-villagers.patch | 2 +- ...-Configurable-entity-base-attributes.patch | 2 +- ...s-to-open-even-with-a-solid-block-on.patch | 2 +- .../server/0161-PlayerBookTooLargeEvent.patch | 8 +- ...iefing-bypass-to-everything-affected.patch | 6 +- .../0168-Add-StructureGenerateEvent.patch | 2 +- ...0-Movement-options-for-armour-stands.patch | 4 +- .../server/0171-Fix-stuck-in-portals.patch | 4 +- 39 files changed, 614 insertions(+), 372 deletions(-) diff --git a/Paper b/Paper index d6f730655..8fa15382b 160000 --- a/Paper +++ b/Paper @@ -1 +1 @@ -Subproject commit d6f730655aa375d37378d689cb9080931750057b +Subproject commit 8fa15382bd7229e2688bb4b65c3f5fd823d4e23a diff --git a/patches/server/0001-Tuinity-Server-Changes.patch b/patches/server/0001-Tuinity-Server-Changes.patch index faecd99ea..f856aa965 100644 --- a/patches/server/0001-Tuinity-Server-Changes.patch +++ b/patches/server/0001-Tuinity-Server-Changes.patch @@ -194,15 +194,9 @@ Also allows us to run mid tick while ticking entities. Prevent unload() calls removing tickets for sync loads -Prevent log spam for "Block is water but TE is chest" - -Happens when breaking a waterlogged chest. -Fix is to just not validate the TE while the chest is being removed. - Optimise collision checking in player move packet handling -Don't need to do another getCubes call if the move() call -doesn't find any collisions +Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision Manually inline methods in BlockPosition @@ -251,10 +245,6 @@ method was not inlined. Paper recently reverted this optimisation, so it's been reintroduced here. -Temporarily Revert usage of Region Manager - -Has some stability issues. - Add packet limiter config Example config: @@ -367,10 +357,15 @@ Prevent light queue overfill when no players are online block changes don't queue light updates (and they shouldn't) -Do not add passengers of entities that were were above save limit +Don't allow StructureLocateEvent to change worlds -Given that the root entity isn't added to the world, this is -pretty unsafe to do. +Callers and even the function itself aren't expecting +this to happen + +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. Rewrite the light engine @@ -407,20 +402,12 @@ total generation (not lighting itself, but the whole generation process) by 2x. According to cpu time, the light engine itself spent 10x less time lighting chunks for generation. -fixup! Highly optimise single and multi-AABB VoxelShapes and collisions - -Revert Temporarily-Revert-usage-of-Region-Manager - Optimise WorldServer#notify 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. -fixup! Util patch - -fixup! Util patch - Actually unload POI data While it's not likely for a poi data leak to be meaningful, @@ -1540,10 +1527,10 @@ index 0000000000000000000000000000000000000000..cae06962d80cdd00962236891472ba81 \ No newline at end of file diff --git a/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java new file mode 100644 -index 0000000000000000000000000000000000000000..eb330a40d7345336ded670d631a9fd66da19f2e7 +index 0000000000000000000000000000000000000000..43de95779a5472aaf04da11c9f4c5feb7253c6c3 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/BlockStarLightEngine.java -@@ -0,0 +1,263 @@ +@@ -0,0 +1,277 @@ +package com.tuinity.tuinity.chunk.light; + +import net.minecraft.server.BlockPosition; @@ -1573,11 +1560,13 @@ index 0000000000000000000000000000000000000000..eb330a40d7345336ded670d631a9fd66 + + @Override + protected boolean[] getEmptinessMap(final IChunkAccess chunk) { -+ return null; ++ return chunk.getBlockEmptinessMap(); + } + + @Override -+ protected void setEmptinessMap(final IChunkAccess chunk, final boolean[] to) {} ++ protected void setEmptinessMap(final IChunkAccess chunk, final boolean[] to) { ++ chunk.setBlockEmptinessMap(to); ++ } + + @Override + protected SWMRNibbleArray[] getNibblesOnChunk(final IChunkAccess chunk) { @@ -1595,9 +1584,21 @@ index 0000000000000000000000000000000000000000..eb330a40d7345336ded670d631a9fd66 + } + + @Override -+ protected boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit) { -+ return null; ++ protected void initNibble(final int chunkX, final int chunkY, final int chunkZ, final boolean extrude, final boolean initRemovedNibbles) { ++ if (chunkY < this.minLightSection || chunkY > this.maxLightSection || this.getChunkInCache(chunkX, chunkZ) == null) { ++ return; ++ } ++ ++ SWMRNibbleArray nibble = this.getNibbleFromCache(chunkX, chunkY, chunkZ); ++ if (nibble == null) { ++ if (!initRemovedNibbles) { ++ throw new IllegalStateException(); ++ } else { ++ this.setNibbleInCache(chunkX, chunkY, chunkZ, new SWMRNibbleArray()); ++ } ++ } else { ++ nibble.setNonNull(); ++ } + } + + @Override @@ -2140,10 +2141,10 @@ 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..64c68f3be9f9f97ec3f9fd5c7fd0221ceb333b1a +index 0000000000000000000000000000000000000000..26534e05ff5aac5a963906ba678411c843b132e3 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/SkyStarLightEngine.java -@@ -0,0 +1,828 @@ +@@ -0,0 +1,706 @@ +package com.tuinity.tuinity.chunk.light; + +import com.tuinity.tuinity.util.WorldUtil; @@ -2202,129 +2203,7 @@ index 0000000000000000000000000000000000000000..64c68f3be9f9f97ec3f9fd5c7fd0221c + } + + @Override -+ protected boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit) { -+ final World world = (World)lightAccess.getWorld(); -+ final int chunkX = chunk.getPos().x; -+ final int chunkZ = chunk.getPos().z; -+ -+ boolean[] chunkEmptinessMap = this.getEmptinessMap(chunkX, chunkZ); -+ boolean[] ret = null; -+ final boolean needsInit = unlit || chunkEmptinessMap == null; -+ if (needsInit) { -+ this.setEmptinessMapCache(chunkX, chunkZ, ret = chunkEmptinessMap = new boolean[WorldUtil.getTotalSections(world)]); -+ } -+ -+ // update emptiness map -+ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { -+ final Boolean valueBoxed = emptinessChanges[sectionIndex]; -+ if (valueBoxed == null) { -+ if (needsInit) { -+ throw new IllegalStateException("Current chunk has not initialised emptiness map yet supplied emptiness map isn't filled?"); -+ } -+ continue; -+ } -+ chunkEmptinessMap[sectionIndex] = valueBoxed.booleanValue(); -+ } -+ -+ // now init neighbour nibbles -+ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { -+ final Boolean valueBoxed = emptinessChanges[sectionIndex]; -+ final int sectionY = sectionIndex + this.minSection; -+ if (valueBoxed == null) { -+ continue; -+ } -+ -+ final boolean empty = valueBoxed.booleanValue(); -+ -+ if (empty) { -+ continue; -+ } -+ -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ // if we're not empty, we also need to initialise nibbles -+ // note: if we're unlit, we absolutely do not want to extrude, as light data isn't set up -+ final boolean extrude = (dx | dz) != 0 || !unlit; -+ for (int dy = 1; dy >= -1; --dy) { -+ this.initNibbleForLitChunk(dx + chunkX, dy + sectionY, dz + chunkZ, extrude, false); -+ } -+ } -+ } -+ } -+ -+ // check for de-init and lazy-init -+ // lazy init is when chunks are being lit, so at the time they weren't loaded when their neighbours were running -+ // init checks. -+ for (int dz = -1; dz <= 1; ++dz) { -+ for (int dx = -1; dx <= 1; ++dx) { -+ // does this neighbour have 1 radius loaded? -+ boolean neighboursLoaded = true; -+ neighbour_loaded_search: -+ for (int dz2 = -1; dz2 <= 1; ++dz2) { -+ for (int dx2 = -1; dx2 <= 1; ++dx2) { -+ if (this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ) == null) { -+ neighboursLoaded = false; -+ break neighbour_loaded_search; -+ } -+ } -+ } -+ -+ for (int sectionY = this.maxLightSection; sectionY >= this.minLightSection; --sectionY) { -+ final SWMRNibbleArray nibble = this.getNibbleFromCache(dx + chunkX, sectionY, dz + chunkZ); -+ -+ // check neighbours to see if we need to de-init this one -+ boolean allEmpty = true; -+ neighbour_search: -+ for (int dy2 = -1; dy2 <= 1; ++dy2) { -+ for (int dz2 = -1; dz2 <= 1; ++dz2) { -+ for (int dx2 = -1; dx2 <= 1; ++dx2) { -+ final int y = sectionY + dy2; -+ if (y < this.minSection || y > this.maxSection) { -+ // empty -+ continue; -+ } -+ final boolean[] emptinessMap = this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ); -+ if (emptinessMap != null) { -+ if (!emptinessMap[y - this.minSection]) { -+ allEmpty = false; -+ break neighbour_search; -+ } -+ } else { -+ final ChunkSection section = this.getChunkSection(dx + dx2 + chunkX, y, dz + dz2 + chunkZ); -+ if (section != null && section != EMPTY_CHUNK_SECTION) { -+ allEmpty = false; -+ break neighbour_search; -+ } -+ } -+ } -+ } -+ } -+ -+ if (allEmpty & neighboursLoaded) { -+ // can only de-init when neighbours are loaded -+ // de-init is fine to delay, as de-init is just an optimisation - it's not required for lighting -+ // to be correct -+ -+ // all were empty, so de-init -+ if (nibble != null) { -+ nibble.setNull(); -+ } -+ } else if (!allEmpty) { -+ // must init -+ final boolean extrude = (dx | dz) != 0 || !unlit; -+ this.initNibbleForLitChunk(dx + chunkX, sectionY, dz + chunkZ, extrude, false); -+ } -+ } -+ } -+ } -+ -+ return ret; -+ } -+ -+ -+ protected final void initNibbleForLitChunk(final int chunkX, final int chunkY, final int chunkZ, final boolean extrude, -+ final boolean initRemovedNibbles) { ++ protected void initNibble(final int chunkX, final int chunkY, final int chunkZ, final boolean extrude, final boolean initRemovedNibbles) { + if (chunkY < this.minLightSection || chunkY > this.maxLightSection || this.getChunkInCache(chunkX, chunkZ) == null) { + return; + } @@ -2336,10 +2215,10 @@ index 0000000000000000000000000000000000000000..64c68f3be9f9f97ec3f9fd5c7fd0221c + this.setNibbleInCache(chunkX, chunkY, chunkZ, nibble = new SWMRNibbleArray(null, true)); + } + } -+ this.initNibbleForLitChunk(nibble, chunkX, chunkY, chunkZ, extrude); ++ this.initNibble(nibble, chunkX, chunkY, chunkZ, extrude); + } + -+ protected final void initNibbleForLitChunk(final SWMRNibbleArray currNibble, final int chunkX, final int chunkY, final int chunkZ, final boolean extrude) { ++ protected final void initNibble(final SWMRNibbleArray currNibble, final int chunkX, final int chunkY, final int chunkZ, final boolean extrude) { + if (!currNibble.isNullNibbleUpdating()) { + // already initialised + return; @@ -2430,7 +2309,7 @@ index 0000000000000000000000000000000000000000..64c68f3be9f9f97ec3f9fd5c7fd0221c + if (needInitNeighbours) { + for (int dz = -1; dz <= 1; ++dz) { + for (int dx = -1; dx <= 1; ++dx) { -+ this.initNibbleForLitChunk(dx + chunkX, chunkY, dz + chunkZ, (dx | dz) == 0 ? extrudeInitialised : true, true); ++ this.initNibble(dx + chunkX, chunkY, dz + chunkZ, (dx | dz) == 0 ? extrudeInitialised : true, true); + } + } + } @@ -2463,12 +2342,12 @@ index 0000000000000000000000000000000000000000..64c68f3be9f9f97ec3f9fd5c7fd0221c + + @Override + protected boolean[] getEmptinessMap(final IChunkAccess chunk) { -+ return chunk.getEmptinessMap(); ++ return chunk.getSkyEmptinessMap(); + } + + @Override + protected void setEmptinessMap(final IChunkAccess chunk, final boolean[] to) { -+ chunk.setEmptinessMap(to); ++ chunk.setSkyEmptinessMap(to); + } + + @Override @@ -2974,10 +2853,10 @@ index 0000000000000000000000000000000000000000..64c68f3be9f9f97ec3f9fd5c7fd0221c +} 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..f20fd2126a21b9c7c45fc420b67c645af875f929 +index 0000000000000000000000000000000000000000..d1aff9117e74d8cd7c3ca9334edfaf174a240956 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightEngine.java -@@ -0,0 +1,1491 @@ +@@ -0,0 +1,1610 @@ +package com.tuinity.tuinity.chunk.light; + +import com.tuinity.tuinity.util.CoordinateUtils; @@ -3744,13 +3623,132 @@ index 0000000000000000000000000000000000000000..f20fd2126a21b9c7c45fc420b67c645a + } + } + ++ protected abstract void initNibble(final int chunkX, final int chunkY, final int chunkZ, final boolean extrude, final boolean initRemovedNibbles); ++ + // subclasses should not initialise caches, as this will always be done by the super call + // subclasses should not invoke updateVisible, as this will always be done by the super call + // subclasses are guaranteed that this is always called before a changed block set + // newChunk specifies whether the changes describe a "first load" of a chunk or changes to existing, already loaded chunks + // rets non-null when the emptiness map changed and needs to be updated -+ protected abstract boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, -+ final Boolean[] emptinessChanges, final boolean unlit); ++ protected final boolean[] handleEmptySectionChanges(final ILightAccess lightAccess, final IChunkAccess chunk, ++ final Boolean[] emptinessChanges, final boolean unlit) { ++ final World world = (World)lightAccess.getWorld(); ++ final int chunkX = chunk.getPos().x; ++ final int chunkZ = chunk.getPos().z; ++ ++ boolean[] chunkEmptinessMap = this.getEmptinessMap(chunkX, chunkZ); ++ boolean[] ret = null; ++ final boolean needsInit = unlit || chunkEmptinessMap == null; ++ if (needsInit) { ++ this.setEmptinessMapCache(chunkX, chunkZ, ret = chunkEmptinessMap = new boolean[WorldUtil.getTotalSections(world)]); ++ } ++ ++ // update emptiness map ++ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { ++ final Boolean valueBoxed = emptinessChanges[sectionIndex]; ++ if (valueBoxed == null) { ++ if (needsInit) { ++ throw new IllegalStateException("Current chunk has not initialised emptiness map yet supplied emptiness map isn't filled?"); ++ } ++ continue; ++ } ++ chunkEmptinessMap[sectionIndex] = valueBoxed.booleanValue(); ++ } ++ ++ // now init neighbour nibbles ++ for (int sectionIndex = (emptinessChanges.length - 1); sectionIndex >= 0; --sectionIndex) { ++ final Boolean valueBoxed = emptinessChanges[sectionIndex]; ++ final int sectionY = sectionIndex + this.minSection; ++ if (valueBoxed == null) { ++ continue; ++ } ++ ++ final boolean empty = valueBoxed.booleanValue(); ++ ++ if (empty) { ++ continue; ++ } ++ ++ for (int dz = -1; dz <= 1; ++dz) { ++ for (int dx = -1; dx <= 1; ++dx) { ++ // if we're not empty, we also need to initialise nibbles ++ // note: if we're unlit, we absolutely do not want to extrude, as light data isn't set up ++ final boolean extrude = (dx | dz) != 0 || !unlit; ++ for (int dy = 1; dy >= -1; --dy) { ++ this.initNibble(dx + chunkX, dy + sectionY, dz + chunkZ, extrude, false); ++ } ++ } ++ } ++ } ++ ++ // check for de-init and lazy-init ++ // lazy init is when chunks are being lit, so at the time they weren't loaded when their neighbours were running ++ // init checks. ++ for (int dz = -1; dz <= 1; ++dz) { ++ for (int dx = -1; dx <= 1; ++dx) { ++ // does this neighbour have 1 radius loaded? ++ boolean neighboursLoaded = true; ++ neighbour_loaded_search: ++ for (int dz2 = -1; dz2 <= 1; ++dz2) { ++ for (int dx2 = -1; dx2 <= 1; ++dx2) { ++ if (this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ) == null) { ++ neighboursLoaded = false; ++ break neighbour_loaded_search; ++ } ++ } ++ } ++ ++ for (int sectionY = this.maxLightSection; sectionY >= this.minLightSection; --sectionY) { ++ final SWMRNibbleArray nibble = this.getNibbleFromCache(dx + chunkX, sectionY, dz + chunkZ); ++ ++ // check neighbours to see if we need to de-init this one ++ boolean allEmpty = true; ++ neighbour_search: ++ for (int dy2 = -1; dy2 <= 1; ++dy2) { ++ for (int dz2 = -1; dz2 <= 1; ++dz2) { ++ for (int dx2 = -1; dx2 <= 1; ++dx2) { ++ final int y = sectionY + dy2; ++ if (y < this.minSection || y > this.maxSection) { ++ // empty ++ continue; ++ } ++ final boolean[] emptinessMap = this.getEmptinessMap(dx + dx2 + chunkX, dz + dz2 + chunkZ); ++ if (emptinessMap != null) { ++ if (!emptinessMap[y - this.minSection]) { ++ allEmpty = false; ++ break neighbour_search; ++ } ++ } else { ++ final ChunkSection section = this.getChunkSection(dx + dx2 + chunkX, y, dz + dz2 + chunkZ); ++ if (section != null && section != EMPTY_CHUNK_SECTION) { ++ allEmpty = false; ++ break neighbour_search; ++ } ++ } ++ } ++ } ++ } ++ ++ if (allEmpty & neighboursLoaded) { ++ // can only de-init when neighbours are loaded ++ // de-init is fine to delay, as de-init is just an optimisation - it's not required for lighting ++ // to be correct ++ ++ // all were empty, so de-init ++ if (nibble != null) { ++ nibble.setNull(); ++ } ++ } else if (!allEmpty) { ++ // must init ++ final boolean extrude = (dx | dz) != 0 || !unlit; ++ this.initNibble(dx + chunkX, sectionY, dz + chunkZ, extrude, false); ++ } ++ } ++ } ++ } ++ ++ return ret; ++ } + + public final void checkChunkEdges(final ILightAccess lightAccess, final int chunkX, final int chunkZ) { + this.setupCaches(lightAccess, chunkX * 16 + 7, 128, chunkZ * 16 + 7, true, false); @@ -4471,7 +4469,7 @@ index 0000000000000000000000000000000000000000..f20fd2126a21b9c7c45fc420b67c645a +} 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..518c21b96947cb87bcc3b5fc3f6210bcb0944e33 +index 0000000000000000000000000000000000000000..0fddb331bfcee762da38efea3a36dc6394718519 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/chunk/light/StarLightInterface.java @@ -0,0 +1,490 @@ @@ -4551,7 +4549,7 @@ index 0000000000000000000000000000000000000000..518c21b96947cb87bcc3b5fc3f6210bc + return null; + } + -+ if (chunk.getEmptinessMap() == null) { ++ if (chunk.getSkyEmptinessMap() == null) { + return null; + } + @@ -4593,7 +4591,7 @@ index 0000000000000000000000000000000000000000..518c21b96947cb87bcc3b5fc3f6210bc + } + } + -+ final boolean[] emptinessMap = chunk.getEmptinessMap(); ++ final boolean[] emptinessMap = chunk.getSkyEmptinessMap(); + + if (emptinessMap == null) { + return 15; @@ -7694,7 +7692,7 @@ index 0000000000000000000000000000000000000000..002abb3cbf0f742e685f2f043d2600de + } +} diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index ed9b2f9adfecdc6d1b9925579ec510657adde11f..fd3bb6dfa6cc060e9785c22a9e61a4325c348e36 100644 +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 { @@ -7742,7 +7740,7 @@ index ed9b2f9adfecdc6d1b9925579ec510657adde11f..fd3bb6dfa6cc060e9785c22a9e61a432 + } + + public static double collideX(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (Math.abs(source_move) < MCUtil.COLLISION_EPSILON) { ++ if (source_move == 0.0) { + return 0.0; + } + @@ -7767,7 +7765,7 @@ index ed9b2f9adfecdc6d1b9925579ec510657adde11f..fd3bb6dfa6cc060e9785c22a9e61a432 + } + + public static double collideY(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (Math.abs(source_move) < MCUtil.COLLISION_EPSILON) { ++ if (source_move == 0.0) { + return 0.0; + } + @@ -7791,7 +7789,7 @@ index ed9b2f9adfecdc6d1b9925579ec510657adde11f..fd3bb6dfa6cc060e9785c22a9e61a432 + } + + public static double collideZ(AxisAlignedBB target, AxisAlignedBB source, double source_move) { -+ if (Math.abs(source_move) < MCUtil.COLLISION_EPSILON) { ++ if (source_move == 0.0) { + return 0.0; + } + @@ -8502,19 +8500,6 @@ index 1f334d63282bd5c23dc3b275a220f09e60c34537..829d4a7508e1656dbdc912096b7eafcf protected final VoxelShape b; protected final boolean c; private final boolean[] j; -diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 12a0230448dd8d56f6dc20e23cacaf0b8a9433d1..9e5e6de52efabe9126f6c47acb35fa1dc461ff4f 100644 ---- a/src/main/java/net/minecraft/server/BlockChest.java -+++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -195,7 +195,7 @@ public class BlockChest extends BlockChestAbstract implements I - @Override - public void remove(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) { - if (!iblockdata.a(iblockdata1.getBlock())) { -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, false); // Tuinity - block has since changed. - - if (tileentity instanceof IInventory) { - InventoryUtils.dropInventory(world, blockposition, (IInventory) tileentity); 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 @@ -8613,10 +8598,10 @@ index 2d887af902a33b0e28d8f0a6ac2e59c815a7856e..2291135eaef64c403183724cb6e413cd @Override public BlockPosition immutableCopy() { diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06408680b5 100644 +index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..ae07ea2a34f5cd82ce2eae523359cb7540065335 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,186 @@ public class Chunk implements IChunkAccess { +@@ -91,6 +91,197 @@ public class Chunk implements IChunkAccess { private final int[] inventoryEntityCounts = new int[16]; // Paper end @@ -8670,9 +8655,10 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 + } + // Tuinity end - optimise hard collision handling + // Tuinity start - rewrite light engine -+ private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile boolean[] emptinessMap; ++ 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() { @@ -8695,13 +8681,23 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 + } + + @Override -+ public boolean[] getEmptinessMap() { -+ return this.emptinessMap; ++ public boolean[] getSkyEmptinessMap() { ++ return this.skyEmptinessMap; + } + + @Override -+ public void setEmptinessMap(boolean[] emptinessMap) { -+ this.emptinessMap = emptinessMap; ++ 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 + @@ -8803,19 +8799,20 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 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(); -@@ -298,6 +478,11 @@ public class Chunk implements IChunkAccess { +@@ -298,6 +489,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.blockNibbles = protochunk.getBlockNibbles(); -+ this.skyNibbles = protochunk.getSkyNibbles(); -+ this.emptinessMap = protochunk.getEmptinessMap(); ++ 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()) { -@@ -548,6 +733,7 @@ public class Chunk implements IChunkAccess { +@@ -548,6 +745,7 @@ public class Chunk implements IChunkAccess { @Override public void a(Entity entity) { @@ -8823,7 +8820,7 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 this.q = true; int i = MathHelper.floor(entity.locX() / 16.0D); int j = MathHelper.floor(entity.locZ() / 16.0D); -@@ -593,8 +779,8 @@ public class Chunk implements IChunkAccess { +@@ -593,8 +791,8 @@ public class Chunk implements IChunkAccess { entity.chunkX = this.loc.x; entity.chunkY = k; entity.chunkZ = this.loc.z; @@ -8834,7 +8831,7 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 // Paper start if (entity instanceof EntityItem) { itemCounts[k]++; -@@ -617,6 +803,7 @@ public class Chunk implements IChunkAccess { +@@ -617,6 +815,7 @@ public class Chunk implements IChunkAccess { } public void a(Entity entity, int i) { @@ -8842,7 +8839,7 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 if (i < 0) { i = 0; } -@@ -631,7 +818,7 @@ public class Chunk implements IChunkAccess { +@@ -631,7 +830,7 @@ public class Chunk implements IChunkAccess { entity.entitySlice = null; entity.inChunk = false; } @@ -8851,7 +8848,7 @@ index af9d54ef057d5f6977cf77c57cde25b6b0d1f39d..7842e65115cf6c37322c83ebff954a06 return; } if (entity instanceof EntityItem) { -@@ -944,6 +1131,7 @@ public class Chunk implements IChunkAccess { +@@ -944,6 +1143,7 @@ public class Chunk implements IChunkAccess { } @@ -9027,6 +9024,19 @@ index 8eecdcde510661ec3a13a25a04ba394f6b6dc012..ab1085091fefea3a3fa15f7028bec050 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/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 { + // 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. +- worldserver = ((org.bukkit.craftbukkit.CraftWorld) event.getOrigin().getWorld()).getHandle(); ++ //worldserver = ((org.bukkit.craftbukkit.CraftWorld) event.getOrigin().getWorld()).getHandle(); // Tuinity - callers and this function don't expect this to change + // Get radius and whether to find unexplored structures (re)defined by event call. + i = event.getRadius(); + flag = event.shouldFindUnexplored(); diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java index 3c7b225edbe23dc1959002293a6f8b816287b5a8..f1c686810fb4e9c05df45d664c93af73d17f0624 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -9897,7 +9907,7 @@ index 550232cb3819138b3bae0fa1c51429485e8bc593..229c3b0f0c650b501f31147adaa17194 throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc032eccb561 100644 +index f307a6361144c7e315b2e0ea45df27527cdb26ca..013c44f80f74376e8bbb37afb5de07aa5d8fb1bc 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 @@ -10051,16 +10061,13 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 } protected BlockPosition ap() { -@@ -815,6 +893,146 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -815,6 +893,137 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return d0; } + // Tuinity start - optimise entity movement + private static double performCollisionsX(AxisAlignedBB currentBoundingBox, double value, List potentialCollisions) { + for (int i = 0, len = potentialCollisions.size(); i < len; ++i) { -+ if (Math.abs(value) < MCUtil.COLLISION_EPSILON) { -+ return 0.0; -+ } + AxisAlignedBB target = potentialCollisions.get(i); + value = AxisAlignedBB.collideX(target, currentBoundingBox, value); + } @@ -10070,9 +10077,6 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 + + private static double performCollisionsY(AxisAlignedBB currentBoundingBox, double value, List potentialCollisions) { + for (int i = 0, len = potentialCollisions.size(); i < len; ++i) { -+ if (Math.abs(value) < MCUtil.COLLISION_EPSILON) { -+ return 0.0; -+ } + AxisAlignedBB target = potentialCollisions.get(i); + value = AxisAlignedBB.collideY(target, currentBoundingBox, value); + } @@ -10082,9 +10086,6 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 + + private static double performCollisionsZ(AxisAlignedBB currentBoundingBox, double value, List potentialCollisions) { + for (int i = 0, len = potentialCollisions.size(); i < len; ++i) { -+ if (Math.abs(value) < MCUtil.COLLISION_EPSILON) { -+ return 0.0; -+ } + AxisAlignedBB target = potentialCollisions.get(i); + value = AxisAlignedBB.collideZ(target, currentBoundingBox, value); + } @@ -10198,7 +10199,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 private Vec3D g(Vec3D vec3d) { AxisAlignedBB axisalignedbb = this.getBoundingBox(); VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this); -@@ -850,6 +1068,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -850,6 +1059,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return vec3d1; } @@ -10206,7 +10207,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 public static double c(Vec3D vec3d) { return vec3d.x * vec3d.x + vec3d.z * vec3d.z; } -@@ -962,18 +1181,34 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -962,18 +1172,34 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected void checkBlockCollisions() { @@ -10244,7 +10245,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 try { iblockdata.a(this.world, blockposition_mutableblockposition, this); this.a(iblockdata); -@@ -987,6 +1222,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -987,6 +1213,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } } @@ -10256,7 +10257,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 } } -@@ -1358,6 +1598,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1358,6 +1589,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return d3 * d3 + d4 * d4 + d5 * d5; } @@ -10264,7 +10265,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 public double h(Entity entity) { return this.e(entity.getPositionVector()); } -@@ -1945,9 +2186,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1945,9 +2177,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke float f1 = this.size.width * 0.8F; AxisAlignedBB axisalignedbb = AxisAlignedBB.g((double) f1, 0.10000000149011612D, (double) f1).d(this.locX(), this.getHeadY(), this.locZ()); @@ -10276,7 +10277,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 } } -@@ -1955,11 +2196,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1955,11 +2187,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return EnumInteractionResult.PASS; } @@ -10292,7 +10293,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 return false; } -@@ -2850,7 +3093,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2850,7 +3084,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.recursiveStream().forEach((entity) -> { worldserver.chunkCheck(entity); entity.az = true; @@ -10301,7 +10302,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 while (iterator.hasNext()) { Entity entity1 = (Entity) iterator.next(); -@@ -3308,12 +3551,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3308,12 +3542,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.locBlock; } @@ -10318,7 +10319,7 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 } public void setMot(double d0, double d1, double d2) { -@@ -3368,7 +3615,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3368,7 +3606,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper end if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) { @@ -10328,8 +10329,23 @@ index f307a6361144c7e315b2e0ea45df27527cdb26ca..f292e15746a947c580aa93e0a23dbc03 int i = MathHelper.floor(d0); int j = MathHelper.floor(d1); int k = MathHelper.floor(d2); +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 { + // 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 + } + + if (movingobjectpositionentity == null || this.getPierceLevel() <= 0) { diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 957a351c3f6c4f66d7af6657ab0c3cbeed94662f..57166a543a9af9e10e38c983487fac7ea9d42d52 100644 +index e80ec303198abade19645267e24cd5a4a8b75d70..35f511c398795a0edeb5fe6d802f2a2bf754bf3a 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 { @@ -10341,6 +10357,49 @@ index 957a351c3f6c4f66d7af6657ab0c3cbeed94662f..57166a543a9af9e10e38c983487fac7e this.setCatType(10); this.setPersistent(); } +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 { + // Paper end + + if (movingobjectposition != null && movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { // Paper - add null check in case cancelled ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly + this.a(movingobjectposition); ++ } // Tuinity - implement cancellation properly + + // 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 a646dc9f030ad1f76ba2b7bb1bc7897cd34b648c..dd18eabd7104995f0e6a8ecb279a3872b46773de 100644 +--- a/src/main/java/net/minecraft/server/EntityFireworks.java ++++ b/src/main/java/net/minecraft/server/EntityFireworks.java +@@ -124,8 +124,10 @@ 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.x(); +diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java +index e97c7794e86c0518bcec0a0370bffbeab20e2623..0816ab54bc99bcf29356b56516e83759a3f2988f 100644 +--- a/src/main/java/net/minecraft/server/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +@@ -226,7 +226,9 @@ public class EntityFishingHook extends IProjectile { + private void m() { + MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); + ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly + this.a(movingobjectposition); ++ } // Tuinity - implement cancellation properly + } + + @Override diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java index eb5c3a1f0d9ff665631caf5bf579e83d1ed25e4f..7582a3a0955db2bc79daeced8e9c869f4276815a 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java @@ -10400,6 +10459,20 @@ index d417878a1584c9e5ec33b94fc65b29f84fb3a5e9..4fe5a8d0201d662c68dd58eeb8cf1d30 } +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 { + MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); + + if (movingobjectposition != null) { ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // CraftBukkit - Call event // Paper - make cancellable // Tuinity - implement cancellation properly + this.a(movingobjectposition); ++ } // Tuinity - implement cancellation properly + } + + double d0 = this.locX() + vec3d.x; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index 04d505c7a19775d0353c10424a84a1ce8885dc2c..9f5b7243ccbe0729a061345c25033d9145b91b3f 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java @@ -10590,6 +10663,32 @@ index 04d505c7a19775d0353c10424a84a1ce8885dc2c..9f5b7243ccbe0729a061345c25033d91 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/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 { + movingobjectposition = null; + } + } +- if (movingobjectposition != null) { ++ if (movingobjectposition != null && org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // Tuinity - implement cancellation properly + // 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 { + + MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); + +- if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { ++ if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) { // Tuinity - implement cancellation properly + this.a(movingobjectposition); + } + } diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index 4efc40c01ec12b80bd7cf9d35cf0ea0df973baf7..f322dccd834ff56b99f8796309709b5b6ac01456 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -10661,10 +10760,10 @@ index c4a83448ed4513f6e4ab179d1d43e5bb0cb13641..5c3eb4fc7e5aec2ad8d0050673fc8f4d Vec3D vec3d1 = raytrace1.a(); VoxelShape voxelshape = raytrace1.a(iblockdata, this, blockposition); diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java -index 180b6b58dc5663158db84b6f1257591439b48c31..62a648a78481b4f3f35882c689e137e733f7f152 100644 +index 180b6b58dc5663158db84b6f1257591439b48c31..564703d87c47eab34a23cb5d159cc66cdbfc00a3 100644 --- a/src/main/java/net/minecraft/server/IChunkAccess.java +++ b/src/main/java/net/minecraft/server/IChunkAccess.java -@@ -24,6 +24,28 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -24,6 +24,36 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { } // Paper end @@ -10682,10 +10781,18 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..62a648a78481b4f3f35882c689e137e7 + default void setSkyNibbles(com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] nibbles) { + throw new UnsupportedOperationException(this.getClass().getName()); + } -+ public default boolean[] getEmptinessMap() { ++ public default boolean[] getSkyEmptinessMap() { + throw new UnsupportedOperationException(this.getClass().getName()); + } -+ public default void setEmptinessMap(final boolean[] emptinessMap) { ++ 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 @@ -10693,7 +10800,7 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..62a648a78481b4f3f35882c689e137e7 IBlockData getType(final int x, final int y, final int z); // Paper @Nullable IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); -@@ -122,6 +144,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -122,6 +152,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { @Nullable NBTTagCompound j(BlockPosition blockposition); @@ -10701,7 +10808,7 @@ index 180b6b58dc5663158db84b6f1257591439b48c31..62a648a78481b4f3f35882c689e137e7 Stream m(); TickList n(); -@@ -142,6 +165,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { +@@ -142,6 +173,7 @@ public interface IChunkAccess extends IBlockAccess, IStructureAccess { return ashortlist[i]; } @@ -10824,6 +10931,19 @@ index be5384ee41290b24b0c419c3e8f4553db34b2399..df28f7a6bf4c650a22ddf046eae4d5e8 default void a(EnumSkyBlock enumskyblock, SectionPosition sectionposition) {} IBlockAccess getWorld(); +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 { + } + + protected void a(MovingObjectPosition movingobjectposition) { +- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition)) return; // CraftBukkit - Call event // Paper - make cancellable ++ // Tuinity - proper cancellation requires moving this into the caller (see method overrides) - TODO this unfortunately means we need to manually inspect each call on update + MovingObjectPosition.EnumMovingObjectType movingobjectposition_enummovingobjecttype = movingobjectposition.getType(); + + if (movingobjectposition_enummovingobjecttype == MovingObjectPosition.EnumMovingObjectType.ENTITY) { 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 @@ -13132,7 +13252,7 @@ index 49008cdec739b19409fdaf1b0ed806a6c0e93200..16779ffa00caf32752170700e1d88092 } // Paper end - optimised tracker diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc 100644 +index 87b1ff21957d5d708209257e569785aeaf191181..4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -419,7 +419,9 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -13146,7 +13266,53 @@ index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0 this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity)); return; } -@@ -1068,7 +1070,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -432,12 +434,14 @@ public class PlayerConnection implements PacketListenerPlayIn { + return; + } + +- boolean flag = worldserver.getCubes(entity, entity.getBoundingBox().shrink(0.0625D)); ++ //boolean flag = worldserver.getCubes(entity, entity.getBoundingBox().shrink(0.0625D)); // Tuinity - replace with different checks ++ AxisAlignedBB oldBox = entity.getBoundingBox(); // Tuinity - copy from player movement packet + + d6 = d3 - this.v; + d7 = d4 - this.w - 1.0E-6D; + d8 = d5 - this.x; + entity.move(EnumMoveType.PLAYER, new Vec3D(d6, d7, d8)); ++ boolean didCollide = toX != entity.locX() || toY != entity.locY() || toZ != entity.locZ(); // Tuinity - needed here as the difference in Y can be reset - also note: this is only a guess at whether collisions took place, floating point errors can make this true when it shouldn't be... + double d11 = d7; + + d6 = d3 - entity.locX(); +@@ -451,16 +455,25 @@ public class PlayerConnection implements PacketListenerPlayIn { + boolean flag1 = false; + + if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot +- flag1 = true; ++ 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)); + } + Location curPos = this.getPlayer().getLocation(); // Spigot + + entity.setLocation(d3, d4, d5, f, f1); + player.setLocation(d3, d4, d5, this.player.yaw, this.player.pitch); // CraftBukkit +- boolean flag2 = worldserver.getCubes(entity, entity.getBoundingBox().shrink(0.0625D)); +- +- if (flag && (flag1 || !flag2)) { ++ //boolean flag2 = worldserver.getCubes(entity, entity.getBoundingBox().shrink(0.0625D)); // Tuinity - replace with different checks ++ ++ // Tuinity start - optimise out extra getCubes ++ boolean teleportBack = flag1; // violating this is always a fail ++ if (!teleportBack) { ++ // note: only call after setLocation, or else getBoundingBox is wrong ++ AxisAlignedBB newBox = entity.getBoundingBox(); ++ if (didCollide || !oldBox.equals(newBox)) { ++ teleportBack = this.hasNewCollision(worldserver, entity, oldBox, newBox); ++ } // else: no collision at all detected, why do we care? ++ } ++ if (teleportBack) { // Tuinity end - optimise out extra getCubes + 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)); +@@ -1068,7 +1081,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (this.teleportPos != null) { @@ -13155,7 +13321,7 @@ index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0 this.A = this.e; this.a(this.teleportPos.x, this.teleportPos.y, this.teleportPos.z, this.player.yaw, this.player.pitch); } -@@ -1138,7 +1140,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1138,7 +1151,7 @@ public class PlayerConnection implements PacketListenerPlayIn { speed = player.abilities.walkSpeed * 10f; } // Paper start - Prevent moving into unloaded chunks @@ -13164,7 +13330,16 @@ index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0 this.internalTeleport(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch, Collections.emptySet()); return; } -@@ -1194,6 +1196,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1155,7 +1168,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + } + +- AxisAlignedBB axisalignedbb = this.player.getBoundingBox(); ++ AxisAlignedBB axisalignedbb = this.player.getBoundingBox(); // Tuinity - diff on change, should be old AABB + + d7 = d4 - this.o; + d8 = d5 - this.p; +@@ -1194,6 +1207,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9)); @@ -13172,15 +13347,59 @@ index 87b1ff21957d5d708209257e569785aeaf191181..5c708ed2cd3b10744b0d6d2eb2ef51d0 this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move // Paper start - prevent position desync if (this.teleportPos != null) { -@@ -1218,7 +1221,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1213,12 +1227,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 +- flag1 = true; ++ flag1 = true; // Tuinity - diff on change, this should be moved wrongly + PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getDisplayName().getString()); } this.player.setLocation(d4, d5, d6, f, f1); - if (!this.player.noclip && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || this.a((IWorldReader) worldserver, axisalignedbb))) { -+ if (!this.player.noclip && !this.player.isSleeping() && (flag1 && worldserver.getCubes(this.player, axisalignedbb) || (didCollide && this.a((IWorldReader) worldserver, axisalignedbb)))) { // Tuinity - optimise out the extra getCubes-like call most of the time ++ // Tuinity start - optimise out extra getCubes ++ // Original for reference: ++ // boolean teleportBack = flag1 && worldserver.getCubes(this.player, axisalignedbb) || (didCollide && this.a((IWorldReader) worldserver, axisalignedbb)); ++ boolean teleportBack = flag1; // violating this is always a fail ++ if (!this.player.noclip && !this.player.isSleeping() && !teleportBack) { ++ AxisAlignedBB newBox = this.player.getBoundingBox(); ++ if (didCollide || !axisalignedbb.equals(newBox)) { ++ // note: only call after setLocation, or else getBoundingBox is wrong ++ teleportBack = this.hasNewCollision(worldserver, this.player, axisalignedbb, newBox); ++ } // else: no collision at all detected, why do we care? ++ } ++ if (!this.player.noclip && !this.player.isSleeping() && teleportBack) { // Tuinity end - optimise out extra getCubes this.a(d0, d1, d2, f, f1); } else { // CraftBukkit start - fire PlayerMoveEvent +@@ -1305,6 +1330,26 @@ public class PlayerConnection implements PacketListenerPlayIn { + } + } + ++ // Tuinity start - optimise out extra getCubes ++ private boolean hasNewCollision(final WorldServer world, final Entity entity, final AxisAlignedBB oldBox, final AxisAlignedBB newBox) { ++ final List collisions = com.tuinity.tuinity.util.CachedLists.getTempCollisionList(); ++ try { ++ world.getCollisions(entity, newBox, collisions, true); ++ ++ for (int i = 0, len = collisions.size(); i < len; ++i) { ++ final AxisAlignedBB box = collisions.get(i); ++ if (!box.voxelShapeIntersect(oldBox)) { ++ return true; ++ } ++ } ++ ++ return false; ++ } finally { ++ com.tuinity.tuinity.util.CachedLists.returnTempCollisionList(collisions); ++ } ++ } ++ // Tuinity end - optimise out extra getCubes ++ + private boolean a(IWorldReader iworldreader, AxisAlignedBB axisalignedbb) { + Stream stream = iworldreader.d(this.player, this.player.getBoundingBox().shrink(9.999999747378752E-6D), (entity) -> { + return true; diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java index 7ea293f38dedd6066601d94adbe175a31c502e1f..e698dd22607b2b2c4068c5bfb03ac53eb5bac080 100644 --- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java @@ -13365,17 +13584,18 @@ index 114e986e5132e5e4bb42d0f08a067429bce53ba6..05656ea8448aa569e8dd480461e2d5f7 this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); // CraftBukkit - SPIGOT-5196 } diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 5b0cd414ca1949ab53b289f7159f18da07d21f14..71c7fca4ea925fee8790c5a4042ad26584a8ceb3 100644 +index 5b0cd414ca1949ab53b289f7159f18da07d21f14..d8b759874545293764690b2ba08a4bd7605c76ae 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java -@@ -48,6 +48,42 @@ public class ProtoChunk implements IChunkAccess { +@@ -48,6 +48,54 @@ public class ProtoChunk implements IChunkAccess { private volatile boolean u; final World world; // Paper - Anti-Xray - Add world // Paper - private -> default + // Tuinity start - rewrite light engine -+ private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] blockNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile com.tuinity.tuinity.chunk.light.SWMRNibbleArray[] skyNibbles = com.tuinity.tuinity.chunk.light.StarLightEngine.getFilledEmptyLight(); -+ private volatile boolean[] emptinessMap; ++ 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() { @@ -13398,20 +13618,31 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..71c7fca4ea925fee8790c5a4042ad265 + } + + @Override -+ public boolean[] getEmptinessMap() { -+ return this.emptinessMap; ++ public boolean[] getSkyEmptinessMap() { ++ return this.skyEmptinessMap; + } + + @Override -+ public void setEmptinessMap(final boolean[] emptinessMap) { -+ this.emptinessMap = emptinessMap; ++ 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 + // Paper start - Anti-Xray - Add world @Deprecated public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter) { this(chunkcoordintpair, chunkconverter, null); } // Notice for updates: Please make sure this constructor isn't used anywhere public ProtoChunk(ChunkCoordIntPair chunkcoordintpair, ChunkConverter chunkconverter, World world) { -@@ -173,20 +209,17 @@ public class ProtoChunk implements IChunkAccess { +@@ -173,20 +221,17 @@ public class ProtoChunk implements IChunkAccess { ChunkSection chunksection = this.a(j >> 4); IBlockData iblockdata1 = chunksection.setType(i & 15, j & 15, k & 15, iblockdata); @@ -13426,17 +13657,17 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..71c7fca4ea925fee8790c5a4042ad265 + HeightMap.Type[] enumset = this.getChunkStatus().heightMaps; // Tuinity - reduce iterator creation EnumSet enumset1 = null; - Iterator iterator = enumset.iterator(); +- +- HeightMap.Type heightmap_type; + // Tuinity - reduce iterator creation -- HeightMap.Type heightmap_type; -- - while (iterator.hasNext()) { - heightmap_type = (HeightMap.Type) iterator.next(); + for (HeightMap.Type heightmap_type : enumset) { // Tuinity - reduce iterator creation HeightMap heightmap = (HeightMap) this.f.get(heightmap_type); if (heightmap == null) { -@@ -202,10 +235,9 @@ public class ProtoChunk implements IChunkAccess { +@@ -202,10 +247,9 @@ public class ProtoChunk implements IChunkAccess { HeightMap.a(this, enumset1); } @@ -13451,10 +13682,10 @@ index 5b0cd414ca1949ab53b289f7159f18da07d21f14..71c7fca4ea925fee8790c5a4042ad265 } diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..0e528df0d9d77f39af1b5c62a29ef31e6ac3b614 100644 +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,39 @@ import javax.annotation.Nullable; +@@ -8,7 +8,50 @@ import javax.annotation.Nullable; public class ProtoChunkExtension extends ProtoChunk { @@ -13483,14 +13714,25 @@ index 300cbb8b01d94e7eb0cded0c8e118103c416d4b6..0e528df0d9d77f39af1b5c62a29ef31e + } + + @Override -+ public boolean[] getEmptinessMap() { -+ return this.getWrappedChunk().getEmptinessMap(); ++ public boolean[] getSkyEmptinessMap() { ++ return this.getWrappedChunk().getSkyEmptinessMap(); + } + + @Override -+ public void setEmptinessMap(final boolean[] emptinessMap) { -+ this.getWrappedChunk().setEmptinessMap(emptinessMap); ++ public void setSkyEmptinessMap(final boolean[] emptinessMap) { ++ this.getWrappedChunk().setSkyEmptinessMap(emptinessMap); + } ++ ++ @Override ++ public boolean[] getBlockEmptinessMap() { ++ return this.getWrappedChunk().getBlockEmptinessMap(); ++ } ++ ++ @Override ++ public void setBlockEmptinessMap(boolean[] emptinessMap) { ++ this.getWrappedChunk().setBlockEmptinessMap(emptinessMap); ++ } ++ + // Tuinity end - rewrite light engine public ProtoChunkExtension(Chunk chunk) { @@ -14793,7 +15035,7 @@ index 7f05587d42b7cdb09552277ec2e467f0edf06f10..5af554870bcf36e47aef43b966b141b9 return this.x * this.x + this.y * this.y + this.z * this.z; } diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 6a0f07b13eef5560dfc7c7b39618c0b825533aec..731a7b52c1c659b3b985704dea9cf57f6c5bcecb 100644 +index 6a0f07b13eef5560dfc7c7b39618c0b825533aec..fce9967912628c232fe41ccc17fe2296f001ec61 100644 --- a/src/main/java/net/minecraft/server/VillagePlace.java +++ b/src/main/java/net/minecraft/server/VillagePlace.java @@ -4,6 +4,7 @@ import com.mojang.datafixers.DataFixer; @@ -14882,9 +15124,9 @@ index 6a0f07b13eef5560dfc7c7b39618c0b825533aec..731a7b52c1c659b3b985704dea9cf57f + + long determineDelay(long coordinate) { + if (this.isEmpty(coordinate)) { -+ return 60 * 20; ++ return 5 * 60 * 20; + } else { -+ return 5 * 20; ++ return 60 * 20; + } + } + @@ -16648,7 +16890,7 @@ index 7511e38130f38703164395a670f12d1af648ff04..e602efcb3fad390bb6bff1055e782bba } value.append("},"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dc7de2b59ec5ca3e5fba34dbb2aa2e6aed8f95cb..a383ba5e897101a3da1544c877148b43be7a6319 100644 +index 9ad6ea5ef331c3c057f39115d00f855ca57e219b..bd7bccbea1a0a052ef7bd6ab299ae72336874911 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 @@ -16688,7 +16930,7 @@ index dc7de2b59ec5ca3e5fba34dbb2aa2e6aed8f95cb..a383ba5e897101a3da1544c877148b43 } @Override -@@ -2280,6 +2285,14 @@ public final class CraftServer implements Server { +@@ -2285,6 +2290,14 @@ public final class CraftServer implements Server { return com.destroystokyo.paper.PaperConfig.config; } diff --git a/patches/server/0002-Rebrand.patch b/patches/server/0002-Rebrand.patch index 3e2bdbbc6..3603fd927 100644 --- a/patches/server/0002-Rebrand.patch +++ b/patches/server/0002-Rebrand.patch @@ -182,7 +182,7 @@ index 0000000000000000000000000000000000000000..d8b408f061d96e2fa8e2e587462e2221 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a383ba5e897101a3da1544c877148b43be7a6319..92bfae8f8249e70105fd848f01f950b67bb1d97e 100644 +index bd7bccbea1a0a052ef7bd6ab299ae72336874911..5100460bab83cd75ac8dcdcc50ea663b1c486d00 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 @@ -195,10 +195,10 @@ index a383ba5e897101a3da1544c877148b43be7a6319..92bfae8f8249e70105fd848f01f950b6 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 979f3504e6a6ca46993f3d9b0f408ab6744bdccd..568d2d78f5961098dfb8947d45ca26fd9334f151 100644 +index ac5003dc827217bd1947c71044abcbcbd2210dcd..37c561fb775cf7dd955b185b4ea94fecc574be63 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -353,7 +353,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -370,7 +370,7 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { diff --git a/patches/server/0003-Purpur-config-files.patch b/patches/server/0003-Purpur-config-files.patch index a639131a6..d5809047b 100644 --- a/patches/server/0003-Purpur-config-files.patch +++ b/patches/server/0003-Purpur-config-files.patch @@ -373,7 +373,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 92bfae8f8249e70105fd848f01f950b67bb1d97e..7502726207073bdac6fc4166064575696f6a7270 100644 +index 5100460bab83cd75ac8dcdcc50ea663b1c486d00..b5d274c1fe214ea274057084bc40d6eeb618b21d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -862,6 +862,7 @@ public final class CraftServer implements Server { @@ -400,7 +400,7 @@ index 92bfae8f8249e70105fd848f01f950b67bb1d97e..7502726207073bdac6fc416606457569 overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2293,6 +2296,18 @@ public final class CraftServer implements Server { +@@ -2298,6 +2301,18 @@ public final class CraftServer implements Server { } // Tuinity end - add config to timings report diff --git a/patches/server/0009-AFK-API.patch b/patches/server/0009-AFK-API.patch index edbdaaa54..2908ed9d9 100644 --- a/patches/server/0009-AFK-API.patch +++ b/patches/server/0009-AFK-API.patch @@ -149,7 +149,7 @@ index b5e1a860a2569d7668330827614d221b60f3fc78..5f85a1d513f4fdc21b64e1a2b6882e33 // Paper start public static final Predicate affectsSpawning = (entity) -> { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc..d1d4f4baf33e6b2224116f22a63b6d218e26635b 100644 +index 4058c1f7ada7d0c9e4ba73a0073b4f94bf410a8f..caf9ce94a7cb6154981d42953c81b588b19e3814 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -250,6 +250,12 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -165,7 +165,7 @@ index 5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc..d1d4f4baf33e6b2224116f22a63b6d21 this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854 this.disconnect(new ChatMessage("multiplayer.disconnect.idling")); } -@@ -506,6 +512,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -517,6 +523,8 @@ public class PlayerConnection implements PacketListenerPlayIn { this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -174,16 +174,16 @@ index 5c708ed2cd3b10744b0d6d2eb2ef51d0411ce0dc..d1d4f4baf33e6b2224116f22a63b6d21 // Skip the first time we do this if (true) { // Spigot - don't skip any move events Location oldTo = to.clone(); -@@ -1217,7 +1225,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1228,7 +1236,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; + 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); -@@ -1256,6 +1264,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1278,6 +1286,8 @@ public class PlayerConnection implements PacketListenerPlayIn { this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); diff --git a/patches/server/0010-Bring-back-server-name.patch b/patches/server/0010-Bring-back-server-name.patch index ebeb72a67..4fc877cea 100644 --- a/patches/server/0010-Bring-back-server-name.patch +++ b/patches/server/0010-Bring-back-server-name.patch @@ -17,10 +17,10 @@ index 65961a03728852bd75367083a0de6fd0082b17cb..780474397acb4d0e7ecb4540e1a2db57 public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true); public final boolean pvp = this.getBoolean("pvp", true); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7502726207073bdac6fc4166064575696f6a7270..c2ac3c69e75de35e38aa262f0634f58005fd3daf 100644 +index b5d274c1fe214ea274057084bc40d6eeb618b21d..43ee4f6ba778ceb0b34906ace86f0f12587a8e8d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2445,4 +2445,11 @@ public final class CraftServer implements Server { +@@ -2450,4 +2450,11 @@ public final class CraftServer implements Server { return mobGoals; } // Paper end diff --git a/patches/server/0013-Lagging-threshold.patch b/patches/server/0013-Lagging-threshold.patch index 3b32d7cc3..1eccab1de 100644 --- a/patches/server/0013-Lagging-threshold.patch +++ b/patches/server/0013-Lagging-threshold.patch @@ -41,10 +41,10 @@ index 4627261562a1482aecf4034b8717ecccc2dd9eb0..a34ed978596f1a466b0b48e7db92ac4f public static boolean enderChestSixRows = false; public static boolean enderChestPermissionRows = false; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c2ac3c69e75de35e38aa262f0634f58005fd3daf..d61f103c1909a82615e49f63b0bdf92e718764ac 100644 +index 43ee4f6ba778ceb0b34906ace86f0f12587a8e8d..2ddf0e5589b6f45f502e6f675000fec361b186fe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2451,5 +2451,10 @@ public final class CraftServer implements Server { +@@ -2456,5 +2456,10 @@ public final class CraftServer implements Server { public String getServerName() { return getProperties().serverName; } diff --git a/patches/server/0018-Player-invulnerabilities.patch b/patches/server/0018-Player-invulnerabilities.patch index a993afe5d..8022a2369 100644 --- a/patches/server/0018-Player-invulnerabilities.patch +++ b/patches/server/0018-Player-invulnerabilities.patch @@ -67,10 +67,10 @@ index dc69cba40806782e0b8ffd3b77aa6298feddb35d..ca63c583524c760072933602079ffe34 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 d1d4f4baf33e6b2224116f22a63b6d218e26635b..07fcf1646a46b867ffb0e88746b4a781ef55729b 100644 +index caf9ce94a7cb6154981d42953c81b588b19e3814..e833447073585ff97f8ab3a95caea8866fcc24e2 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1666,6 +1666,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1708,6 +1708,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer()); // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; diff --git a/patches/server/0021-Alternative-Keepalive-Handling.patch b/patches/server/0021-Alternative-Keepalive-Handling.patch index c8a22adf1..5cb0efbd7 100644 --- a/patches/server/0021-Alternative-Keepalive-Handling.patch +++ b/patches/server/0021-Alternative-Keepalive-Handling.patch @@ -17,7 +17,7 @@ index 8e93f1540ba5f995489c1fbcec70d10b011cd9c3..470f92c4fb0919d052b19acff8dff533 return this.a; } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 07fcf1646a46b867ffb0e88746b4a781ef55729b..d74986818af4fbefdd60f865d2225d61008df7d1 100644 +index e833447073585ff97f8ab3a95caea8866fcc24e2..fdd517290a0b306dff9c0fffadc424b59b8504f3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -84,6 +84,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -50,7 +50,7 @@ index 07fcf1646a46b867ffb0e88746b4a781ef55729b..d74986818af4fbefdd60f865d2225d61 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 -@@ -2840,6 +2856,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2882,6 +2898,16 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInKeepAlive packetplayinkeepalive) { diff --git a/patches/server/0027-Giants-AI-settings.patch b/patches/server/0027-Giants-AI-settings.patch index a8eb3d5cd..526966743 100644 --- a/patches/server/0027-Giants-AI-settings.patch +++ b/patches/server/0027-Giants-AI-settings.patch @@ -5,7 +5,7 @@ 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 f292e15746a947c580aa93e0a23dbc032eccb561..0e465a2107bd27e59a437c48672068a951ccccff 100644 +index 013c44f80f74376e8bbb37afb5de07aa5d8fb1bc..39036105b51dddbce8e4986e3be226f31fb13051 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/patches/server/0039-Cat-spawning-options.patch b/patches/server/0039-Cat-spawning-options.patch index 61a081c5f..87be9d470 100644 --- a/patches/server/0039-Cat-spawning-options.patch +++ b/patches/server/0039-Cat-spawning-options.patch @@ -62,7 +62,7 @@ index 5e17868a76ea8e3f105c11d496d6da12afa0da41..5a0f8779672a9e34f6970045361630ab } diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index 731a7b52c1c659b3b985704dea9cf57f6c5bcecb..fd32be3362ef88d903fd49ff8fa90c1bb762d9ec 100644 +index fce9967912628c232fe41ccc17fe2296f001ec61..44063d599e39e087b3eccfe204ef2fd79c3364e5 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 { diff --git a/patches/server/0041-Cows-eat-mushrooms.patch b/patches/server/0041-Cows-eat-mushrooms.patch index a5eb95175..d77f9afd4 100644 --- a/patches/server/0041-Cows-eat-mushrooms.patch +++ b/patches/server/0041-Cows-eat-mushrooms.patch @@ -5,10 +5,10 @@ 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 0e465a2107bd27e59a437c48672068a951ccccff..911a942d191659bdd055b2f1374246a829111330 100644 +index 39036105b51dddbce8e4986e3be226f31fb13051..4ed4f31c8e34279f9aa9fd7bbddbb36239ea36ef 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2787,6 +2787,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2778,6 +2778,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.invulnerable = flag; } diff --git a/patches/server/0048-Signs-allow-color-codes.patch b/patches/server/0048-Signs-allow-color-codes.patch index 1a4360b0d..c8061ab76 100644 --- a/patches/server/0048-Signs-allow-color-codes.patch +++ b/patches/server/0048-Signs-allow-color-codes.patch @@ -17,10 +17,10 @@ index ca63c583524c760072933602079ffe34796ff83c..eddec84023a3458deebec28215aba9ac 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 d74986818af4fbefdd60f865d2225d61008df7d1..1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11 100644 +index fdd517290a0b306dff9c0fffadc424b59b8504f3..3fca11948fad36b6adec55883d365e58a17925fa 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2837,6 +2837,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2879,6 +2879,14 @@ public class PlayerConnection implements PacketListenerPlayIn { } } // Paper end diff --git a/patches/server/0055-Fix-the-dead-lagging-the-server.patch b/patches/server/0055-Fix-the-dead-lagging-the-server.patch index 05c42db39..667098371 100644 --- a/patches/server/0055-Fix-the-dead-lagging-the-server.patch +++ b/patches/server/0055-Fix-the-dead-lagging-the-server.patch @@ -5,10 +5,10 @@ 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 911a942d191659bdd055b2f1374246a829111330..7f27993ee71b8ad081e0bb8d5e7f7e467683717e 100644 +index 4ed4f31c8e34279f9aa9fd7bbddbb36239ea36ef..f18941c7c740959181b728ab9da06c7e9d97aa79 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1532,6 +1532,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1523,6 +1523,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F; this.lastYaw = this.yaw; this.lastPitch = this.pitch; diff --git a/patches/server/0070-Add-canSaveToDisk-to-Entity.patch b/patches/server/0070-Add-canSaveToDisk-to-Entity.patch index e114b84e3..1dd9f44d5 100644 --- a/patches/server/0070-Add-canSaveToDisk-to-Entity.patch +++ b/patches/server/0070-Add-canSaveToDisk-to-Entity.patch @@ -17,7 +17,7 @@ index 076d6c1e1cc049dd312ecb30518e7b25fc2d7371..5f04591193d58ba7897194142da5efcb 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 7f27993ee71b8ad081e0bb8d5e7f7e467683717e..c164891ab4ee38244759309cee9d4aaf38f4f481 100644 +index f18941c7c740959181b728ab9da06c7e9d97aa79..dfbb5a9538780cbd2a5766486138f35b189da235 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -308,6 +308,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/patches/server/0071-Configurable-void-damage-height.patch b/patches/server/0071-Configurable-void-damage-height.patch index 35aef10b1..dd1e1615e 100644 --- a/patches/server/0071-Configurable-void-damage-height.patch +++ b/patches/server/0071-Configurable-void-damage-height.patch @@ -5,7 +5,7 @@ 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 c164891ab4ee38244759309cee9d4aaf38f4f481..8ae0e83179026d09f318ffaae751c942ecd48c41 100644 +index dfbb5a9538780cbd2a5766486138f35b189da235..9eb2e73c084b142bf04f798b572e6ca87f4f8416 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -611,7 +611,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/patches/server/0076-Add-5-second-tps-average-in-tps.patch b/patches/server/0076-Add-5-second-tps-average-in-tps.patch index 994de0937..360709e81 100644 --- a/patches/server/0076-Add-5-second-tps-average-in-tps.patch +++ b/patches/server/0076-Add-5-second-tps-average-in-tps.patch @@ -47,10 +47,10 @@ index 942f556eca32ce13c6b3490ef0d6f9e960a36d06..e16f120544ad46995dcf695849d3634c lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur tickSection = curTime; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d61f103c1909a82615e49f63b0bdf92e718764ac..b3bc2d908a028fe182f4be2ed4d2bb6a1e9ec5cb 100644 +index 2ddf0e5589b6f45f502e6f675000fec361b186fe..413c55feb6b1c2ddc80aa8dc1c83ed13b2c4c4a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2243,6 +2243,7 @@ public final class CraftServer implements Server { +@@ -2248,6 +2248,7 @@ public final class CraftServer implements Server { @Override public double[] getTPS() { return new double[] { diff --git a/patches/server/0078-Item-entity-immunities.patch b/patches/server/0078-Item-entity-immunities.patch index bbbbc5c8b..2713cfdbf 100644 --- a/patches/server/0078-Item-entity-immunities.patch +++ b/patches/server/0078-Item-entity-immunities.patch @@ -5,10 +5,10 @@ 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 8ae0e83179026d09f318ffaae751c942ecd48c41..dbf6e99ec49841336c81eadfd193216583b03a3b 100644 +index 9eb2e73c084b142bf04f798b572e6ca87f4f8416..f5159b76dee6127d7db2addfcb512b5b1f5b9c41 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1481,6 +1481,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1472,6 +1472,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } diff --git a/patches/server/0081-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch b/patches/server/0081-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch index ab5483f1f..346a6e9bb 100644 --- a/patches/server/0081-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch +++ b/patches/server/0081-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch @@ -17,10 +17,10 @@ index 6fe5678cffc2487fe00c953d772f764bb37a4b11..bd0267ee4b3782f6d1ec39cba7966ba4 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 dbf6e99ec49841336c81eadfd193216583b03a3b..cf13b30c71e093296ffa02c6f1383de405ee34d3 100644 +index f5159b76dee6127d7db2addfcb512b5b1f5b9c41..905e3a98fe900c82053b1514122bfe6cf1000dfa 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2147,8 +2147,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2138,8 +2138,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(new ItemStack(imaterial), (float) i); } diff --git a/patches/server/0086-Allow-color-codes-in-books.patch b/patches/server/0086-Allow-color-codes-in-books.patch index 597841017..9192e9134 100644 --- a/patches/server/0086-Allow-color-codes-in-books.patch +++ b/patches/server/0086-Allow-color-codes-in-books.patch @@ -5,10 +5,10 @@ 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 1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11..9b05adc3a834ce1f063c3b00505faed5e4ff66ba 100644 +index 3fca11948fad36b6adec55883d365e58a17925fa..ffccdc3bf1d28836f4fc2772ebfde843415ea232 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1018,7 +1018,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1029,7 +1029,8 @@ public class PlayerConnection implements PacketListenerPlayIn { if (itemstack.getItem() == Items.WRITABLE_BOOK) { NBTTagList nbttaglist = new NBTTagList(); @@ -18,7 +18,7 @@ index 1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11..9b05adc3a834ce1f063c3b00505faed5 ItemStack old = itemstack.cloneItemStack(); // CraftBukkit itemstack.a("pages", (NBTBase) nbttaglist); CraftEventFactory.handleEditBookEvent(player, i, old, itemstack); // CraftBukkit -@@ -1036,13 +1037,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1047,13 +1048,14 @@ public class PlayerConnection implements PacketListenerPlayIn { itemstack1.setTag(nbttagcompound.clone()); } @@ -35,7 +35,7 @@ index 1f2e8c6dbeaefaf7a4bba85d8302f444c4275e11..9b05adc3a834ce1f063c3b00505faed5 ChatComponentText chatcomponenttext = new ChatComponentText(s1); String s2 = IChatBaseComponent.ChatSerializer.a((IChatBaseComponent) chatcomponenttext); -@@ -1054,6 +1056,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1065,6 +1067,16 @@ public class PlayerConnection implements PacketListenerPlayIn { } } diff --git a/patches/server/0087-Entity-lifespan.patch b/patches/server/0087-Entity-lifespan.patch index c5c4db3d0..bf42194cc 100644 --- a/patches/server/0087-Entity-lifespan.patch +++ b/patches/server/0087-Entity-lifespan.patch @@ -92,10 +92,10 @@ index c9791be9385c83c8ab626ff3661b0c6cb45822ad..c2144f78c24f015775a00b1c82de645e } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9b05adc3a834ce1f063c3b00505faed5e4ff66ba..5db09c913d7a0c6feef4e3fa22b22235238721cb 100644 +index ffccdc3bf1d28836f4fc2772ebfde843415ea232..8932f4854d9fc52fb2ec66a748e640dfd8806461 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2229,6 +2229,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2271,6 +2271,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; diff --git a/patches/server/0097-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch b/patches/server/0097-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch index 34ca888b2..b5f43b107 100644 --- a/patches/server/0097-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch +++ b/patches/server/0097-Duplicate-paper-s-vanilla-scoreboard-colors-patch-to.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Duplicate paper's vanilla scoreboard colors patch to sync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5db09c913d7a0c6feef4e3fa22b22235238721cb..e2f97fa2b350c56c7086d89b4f66d07f3668e479 100644 +index 8932f4854d9fc52fb2ec66a748e640dfd8806461..eff58bba46e5cb4bd412fcb65e293d5b9eb58aba 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1988,7 +1988,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2030,7 +2030,15 @@ public class PlayerConnection implements PacketListenerPlayIn { return null; } @@ -26,7 +26,7 @@ index 5db09c913d7a0c6feef4e3fa22b22235238721cb..e2f97fa2b350c56c7086d89b4f66d07f PlayerConnection.this.minecraftServer.console.sendMessage(message); if (((LazyPlayerSet) queueEvent.getRecipients()).isLazy()) { for (Object player : PlayerConnection.this.minecraftServer.getPlayerList().players) { -@@ -2021,7 +2029,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2063,7 +2071,7 @@ public class PlayerConnection implements PacketListenerPlayIn { // Paper Start - (Meh) Support for vanilla world scoreboard name coloring String displayName = event.getPlayer().getDisplayName(); if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) { diff --git a/patches/server/0107-Stop-squids-floating-on-top-of-water.patch b/patches/server/0107-Stop-squids-floating-on-top-of-water.patch index 3b1bd3bab..3c4866d4d 100644 --- a/patches/server/0107-Stop-squids-floating-on-top-of-water.patch +++ b/patches/server/0107-Stop-squids-floating-on-top-of-water.patch @@ -5,10 +5,10 @@ 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 cf13b30c71e093296ffa02c6f1383de405ee34d3..3002dbaba08a5567e7e173f47f5973a8d6b4075a 100644 +index 905e3a98fe900c82053b1514122bfe6cf1000dfa..e59826b3e822a49378ae0d7b7cbca8c5d5ff476d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -3457,8 +3457,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3448,8 +3448,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.lastYaw = this.yaw; } diff --git a/patches/server/0108-Ridables.patch b/patches/server/0108-Ridables.patch index 9549262da..a765a834b 100644 --- a/patches/server/0108-Ridables.patch +++ b/patches/server/0108-Ridables.patch @@ -161,7 +161,7 @@ index bd0267ee4b3782f6d1ec39cba7966ba4f62f1adf..8b36ac2b0950a827763aa2357700f37e 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 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cbb1f8a0b4 100644 +index e59826b3e822a49378ae0d7b7cbca8c5d5ff476d..0115e2c73eff9d5e4c6778e32fc54b9c116b6b22 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -80,7 +80,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -200,7 +200,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb private float headHeight; // CraftBukkit start public boolean persist = true; -@@ -1491,6 +1491,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1482,6 +1482,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; } @@ -208,7 +208,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb public void a(float f, Vec3D vec3d) { Vec3D vec3d1 = a(vec3d, f, this.yaw); -@@ -2247,6 +2248,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2238,6 +2239,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(entity, false); } @@ -216,7 +216,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb public boolean a(Entity entity, boolean flag) { for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) { if (entity1.vehicle == this) { -@@ -2342,6 +2344,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2333,6 +2335,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.passengers.add(entity); } @@ -230,7 +230,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb } return true; // CraftBukkit } -@@ -2382,6 +2391,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2373,6 +2382,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } // Spigot end @@ -243,7 +243,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb this.passengers.remove(entity); entity.j = 60; } -@@ -2547,6 +2562,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2538,6 +2553,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.setFlag(4, flag); } @@ -251,7 +251,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb public boolean bE() { return this.glowing || this.world.isClientSide && this.getFlag(6); } -@@ -2769,6 +2785,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2760,6 +2776,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public void setHeadRotation(float f) {} @@ -259,7 +259,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb public void n(float f) {} public boolean bL() { -@@ -3210,6 +3227,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3201,6 +3218,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } @@ -278,7 +278,7 @@ index 3002dbaba08a5567e7e173f47f5973a8d6b4075a..2bd65dd4c4c4824a7969392f8ded35cb @Override public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {} -@@ -3662,4 +3691,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3653,4 +3682,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return ((ChunkProviderServer) world.getChunkProvider()).isInEntityTickingChunk(this); } // Paper end @@ -614,7 +614,7 @@ index 74082136b38491a0a50d152c455edfa61a6afb9f..dcfad16e06450068d5801fc002c96501 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 57166a543a9af9e10e38c983487fac7ea9d42d52..05929d5c539a738e6b6e8d32d9b0f843a665f4f6 100644 +index 35f511c398795a0edeb5fe6d802f2a2bf754bf3a..700314b02abb355e6a600d744887a705cbcfb4e4 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 { @@ -4486,7 +4486,7 @@ index ca3c5150bcfe2a92b49ad5a27c23dd37a7054fbb..323d79a99402b0f6952b4fb873170069 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 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d41770955 100644 +index 2e623ef9be036ea467e9e41817c2eced018f8f93..0442b722e5dc7ccc6e607fb3fa7766496b3398d5 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 { @@ -4494,10 +4494,10 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d }; private static final PathfinderTargetCondition bz = (new PathfinderTargetCondition()).a(20.0D).a(EntityWither.by); + private int shootCooldown = 0; // Purpur + // Paper start + private boolean canPortal = false; - public EntityWither(EntityTypes entitytypes, World world) { - super(entitytypes, world); -@@ -39,15 +40,122 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -44,15 +45,122 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.setHealth(this.getMaxHealth()); this.getNavigation().d(true); this.f = 50; @@ -4621,7 +4621,7 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, new Class[0])); this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityInsentient.class, 0, false, false, EntityWither.by)); } -@@ -189,6 +297,16 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -194,6 +302,16 @@ public class EntityWither extends EntityMonster implements IRangedEntity { @Override protected void mobTick() { @@ -4638,7 +4638,7 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d int i; if (this.getInvul() > 0) { -@@ -372,7 +490,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -377,7 +495,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.bossBattle.removePlayer(entityplayer); } @@ -4647,7 +4647,7 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d if (i <= 0) { return this.locX(); } else { -@@ -383,11 +501,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -388,11 +506,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } @@ -4661,7 +4661,7 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d if (i <= 0) { return this.locZ(); } else { -@@ -511,7 +629,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -516,7 +634,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } public static AttributeProvider.Builder eK() { @@ -4670,7 +4670,7 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d } public int getInvul() { -@@ -523,11 +641,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -528,11 +646,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } public int getHeadTarget(int i) { @@ -4683,8 +4683,8 @@ index 53482a420c356fd50e5ab6dd729a271d6594dac7..f68cf834aa65cc4bbb1eb9901586395d + if (!hasRider()) this.datawatcher.set(EntityWither.bo.get(i), j); // Purpur } - public boolean S_() { -@@ -541,7 +659,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + public final boolean isPowered() { return this.S_(); } // Paper - OBFHELPER +@@ -547,7 +665,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { @Override protected boolean n(Entity entity) { @@ -4885,7 +4885,7 @@ index cbc0b8bc854ab1b0ba95fa0a2041385f440718d9..89d64ea0d1e61dfce622df026209af12 default int getHeight() { diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index bbc089b41fcbe0141f13591db2cb44b9e688cac4..63040363fa5ae79ab0f2c31a1257cac2a610bc6a 100644 +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 { @@ -4973,10 +4973,10 @@ index 0000000000000000000000000000000000000000..44929182dfd7ad847d9657c324f440cb + } +} diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e2f97fa2b350c56c7086d89b4f66d07f3668e479..398f883b2e646dc8e90753270d1dece833a80739 100644 +index eff58bba46e5cb4bd412fcb65e293d5b9eb58aba..e9485684b7d5ddde72fc388d51cfef679178bad3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2246,6 +2246,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2288,6 +2288,8 @@ public class PlayerConnection implements PacketListenerPlayIn { } this.server.getPluginManager().callEvent(event); @@ -6383,10 +6383,10 @@ index a6d849facba1526ae2a2b7f3fb9a140d0b50289c..b56ca054b37f5887e13b481baad8132f + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 63d329dca12f902e2fb2a62ee4c86aea6453f1a3..a6963544fe460798ee870d7080939c8ec838398e 100644 +index 696ded96e6018bc5289cc20f72d6dc9395d3b6a6..55ab5e078d28de962ec450c575c7f5bb4fa7ce6f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -509,6 +509,18 @@ public class CraftEventFactory { +@@ -510,6 +510,18 @@ public class CraftEventFactory { } craftServer.getPluginManager().callEvent(event); @@ -6405,7 +6405,7 @@ index 63d329dca12f902e2fb2a62ee4c86aea6453f1a3..a6963544fe460798ee870d7080939c8e return event; } -@@ -909,6 +921,7 @@ public class CraftEventFactory { +@@ -910,6 +922,7 @@ public class CraftEventFactory { damageCause = DamageCause.ENTITY_EXPLOSION; } event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), entity.getBukkitEntity(), damageCause, modifiers, modifierFunctions); @@ -6413,7 +6413,7 @@ index 63d329dca12f902e2fb2a62ee4c86aea6453f1a3..a6963544fe460798ee870d7080939c8e } event.setCancelled(cancelled); -@@ -993,6 +1006,7 @@ public class CraftEventFactory { +@@ -994,6 +1007,7 @@ public class CraftEventFactory { if (!event.isCancelled()) { event.getEntity().setLastDamageCause(event); } @@ -6421,7 +6421,7 @@ index 63d329dca12f902e2fb2a62ee4c86aea6453f1a3..a6963544fe460798ee870d7080939c8e return event; } -@@ -1042,6 +1056,7 @@ public class CraftEventFactory { +@@ -1043,6 +1057,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions); diff --git a/patches/server/0111-Entities-can-use-portals-configuration.patch b/patches/server/0111-Entities-can-use-portals-configuration.patch index 983de99c8..e3531bb18 100644 --- a/patches/server/0111-Entities-can-use-portals-configuration.patch +++ b/patches/server/0111-Entities-can-use-portals-configuration.patch @@ -5,10 +5,10 @@ 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 2bd65dd4c4c4824a7969392f8ded35cbb1f8a0b4..46786324d6bb5150794b518e5c0f0a42d1851f74 100644 +index 0115e2c73eff9d5e4c6778e32fc54b9c116b6b22..e4f2e51b6306fcaf161b7dfb734d9d28947e964b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2423,7 +2423,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2414,7 +2414,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public void d(BlockPosition blockposition) { if (this.ai()) { this.resetPortalCooldown(); @@ -17,7 +17,7 @@ index 2bd65dd4c4c4824a7969392f8ded35cbb1f8a0b4..46786324d6bb5150794b518e5c0f0a42 if (!this.world.isClientSide && !blockposition.equals(this.ac)) { this.ac = blockposition.immutableCopy(); } -@@ -3003,7 +3003,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2994,7 +2994,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean canPortal() { diff --git a/patches/server/0113-Customizable-wither-health-and-healing.patch b/patches/server/0113-Customizable-wither-health-and-healing.patch index 1253215f6..d91842da5 100644 --- a/patches/server/0113-Customizable-wither-health-and-healing.patch +++ b/patches/server/0113-Customizable-wither-health-and-healing.patch @@ -6,10 +6,10 @@ 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 f68cf834aa65cc4bbb1eb9901586395d41770955..71b6fc480617f040029b2201f24d05affeb90b70 100644 +index 0442b722e5dc7ccc6e607fb3fa7766496b3398d5..9d67ce93573f85d64e8f0a8bd9434c130fc75b17 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -145,6 +145,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -150,6 +150,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { skull.setPositionRaw(headX, headY, headZ); world.addEntity(skull); } @@ -21,7 +21,7 @@ index f68cf834aa65cc4bbb1eb9901586395d41770955..71b6fc480617f040029b2201f24d05af // Purpur end @Override -@@ -348,7 +353,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -353,7 +358,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { this.setInvul(i); if (this.ticksLived % 10 == 0) { @@ -30,7 +30,7 @@ index f68cf834aa65cc4bbb1eb9901586395d41770955..71b6fc480617f040029b2201f24d05af } } else { -@@ -457,8 +462,10 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -462,8 +467,10 @@ public class EntityWither extends EntityMonster implements IRangedEntity { } } diff --git a/patches/server/0116-Despawn-rate-config-options-per-projectile-type.patch b/patches/server/0116-Despawn-rate-config-options-per-projectile-type.patch index d5cdf3a70..1397a4dfd 100644 --- a/patches/server/0116-Despawn-rate-config-options-per-projectile-type.patch +++ b/patches/server/0116-Despawn-rate-config-options-per-projectile-type.patch @@ -6,7 +6,7 @@ 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 1e7f5957d879d1ba8cf2b29cf9397b8e204e4381..7f89b269e37e1046a64c62e1db2a37e6aa4cd54c 100644 +index f983516b89cdf7ce7fdea8f5a5b1a29dd01ae597..74529a297540ea9c69952d88fe3bb5a13816dcef 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 { @@ -18,7 +18,7 @@ index 1e7f5957d879d1ba8cf2b29cf9397b8e204e4381..7f89b269e37e1046a64c62e1db2a37e6 private double damage; public int knockbackStrength; private SoundEffect ak; -@@ -255,13 +255,23 @@ public abstract class EntityArrow extends IProjectile { +@@ -257,13 +257,23 @@ public abstract class EntityArrow extends IProjectile { } @@ -96,10 +96,10 @@ index 63b4a449b56ef549830e4bbd3eab116e64379189..e8650c1bfa8f94ba461b709412567911 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index a646dc9f030ad1f76ba2b7bb1bc7897cd34b648c..9789d480ad2b6da6874004c068a298ed9c69a4e3 100644 +index dd18eabd7104995f0e6a8ecb279a3872b46773de..601f639275f4df983f19aa9cb0dc5f2611387853 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -298,4 +298,11 @@ public class EntityFireworks extends IProjectile { +@@ -300,4 +300,11 @@ public class EntityFireworks extends IProjectile { public Packet P() { return new PacketPlayOutSpawnEntity(this); } @@ -112,10 +112,10 @@ index a646dc9f030ad1f76ba2b7bb1bc7897cd34b648c..9789d480ad2b6da6874004c068a298ed + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index e97c7794e86c0518bcec0a0370bffbeab20e2623..7fcee87cdcd15a17b9019fa40f30cae688272294 100644 +index 0816ab54bc99bcf29356b56516e83759a3f2988f..2bad182d9d6248c1e8ac9138e46d192dccc2a973 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -576,4 +576,11 @@ public class EntityFishingHook extends IProjectile { +@@ -578,4 +578,11 @@ public class EntityFishingHook extends IProjectile { private HookState() {} } @@ -144,10 +144,10 @@ 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 7636a51a7ef0aa05b5b2aaa9d17e7b551dedac96..3e6438c9778ec6c9f62ac74d97fb5108944d0952 100644 +index 480a02a8f6ec7110f9af8f2037fdc09a7a54ef01..aa9afb60808a9988b38cf588ec9f649ee09c728e 100644 --- a/src/main/java/net/minecraft/server/EntityLlamaSpit.java +++ b/src/main/java/net/minecraft/server/EntityLlamaSpit.java -@@ -71,4 +71,11 @@ public class EntityLlamaSpit extends IProjectile { +@@ -73,4 +73,11 @@ public class EntityLlamaSpit extends IProjectile { public Packet P() { return new PacketPlayOutSpawnEntity(this); } @@ -176,7 +176,7 @@ index ddf1f80f3ba45e09cd13ca646a8ec6e8d47be555..bd84a3ac6146cfe6952a9334820696b4 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityShulkerBullet.java b/src/main/java/net/minecraft/server/EntityShulkerBullet.java -index 23017b5486530bcf76b3934cfa8621e8b4772b27..0b16473aedfca996d1f6767bead4a2191df1df9e 100644 +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 { @@ -257,7 +257,7 @@ 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 63040363fa5ae79ab0f2c31a1257cac2a610bc6a..1c79f58ce2a48745c9790cd04d6d6054b9eb6ed4 100644 +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/patches/server/0127-Arrows-should-not-reset-despawn-counter.patch b/patches/server/0127-Arrows-should-not-reset-despawn-counter.patch index 8af67ad41..c75083336 100644 --- a/patches/server/0127-Arrows-should-not-reset-despawn-counter.patch +++ b/patches/server/0127-Arrows-should-not-reset-despawn-counter.patch @@ -7,10 +7,10 @@ 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 7f89b269e37e1046a64c62e1db2a37e6aa4cd54c..5ec8c9484de64b956ec31b578a2a337340d70339 100644 +index 74529a297540ea9c69952d88fe3bb5a13816dcef..2e11286e2baffa66bea9570b0377478cd45fac1e 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -243,7 +243,7 @@ public abstract class EntityArrow extends IProjectile { +@@ -245,7 +245,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/server/0131-Make-animal-breeding-times-configurable.patch b/patches/server/0131-Make-animal-breeding-times-configurable.patch index 581f0877e..0a7944147 100644 --- a/patches/server/0131-Make-animal-breeding-times-configurable.patch +++ b/patches/server/0131-Make-animal-breeding-times-configurable.patch @@ -46,7 +46,7 @@ index d8354ec4d19fc3fbddc2551ee217acb137482e63..ded4e10f5082fb5aa25368d9035affba @Override diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index 05929d5c539a738e6b6e8d32d9b0f843a665f4f6..a6ce4ca27c9670655a8f66bfc624f12659613379 100644 +index 700314b02abb355e6a600d744887a705cbcfb4e4..8346db6c8521064ff51445a0da747a2d70d14633 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/patches/server/0137-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch b/patches/server/0137-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch index 8841a3e9c..d7ac0fbc9 100644 --- a/patches/server/0137-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch +++ b/patches/server/0137-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch @@ -33,10 +33,10 @@ index aef1dc47f2025f09d650a04f6dfa867d5ea1b65a..c973a1f1aecd47f11a12c94325cc18c3 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 a6963544fe460798ee870d7080939c8ec838398e..c6402e5c712744a807242e0421cd3383f6ba085f 100644 +index 55ab5e078d28de962ec450c575c7f5bb4fa7ce6f..533051ec74a64ef6893d848eb4579166d26c6bf7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1055,7 +1055,7 @@ public class CraftEventFactory { +@@ -1056,7 +1056,7 @@ public class CraftEventFactory { private static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, Map modifiers, Map> modifierFunctions, boolean cancelled) { EntityDamageEvent event; if (damager != null) { diff --git a/patches/server/0147-PaperPR-Config-option-for-Piglins-guarding-chests.patch b/patches/server/0147-PaperPR-Config-option-for-Piglins-guarding-chests.patch index 471ea1a60..3dc0026a6 100644 --- a/patches/server/0147-PaperPR-Config-option-for-Piglins-guarding-chests.patch +++ b/patches/server/0147-PaperPR-Config-option-for-Piglins-guarding-chests.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PaperPR - Config option for Piglins guarding chests diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 89f3a28c20f0e4db4650c435dbcbc923b7bde8aa..5c7e3c2671c0f8a3966a61e2652b8bb64f79a83e 100644 +index 4735dcba31b556fafe9c7d7440c89e940755c81f..78250d7db036198ec7119a065444c9253c1ab043 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -698,6 +698,11 @@ public class PaperWorldConfig { +@@ -704,6 +704,11 @@ public class PaperWorldConfig { zombiesTargetTurtleEggs = getBoolean("zombies-target-turtle-eggs", zombiesTargetTurtleEggs); } diff --git a/patches/server/0150-Lobotomize-stuck-villagers.patch b/patches/server/0150-Lobotomize-stuck-villagers.patch index 7164a3c7c..0f219e0ee 100644 --- a/patches/server/0150-Lobotomize-stuck-villagers.patch +++ b/patches/server/0150-Lobotomize-stuck-villagers.patch @@ -5,7 +5,7 @@ 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 46786324d6bb5150794b518e5c0f0a42d1851f74..b26a2b9b71f4a3a5b40612d5737500211fbefe15 100644 +index e4f2e51b6306fcaf161b7dfb734d9d28947e964b..cb4856e3bbb25e1077f5b4832f359549d57acd7e 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/patches/server/0156-Configurable-entity-base-attributes.patch b/patches/server/0156-Configurable-entity-base-attributes.patch index f3f3ea0a9..5d003fd07 100644 --- a/patches/server/0156-Configurable-entity-base-attributes.patch +++ b/patches/server/0156-Configurable-entity-base-attributes.patch @@ -60,7 +60,7 @@ index dcfad16e06450068d5801fc002c9650102dbf995..90b90fa33b39020189a1d4a5826fa3ab @Override diff --git a/src/main/java/net/minecraft/server/EntityCat.java b/src/main/java/net/minecraft/server/EntityCat.java -index a6ce4ca27c9670655a8f66bfc624f12659613379..16623cc1670422b5b1fa1cabb24a4052358de0fc 100644 +index 8346db6c8521064ff51445a0da747a2d70d14633..e411da6f0f55b965fe9e303cf3b56201d33cd260 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 { diff --git a/patches/server/0158-Option-for-chests-to-open-even-with-a-solid-block-on.patch b/patches/server/0158-Option-for-chests-to-open-even-with-a-solid-block-on.patch index 9fdeb38cd..bbecdc4e2 100644 --- a/patches/server/0158-Option-for-chests-to-open-even-with-a-solid-block-on.patch +++ b/patches/server/0158-Option-for-chests-to-open-even-with-a-solid-block-on.patch @@ -5,7 +5,7 @@ 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 9e5e6de52efabe9126f6c47acb35fa1dc461ff4f..487b281cf53d3482853d56ee1e90a329d516395f 100644 +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/patches/server/0161-PlayerBookTooLargeEvent.patch b/patches/server/0161-PlayerBookTooLargeEvent.patch index f363cf151..dcf5eacc7 100644 --- a/patches/server/0161-PlayerBookTooLargeEvent.patch +++ b/patches/server/0161-PlayerBookTooLargeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerBookTooLargeEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 398f883b2e646dc8e90753270d1dece833a80739..e3cdeb2d899957901e99f0f997af92505cbe4582 100644 +index e9485684b7d5ddde72fc388d51cfef679178bad3..75d955948a407d94e6f3a88f86afa8b1d6ba33cb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -930,6 +930,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -941,6 +941,7 @@ public class PlayerConnection implements PacketListenerPlayIn { NBTTagList pageList = testStack.getTag().getList("pages", 8); if (pageList.size() > 100) { PlayerConnection.LOGGER.warn(this.player.getName() + " tried to send a book with too many pages"); @@ -16,7 +16,7 @@ index 398f883b2e646dc8e90753270d1dece833a80739..e3cdeb2d899957901e99f0f997af9250 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -942,6 +943,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -953,6 +954,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 398f883b2e646dc8e90753270d1dece833a80739..e3cdeb2d899957901e99f0f997af9250 minecraftServer.scheduleOnMain(() -> this.disconnect("Book too large!")); return; } -@@ -965,6 +967,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -976,6 +978,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/server/0165-Add-mobGriefing-bypass-to-everything-affected.patch b/patches/server/0165-Add-mobGriefing-bypass-to-everything-affected.patch index 098a3bc6a..e98d97538 100644 --- a/patches/server/0165-Add-mobGriefing-bypass-to-everything-affected.patch +++ b/patches/server/0165-Add-mobGriefing-bypass-to-everything-affected.patch @@ -246,10 +246,10 @@ index 319bb68f27f360bb36897c73a68ddeac64b67a6f..550decf12140596e63b57a7ee5940e4f } diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 71b6fc480617f040029b2201f24d05affeb90b70..48d27d58358e0568579d69320f47e751ea4ec37a 100644 +index 9d67ce93573f85d64e8f0a8bd9434c130fc75b17..c6a687ffa92bea750b922dfe92bf715a476967e6 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -317,7 +317,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -322,7 +322,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { if (this.getInvul() > 0) { i = this.getInvul() - 1; if (i <= 0) { @@ -258,7 +258,7 @@ index 71b6fc480617f040029b2201f24d05affeb90b70..48d27d58358e0568579d69320f47e751 // 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); -@@ -429,7 +429,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -434,7 +434,7 @@ public class EntityWither extends EntityMonster implements IRangedEntity { if (this.bw > 0) { --this.bw; diff --git a/patches/server/0168-Add-StructureGenerateEvent.patch b/patches/server/0168-Add-StructureGenerateEvent.patch index 87cdd585a..90a1be64a 100644 --- a/patches/server/0168-Add-StructureGenerateEvent.patch +++ b/patches/server/0168-Add-StructureGenerateEvent.patch @@ -19,7 +19,7 @@ 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 097cb9896c525a605c50e83548f828e0c71ab3d5..8a0d01d2bab4a28aa3c075534bc70b6e835810ef 100644 +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/patches/server/0170-Movement-options-for-armour-stands.patch b/patches/server/0170-Movement-options-for-armour-stands.patch index ac34a3d82..46abe28af 100644 --- a/patches/server/0170-Movement-options-for-armour-stands.patch +++ b/patches/server/0170-Movement-options-for-armour-stands.patch @@ -17,10 +17,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/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b26a2b9b71f4a3a5b40612d5737500211fbefe15..31642841b2954dacdebed8d40f81381330fcfcab 100644 +index cb4856e3bbb25e1077f5b4832f359549d57acd7e..41844f30a2a98eb14559b3ab0885ae738b54520c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1369,7 +1369,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1360,7 +1360,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.isInWater() || flag; } diff --git a/patches/server/0171-Fix-stuck-in-portals.patch b/patches/server/0171-Fix-stuck-in-portals.patch index eef3c9371..f64f9eda7 100644 --- a/patches/server/0171-Fix-stuck-in-portals.patch +++ b/patches/server/0171-Fix-stuck-in-portals.patch @@ -5,10 +5,10 @@ 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 31642841b2954dacdebed8d40f81381330fcfcab..6861683cf060df4f173ffc01ebd9de70b8c92667 100644 +index 41844f30a2a98eb14559b3ab0885ae738b54520c..63eb29635957d4e6ce1274ee17a59af62d442d4e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2420,12 +2420,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2411,12 +2411,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return new Vec2F(this.pitch, this.yaw); }