From 98330439e8777124d6d11fc9812a941390af5982 Mon Sep 17 00:00:00 2001 From: Josh Roy Date: Tue, 23 Nov 2021 18:06:05 -0500 Subject: [PATCH] More more more more more more more more more work --- .../api/0150-Mob-Pathfinding-API.patch | 0 ...CanPlaceOn-and-CanDestroy-NBT-values.patch | 0 ...currency-Improvements-to-Permissions.patch | 0 ...-Add-ItemStackRecipeChoice-Draft-API.patch | 0 ...nt-furnace-cook-speed-multiplier-API.patch | 0 .../api/0155-Material-API-additions.patch | 0 .../0156-Add-Material-Tags.patch} | 2 +- .../0157-PreSpawnerSpawnEvent.patch} | 0 ...158-Add-LivingEntity-getTargetEntity.patch | 0 .../api/0159-Add-sun-related-API.patch | 2 +- .../api/0160-Here-s-Johnny.patch | 0 .../{unapplied => }/api/0161-Turtle-API.patch | 0 .../0162-Add-spectator-target-events.patch | 0 ...w-chests-to-be-placed-with-NBT-data.patch} | 8 +++--- .../0262-Mob-Pathfinding-API.patch} | 6 ++--- ...for-CanPlaceOn-and-CanDestroy-NBT-v.patch} | 4 +-- ...nt-chunk-loading-from-Fluid-Flowing.patch} | 17 ++++++------ ...nt-Mob-AI-Rules-from-Loading-Chunks.patch} | 2 +- ...ning-from-loading-generating-chunks.patch} | 8 +++--- ...t-furnace-cook-speed-multiplier-API.patch} | 10 +++---- ...rseException-in-Entity-and-TE-names.patch} | 10 +++---- .../0269-Honor-EntityAgeable.ageLock.patch} | 0 ...le-connection-throttle-kick-message.patch} | 0 .../0271-Hook-into-CB-plugin-rewrites.patch} | 4 +-- .../0272-PreSpawnerSpawnEvent.patch} | 4 +-- ...73-Add-LivingEntity-getTargetEntity.patch} | 8 +++--- .../0274-Add-sun-related-API.patch} | 4 +-- .../0275-Here-s-Johnny.patch} | 0 .../0276-Turtle-API.patch} | 26 +++++++------------ ...ator-target-events-and-improve-impl.patch} | 16 ++++++------ todo.txt | 1 + 31 files changed, 63 insertions(+), 69 deletions(-) rename patches/{unapplied => }/api/0150-Mob-Pathfinding-API.patch (100%) rename patches/{unapplied => }/api/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch (100%) rename patches/{unapplied => }/api/0152-Performance-Concurrency-Improvements-to-Permissions.patch (100%) rename patches/{unapplied => }/api/0153-Add-ItemStackRecipeChoice-Draft-API.patch (100%) rename patches/{unapplied => }/api/0154-Implement-furnace-cook-speed-multiplier-API.patch (100%) rename patches/{unapplied => }/api/0155-Material-API-additions.patch (100%) rename patches/{unapplied/api/0157-Add-Material-Tags.patch => api/0156-Add-Material-Tags.patch} (99%) rename patches/{unapplied/api/0156-PreSpawnerSpawnEvent.patch => api/0157-PreSpawnerSpawnEvent.patch} (100%) rename patches/{unapplied => }/api/0158-Add-LivingEntity-getTargetEntity.patch (100%) rename patches/{unapplied => }/api/0159-Add-sun-related-API.patch (94%) rename patches/{unapplied => }/api/0160-Here-s-Johnny.patch (100%) rename patches/{unapplied => }/api/0161-Turtle-API.patch (100%) rename patches/{unapplied => }/api/0162-Add-spectator-target-events.patch (100%) rename patches/{unapplied/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch => server/0261-Allow-chests-to-be-placed-with-NBT-data.patch} (83%) rename patches/{unapplied/server/0265-Mob-Pathfinding-API.patch => server/0262-Mob-Pathfinding-API.patch} (96%) rename patches/{unapplied/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch => server/0263-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch} (99%) rename patches/{unapplied/server/0266-Prevent-chunk-loading-from-Fluid-Flowing.patch => server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch} (86%) rename patches/{unapplied/server/0268-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch => server/0265-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch} (96%) rename patches/{unapplied/server/0269-Prevent-mob-spawning-from-loading-generating-chunks.patch => server/0266-Prevent-mob-spawning-from-loading-generating-chunks.patch} (86%) rename patches/{unapplied/server/0270-Implement-furnace-cook-speed-multiplier-API.patch => server/0267-Implement-furnace-cook-speed-multiplier-API.patch} (95%) rename patches/{unapplied/server/0271-Catch-JsonParseException-in-Entity-and-TE-names.patch => server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch} (93%) rename patches/{unapplied/server/0272-Honor-EntityAgeable.ageLock.patch => server/0269-Honor-EntityAgeable.ageLock.patch} (100%) rename patches/{unapplied/server/0273-Configurable-connection-throttle-kick-message.patch => server/0270-Configurable-connection-throttle-kick-message.patch} (100%) rename patches/{unapplied/server/0274-Hook-into-CB-plugin-rewrites.patch => server/0271-Hook-into-CB-plugin-rewrites.patch} (98%) rename patches/{unapplied/server/0292-PreSpawnerSpawnEvent.patch => server/0272-PreSpawnerSpawnEvent.patch} (91%) rename patches/{unapplied/server/0276-Add-LivingEntity-getTargetEntity.patch => server/0273-Add-LivingEntity-getTargetEntity.patch} (94%) rename patches/{unapplied/server/0275-Add-sun-related-API.patch => server/0274-Add-sun-related-API.patch} (87%) rename patches/{unapplied/server/0283-Here-s-Johnny.patch => server/0275-Here-s-Johnny.patch} (100%) rename patches/{unapplied/server/0277-Turtle-API.patch => server/0276-Turtle-API.patch} (76%) rename patches/{unapplied/server/0279-Call-player-spectator-target-events-and-improve-impl.patch => server/0277-Call-player-spectator-target-events-and-improve-impl.patch} (91%) diff --git a/patches/unapplied/api/0150-Mob-Pathfinding-API.patch b/patches/api/0150-Mob-Pathfinding-API.patch similarity index 100% rename from patches/unapplied/api/0150-Mob-Pathfinding-API.patch rename to patches/api/0150-Mob-Pathfinding-API.patch diff --git a/patches/unapplied/api/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/patches/api/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch similarity index 100% rename from patches/unapplied/api/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch rename to patches/api/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch diff --git a/patches/unapplied/api/0152-Performance-Concurrency-Improvements-to-Permissions.patch b/patches/api/0152-Performance-Concurrency-Improvements-to-Permissions.patch similarity index 100% rename from patches/unapplied/api/0152-Performance-Concurrency-Improvements-to-Permissions.patch rename to patches/api/0152-Performance-Concurrency-Improvements-to-Permissions.patch diff --git a/patches/unapplied/api/0153-Add-ItemStackRecipeChoice-Draft-API.patch b/patches/api/0153-Add-ItemStackRecipeChoice-Draft-API.patch similarity index 100% rename from patches/unapplied/api/0153-Add-ItemStackRecipeChoice-Draft-API.patch rename to patches/api/0153-Add-ItemStackRecipeChoice-Draft-API.patch diff --git a/patches/unapplied/api/0154-Implement-furnace-cook-speed-multiplier-API.patch b/patches/api/0154-Implement-furnace-cook-speed-multiplier-API.patch similarity index 100% rename from patches/unapplied/api/0154-Implement-furnace-cook-speed-multiplier-API.patch rename to patches/api/0154-Implement-furnace-cook-speed-multiplier-API.patch diff --git a/patches/unapplied/api/0155-Material-API-additions.patch b/patches/api/0155-Material-API-additions.patch similarity index 100% rename from patches/unapplied/api/0155-Material-API-additions.patch rename to patches/api/0155-Material-API-additions.patch diff --git a/patches/unapplied/api/0157-Add-Material-Tags.patch b/patches/api/0156-Add-Material-Tags.patch similarity index 99% rename from patches/unapplied/api/0157-Add-Material-Tags.patch rename to patches/api/0156-Add-Material-Tags.patch index cf8acd34f7..6bf9a73da7 100644 --- a/patches/unapplied/api/0157-Add-Material-Tags.patch +++ b/patches/api/0156-Add-Material-Tags.patch @@ -958,7 +958,7 @@ index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289 + .ensureSize("WATER_BASED", 11); +} diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java -index c86ac9f44c81ed86a157f0666b52e8a4d8e9304c..cbe233c67f97452f662bb49ec5778f7187bf3441 100644 +index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde9cff41a8 100644 --- a/src/main/java/org/bukkit/Tag.java +++ b/src/main/java/org/bukkit/Tag.java @@ -11,6 +11,10 @@ import org.jetbrains.annotations.NotNull; diff --git a/patches/unapplied/api/0156-PreSpawnerSpawnEvent.patch b/patches/api/0157-PreSpawnerSpawnEvent.patch similarity index 100% rename from patches/unapplied/api/0156-PreSpawnerSpawnEvent.patch rename to patches/api/0157-PreSpawnerSpawnEvent.patch diff --git a/patches/unapplied/api/0158-Add-LivingEntity-getTargetEntity.patch b/patches/api/0158-Add-LivingEntity-getTargetEntity.patch similarity index 100% rename from patches/unapplied/api/0158-Add-LivingEntity-getTargetEntity.patch rename to patches/api/0158-Add-LivingEntity-getTargetEntity.patch diff --git a/patches/unapplied/api/0159-Add-sun-related-API.patch b/patches/api/0159-Add-sun-related-API.patch similarity index 94% rename from patches/unapplied/api/0159-Add-sun-related-API.patch rename to patches/api/0159-Add-sun-related-API.patch index 7f3635a017..677e68f14b 100644 --- a/patches/unapplied/api/0159-Add-sun-related-API.patch +++ b/patches/api/0159-Add-sun-related-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index fff4d4083a0065655192cff4ed61f4e80a2e7f75..e4d3618afa8a022ae556febd23be76b5fe6dfe0e 100644 +index a0a4d0f143303bd449494ec1479db1e449836595..614c04c31c95e9a404b5caac3e07285ce2c58367 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -1789,6 +1789,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient diff --git a/patches/unapplied/api/0160-Here-s-Johnny.patch b/patches/api/0160-Here-s-Johnny.patch similarity index 100% rename from patches/unapplied/api/0160-Here-s-Johnny.patch rename to patches/api/0160-Here-s-Johnny.patch diff --git a/patches/unapplied/api/0161-Turtle-API.patch b/patches/api/0161-Turtle-API.patch similarity index 100% rename from patches/unapplied/api/0161-Turtle-API.patch rename to patches/api/0161-Turtle-API.patch diff --git a/patches/unapplied/api/0162-Add-spectator-target-events.patch b/patches/api/0162-Add-spectator-target-events.patch similarity index 100% rename from patches/unapplied/api/0162-Add-spectator-target-events.patch rename to patches/api/0162-Add-spectator-target-events.patch diff --git a/patches/unapplied/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch b/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch similarity index 83% rename from patches/unapplied/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch rename to patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch index c30af9bad4..2d75e11b9c 100644 --- a/patches/unapplied/server/0264-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/patches/server/0261-Allow-chests-to-be-placed-with-NBT-data.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow chests to be placed with NBT data diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 533f2fd1a7c63180385ef544cba2b1d29c00b481..c5683f76f6f11246dc5bbaa13dfc253e5e286590 100644 +index 6c82bb01db0431080425bfa65ab67ce703194214..9126aa0c988824ce89ffa724ae9895105184d0f1 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -338,6 +338,7 @@ public final class ItemStack { +@@ -339,6 +339,7 @@ public final class ItemStack { enuminteractionresult = InteractionResult.FAIL; // cancel placement // PAIL: Remove this when MC-99075 fixed placeEvent.getPlayer().updateInventory(); @@ -17,10 +17,10 @@ index 533f2fd1a7c63180385ef544cba2b1d29c00b481..c5683f76f6f11246dc5bbaa13dfc253e world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710 for (BlockState blockstate : blocks) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -index f2c9755c2b55bee2a0b981313e1fcd1f8ab5e3d8..52de9852f87d346714a950b60a0004d386ac10f0 100644 +index ff8e05038c1c2fa630f2d4efe460a313d209da8d..e56f7d76b501dab7d549efd2fafd514a9625c24e 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -@@ -239,7 +239,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement +@@ -238,7 +238,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement // CraftBukkit start @Override public boolean onlyOpCanSetNbt() { diff --git a/patches/unapplied/server/0265-Mob-Pathfinding-API.patch b/patches/server/0262-Mob-Pathfinding-API.patch similarity index 96% rename from patches/unapplied/server/0265-Mob-Pathfinding-API.patch rename to patches/server/0262-Mob-Pathfinding-API.patch index ebe42603c8..d39edfd5b8 100644 --- a/patches/unapplied/server/0265-Mob-Pathfinding-API.patch +++ b/patches/server/0262-Mob-Pathfinding-API.patch @@ -151,10 +151,10 @@ index 0000000000000000000000000000000000000000..8c9f0c6c38627beded373ca29f1989ae + } +} diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java -index 31d4431a60e742e2ca3b1a2abcce33954f599488..f4b6c2bf74884c0b53956788dcfcca784cfafca2 100644 +index 5f59b2bd26571d16e04f2b6a5ded8f8fb7c4e31e..bdc221f5b1eccff017c5eace11f4ea2540329f1d 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java -@@ -20,6 +20,7 @@ public class Path { +@@ -21,6 +21,7 @@ public class Path { private final BlockPos target; private final float distToTarget; private final boolean reached; @@ -163,7 +163,7 @@ index 31d4431a60e742e2ca3b1a2abcce33954f599488..f4b6c2bf74884c0b53956788dcfcca78 public Path(List nodes, BlockPos target, boolean reachesTarget) { this.nodes = nodes; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index ee84ae1baf959a496a4228edab89b9c0079bc615..140672d03dd2563d2b1fb905d79164ff53cf0b76 100644 +index 219bdf53a860628335efe92d4f294a5fa52087b2..b0d348061487110993b6c4c8a7dc7208f27361b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -12,8 +12,11 @@ import org.bukkit.loot.LootTable; diff --git a/patches/unapplied/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0263-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch similarity index 99% rename from patches/unapplied/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch rename to patches/server/0263-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 7f8d0e6dc2..297eb4c4cf 100644 --- a/patches/unapplied/server/0267-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/0263-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 71320d9484842be3a694117de25159f3581bd2a3..0aa7854119ab876f0e46bb7667282d79d2a57e3d 100644 +index ec26116dcaa2b1ba71498323d3b7624aad49dbbf..9d4685698ed707239b071a366eebbc4b8450683c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer; @@ -125,7 +125,7 @@ index 71320d9484842be3a694117de25159f3581bd2a3..0aa7854119ab876f0e46bb7667282d79 + String internal = SerializableMeta.getString(map, "internal", true); if (internal != null) { - ByteArrayInputStream buf = new ByteArrayInputStream(Base64.decodeBase64(internal)); + ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal)); @@ -647,6 +723,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasDamage()) { itemTag.putInt(DAMAGE.NBT, damage); diff --git a/patches/unapplied/server/0266-Prevent-chunk-loading-from-Fluid-Flowing.patch b/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 86% rename from patches/unapplied/server/0266-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch index 0a3719ca71..aa7b5e1b63 100644 --- a/patches/unapplied/server/0266-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/patches/server/0264-Prevent-chunk-loading-from-Fluid-Flowing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent chunk loading from Fluid Flowing diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f9cefd006 100644 +index 4be8fbe06ee97d5fe8f99d5d8137ac7302ffec91..18e24f400289fdfca0bf33ea0f93badeef3e46eb 100644 --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java -@@ -176,7 +176,8 @@ public abstract class FlowingFluid extends Fluid { +@@ -175,7 +175,8 @@ public abstract class FlowingFluid extends Fluid { Direction enumdirection = (Direction) entry.getKey(); FluidState fluid1 = (FluidState) entry.getValue(); BlockPos blockposition1 = pos.relative(enumdirection); @@ -18,21 +18,22 @@ index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f if (this.canSpreadTo(world, pos, blockState, enumdirection, blockposition1, iblockdata1, world.getFluidState(blockposition1), fluid1.getType())) { // CraftBukkit start -@@ -203,7 +204,8 @@ public abstract class FlowingFluid extends Fluid { +@@ -202,7 +203,9 @@ public abstract class FlowingFluid extends Fluid { while (iterator.hasNext()) { Direction enumdirection = (Direction) iterator.next(); BlockPos blockposition1 = pos.relative(enumdirection); - BlockState iblockdata1 = world.getBlockState(blockposition1); ++ + BlockState iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper + if (iblockdata1 == null) continue; // Paper FluidState fluid = iblockdata1.getFluidState(); - if (fluid.getType().isSame((Fluid) this) && this.canPassThroughWall(enumdirection, (BlockGetter) world, pos, state, blockposition1, iblockdata1)) { -@@ -320,11 +322,18 @@ public abstract class FlowingFluid extends Fluid { + if (fluid.getType().isSame(this) && this.canPassThroughWall(enumdirection, world, pos, state, blockposition1, iblockdata1)) { +@@ -319,11 +322,18 @@ public abstract class FlowingFluid extends Fluid { if (enumdirection1 != enumdirection) { BlockPos blockposition2 = blockposition.relative(enumdirection1); short short0 = FlowingFluid.getCacheKey(blockposition1, blockposition2); -- Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (k) -> { +- Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (short1) -> { - BlockState iblockdata1 = world.getBlockState(blockposition2); + // Paper start - avoid loading chunks + Pair pair = short2objectmap.get(short0); @@ -51,11 +52,11 @@ index 21e2ffc105b7b573b19c826a5877ed726156e692..6e3e873efa1f50f53cb6503bde8a981f BlockState iblockdata1 = (BlockState) pair.getFirst(); FluidState fluid = (FluidState) pair.getSecond(); -@@ -396,11 +405,16 @@ public abstract class FlowingFluid extends Fluid { +@@ -395,11 +405,16 @@ public abstract class FlowingFluid extends Fluid { Direction enumdirection = (Direction) iterator.next(); BlockPos blockposition1 = pos.relative(enumdirection); short short0 = FlowingFluid.getCacheKey(pos, blockposition1); -- Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (j) -> { +- Pair pair = (Pair) short2objectmap.computeIfAbsent(short0, (short1) -> { - BlockState iblockdata1 = world.getBlockState(blockposition1); - - return Pair.of(iblockdata1, iblockdata1.getFluidState()); diff --git a/patches/unapplied/server/0268-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/patches/server/0265-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 96% rename from patches/unapplied/server/0268-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to patches/server/0265-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 6165cd6338..346c8d326f 100644 --- a/patches/unapplied/server/0268-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/patches/server/0265-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -index b255eed15cfc7282167a9bed01653b34bb8d13f1..ac5779319081a6894373877067edf958da8a9cf5 100644 +index 4a67daa7ee7f8c0fcb37c2a0fdba158485343a1f..a618b50ac8448528ac6ac64b400fa3d0882dbaf9 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java @@ -133,7 +133,9 @@ public class RemoveBlockGoal extends MoveToBlockGoal { diff --git a/patches/unapplied/server/0269-Prevent-mob-spawning-from-loading-generating-chunks.patch b/patches/server/0266-Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 86% rename from patches/unapplied/server/0269-Prevent-mob-spawning-from-loading-generating-chunks.patch rename to patches/server/0266-Prevent-mob-spawning-from-loading-generating-chunks.patch index f2712fc3f5..8b7d91e3a7 100644 --- a/patches/unapplied/server/0269-Prevent-mob-spawning-from-loading-generating-chunks.patch +++ b/patches/server/0266-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks also prevents if out of world border bounds diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index ca0fcf46e67deb07a3fdb071b771a7603e0fc3d0..c8b9877135aebf1f500ab9b00d94dde0e846d247 100644 +index 831799937d4e1f31dbf7caaf0c6b38762ccec127..86cdb9ea888b85424285fc26534dc7a7ad3610ac 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -193,9 +193,9 @@ public final class NaturalSpawner { +@@ -196,9 +196,9 @@ public final class NaturalSpawner { StructureFeatureManager structuremanager = world.structureFeatureManager(); ChunkGenerator chunkgenerator = world.getChunkSource().getGenerator(); int i = pos.getY(); @@ -21,12 +21,12 @@ index ca0fcf46e67deb07a3fdb071b771a7603e0fc3d0..c8b9877135aebf1f500ab9b00d94dde0 BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); int j = 0; int k = 0; -@@ -224,7 +224,7 @@ public final class NaturalSpawner { +@@ -227,7 +227,7 @@ public final class NaturalSpawner { if (entityhuman != null) { double d2 = entityhuman.distanceToSqr(d0, (double) i, d1); - if (NaturalSpawner.isRightDistanceToPlayerAndSpawnPoint(world, chunk, blockposition_mutableblockposition, d2)) { + if (world.isLoadedAndInBounds(blockposition_mutableblockposition) && NaturalSpawner.isRightDistanceToPlayerAndSpawnPoint(world, chunk, blockposition_mutableblockposition, d2)) { // Paper - don't load chunks for mob spawn if (biomesettingsmobs_c == null) { - Optional optional = NaturalSpawner.getRandomSpawnMobAt(world, structuremanager, chunkgenerator, group, world.random, (BlockPos) blockposition_mutableblockposition); + Optional optional = NaturalSpawner.getRandomSpawnMobAt(world, structuremanager, chunkgenerator, group, world.random, blockposition_mutableblockposition); diff --git a/patches/unapplied/server/0270-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch similarity index 95% rename from patches/unapplied/server/0270-Implement-furnace-cook-speed-multiplier-API.patch rename to patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch index 9e195897f9..949411fc0a 100644 --- a/patches/unapplied/server/0270-Implement-furnace-cook-speed-multiplier-API.patch +++ b/patches/server/0267-Implement-furnace-cook-speed-multiplier-API.patch @@ -11,7 +11,7 @@ to the nearest Integer when updating its current cook time. Modified by: Eric Su diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0bec729273 100644 +index 6c33b524d81ccd8ed060c3a9067cb1b669c7660d..fd1fb954ef1eb2624939a5c5d0d2c258d3398ff2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java @@ -73,6 +73,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -42,7 +42,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b ContainerHelper.saveAllItems(nbt, this.items); CompoundTag nbttagcompound1 = new CompoundTag(); -@@ -346,7 +353,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -345,7 +352,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0)); CookingRecipe recipe = (CookingRecipe) irecipe.toBukkitRecipe(); @@ -51,7 +51,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b world.getCraftServer().getPluginManager().callEvent(event); blockEntity.cookingTotalTime = event.getTotalCookTime(); -@@ -354,9 +361,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -353,9 +360,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit // CraftBukkit end ++blockEntity.cookingProgress; @@ -63,7 +63,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, irecipe, blockEntity.items, i)) { // CraftBukkit blockEntity.setRecipeUsed(irecipe); } -@@ -456,9 +463,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -455,9 +462,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } } @@ -79,7 +79,7 @@ index 265fa3cb96b7d39194a7e83b8b77b811bc3e8b40..02ded982bc36ce6530c92e18a079dc0b public static boolean isFuel(ItemStack stack) { return AbstractFurnaceBlockEntity.getFuel().containsKey(stack.getItem()); -@@ -527,7 +538,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -526,7 +537,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } if (slot == 0 && !flag) { diff --git a/patches/unapplied/server/0271-Catch-JsonParseException-in-Entity-and-TE-names.patch b/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 93% rename from patches/unapplied/server/0271-Catch-JsonParseException-in-Entity-and-TE-names.patch rename to patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch index d23a3f4d1c..f026f7324c 100644 --- a/patches/unapplied/server/0271-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/patches/server/0268-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 1c09656bfed70ead0f0d182be4f84f1a97b3cf1e..f1135616657692a2611dde02e2dc5ac4d8127269 100644 +index 170b3cbc89793bb92e249383d86a5f0c756d5004..3b10ef3801ffd47707836b3ed3482e99ddd0050b 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -7,6 +7,8 @@ import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; @@ -69,7 +69,7 @@ index 04a3627667498b841fbff547d1874d99cc708af4..2e6172930526efc536a214e420e690a5 if (nbt.contains("TrackOutput", 1)) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java -index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c2699e4c79a 100644 +index 8854901b439cdeddc528e02fa5f8539869556a3c..c72ec5b38fe8a234eb31065dfa88698dfbb6c054 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BannerBlockEntity.java @@ -10,6 +10,7 @@ import net.minecraft.nbt.ListTag; @@ -78,9 +78,9 @@ index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c26 import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.server.MCUtil; import net.minecraft.world.Nameable; + import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.DyeColor; - import net.minecraft.world.item.ItemStack; -@@ -95,7 +96,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { +@@ -97,7 +98,7 @@ public class BannerBlockEntity extends BlockEntity implements Nameable { public void load(CompoundTag nbt) { super.load(nbt); if (nbt.contains("CustomName", 8)) { @@ -90,7 +90,7 @@ index e07c9e7e37a2c6aa3fc4b7fdc2d547d9c8a2177e..83f27ede626fc7e263acf2c9417a2c26 this.itemPatterns = nbt.getList("Patterns", 10); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java -index 16fd9b356fee79b56893fe0a7c71721ae81664ab..67e39ebc7984d47bdf9081c24cb26845d70b83bb 100644 +index cfd1e2fbc029d928daa2d9f12df393c8cf30e850..d9ed3c53187febbc6c835286d6db17b508dbf71a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java @@ -5,6 +5,7 @@ import net.minecraft.core.BlockPos; diff --git a/patches/unapplied/server/0272-Honor-EntityAgeable.ageLock.patch b/patches/server/0269-Honor-EntityAgeable.ageLock.patch similarity index 100% rename from patches/unapplied/server/0272-Honor-EntityAgeable.ageLock.patch rename to patches/server/0269-Honor-EntityAgeable.ageLock.patch diff --git a/patches/unapplied/server/0273-Configurable-connection-throttle-kick-message.patch b/patches/server/0270-Configurable-connection-throttle-kick-message.patch similarity index 100% rename from patches/unapplied/server/0273-Configurable-connection-throttle-kick-message.patch rename to patches/server/0270-Configurable-connection-throttle-kick-message.patch diff --git a/patches/unapplied/server/0274-Hook-into-CB-plugin-rewrites.patch b/patches/server/0271-Hook-into-CB-plugin-rewrites.patch similarity index 98% rename from patches/unapplied/server/0274-Hook-into-CB-plugin-rewrites.patch rename to patches/server/0271-Hook-into-CB-plugin-rewrites.patch index 3f5cb35595..a10bd7e5d0 100644 --- a/patches/unapplied/server/0274-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0271-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index a79c62e1c3ee49ada505c07b1171b439beeb4bdf..cbf630243410f97c21b14f654e81dc96b0323b70 100644 +index a679133a3de51e26eb19932ece9ade292879aefd..d5330d1dff2d02e585eba3ec7c48bf261cdce8ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -6,7 +6,9 @@ import java.io.FileOutputStream; @@ -167,7 +167,7 @@ index a79c62e1c3ee49ada505c07b1171b439beeb4bdf..cbf630243410f97c21b14f654e81dc96 if ( owner.equals( "org/bukkit/block/Biome" ) ) { switch ( name ) -@@ -273,6 +387,14 @@ public class Commodore +@@ -306,6 +420,14 @@ public class Commodore return; } diff --git a/patches/unapplied/server/0292-PreSpawnerSpawnEvent.patch b/patches/server/0272-PreSpawnerSpawnEvent.patch similarity index 91% rename from patches/unapplied/server/0292-PreSpawnerSpawnEvent.patch rename to patches/server/0272-PreSpawnerSpawnEvent.patch index ef07bb5353..10ccc104e1 100644 --- a/patches/unapplied/server/0292-PreSpawnerSpawnEvent.patch +++ b/patches/server/0272-PreSpawnerSpawnEvent.patch @@ -9,10 +9,10 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for spawners. diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 572328fafb2347886900352983fd5b6490b0dd68..8c266bd81b9350b056067d83415bf2b581e19c94 100644 +index ef0b18dba50916c4c717c2e6bd55a5e4d60f225f..36d1bdef298cecd84fdaa400f414f2798a9a49bb 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -139,11 +139,11 @@ public abstract class BaseSpawner { +@@ -128,11 +128,11 @@ public abstract class BaseSpawner { org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); if (type != null) { diff --git a/patches/unapplied/server/0276-Add-LivingEntity-getTargetEntity.patch b/patches/server/0273-Add-LivingEntity-getTargetEntity.patch similarity index 94% rename from patches/unapplied/server/0276-Add-LivingEntity-getTargetEntity.patch rename to patches/server/0273-Add-LivingEntity-getTargetEntity.patch index 8a49b6613e..5e6633ca02 100644 --- a/patches/unapplied/server/0276-Add-LivingEntity-getTargetEntity.patch +++ b/patches/server/0273-Add-LivingEntity-getTargetEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376df8f7bb3e 100644 +index d61375bdd0cff7dfd74dd5dc1e6803e6320aa82a..5d47b536e89f192b10aa1434cd9cdccc49cd3eec 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable; +@@ -113,6 +113,7 @@ import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.AABB; @@ -16,7 +16,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.PlayerTeam; -@@ -3736,6 +3737,38 @@ public abstract class LivingEntity extends Entity { +@@ -3735,6 +3736,38 @@ public abstract class LivingEntity extends Entity { return level.clip(raytrace); } @@ -56,7 +56,7 @@ index 1c35ba0d74aa02b0a94400308c20485ccaad7a13..a7aa62e52105b7adb7725f7abeae376d public int getShieldBlockingDelay() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 873b70c36d145a14632102c9e92d501745064fa4..c396ad36084e46c4b812d970e07a9188aed16daf 100644 +index 9c024b46522e2984ed662538302fbac68a77fd86..fb0e0c629d16bc97efc3e91f7ba6fe9e87fc950b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -1,5 +1,6 @@ diff --git a/patches/unapplied/server/0275-Add-sun-related-API.patch b/patches/server/0274-Add-sun-related-API.patch similarity index 87% rename from patches/unapplied/server/0275-Add-sun-related-API.patch rename to patches/server/0274-Add-sun-related-API.patch index e7fc1454cf..c9213fc75f 100644 --- a/patches/unapplied/server/0275-Add-sun-related-API.patch +++ b/patches/server/0274-Add-sun-related-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 034c2886b4e29be40fa2e5e213a7457d803c0f55..a6884bde5e6e717c5f37b0b96070b44f1253ce35 100644 +index 7f4024dbc1a0c50af9344689561de54eb35e1c98..8615d4abbf18ab105ca7edffa10e8122ef76add3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -664,6 +664,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -23,7 +23,7 @@ index 034c2886b4e29be40fa2e5e213a7457d803c0f55..a6884bde5e6e717c5f37b0b96070b44f public long getGameTime() { return world.levelData.getGameTime(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 140672d03dd2563d2b1fb905d79164ff53cf0b76..e0022ea4bf228eef8384f20cfc717076c5ca5c99 100644 +index b0d348061487110993b6c4c8a7dc7208f27361b3..d7bc601f2cb4e22565eeebb2d8ebe051748de92a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -80,4 +80,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/patches/unapplied/server/0283-Here-s-Johnny.patch b/patches/server/0275-Here-s-Johnny.patch similarity index 100% rename from patches/unapplied/server/0283-Here-s-Johnny.patch rename to patches/server/0275-Here-s-Johnny.patch diff --git a/patches/unapplied/server/0277-Turtle-API.patch b/patches/server/0276-Turtle-API.patch similarity index 76% rename from patches/unapplied/server/0277-Turtle-API.patch rename to patches/server/0276-Turtle-API.patch index ebd098adad..75d7b88e5d 100644 --- a/patches/unapplied/server/0277-Turtle-API.patch +++ b/patches/server/0276-Turtle-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java -index 70a51ba19fb34f652858b18f24554261787d97e2..27ea9c10b7f66c2133b0829c0b1c37143dd80b56 100644 +index dabdce6332c267c3b82698010e284b34dcc0c083..8d8cce87acc5a93afb4b8925a5a5dbf71d371fcd 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java @@ -14,7 +14,7 @@ public abstract class MoveToBlockGoal extends Goal { @@ -18,31 +18,23 @@ index 70a51ba19fb34f652858b18f24554261787d97e2..27ea9c10b7f66c2133b0829c0b1c3714 private final int searchRange; private final int verticalSearchRange; diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 3ba8fafcd5de584209dd30cadb8e76a46dac4bc8..00dbe5046c3b93e402218a6903ea2f087410388b 100644 +index 44679e3b44b03dc20b3763af84df655d81680c06..60e1111f3c2c43398f21c541248f38524f41f4fb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundTag; - import net.minecraft.network.syncher.EntityDataAccessor; - import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; -+import net.minecraft.server.MCUtil; - import net.minecraft.server.level.ServerLevel; - import net.minecraft.server.level.ServerPlayer; - import net.minecraft.sounds.SoundEvent; -@@ -487,14 +488,17 @@ public class Turtle extends Animal { +@@ -484,14 +484,17 @@ public class Turtle extends Animal { if (!this.turtle.isInWater() && this.isReachedTarget()) { if (this.turtle.layEggCounter < 1) { - this.turtle.setLayingEgg(true); -+ this.turtle.setLayingEgg(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), MCUtil.toLocation(this.turtle.level, this.getTargetPosition())).callEvent()); // Paper - } else if (this.turtle.layEggCounter > 200) { ++ this.turtle.setLayingEgg(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), net.minecraft.server.MCUtil.toLocation(this.turtle.level, this.getTargetPosition())).callEvent()); // Paper + } else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) { Level world = this.turtle.level; // CraftBukkit start - if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1)).isCancelled()) { + // Paper start + int eggCount = this.turtle.random.nextInt(4) + 1; -+ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), MCUtil.toLocation(this.turtle.level, this.blockPos.above()), eggCount); ++ com.destroystokyo.paper.event.entity.TurtleLayEggEvent layEggEvent = new com.destroystokyo.paper.event.entity.TurtleLayEggEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity(), net.minecraft.server.MCUtil.toLocation(this.turtle.level, this.blockPos.above()), eggCount); + if (layEggEvent.callEvent() && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, layEggEvent.getEggCount())).isCancelled()) { world.playSound((Player) null, blockposition, SoundEvents.TURTLE_LAY_EGG, SoundSource.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F); - world.setBlock(this.blockPos.above(), (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1), 3); @@ -50,12 +42,12 @@ index 3ba8fafcd5de584209dd30cadb8e76a46dac4bc8..00dbe5046c3b93e402218a6903ea2f08 } // CraftBukkit end this.turtle.setHasEgg(false); -@@ -562,7 +566,7 @@ public class Turtle extends Animal { +@@ -559,7 +562,7 @@ public class Turtle extends Animal { @Override public boolean canUse() { -- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(700) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))); -+ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(700) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper +- return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))); ++ return this.turtle.isBaby() ? false : (this.turtle.hasEgg() ? true : (this.turtle.getRandom().nextInt(reducedTickDelay(700)) != 0 ? false : !this.turtle.getHomePos().closerThan((Position) this.turtle.position(), 64.0D))) && new com.destroystokyo.paper.event.entity.TurtleGoHomeEvent((org.bukkit.entity.Turtle) this.turtle.getBukkitEntity()).callEvent(); // Paper } @Override diff --git a/patches/unapplied/server/0279-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0277-Call-player-spectator-target-events-and-improve-impl.patch similarity index 91% rename from patches/unapplied/server/0279-Call-player-spectator-target-events-and-improve-impl.patch rename to patches/server/0277-Call-player-spectator-target-events-and-improve-impl.patch index 982fcef989..e4a7c69c89 100644 --- a/patches/unapplied/server/0279-Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/0277-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,24 +19,24 @@ spectate the target entity. Co-authored-by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4cfbb920abad262d42553270455f0cd09dbdcb1a..c4f433832dc439830fc1584d36a197066fdb3e75 100644 +index a2e2b6ea166bf64fe5b49672a6c6f86af3776638..4a8afc06f58bb608055a0fabc587bf06a7110232 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1823,14 +1823,58 @@ public class ServerPlayer extends Player { +@@ -1850,14 +1850,58 @@ public class ServerPlayer extends Player { } - public void setCamera(Entity entity) { + public void setCamera(@Nullable Entity entity) { + // Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event and improve implementation Entity entity1 = this.getCamera(); - this.camera = (Entity) (entity == null ? this : entity); - if (entity1 != this.camera) { - this.connection.send(new ClientboundSetCameraPacket(this.camera)); -- this.connection.b(this.camera.getX(), this.camera.getY(), this.camera.getZ(), this.getYRot(), this.getXRot(), TeleportCause.SPECTATE); // CraftBukkit +- this.connection.teleport(this.camera.getX(), this.camera.getY(), this.camera.getZ(), this.getYRot(), this.getXRot(), TeleportCause.SPECTATE); // CraftBukkit + if (entity == null) { + entity = this; - } - ++ } ++ + if (entity1 == entity) return; // new spec target is the current spec target + + if (entity == this) { @@ -63,8 +63,8 @@ index 4cfbb920abad262d42553270455f0cd09dbdcb1a..c4f433832dc439830fc1584d36a19706 + MinecraftServer.LOGGER.debug("Blocking frozen player " + this + " from spectating entity " + entity); + return; + } -+ } -+ + } + + this.camera = entity; // only set after validating state + + if (entity != this) { diff --git a/todo.txt b/todo.txt index 25f9921a9a..0d8e21029d 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ Add Timings to LevelTicks and EntityTickList Check IBlockDataList#GLOBAL_PALETTE Check if PlayerNaturallySpawnedEvent is called correctly +Make sure fluids aren't completly fucked, there may be more sync loads to nuke there as well