diff --git a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch index f59cc5e55a..36703d12b5 100644 --- a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -17,14 +17,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return getEnchantmentLevel(Enchantments.CHANNELING, itemstack) > 0; } -+ // Paper - OBFHELPER -+ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { -+ Entry entry = b(enchantment, entityliving); -+ return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; -+ } - @Nullable - public static Entry b(Enchantment enchantment, EntityLiving entityliving) { +- @Nullable +- public static Entry b(Enchantment enchantment, EntityLiving entityliving) { ++ public static @javax.annotation.Nonnull ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { Entry entry = b(enchantment, entityliving); return entry != null ? entry.getValue() : ItemStack.NULL_ITEM; } // Paper - OBFHELPER ++ @Nullable public static Entry b(Enchantment enchantment, EntityLiving entityliving) { return a(enchantment, entityliving, (itemstack) -> { + return true; + }); diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -33,12 +32,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -+ public int durToXp(int i) { return b(i); } // Paper OBFHELPER ++ public final int durToXp(int i) { return b(i); } // Paper OBFHELPER private int b(int i) { return i / 2; } -+ public int xpToDur(int i) { return c(i); } // Paper OBFHELPER ++ public final int xpToDur(int i) { return c(i); } // Paper OBFHELPER private int c(int i) { return i * 2; } diff --git a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch index 005f87cf20..f2be10dba4 100644 --- a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + MinecraftKey key = e.getMinecraftKey(); MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); - ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Entity.java diff --git a/Spigot-Server-Patches/Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-Server-Patches/Add-PlayerAttackEntityCooldownResetEvent.patch index 436e2e8ff6..b9ce035409 100644 --- a/Spigot-Server-Patches/Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerAttackEntityCooldownResetEvent.patch @@ -16,11 +16,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - PlayerAttackEntityCooldownResetEvent + if (damagesource.getEntity() instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) damagesource.getEntity(); -+ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getCooledAttackStrength(0F)).callEvent()) { -+ player.resetCooldown(); ++ if (new com.destroystokyo.paper.event.player.PlayerAttackEntityCooldownResetEvent(player.getBukkitEntity(), this.getBukkitEntity(), player.getAttackCooldown(0F)).callEvent()) { ++ player.resetAttackCooldown(); + } + } else { -+ ((EntityHuman) damagesource.getEntity()).resetCooldown(); ++ ((EntityHuman) damagesource.getEntity()).resetAttackCooldown(); + } + // Paper end } diff --git a/Spigot-Server-Patches/Add-PrepareResultEvent.patch b/Spigot-Server-Patches/Add-PrepareResultEvent.patch index 72274781ac..70f8c1fc68 100644 --- a/Spigot-Server-Patches/Add-PrepareResultEvent.patch +++ b/Spigot-Server-Patches/Add-PrepareResultEvent.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return nonnulllist; } -+ public void notifyListeners() { this.c(); } // Paper - OBFHELPER ++ public final void notifyListeners() { this.c(); } // Paper - OBFHELPER public void c() { int i; diff --git a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch index b24092e868..c88c8b5a73 100644 --- a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch @@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } + -+ this.networkManager.setSpoofedRemoteAddress(new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), ((java.net.InetSocketAddress) this.networkManager.getSocketAddress()).getPort())); ++ this.networkManager.socketAddress = new java.net.InetSocketAddress(com.destroystokyo.paper.proxy.VelocityProxy.readAddress(buf), ((java.net.InetSocketAddress) this.networkManager.getSocketAddress()).getPort()); + + this.setGameProfile(com.destroystokyo.paper.proxy.VelocityProxy.createProfile(buf)); + @@ -213,19 +213,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.disconnect(new ChatMessage("multiplayer.disconnect.unexpected_query_response")); } -diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/NetworkManager.java -+++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { - private final EnumProtocolDirection h; - private final Queue packetQueue = Queues.newConcurrentLinkedQueue(); - public Channel channel; -- public SocketAddress socketAddress; -+ public SocketAddress socketAddress; public void setSpoofedRemoteAddress(SocketAddress address) { this.socketAddress = address; } // Paper - OBFHELPER - // Spigot Start - public java.util.UUID spoofedUUID; - public com.mojang.authlib.properties.Property[] spoofedProfile; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java diff --git a/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch index db52112c64..5a3fcba1ad 100644 --- a/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch @@ -23,11 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -0,0 +0,0 @@ public class EnderDragonBattle { - private int h; - private int i; - private int j; -- private boolean dragonKilled; -+ private boolean dragonKilled; private void setDragonKilled(boolean dragonKilled) { this.dragonKilled = dragonKilled; } // Paper - OBFHELPER + private boolean dragonKilled; private boolean previouslyKilled; public UUID dragonUUID; - private boolean n; @@ -41,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.n = true; + // Paper start + setScanForLegacyFight(worldserver.paperConfig.scanForLegacyEnderDragon); -+ if (!scanForLegacyFight()) setDragonKilled(true); ++ if (!scanForLegacyFight()) dragonKilled = true; + // Paper end this.world = worldserver; if (nbttagcompound.hasKeyOfType("DragonKilled", 99)) { diff --git a/Spigot-Server-Patches/Add-entity-liquid-API.patch b/Spigot-Server-Patches/Add-entity-liquid-API.patch index 16adb9c093..2d81e3d85e 100644 --- a/Spigot-Server-Patches/Add-entity-liquid-API.patch +++ b/Spigot-Server-Patches/Add-entity-liquid-API.patch @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, (double) this.size.height, 0.0D)); } -+ public boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER ++ public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER private boolean k() { return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN); } @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.isInWater() || this.isInRain() || this.k(); } -+ public boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER ++ public final boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER public boolean aD() { return this.isInWater() || this.k(); } @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.inLava = true; } -+ public boolean isInLava() { return aN(); } // Paper - OBFHELPER ++ public final boolean isInLava() { return aN(); } // Paper - OBFHELPER public boolean aN() { return this.inLava; } diff --git a/Spigot-Server-Patches/Add-more-Zombie-API.patch b/Spigot-Server-Patches/Add-more-Zombie-API.patch index 2b4eadb144..c9676b3ae5 100644 --- a/Spigot-Server-Patches/Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/Add-more-Zombie-API.patch @@ -4,19 +4,6 @@ Date: Sun, 7 Oct 2018 04:29:59 -0500 Subject: [PATCH] Add more Zombie API -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { - this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3)); - } - -+ public boolean isArmsRaisedZombie() { return (this.datawatcher.get(EntityInsentient.b) & 4) != 0; } // Paper - OBFHELPER -+ public void setArmsRaisedZombie(boolean flag) { this.setAggressive(flag); } // Paper - OBFHELPER - public void setAggressive(boolean flag) { - byte b0 = (Byte) this.datawatcher.get(EntityInsentient.b); - diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java @@ -29,14 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public EntityZombie(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { - this.getDataWatcher().register(EntityZombie.DROWN_CONVERTING, false); - } - -+ public boolean isDrowning() { return isDrownConverting(); } // Paper - OBFHELPER - public boolean isDrownConverting() { - return (Boolean) this.getDataWatcher().get(EntityZombie.DROWN_CONVERTING); - } @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); } @@ -103,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + @Override + public boolean isDrowning() { -+ return getHandle().isDrowning(); ++ return getHandle().isDrownConverting(); + } + + @Override @@ -123,12 +102,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public boolean isArmsRaised() { -+ return getHandle().isArmsRaisedZombie(); ++ return getHandle().isAggressive(); + } + + @Override + public void setArmsRaised(final boolean raised) { -+ getHandle().setArmsRaisedZombie(raised); ++ getHandle().setAggressive(raised); + } + + @Override diff --git a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index a1a2c91eb2..cb53ca32ab 100644 --- a/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/Spigot-Server-Patches/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.a = true; } -+ public void jumpIfSet() { this.b(); } // Paper - OBFHELPER ++ public final void jumpIfSet() { this.b(); } // Paper - OBFHELPER public void b() { this.b.setJumping(this.a); this.a = false; @@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.isInWater() || this.isInRain(); } -+ public boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER ++ public final boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER public boolean aC() { return this.isInWater() || this.isInRain() || this.k(); } diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index facbe05cd0..87a08d0381 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1068,9 +1068,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - public void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // Paper - OBFHELPER - public void b(PacketDataSerializer packetdataserializer) { + // Paper start - Anti-Xray - Add chunk packet info -+ @Deprecated public void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // OBFHELPER // Notice for updates: Please make sure this method isn't used anywhere -+ @Deprecated public void b(PacketDataSerializer packetdataserializer) { this.writeChunkSection(packetdataserializer, null); } // Notice for updates: Please make sure this method isn't used anywhere -+ public void writeChunkSection(PacketDataSerializer packetDataSerializer, ChunkPacketInfo chunkPacketInfo) { this.b(packetDataSerializer, chunkPacketInfo); } // OBFHELPER ++ @Deprecated public final void writeChunkSection(PacketDataSerializer packetDataSerializer) { this.b(packetDataSerializer); } // OBFHELPER // Notice for updates: Please make sure this method isn't used anywhere ++ @Deprecated public final void b(PacketDataSerializer packetdataserializer) { this.writeChunkSection(packetdataserializer, null); } // Notice for updates: Please make sure this method isn't used anywhere ++ public final void writeChunkSection(PacketDataSerializer packetDataSerializer, ChunkPacketInfo chunkPacketInfo) { this.b(packetDataSerializer, chunkPacketInfo); } // OBFHELPER + public void b(PacketDataSerializer packetdataserializer, ChunkPacketInfo chunkPacketInfo) { + // Paper end packetdataserializer.writeShort(this.nonEmptyBlockCount); @@ -1096,7 +1096,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final Function f; private final T g; + private final T[] predefinedObjects; // Paper - Anti-Xray - Add predefined objects - protected DataBits a; protected DataBits getDataBits() { return this.a; } // Paper - OBFHELPER + protected DataBits a; public final DataBits getDataBits() { return this.a; } // Paper - OBFHELPER private DataPalette h; private DataPalette getDataPalette() { return this.h; } // Paper - OBFHELPER private int i; private int getBitsPerObject() { return this.i; } // Paper - OBFHELPER @@ -0,0 +0,0 @@ public class DataPaletteBlock implements DataPaletteExpandable { diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch index 575769171b..b8457cb5c4 100644 --- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch @@ -2771,15 +2771,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.t = chunkstatus == null ? 0 : chunkstatus.c() + 1; } -+ public int getStatusIndex() { return c(); } // Paper - OBFHELPER ++ public final int getStatusIndex() { return c(); } // Paper - OBFHELPER public int c() { return this.t; } +@@ -0,0 +0,0 @@ public class ChunkStatus { + return this.s; + } + +- public ChunkStatus getPreviousStatus() { return this.e(); } // Paper - OBFHELPER ++ public final ChunkStatus getPreviousStatus() { return this.e(); } // Paper - OBFHELPER + public ChunkStatus e() { + return this.u; + } @@ -0,0 +0,0 @@ public class ChunkStatus { return this.w.doWork(this, worldserver, definedstructuremanager, lightenginethreaded, function, ichunkaccess); } -+ public int getNeighborRadius() { return this.f(); } // Paper - OBFHELPER ++ public final int getNeighborRadius() { return this.f(); } // Paper - OBFHELPER public int f() { return this.x; } @@ -2787,7 +2796,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.z; } -+ public boolean isAtLeastStatus(ChunkStatus chunkstatus) { return b(chunkstatus); } // Paper - OBFHELPER ++ public final boolean isAtLeastStatus(ChunkStatus chunkstatus) { return b(chunkstatus); } // Paper - OBFHELPER public boolean b(ChunkStatus chunkstatus) { return this.c() >= chunkstatus.c(); } @@ -3060,7 +3069,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private boolean updatingChunksModified; @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; - private final DefinedStructureManager definedStructureManager; + public final DefinedStructureManager definedStructureManager; // Paper - private -> public diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index 72db0d0294..43ef06d0b6 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -196,7 +196,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + boolean isCompleteFromCache = this.completeFromCache(true, onlineMode); + if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) { -+ GameProfile result = server.getSessionService().fillProfileProperties(profile, true); ++ GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true); + if (result != null) { + copyProfileProperties(result, this.profile, true); + } @@ -462,18 +462,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName())); -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant visibleChunks = chunkMap.visibleChunks; -+ ChunkMapDistance chunkMapDistance = chunkMap.getChunkMapDistanceManager(); ++ ChunkMapDistance chunkMapDistance = chunkMap.chunkDistanceManager; + List allChunks = new ArrayList<>(visibleChunks.values()); + List players = world.players; + @@ -424,15 +424,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public final WorldServer world; private final LightEngineThreaded lightEngine; private final IAsyncTaskHandler executor; -@@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - private final Mailbox> mailboxWorldGen; - private final Mailbox> mailboxMain; - public final WorldLoadListener worldLoadListener; -- public final PlayerChunkMap.a chunkDistanceManager; -+ public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER - private final AtomicInteger u; - private final DefinedStructureManager definedStructureManager; - private final File w; diff --git a/src/main/java/net/minecraft/server/Ticket.java b/src/main/java/net/minecraft/server/Ticket.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Ticket.java diff --git a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch index 4eef9c894f..ac41c2cb49 100644 --- a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.ac(); + + // Paper start - These shouldn't be going through portals -+ if (this.inPortal()) { ++ if (this.inPortal) { + this.die(); + } + // Paper end diff --git a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch index a474a6d213..c541487bda 100644 --- a/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/Duplicate-UUID-Resolve-Option.patch @@ -100,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }); } -+ public void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER ++ public final void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER public void a_(UUID uuid) { this.uniqueID = uuid; this.al = this.uniqueID.toString(); diff --git a/Spigot-Server-Patches/EnderDragon-Events.patch b/Spigot-Server-Patches/EnderDragon-Events.patch index 3aa88fe659..35ea45a96c 100644 --- a/Spigot-Server-Patches/EnderDragon-Events.patch +++ b/Spigot-Server-Patches/EnderDragon-Events.patch @@ -24,10 +24,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ++this.c; } -+ public void removeAreaEffect() { this.e(); } // Paper - OBFHELPER - @Override - public void e() { +- @Override +- public void e() { ++ public final void removeAreaEffect() { this.e(); } // Paper - OBFHELPER ++ @Override public void e() { if (this.d != null) { + this.d.die(); + this.d = null; diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java diff --git a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch index 6b84bb998d..71094e7dd4 100644 --- a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch @@ -17,6 +17,15 @@ diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java +@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean ac; + public boolean impulse; + public int portalCooldown; +- protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER ++ public boolean inPortal; // Paper - public + protected int portalTicks; + protected BlockPosition ah; + protected Vec3D ai; @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; @@ -51,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.al; } -+ public boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! ++ public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! public boolean bU() { // Paper start return this.pushedByWater(); @@ -681,7 +690,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + // Paper start - special case always immunities + // immunize brand new entities, dead entities, and portal scenarios -+ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal() || entity.portalCooldown > 0) { ++ if (entity.defaultActivationState || entity.ticksLived < 20*10 || !entity.isAlive() || entity.inPortal || entity.portalCooldown > 0) { + return true; + } + // immunize leashed entities diff --git a/Spigot-Server-Patches/Entity-Origin-API.patch b/Spigot-Server-Patches/Entity-Origin-API.patch index 7827409589..1ae2bc9ea1 100644 --- a/Spigot-Server-Patches/Entity-Origin-API.patch +++ b/Spigot-Server-Patches/Entity-Origin-API.patch @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 protected abstract void saveData(NBTTagCompound nbttagcompound); -+ protected NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER ++ protected final NBTTagList createList(double... adouble) { return a(adouble); } // Paper - OBFHELPER protected NBTTagList a(double... adouble) { NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/Spigot-Server-Patches/Expose-Arrow-getItemStack.patch b/Spigot-Server-Patches/Expose-Arrow-getItemStack.patch index 374b7dc20c..ad81ce0990 100644 --- a/Spigot-Server-Patches/Expose-Arrow-getItemStack.patch +++ b/Spigot-Server-Patches/Expose-Arrow-getItemStack.patch @@ -12,8 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -+ public ItemStack getOriginalItemStack() { return getItemStack(); } // Paper - OBFHelper -+ ++ public final ItemStack getOriginalItemStack() { return getItemStack(); } // Paper - OBFHELPER - exists purely due to overrides all as protected and dont want to change them all protected abstract ItemStack getItemStack(); @Override diff --git a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch index 23f8a5b681..1c014a4a1d 100644 --- a/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/Expose-attack-cooldown-methods-for-Player.patch @@ -16,16 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public float eR() { return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); } - -+ public float getCooledAttackStrength(float adjustTicks) { return getAttackCooldown(adjustTicks); } // Paper - OBFHELPER - public float getAttackCooldown(float f) { - return MathHelper.a(((float) this.aA + f) / this.eR(), 0.0F, 1.0F); - } - -+ public void resetCooldown() { this.ey(); } // Paper - OBFHELPER - public void resetAttackCooldown() { - this.aA = 0; - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -40,11 +30,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + public float getCooledAttackStrength(float adjustTicks) { -+ return getHandle().getCooledAttackStrength(adjustTicks); ++ return getHandle().getAttackCooldown(adjustTicks); + } + + public void resetCooldown() { -+ getHandle().resetCooldown(); ++ getHandle().resetAttackCooldown(); + } + // Paper end + diff --git a/Spigot-Server-Patches/Firework-API-s.patch b/Spigot-Server-Patches/Firework-API-s.patch index cd5ddd74de..790f6fe91a 100644 --- a/Spigot-Server-Patches/Firework-API-s.patch +++ b/Spigot-Server-Patches/Firework-API-s.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private int ticksFlown; public int expectedLifespan; - private EntityLiving ridingEntity; -+ private EntityLiving ridingEntity; public final EntityLiving getBoostedEntity() { return this.ridingEntity; } // Paper - OBFHELPER ++ public EntityLiving ridingEntity; // Paper - public + public java.util.UUID spawningEntity; // Paper public EntityFireworks(EntityTypes entitytypes, World world) { @@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.entity.LivingEntity getBoostedEntity() { -+ net.minecraft.server.EntityLiving boostedEntity = getHandle().getBoostedEntity(); ++ net.minecraft.server.EntityLiving boostedEntity = getHandle().ridingEntity; + return boostedEntity != null ? (org.bukkit.entity.LivingEntity) boostedEntity.getBukkitEntity() : null; + } + // Paper end diff --git a/Spigot-Server-Patches/Fix-Light-Command.patch b/Spigot-Server-Patches/Fix-Light-Command.patch index 481217a097..e88a67b9fe 100644 --- a/Spigot-Server-Patches/Fix-Light-Command.patch +++ b/Spigot-Server-Patches/Fix-Light-Command.patch @@ -150,7 +150,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox mailbox = Mailbox.a("main", iasynctaskhandler::a); diff --git a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch index e4af25853b..2c8403088e 100644 --- a/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch +++ b/Spigot-Server-Patches/Fix-World-isChunkGenerated-calls.patch @@ -218,7 +218,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // We've used an invalid region file. + throw new IllegalStateException("RegionFile is closed"); + } -+ this.statuses[this.getChunkLocation(new ChunkCoordIntPair(x, z))] = status; ++ this.statuses[getChunkLocation(x, z)] = status; + } + + public ChunkStatus getStatusIfCached(int x, int z) { @@ -226,7 +226,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // We've used an invalid region file. + throw new IllegalStateException("RegionFile is closed"); + } -+ final int location = this.getChunkLocation(new ChunkCoordIntPair(x, z)); ++ final int location = getChunkLocation(x, z); + return this.statuses[location]; + } + // Paper end @@ -238,7 +238,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.getOffset(chunkcoordintpair) != 0; } -+ private final int getChunkLocation(ChunkCoordIntPair chunkcoordintpair) { return this.g(chunkcoordintpair); } // Paper - OBFHELPER ++ private static int getChunkLocation(int x, int z) { return (x & 31) + (z & 31) * 32; } // Paper - OBFHELPER - sort of, mirror of logic below private static int g(ChunkCoordIntPair chunkcoordintpair) { return chunkcoordintpair.j() + chunkcoordintpair.k() * 32; } diff --git a/Spigot-Server-Patches/Fix-arrows-never-despawning-MC-125757.patch b/Spigot-Server-Patches/Fix-arrows-never-despawning-MC-125757.patch index 0188186000..7e3ee14ef3 100644 --- a/Spigot-Server-Patches/Fix-arrows-never-despawning-MC-125757.patch +++ b/Spigot-Server-Patches/Fix-arrows-never-despawning-MC-125757.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } -+ protected void tickDespawnCounter() { this.h(); } // Paper - OBFHELPER ++ protected final void tickDespawnCounter() { this.h(); } // Paper - OBFHELPER protected void h() { ++this.despawnCounter; if (this.despawnCounter >= (fromPlayer == PickupStatus.CREATIVE_ONLY ? world.paperConfig.creativeArrowDespawnRate : (fromPlayer == PickupStatus.DISALLOWED ? world.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof EntityThrownTrident) ? world.spigotConfig.tridentDespawnRate : world.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init? diff --git a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch index 4781665029..5c3aa1cd28 100644 --- a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (e.shouldBeRemoved) return; // Paper MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); - ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Chunk.java diff --git a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index d33d9a7019..3b9f6b0394 100644 --- a/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -106,7 +106,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final Mailbox> j; private final Mailbox k; - private final LongSet l = new LongOpenHashSet(); -+ private final LongSet l = new LongOpenHashSet(); LongSet getOnPlayerTicketAddQueue() { return l; } // Paper - OBFHELPER ++ private final LongSet l = new LongOpenHashSet(); public final LongSet getOnPlayerTicketAddQueue() { return l; } // Paper - OBFHELPER private final Executor m; private long currentTick; @@ -394,7 +394,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + BlockPosition blockPos = chunkPos.asPosition(); + + boolean isFront = false; -+ BlockPosition.PooledBlockPosition pos = BlockPosition.PooledBlockPosition.acquire(); ++ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); + for (int index = 0, len = backingSet.length; index < len; ++index) { + if (!(backingSet[index] instanceof EntityPlayer)) { + continue; @@ -421,7 +421,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + minDist = dist; + } + } -+ pos.close(); + if (minDist == Double.MAX_VALUE) { + minDist = 15; + } else { @@ -997,7 +996,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap priorities = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); + + int viewDistance = getEffectiveNoTickViewDistance(); -+ BlockPosition.PooledBlockPosition pos = BlockPosition.PooledBlockPosition.acquire(); ++ BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); + + // Prioritize circular near + double playerChunkX = MathHelper.floor(player.locX()) >> 4; @@ -1053,7 +1052,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + }); + } + -+ pos.close(); + if (priorities.isEmpty()) return; + chunkDistanceManager.delayDistanceManagerTick = true; + priorities.long2IntEntrySet().fastForEach(entry -> chunkDistanceManager.markHighPriority(new ChunkCoordIntPair(entry.getLongKey()), entry.getIntValue())); diff --git a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch index 866ca714ba..2bbe2df646 100644 --- a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private boolean armorStandInvisible; public long bp; - private int bA; -+ private int bA; public void setDisabledSlots(int i) { bA = i; } public int getDisabledSlots() { return bA; } // Paper - OBFHELPER ++ private int bA; public final void setDisabledSlots(int i) { bA = i; } public final int getDisabledSlots() { return bA; } // Paper - OBFHELPER public Vector3f headPose; public Vector3f bodyPose; public Vector3f leftArmPose; @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return enumitemslot; } -+ public boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER ++ public final boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER private boolean d(EnumItemSlot enumitemslot) { return (this.bA & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch index eac1cd199c..1fb03c1d3c 100644 --- a/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch +++ b/Spigot-Server-Patches/Implement-Player-Client-Options-API.patch @@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public String locale = null; // CraftBukkit - lowercase // Paper - default to null public void a(PacketPlayInSettings packetplayinsettings) { -+ new PlayerClientOptionsChangeEvent(getBukkitEntity(), packetplayinsettings.getLocale(), packetplayinsettings.viewDistance, com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(packetplayinsettings.getChatVisibility().name()), packetplayinsettings.hasChatColorsEnabled(), new com.destroystokyo.paper.PaperSkinParts(packetplayinsettings.getSkinParts()), packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT).callEvent(); // Paper - settings event ++ new PlayerClientOptionsChangeEvent(getBukkitEntity(), packetplayinsettings.locale, packetplayinsettings.viewDistance, com.destroystokyo.paper.ClientOption.ChatVisibility.valueOf(packetplayinsettings.getChatVisibility().name()), packetplayinsettings.hasChatColorsEnabled(), new com.destroystokyo.paper.PaperSkinParts(packetplayinsettings.getSkinParts()), packetplayinsettings.getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT).callEvent(); // Paper - settings event // CraftBukkit start if (getMainHand() != packetplayinsettings.getMainHand()) { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT); @@ -130,15 +130,6 @@ diff --git a/src/main/java/net/minecraft/server/PacketPlayInSettings.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/PacketPlayInSettings.java +++ b/src/main/java/net/minecraft/server/PacketPlayInSettings.java -@@ -0,0 +0,0 @@ import java.io.IOException; - - public class PacketPlayInSettings implements Packet { - -- public String locale; -+ public String locale; public String getLocale() { return this.locale; } // Paper - OBFHELPER - public int viewDistance; - private EnumChatVisibility c; - private boolean d; @@ -0,0 +0,0 @@ public class PacketPlayInSettings implements Packet { packetlistenerplayin.a(this); } diff --git a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index d465dc18ea..016b529a69 100644 --- a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final Map, Comparable> k = Maps.newLinkedHashMap(); // CraftBukkit - stable private final Map l = Maps.newHashMap(); - private MinecraftKey m = new MinecraftKey(""); -+ private MinecraftKey m = new MinecraftKey(""); public MinecraftKey getBlockKey() { return this.m; } // Paper - OBFHELPER ++ private MinecraftKey m = new MinecraftKey(""); public final MinecraftKey getBlockKey() { return this.m; } // Paper - OBFHELPER private BlockStateList n; private IBlockData o; @Nullable @@ -21,13 +21,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.p; } -+ public @Nullable MinecraftKey getTagKey() { return d(); } // Paper - OBFHELPER ++ public final @Nullable MinecraftKey getTagKey() { return d(); } // Paper - OBFHELPER @Nullable public MinecraftKey d() { return this.q; } -+ public ArgumentBlock parse(boolean parseTile) throws CommandSyntaxException { return this.a(parseTile); } // Paper - OBFHELPER ++ public final ArgumentBlock parse(boolean parseTile) throws CommandSyntaxException { return this.a(parseTile); } // Paper - OBFHELPER public ArgumentBlock a(boolean flag) throws CommandSyntaxException { this.s = this::l; if (this.i.canRead() && this.i.peek() == '#') { diff --git a/Spigot-Server-Patches/Improve-death-events.patch b/Spigot-Server-Patches/Improve-death-events.patch index 69868f867c..197f4561f8 100644 --- a/Spigot-Server-Patches/Improve-death-events.patch +++ b/Spigot-Server-Patches/Improve-death-events.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.h = null; } -+ public void reset() { this.g(); } // Paper - OBFHELPER ++ public final void reset() { this.g(); } // Paper - OBFHELPER public void g() { int i = this.f ? 300 : 100; @@ -34,7 +34,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // CraftBukkit end -+ public void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER ++ public final void runKillTrigger(Entity entity, int kills, DamageSource damageSource) { this.a(entity, kills, damageSource); } // Paper - OBFHELPER public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.fallDistance = 0.0F; } -+ public void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER ++ public final void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER public void a_(EntityLiving entityliving) {} protected void k(double d0, double d1, double d2) { @@ -429,7 +429,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + double z = event.getEntity().getLocation().getZ(); + net.minecraft.server.SoundEffect soundEffect = org.bukkit.craftbukkit.CraftSound.getSoundEffect(event.getDeathSound()); + net.minecraft.server.SoundCategory soundCategory = net.minecraft.server.SoundCategory.valueOf(event.getDeathSoundCategory().name()); -+ victim.world.sendSoundEffect(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); ++ victim.world.playSound(source, x, y, z, soundEffect, soundCategory, event.getDeathSoundVolume(), event.getDeathSoundPitch()); + } + } + // Paper end diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index 3d3608370a..daa7956fa2 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -401,7 +401,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return entity.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTableKey())) : null; ++ return entity.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.lootTable)) : null; + } + + @Override @@ -422,8 +422,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ entity.setLootTable(newKey); ++ entity.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); + } + + @Override @@ -470,7 +469,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public org.bukkit.loot.LootTable getLootTable() { -+ return tileEntityLootable.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.getLootTableKey())) : null; ++ return tileEntityLootable.lootTable != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.lootTable)) : null; + } + + @Override @@ -481,18 +480,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ tileEntityLootable.setLootTable(newKey); ++ tileEntityLootable.lootTable = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); + } + + @Override + public void setSeed(long seed) { -+ tileEntityLootable.setSeed(seed); ++ tileEntityLootable.lootTableSeed = seed; + } + + @Override + public long getSeed() { -+ return tileEntityLootable.getSeed(); ++ return tileEntityLootable.lootTableSeed; + } + + @Override @@ -536,11 +534,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - private NonNullList items; - private boolean c; - @Nullable -- public MinecraftKey lootTable; -+ public MinecraftKey lootTable; public MinecraftKey getLootTableKey() { return this.lootTable; } public void setLootTable(final MinecraftKey key) { this.lootTable = key; } // Paper - OBFHELPER public long lootTableSeed; // CraftBukkit start @@ -599,14 +592,10 @@ diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java -@@ -0,0 +0,0 @@ import javax.annotation.Nullable; - public abstract class TileEntityLootable extends TileEntityContainer { - +@@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer { @Nullable -- public MinecraftKey lootTable; -- public long lootTableSeed; -+ public MinecraftKey lootTable; public MinecraftKey getLootTableKey() { return this.lootTable; } public void setLootTable(final MinecraftKey key) { this.lootTable = key; } // Paper - OBFHELPER -+ public long lootTableSeed; public long getSeed() { return this.lootTableSeed; } public void setSeed(final long seed) { this.lootTableSeed = seed; } // Paper - OBFHELPER + public MinecraftKey lootTable; + public long lootTableSeed; + public final com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperTileEntityLootableInventory(this)); // Paper protected TileEntityLootable(TileEntityTypes tileentitytypes) { diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index d84ff986fc..68d687af01 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -2287,6 +2287,19 @@ diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { + return IntStream.of(new int[]{baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()}); + }); + public static final BaseBlockPosition ZERO = new BaseBlockPosition(0, 0, 0); +- private int a; +- private int b; +- private int e; ++ private int a;public final void setX(final int x) { this.a = x; } // Paper - OBFHELPER ++ private int b;public final void setY(final int y) { this.b = y; } // Paper - OBFHELPER ++ private int e;public final void setZ(final int z) { this.e = z; } // Paper - OBFHELPER + + public BaseBlockPosition(int i, int j, int k) { + this.a = i; @@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0; } @@ -2326,7 +2339,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition)); } -+ public IBlockData getBlockData() { return p(); } // Paper - OBFHELPER ++ public final IBlockData getBlockData() { return p(); } // Paper - OBFHELPER protected abstract IBlockData p(); public boolean isAlwaysDestroyable() { @@ -2338,24 +2351,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2); } -+ public BlockPosition add(int i, int j, int k) {return b(i, j, k);} // Paper - OBFHELPER ++ public final BlockPosition add(int i, int j, int k) {return b(i, j, k);} // Paper - OBFHELPER public BlockPosition b(int i, int j, int k) { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } -@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { - return new BlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); - } - -+ @Deprecated // We'll replace this... -+ public BlockPosition asImmutable() { return immutableCopy(); } // Paper - OBFHELPER - public BlockPosition immutableCopy() { - return this; - } @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { return super.a(enumblockrotation).immutableCopy(); } -+ public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER ++ public final BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return d(i, j, k);} // Paper - OBFHELPER public BlockPosition.MutableBlockPosition d(int i, int j, int k) { this.o(i); this.p(j); @@ -2363,7 +2367,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this; } -+ public BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER ++ public final BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } @@ -2371,36 +2375,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -+ public final void setX(final int x) { super.o(x); } // Paper - OBFHELPER ++ /* // Paper start - comment out useless overrides @Override @Override public void o(int i) { super.o(i); - } - -+ public final void setY(final int y) { super.p(y); } // Paper - OBFHELPER - @Override - public void p(int i) { +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { super.p(i); } -+ public final void setZ(final int z) { super.q(z); } // Paper - OBFHELPER - @Override +- @Override public void q(int i) { super.q(i); -@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { - return new BlockPosition(this); } - } -+ -+ // Paper start -+ public static class PooledBlockPosition extends BlockPosition.MutableBlockPosition implements AutoCloseable { -+ @Deprecated -+ public void close() {} -+ @Deprecated -+ public static BlockPosition.PooledBlockPosition acquire() { return new PooledBlockPosition(); } -+ } -+ // Paper end - } ++ */ // Paper end + + @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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/Chunk.java @@ -2730,8 +2720,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - public static long pair(int i, int j) { -+ public static long asLong(final BlockPosition pos) { return pair(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER -+ public static long asLong(int x, int z) { return pair(x, z); } // Paper - OBFHELPER ++ public static long pair(final BlockPosition pos) { return pair(pos.getX() >> 4, pos.getZ() >> 4); } // Paper - OBFHELPER + public static long pair(int i, int j) { return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } @@ -3001,7 +2990,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return (int) (k >> l & this.d); } -+ public long[] getDataBits() { return this.a(); } // Paper - OBFHELPER ++ public final long[] getDataBits() { return this.a(); } // Paper - OBFHELPER public long[] a() { return this.b; } @@ -3042,7 +3031,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - protected DataBits a; - private DataPalette h; - private int i; -+ protected DataBits a; protected DataBits getDataBits() { return this.a; } // Paper - OBFHELPER ++ protected DataBits a; public final DataBits getDataBits() { return this.a; } // Paper - OBFHELPER + private DataPalette h; private DataPalette getDataPalette() { return this.h; } // Paper - OBFHELPER + private int i; private int getBitsPerObject() { return this.i; } // Paper - OBFHELPER private final ReentrantLock j = new ReentrantLock(); @@ -3198,7 +3187,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end + -+ public void addTask(R r0) { a(r0); }; // Paper - OBFHELPER ++ public final void addTask(R r0) { a(r0); }; // Paper - OBFHELPER public void a(R r0) { this.d.add(r0); LockSupport.unpark(this.getThread()); diff --git a/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch index 82ba59b0e4..e8e4686b16 100644 --- a/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/No-Tick-view-distance-implementation.patch @@ -245,7 +245,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private final Mailbox> mailboxMain; + final Mailbox> mailboxMain; // Paper - private -> package private public final WorldLoadListener worldLoadListener; - public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER + public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; @@ -0,0 +0,0 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick diff --git a/Spigot-Server-Patches/Optimise-random-block-ticking.patch b/Spigot-Server-Patches/Optimise-random-block-ticking.patch index 23a930b1be..426d3783c2 100644 --- a/Spigot-Server-Patches/Optimise-random-block-ticking.patch +++ b/Spigot-Server-Patches/Optimise-random-block-ticking.patch @@ -234,14 +234,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { + } - public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER public void setHomePos(BlockPosition blockposition) { - this.datawatcher.set(EntityTurtle.bw, blockposition); + this.datawatcher.set(EntityTurtle.bw, blockposition.immutableCopy()); // Paper - called with mutablepos... } - // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them - public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER + public BlockPosition getHomePos() { // Paper - public + return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/World.java diff --git a/Spigot-Server-Patches/Optimize-Bit-Operations-by-inlining.patch b/Spigot-Server-Patches/Optimize-Bit-Operations-by-inlining.patch index f36d72ff52..916d149f12 100644 --- a/Spigot-Server-Patches/Optimize-Bit-Operations-by-inlining.patch +++ b/Spigot-Server-Patches/Optimize-Bit-Operations-by-inlining.patch @@ -10,6 +10,31 @@ diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + }).stable(); + private static final Logger LOGGER = LogManager.getLogger(); + public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); +- private static final int f = 1 + MathHelper.f(MathHelper.c(30000000)); +- private static final int g = BlockPosition.f; +- private static final int h = 64 - BlockPosition.f - BlockPosition.g; +- private static final long i = (1L << BlockPosition.f) - 1L; +- private static final long j = (1L << BlockPosition.h) - 1L; +- private static final long k = (1L << BlockPosition.g) - 1L; +- private static final int l = BlockPosition.h; +- private static final int m = BlockPosition.h + BlockPosition.g; ++ // Paper start - static constants ++ private static final int f = 26; ++ private static final int g = 26; ++ private static final int h = 12; ++ private static final long i = 67108863; ++ private static final long j = 4095; ++ private static final long k = 67108863; ++ private static final int l = 12; ++ private static final int m = 38; ++ // Paper end + + public BlockPosition(int i, int j, int k) { + super(i, j, k); @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } diff --git a/Spigot-Server-Patches/Optimize-Light-Engine.patch b/Spigot-Server-Patches/Optimize-Light-Engine.patch index f6bc378468..0a5328ebf2 100644 --- a/Spigot-Server-Patches/Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/Optimize-Light-Engine.patch @@ -1380,7 +1380,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - @Override + -+ public void queue(T t0) { a(t0); } @Override // Paper - OBFHELPER ++ public final void queue(T t0) { a(t0); } @Override // Paper - OBFHELPER public void a(T t0) { this.a.a(t0); this.f(); diff --git a/Spigot-Server-Patches/Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch index 7525f11629..11c0d25cab 100644 --- a/Spigot-Server-Patches/Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch +++ b/Spigot-Server-Patches/Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch @@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap; - Long2ObjectLinkedOpenHashMap visibleChunks = chunkMap.visibleChunks; + Long2ObjectLinkedOpenHashMap visibleChunks = chunkMap.getVisibleChunks(); - ChunkMapDistance chunkMapDistance = chunkMap.getChunkMapDistanceManager(); + ChunkMapDistance chunkMapDistance = chunkMap.chunkDistanceManager; List allChunks = new ArrayList<>(visibleChunks.values()); List players = world.players; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java diff --git a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 5495b4bf28..38dfa8c504 100644 --- a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { - private int b; - private int e; + private int b;public final void setY(final int y) { this.b = y; } // Paper - OBFHELPER + private int e;public final void setZ(final int z) { this.e = z; } // Paper - OBFHELPER + // Paper start + public boolean isValidLocation() { diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index 83131e2f65..73913d1ad7 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch + + MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); -+ ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); ++ ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); + info.left++; + info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); + if (!chunkProviderServer.isInEntityTickingChunk(e)) { @@ -575,23 +575,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { - private static final DataWatcherObject aA = DataWatcher.a(Entity.class, DataWatcherRegistry.i); - protected static final DataWatcherObject POSE = DataWatcher.a(Entity.class, DataWatcherRegistry.s); - public boolean inChunk; -- public int chunkX; -- public int chunkY; -- public int chunkZ; -+ public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER -+ public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER -+ public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER - private boolean aB; - public long Z; - public long aa; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java diff --git a/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch index bad4373f6b..f62e681ba0 100644 --- a/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/Spigot-Server-Patches/Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -55,9 +55,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public class MobSpawnerPatrol implements MobSpawner { -+ private int getSpawnDelay() { return a; } // Paper - OBFHELPER -+ private void setSpawnDelay(int spawnDelay) { this.a = spawnDelay; } // Paper - OBFHELPER - private int a; +- private int a; ++ private int a;private int getSpawnDelay() { return a; } private void setSpawnDelay(int spawnDelay) { this.a = spawnDelay; } // Paper - OBFHELPER public MobSpawnerPatrol() {} @@ -136,7 +135,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.b.values().iterator(); } -+ public Statistic get(T t) { return this.b(t); }; // Paper - OBFHELPER ++ public final Statistic get(T t) { return this.b(t); }; // Paper - OBFHELPER public Statistic b(T t0) { return this.a(t0, Counter.DEFAULT); } diff --git a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch index d9eb6c5f49..d462a27237 100644 --- a/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/Reset-players-airTicks-on-respawn.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } -+ public int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER ++ public final int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER public int bD() { return 300; } diff --git a/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch index 7f0ea1018d..076a7a7187 100644 --- a/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - send SoundEffect to everyone who can see fromEntity + private static void sendSoundEffect(EntityHuman fromEntity, double x, double y, double z, SoundEffect soundEffect, SoundCategory soundCategory, float volume, float pitch) { -+ fromEntity.world.sendSoundEffect(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself ++ fromEntity.world.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself + if (fromEntity instanceof EntityPlayer) { + ((EntityPlayer) fromEntity).playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(soundEffect, soundCategory, x, y, z, volume, pitch)); + } @@ -71,19 +71,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (flag4) { entity.extinguish(); } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.playSound(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); - } - -+ // Paper start - OBFHELPER -+ public final void sendSoundEffect(@Nullable EntityHuman fromEntity, double x, double y, double z, SoundEffect soundeffect, SoundCategory soundcategory, float volume, float pitch) { -+ this.playSound(fromEntity, x, y, z, soundeffect, soundcategory, volume, pitch); -+ } -+ // Paper end - public abstract void playSound(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1); - - public abstract void playSound(@Nullable EntityHuman entityhuman, Entity entity, SoundEffect soundeffect, SoundCategory soundcategory, float f, float f1); diff --git a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index e53354a27f..88fb2ce9dd 100644 --- a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ((HeightMap) this.heightMap.get(heightmap_type)).a(along); } -+ public void removeEntity(Entity entity) { this.b(entity); } // Paper - OBFHELPER ++ public final void removeEntity(Entity entity) { this.b(entity); } // Paper - OBFHELPER public void b(Entity entity) { this.a(entity, entity.chunkY); } @@ -110,7 +110,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return chunk; + } + -+ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ()); ++ return !inChunk ? null : ((WorldServer)world).getChunkProvider().getChunkAtIfLoadedMainThreadNoCache(chunkX, chunkZ); + } + private MinecraftKey entityKey; diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 1e7fcad408..47705a5182 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -906,7 +906,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.a = acustomfunction_c; } -+ public MinecraftKey getMinecraftKey() { return this.a(); } // Paper - OBFHELPER ++ public final MinecraftKey getMinecraftKey() { return this.a(); } // Paper - OBFHELPER public MinecraftKey a() { return this.b; } diff --git a/Spigot-Server-Patches/Turtle-API.patch b/Spigot-Server-Patches/Turtle-API.patch index f678048f06..039f347a95 100644 --- a/Spigot-Server-Patches/Turtle-API.patch +++ b/Spigot-Server-Patches/Turtle-API.patch @@ -9,19 +9,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { - this.G = 1.0F; - } - -+ public final void setHome(BlockPosition pos) { setHomePos(pos); } // Paper - OBFHELPER public void setHomePos(BlockPosition blockposition) { this.datawatcher.set(EntityTurtle.bw, blockposition); } - -+ // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them -+ public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER - private BlockPosition getHomePos() { +- private BlockPosition getHomePos() { ++ public BlockPosition getHomePos() { // Paper - public return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); } + @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { return (Boolean) this.datawatcher.get(EntityTurtle.bx); } @@ -112,12 +108,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + @Override + public Location getHome() { -+ return MCUtil.toLocation(getHandle().world, getHandle().getHome()); ++ return MCUtil.toLocation(getHandle().world, getHandle().getHomePos()); + } + + @Override + public void setHome(Location location) { -+ getHandle().setHome(MCUtil.toBlockPosition(location)); ++ getHandle().setHomePos(MCUtil.toBlockPosition(location)); + } + + @Override diff --git a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch index 705436afb6..fc1289d69c 100644 --- a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public String toString() { - return String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getDisplayName().getString(), this.id, this.world == null ? "~NULL~" : this.world.toString(), this.locX(), this.locY(), this.locZ()); -+ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), getChunkX(), getChunkZ(), this.ticksLived, this.valid, this.dead}); // Paper - add more information ++ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cx=%d, cz=%d, tl=%d, v=%b, d=%b]", new Object[] { this.getClass().getSimpleName(), this.getDisplayName().getString(), Integer.valueOf(this.id), this.uniqueID.toString(), this.world == null ? "~NULL~" : this.world.toString(), Double.valueOf(this.locX()), Double.valueOf(this.locY()), Double.valueOf(this.locZ()), chunkX, chunkZ, this.ticksLived, this.valid, this.dead}); // Paper - add more information } public boolean isInvulnerable(DamageSource damagesource) {