diff --git a/patches/api-unmapped/Add-additional-open-container-api-to-HumanEntity.patch b/patches/api/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/api-unmapped/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/api/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/api-unmapped/Entity-isTicking.patch b/patches/api/Entity-isTicking.patch similarity index 100% rename from patches/api-unmapped/Entity-isTicking.patch rename to patches/api/Entity-isTicking.patch diff --git a/patches/api-unmapped/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 100% rename from patches/api-unmapped/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch diff --git a/patches/server-remapped/Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server-remapped/Fix-Not-a-string-Map-Conversion-spam.patch deleted file mode 100644 index 29957a8aec..0000000000 --- a/patches/server-remapped/Fix-Not-a-string-Map-Conversion-spam.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 8 Oct 2020 00:00:25 -0400 -Subject: [PATCH] Fix "Not a string" Map Conversion spam - -The maps did convert successfully, but had noisy logs due to Spigot -implementing this logic incorrectly. - -This stops the spam by converting the old format to new before -requesting the world. - -diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPos; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.ListTag; - import net.minecraft.nbt.NbtOps; -+import net.minecraft.nbt.NumericTag; -+import net.minecraft.nbt.StringTag; - import net.minecraft.nbt.Tag; - import net.minecraft.network.chat.Component; - import net.minecraft.network.protocol.Packet; -@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData { - - @Override - public void load(CompoundTag tag) { -- DataResult> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, tag.get("dimension"))); // CraftBukkit - decompile error -+ // Paper start - fix "Not a string" spam -+ Tag dimension = tag.get("dimension"); -+ if (dimension instanceof NumericTag && ((NumericTag) dimension).getAsInt() >= CraftWorld.CUSTOM_DIMENSION_OFFSET) { -+ long least = tag.getLong("UUIDLeast"); -+ long most = tag.getLong("UUIDMost"); -+ -+ if (least != 0L && most != 0L) { -+ this.uniqueId = new UUID(most, least); -+ CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId); -+ if (world != null) { -+ dimension = StringTag.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH)); -+ } else { -+ dimension = StringTag.create("bukkit:_invalidworld_"); -+ } -+ } else { -+ dimension = StringTag.create("bukkit:_invalidworld_"); -+ } -+ } -+ DataResult> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, dimension)); // CraftBukkit - decompile error -+ // Paper end - fix "Not a string" spam - Logger logger = MapItemSavedData.LOGGER; - - logger.getClass(); diff --git a/patches/server/Add-a-way-to-get-translation-keys-for-blocks-entitie.patch b/patches/server/Add-a-way-to-get-translation-keys-for-blocks-entitie.patch index 8a01b2d174..dd0d9db276 100644 --- a/patches/server/Add-a-way-to-get-translation-keys-for-blocks-entitie.patch +++ b/patches/server/Add-a-way-to-get-translation-keys-for-blocks-entitie.patch @@ -17,14 +17,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static Optional> byString(String id) { return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id)); } -@@ -0,0 +0,0 @@ public class EntityType implements EntityTypeTest { - return this.category; - } - -+ public String getDescriptionId() { return getDescriptionId(); } // Paper - OBFHELPER - public String getDescriptionId() { - if (this.descriptionId == null) { - this.descriptionId = Util.makeDescriptionId("entity", Registry.ENTITY_TYPE.getKey(this)); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/patches/server-remapped/Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch similarity index 97% rename from patches/server-remapped/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/Add-additional-open-container-api-to-HumanEntity.patch index 408fbd3023..c35cfeb1d7 100644 --- a/patches/server-remapped/Add-additional-open-container-api-to-HumanEntity.patch +++ b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch @@ -78,4 +78,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override public void closeInventory() { - // Paper start + this.getHandle().closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLUGIN); diff --git a/patches/server/Add-entity-liquid-API.patch b/patches/server/Add-entity-liquid-API.patch index e4a09662bc..62e0b362c3 100644 --- a/patches/server/Add-entity-liquid-API.patch +++ b/patches/server/Add-entity-liquid-API.patch @@ -19,26 +19,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.level.isRainingAt(blockposition) || this.level.isRainingAt(new BlockPos((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ())); } -+ public final boolean isInBubbleColumn() { return isInBubbleColumn(); } // Paper - OBFHELPER - private boolean isInBubbleColumn() { +- private boolean isInBubbleColumn() { ++ public boolean isInBubbleColumn() { // Paper - make public return this.level.getBlockState(this.blockPosition()).is(Blocks.BUBBLE_COLUMN); } + @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n + return this.isInWater() || this.isInRain(); + } + +- public final boolean isInWaterOrRainOrBubble() { return isInWaterRainOrBubble(); } // Paper - OBFHELPER + public boolean isInWaterRainOrBubble() { return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } - -+ public final boolean isInWaterOrBubbleColumn() { return isInWaterOrBubble(); } // Paper - OBFHELPER - public boolean isInWaterOrBubble() { - return this.isInWater() || this.isInBubbleColumn(); - } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n - return this.fluidOnEyes == fluidTag; - } - -+ public final boolean isInLava() { return isInLava(); } // Paper - OBFHELPER - public boolean isInLava() { - return !this.firstTick && this.fluidHeight.getDouble(FluidTags.LAVA) > 0.0D; - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -61,11 +54,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + public boolean isInWaterOrBubbleColumn() { -+ return getHandle().isInWaterOrBubbleColumn(); ++ return getHandle().isInWaterOrBubble(); + } + + public boolean isInWaterOrRainOrBubbleColumn() { -+ return getHandle().isInWaterOrRainOrBubble(); ++ return getHandle().isInWaterRainOrBubble(); + } + + public boolean isInLava() { diff --git a/patches/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch index 0b853fe9ad..3cdd4b5a70 100644 --- a/patches/server/Add-more-Evoker-API.patch +++ b/patches/server/Add-more-Evoker-API.patch @@ -4,6 +4,25 @@ Date: Sun, 23 Aug 2020 15:28:35 +0200 Subject: [PATCH] Add more Evoker API +diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java +@@ -0,0 +0,0 @@ public class Evoker extends SpellcasterIllager { + return SoundEvents.EVOKER_HURT; + } + +- void setWololoTarget(@Nullable Sheep sheep) { ++ public void setWololoTarget(@Nullable Sheep sheep) { // Paper - make public + this.wololoTarget = sheep; + } + + @Nullable +- Sheep getWololoTarget() { ++ public Sheep getWololoTarget() { // Paper - make public + return this.wololoTarget; + } + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java diff --git a/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch index 0296b992f5..380be09acb 100644 --- a/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch @@ -19,17 +19,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + CraftChunkData data = (CraftChunkData) createChunkData(world); + // do bunch of vanilla shit + net.minecraft.server.level.ServerLevel nmsWorld = ((CraftWorld) world).getHandle(); -+ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), net.minecraft.world.level.chunk.UpgradeData.getEmptyConverter(), nmsWorld); ++ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), null, nmsWorld); + List list = new ArrayList<>(); + list.add(protoChunk); -+ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list); ++ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list, net.minecraft.world.level.chunk.ChunkStatus.EMPTY, -1); + // call vanilla generator, one feature after another. Order here is important! + net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator = nmsWorld.getChunkSource().generator; + if (chunkGenerator instanceof org.bukkit.craftbukkit.generator.CustomChunkGenerator) { + chunkGenerator = ((org.bukkit.craftbukkit.generator.CustomChunkGenerator) chunkGenerator).delegate; + } + chunkGenerator.createBiomes(nmsWorld.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), protoChunk); -+ chunkGenerator.fillFromNoise(genRegion, nmsWorld.structureFeatureManager(), protoChunk); ++ chunkGenerator.fillFromNoise((runnable) -> {}, nmsWorld.structureFeatureManager(), protoChunk); + chunkGenerator.buildSurfaceAndBedrock(genRegion, protoChunk); + // copy over generated sections + data.setRawChunkData(protoChunk.getSections()); diff --git a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 08ac598f9b..83cf3e986d 100644 --- a/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (goalFloat.validConditions()) goalFloat.update(); + this.getJumpControl().jumpIfSet(); + } -+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterOrRainOrBubble()) { ++ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) { + hurt(DamageSource.DROWN, 1.0F); + } + return; diff --git a/patches/server-remapped/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/server-remapped/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/server-remapped/Cache-block-data-strings.patch b/patches/server/Cache-block-data-strings.patch similarity index 96% rename from patches/server-remapped/Cache-block-data-strings.patch rename to patches/server/Cache-block-data-strings.patch index 990a33c854..e3d873f60b 100644 --- a/patches/server-remapped/Cache-block-data-strings.patch +++ b/patches/server/Cache-block-data-strings.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; @@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData { - Preconditions.checkState(MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); + Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); } + // Paper start - cache block data strings diff --git a/patches/server-remapped/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch similarity index 97% rename from patches/server-remapped/Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/Create-HoverEvent-from-ItemStack-Entity.patch index e28d2a2da0..bcf162d1b9 100644 --- a/patches/server-remapped/Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { - return nms != null ? net.minecraft.locale.Language.getInstance().translateKey(nms.getItem().getDescriptionId()) : null; + return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId()) : null; } + + @Override diff --git a/patches/server-remapped/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch b/patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch similarity index 94% rename from patches/server-remapped/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch rename to patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch index 774d6539d7..1f63371dbb 100644 --- a/patches/server-remapped/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch +++ b/patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ChunkHolder { } - public void blockChanged(BlockPos blockposition) { + public void blockChanged(BlockPos pos) { + if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance diff --git a/patches/server-remapped/Entity-isTicking.patch b/patches/server/Entity-isTicking.patch similarity index 92% rename from patches/server-remapped/Entity-isTicking.patch rename to patches/server/Entity-isTicking.patch index 74b05b0ee3..e50aca08e0 100644 --- a/patches/server-remapped/Entity-isTicking.patch +++ b/patches/server/Entity-isTicking.patch @@ -8,15 +8,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ import net.minecraft.resources.ResourceLocation; +@@ -0,0 +0,0 @@ import net.minecraft.resources.ResourceKey; + import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MCUtil; import net.minecraft.server.MinecraftServer; - import net.minecraft.server.level.ChunkMap; +import net.minecraft.server.level.ServerChunkCache; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.TicketType; -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } diff --git a/patches/server-remapped/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 98% rename from patches/server-remapped/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index d9b9a3fc88..72a796cd5f 100644 --- a/patches/server-remapped/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n void accept(Entity entity, double x, double y, double z); } diff --git a/patches/server-remapped/Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 81% rename from patches/server-remapped/Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch index cc4ff92983..214699470c 100644 --- a/patches/server-remapped/Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch @@ -9,21 +9,13 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -0,0 +0,0 @@ import net.minecraft.world.entity.ai.village.poi.PoiType; - import net.minecraft.world.entity.animal.horse.SkeletonHorse; - import net.minecraft.world.entity.boss.EnderDragonPart; - import net.minecraft.world.entity.boss.enderdragon.EnderDragon; -+import net.minecraft.world.entity.item.ItemEntity; - import net.minecraft.world.entity.monster.Drowned; - import net.minecraft.world.entity.player.Player; - import net.minecraft.world.entity.raid.Raid; @@ -0,0 +0,0 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl - } else if (this.isUUIDUsed(entity)) { + // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit return false; } else { + // Paper start - capture all item additions to the world -+ if (captureDrops != null && entity instanceof ItemEntity) { -+ captureDrops.add((ItemEntity) entity); ++ if (captureDrops != null && entity instanceof net.minecraft.world.entity.item.ItemEntity) { ++ captureDrops.add((net.minecraft.world.entity.item.ItemEntity) entity); + return true; + } + // Paper end diff --git a/patches/server-remapped/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 78% rename from patches/server-remapped/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index de2c7c57fd..c4ee2d8add 100644 --- a/patches/server-remapped/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -12,29 +12,29 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit -- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot); -+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot); // Paper - use proper setPositionRotation for teleportation +- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); ++ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper setPositionRotation for teleportation this.lastGoodX = this.awaitingPositionFromClient.x; this.lastGoodY = this.awaitingPositionFromClient.y; this.lastGoodZ = this.awaitingPositionFromClient.z; -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener { +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit end this.awaitingTeleportTime = this.tickCount; - this.player.absMoveTo(d0, d1, d2, f, f1); + this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation - this.player.forceCheckHighPriority(); // Paper - this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport)); + this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag)); } + diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n // CraftBukkit start private static final int CURRENT_LEVEL = 2; @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 static boolean isLevelAtLeast(CompoundTag tag, int level) { return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } public void moveTo(double x, double y, double z, float yaw, float pitch) { @@ -53,21 +53,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.preserveMotion = false; + } + // Paper end - this.setPosAndOldPos(x, y, z); - this.yRot = yaw; - this.xRot = pitch; + this.setPosRaw(x, y, z); + this.setYRot(yaw); + this.setXRot(pitch); diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { - return; - } + return; + } -+ entity.preserveMotion = true; // Paper - preserve entity motion from tag - entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F); - if (entity instanceof Mob) { - Mob entityinsentient = (Mob) entity; ++ entity.preserveMotion = true; // Paper - preserve entity motion from tag + entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F); + if (entity instanceof Mob) { + Mob entityinsentient = (Mob) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -76,8 +76,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // entity.setLocation() throws no event, and so cannot be cancelled -- entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); +- this.entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); + entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting // SPIGOT-619: Force sync head rotation also - entity.setYHeadRot(location.getYaw()); - ((net.minecraft.server.level.ServerLevel) entity.level).updateChunkPos(entity); // Spigot - register to new chunk + this.entity.setYHeadRot(location.getYaw()); + diff --git a/patches/server/Fix-MC-187716-Use-configured-height.patch b/patches/server/Fix-MC-187716-Use-configured-height.patch index 66cf98960f..bae9244160 100644 --- a/patches/server/Fix-MC-187716-Use-configured-height.patch +++ b/patches/server/Fix-MC-187716-Use-configured-height.patch @@ -8,12 +8,6 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/Ne index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java +++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java -@@ -0,0 +0,0 @@ - package net.minecraft.world.level.levelgen.surfacebuilders; -+<<<<<<< found - - import com.google.common.collect.ImmutableList; - import com.google.common.collect.ImmutableMap; @@ -0,0 +0,0 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder