diff --git a/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index 6dce84c01c..f235d77096 100644 --- a/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index eaac25dc3..2842956bf 100644 +index 7dbc6f437..02bbb0d1d 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch index 7f3017c94c..1560c95928 100644 --- a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch @@ -13,7 +13,7 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index c2f26577c..851960afb 100644 +index 6fc0ce050..152a677e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { @@ -26,7 +26,7 @@ index c2f26577c..851960afb 100644 case CHEST: case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index cdf16e15a..aa99254ff 100644 +index cadff64bf..b1e0d6185 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack { @@ -350,23 +350,21 @@ index 000000000..dc372f6db + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 0cdc8007a..2ab4a1cf4 100644 +index e43a24989..5bff99edd 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { - .put(CraftMetaFirework.class, "FIREWORK") +@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { .put(CraftMetaCharge.class, "FIREWORK_EFFECT") .put(CraftMetaKnowledgeBook.class, "KNOWLEDGE_BOOK") + .put(CraftMetaTropicalFishBucket.class, "TROPICAL_FISH_BUCKET") + .put(CraftMetaArmorStand.class, "ARMOR_STAND") .put(CraftMetaItem.class, "UNSPECIFIC") .build(); -@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Repairable { - CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT, - CraftMetaCharge.EXPLOSION.NBT, +@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { CraftMetaBlockState.BLOCK_ENTITY_TAG.NBT, -- CraftMetaKnowledgeBook.BOOK_RECIPES.NBT -+ CraftMetaKnowledgeBook.BOOK_RECIPES.NBT, + CraftMetaKnowledgeBook.BOOK_RECIPES.NBT, + CraftMetaTropicalFishBucket.VARIANT.NBT + // Paper start + CraftMetaArmorStand.ENTITY_TAG.NBT, + CraftMetaArmorStand.INVISIBLE.NBT, @@ -379,15 +377,14 @@ index 0cdc8007a..2ab4a1cf4 100644 } return HANDLED_TAGS; diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 1f537d584..a29731f1d 100644 +index f66cc81d9..eb6cf1bb3 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -0,0 +0,0 @@ import static org.hamcrest.Matchers.*; - + import java.util.ArrayList; import java.util.Arrays; import java.util.List; -+ -+import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; ++import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper import net.minecraft.server.Block; import net.minecraft.server.ITileEntity; import net.minecraft.server.Item; @@ -396,14 +393,18 @@ index 1f537d584..a29731f1d 100644 return cleanStack; } + }, ++ // Paper start + new StackProvider(Material.ARMOR_STAND) { -+ @Override ItemStack operate(ItemStack cleanStack) { ++ @Override ++ ItemStack operate(ItemStack cleanStack) { + final ArmorStandMeta meta = (ArmorStandMeta) cleanStack.getItemMeta(); + meta.setInvisible(true); + cleanStack.setItemMeta(meta); + return cleanStack; + } } ++ // paper end ); + assertThat("Forgotten test?", providers, hasSize(ItemStackTest.COMPOUND_MATERIALS.length - 4/* Normal item meta, skulls, eggs and tile entities */)); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch index 1e7e55b5ee..a4f365e843 100644 --- a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch @@ -9,16 +9,16 @@ index 77440ac81..8711462e1 100644 --- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; - + public class PacketPlayInUseEntity implements Packet { - + - private int a; + private int a; public int getEntityId() { return this.a; } // Paper - add accessor private PacketPlayInUseEntity.EnumEntityUseAction action; private Vec3D c; private EnumHand d; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 2cc277e4f..b1f483990 100644 +index 9c27966ea..5c70a4a9b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -35,7 +35,7 @@ index 2cc277e4f..b1f483990 100644 + )); + } + // Paper end - + } - + -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-SkullMeta.setPlayerProfile-API.patch b/Spigot-Server-Patches/Add-SkullMeta.setPlayerProfile-API.patch index 7e08611973..fd38d65a09 100644 --- a/Spigot-Server-Patches/Add-SkullMeta.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Add-SkullMeta.setPlayerProfile-API.patch @@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 862b30286..1ac549e5e 100644 +index 52de1439e..960ae59ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.inventory; diff --git a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch index b425e8db2b..03541fcd23 100644 --- a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index a0128426f..d85b5defc 100644 +index 9e2fc4947..4b9ecb4a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch index c7cca6994f..e4a23f9fe8 100644 --- a/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch +++ b/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch @@ -12,12 +12,12 @@ This disables that by not saving the thrower when the chunk is unloaded. This is mainly useful for survival servers that do not allow freeform teleporting. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 99d681ef1..03a9a96fc 100644 +index 87d2dd131..5a9c68e4f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); - log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); + private void disableSprintInterruptionOnAttack() { + disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); } + + public boolean disableEnderpearlExploit = true; @@ -27,15 +27,15 @@ index 99d681ef1..03a9a96fc 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 01c7fcc8b..8e6428a0c 100644 +index fc8c0cab5..b3323aa8e 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile { - if (this.shooterName != null && this.shooterName.isEmpty()) { - this.shooterName = null; + if (nbttagcompound.hasKeyOfType("owner", 10)) { + this.shooterId = GameProfileSerializer.b(nbttagcompound.getCompound("owner")); } + if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterName = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit - this.shooter = this.getShooter(); } + -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch index f9483e001d..813fafcaa2 100644 --- a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -84,7 +84,7 @@ index 000000000..74c012fd4 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index a89a86e6d..2762bcc2e 100644 +index 07c53f505..91acfceec 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -0,0 +0,0 @@ import java.net.InetSocketAddress; @@ -96,42 +96,44 @@ index a89a86e6d..2762bcc2e 100644 public class LegacyPingHandler extends ChannelInboundHandlerAdapter { @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - MinecraftServer minecraftserver = this.b.d(); - int i = bytebuf.readableBytes(); - String s; -+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper + MinecraftServer minecraftserver = this.b.d(); + int i = bytebuf.readableBytes(); + String s; ++ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper - switch (i) { - case 0: - LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.H()), Integer.valueOf(minecraftserver.I())}); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s)); - break; + switch (i) { + case 0: + LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); +- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers()); ++ ++ // Paper end + this.a(channelhandlercontext, this.a(s)); + break; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } + return; + } - LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.H()), Integer.valueOf(minecraftserver.I())}); -+ // Paper start - Call PaperServerListPingEvent and use results -+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); -+ if (event == null) { -+ channelhandlercontext.close(); -+ break; -+ } -+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), -+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); -+ // Paper end - this.a(channelhandlercontext, this.a(s)); - break; +- LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); ++ // Paper start - Call PaperServerListPingEvent and use results ++ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); ++ if (event == null) { ++ channelhandlercontext.close(); ++ break; ++ } ++ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(), ++ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers()); ++ // Paper end + this.a(channelhandlercontext, this.a(s)); + break; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { diff --git a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch index b7f7c8b782..da658b02ba 100644 --- a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch +++ b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Call PortalCreateEvent for exit portals diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index f49729796..42e4b2d01 100644 +index 402d8d7d6..f36373450 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -26,6 +26,13 @@ index f49729796..42e4b2d01 100644 import org.bukkit.util.Vector; // CraftBukkit end + public class PortalTravelAgent { + +- private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; ++ private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; private static final BlockPortal PORTAL_BLOCK = a; // Paper - OBFHELPER + public final WorldServer world; // Paper - private -> public + private final Random c; + private final Long2ObjectMap d = new Long2ObjectOpenHashMap(4096); @@ -0,0 +0,0 @@ public class PortalTravelAgent { byte b0 = 1; byte b1 = 0; @@ -68,13 +75,14 @@ index f49729796..42e4b2d01 100644 + Map nmsBlocks = new HashMap<>(); // Paper + if (d0 < 0.0D) { - i1 = MathHelper.clamp(i1, 70, this.world.ab() - 10); + i1 = MathHelper.clamp(i1, 70, this.world.aa() - 10); j5 = i1; @@ -0,0 +0,0 @@ public class PortalTravelAgent { l3 = j2 + (l2 - 1) * l5 - k2 * k5; boolean flag1 = i3 < 0; -- this.world.setTypeUpdate(new BlockPosition(j3, k3, l3), flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); +- blockposition_mutableblockposition.c(j3, k3, l3); +- this.world.setTypeUpdate(blockposition_mutableblockposition, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); + // Paper start + BlockPosition pos = new BlockPosition(j3, k3, l3); + nmsBlocks.putIfAbsent(pos, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData()); @@ -84,19 +92,29 @@ index f49729796..42e4b2d01 100644 } } @@ -0,0 +0,0 @@ public class PortalTravelAgent { - i4 = j2 + (i3 - 1) * l5; - boolean flag2 = i3 == 0 || i3 == 3 || j3 == -1 || j3 == 3; - -- this.world.setTypeAndData(new BlockPosition(k3, l3, i4), flag2 ? Blocks.OBSIDIAN.getBlockData() : iblockdata, 2); + for (l2 = -1; l2 < 4; ++l2) { + if (k2 == -1 || k2 == 2 || l2 == -1 || l2 == 3) { + blockposition_mutableblockposition.c(i5 + k2 * k5, j5 + l2, j2 + k2 * l5); +- this.world.setTypeAndData(blockposition_mutableblockposition, Blocks.OBSIDIAN.getBlockData(), 3); + // Paper start -+ BlockPosition pos = new BlockPosition(k3, l3, i4); -+ nmsBlocks.putIfAbsent(pos, flag2 ? Blocks.OBSIDIAN.getBlockData() : iblockdata); ++ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ()); ++ nmsBlocks.putIfAbsent(pos, Blocks.OBSIDIAN.getBlockData()); + bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ())); + // Paper end } } - + } @@ -0,0 +0,0 @@ public class PortalTravelAgent { + for (l2 = 0; l2 < 2; ++l2) { + for (i3 = 0; i3 < 3; ++i3) { + blockposition_mutableblockposition.c(i5 + l2 * k5, j5 + i3, j2 + l2 * l5); +- this.world.setTypeAndData(blockposition_mutableblockposition, iblockdata, 18); ++ ++ // Paper start ++ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ()); ++ nmsBlocks.putIfAbsent(pos, PORTAL_BLOCK.getBlockData()); ++ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ())); ++ // paper end } } diff --git a/Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch b/Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch deleted file mode 100644 index 7ea32d927d..0000000000 --- a/Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 21 Apr 2018 11:21:48 -0400 -Subject: [PATCH] Configurable Allowance of Permanent Chunk Loaders - -This disables the behavior that allows players to keep chunks permanently loaded -by default and allows server operators to enable it if they wish. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 5a2fbf7c7..99d681ef1 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -0,0 +0,0 @@ public class PaperWorldConfig { - private void disableSprintInterruptionOnAttack() { - disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); - } -+ -+ public boolean allowPermaChunkLoaders = false; -+ private void allowPermaChunkLoaders() { -+ allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); -+ log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); -+ } - } -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 55dada668..0eba3df57 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - } - - public Chunk getChunkAt(int i, int j, Runnable runnable, boolean generate) { -- Chunk chunk = getLoadedChunkAt(i, j); -+ Chunk chunk = world.paperConfig.allowPermaChunkLoaders ? getLoadedChunkAt(i, j) : getChunkIfLoaded(i, j); // Paper - Configurable perma chunk loaders - ChunkRegionLoader loader = null; - - if (this.chunkLoader instanceof ChunkRegionLoader) { --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-Unrestricted-Signs.patch b/Spigot-Server-Patches/Configurable-Unrestricted-Signs.patch deleted file mode 100644 index ab5b0f7136..0000000000 --- a/Spigot-Server-Patches/Configurable-Unrestricted-Signs.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Mar 2018 19:57:10 -0400 -Subject: [PATCH] Configurable Unrestricted Signs - -Bukkit restricts command execution of signs to test if the sender -has permission to run the specified command. This breaks vanilla -maps that use signs to intentionally run as elevated permission. - -Bukkit provides an unrestricted advancements setting, so this setting -compliments that one and allows for unrestricted signs. - -We still filter sign update packets to strip out commands at edit phase, -however there is no sanity in ever expecting creative mode to not be -able to create signs with any command. - -Creative servers should absolutely never enable this. -Non creative servers, enable at own risk!!! - -diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 3f2c5b2d5..67bd3bcbe 100644 ---- a/src/main/java/net/minecraft/server/TileEntitySign.java -+++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity { - public void load(NBTTagCompound nbttagcompound) { - this.isEditable = false; - super.load(nbttagcompound); -- ICommandListener icommandlistener = new ICommandListener() { -+ ICommandListener icommandlistener = new ISignCommandListener() { // Paper - public String getName() { - return "Sign"; - } -@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity { - } - - public boolean b(final EntityHuman entityhuman) { -- ICommandListener icommandlistener = new ICommandListener() { -+ ICommandListener icommandlistener = new ISignCommandListener() { // Paper - public String getName() { - return entityhuman.getName(); - } -@@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity { - public CommandObjectiveExecutor f() { - return this.i; - } -+ public interface ISignCommandListener extends ICommandListener {} // Paper - } -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e86c16755..6095948e8 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - private CraftIconCache icon; - private boolean overrideAllCommandBlockCommands = false; - private boolean unrestrictedAdvancements; -+ private boolean unrestrictedSignCommands; // Paper - private final List playerView; - public int reloadCount; - public static Exception excessiveVelEx; // Paper - Velocity warnings -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - saveCommandsConfig(); - overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); - unrestrictedAdvancements = commandsConfiguration.getBoolean("unrestricted-advancements"); -+ // Paper start -+ unrestrictedSignCommands = commandsConfiguration.getBoolean("unrestricted-signs"); -+ if (unrestrictedSignCommands) { -+ logger.warning("Warning: Commands are no longer restricted on signs. If you allow players to use Creative Mode, there may be risk of players bypassing permissions. Use this setting at your own risk!!!!"); -+ } -+ // Paper end - pluginManager.useTimings(configuration.getBoolean("settings.plugin-profiling")); - monsterSpawn = configuration.getInt("spawn-limits.monsters"); - animalSpawn = configuration.getInt("spawn-limits.animals"); -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - listener = ((CommandListenerWrapper) listener).base; - } - -+ if (unrestrictedSignCommands && listener instanceof TileEntitySign.ISignCommandListener) return true; // Paper - return unrestrictedAdvancements && listener instanceof AdvancementRewards.AdvancementCommandListener; - } - --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch index 76b90ffe37..a53b643e0a 100644 --- a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch @@ -6,21 +6,20 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ef1fa8cf6..5a2fbf7c7 100644 +index 830b99cd7..87d2dd131 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents); - log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled")); + squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); } -+ + + public boolean disableSprintInterruptionOnAttack; + private void disableSprintInterruptionOnAttack() { + disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 35fde8b23..0b51903e2 100644 +index 02f5d61c8..fc5263f08 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch index 66a592d83c..f69911b04b 100644 --- a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch +++ b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index b93a26e8f..3d32e0056 100644 +index 424464d09..909ad36fb 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> { @@ -31,5 +31,5 @@ index b93a26e8f..3d32e0056 100644 + if (enableExplicitFlush) this.channel.eventLoop().execute(() -> this.channel.flush()); // Paper - we don't need to explicit flush here, but allow opt in incase issues are found to a better version } - } + if (this.u++ % 20 == 0) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Enderman.teleportRandomly.patch b/Spigot-Server-Patches/Enderman.teleportRandomly.patch index 64fd262192..0a27e064ec 100644 --- a/Spigot-Server-Patches/Enderman.teleportRandomly.patch +++ b/Spigot-Server-Patches/Enderman.teleportRandomly.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index e8ea231dc..4f8dd320f 100644 +index a9020083d..a5b517ba9 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { - super.M(); + super.mobTick(); } -+ public boolean teleportRandomly() { return dm(); } // Paper - OBFHELPER - protected boolean dm() { ++ public boolean teleportRandomly() { return dz(); } // Paper - OBFHELPER + protected boolean dz() { double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D; double d1 = this.locY + (double) (this.random.nextInt(64) - 32); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index f602c2313..7e6af5d02 100644 +index 5998530a8..f62ea821f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -0,0 +0,0 @@ public class CraftEnderman extends CraftMonster implements Enderman { @@ -28,5 +28,5 @@ index f602c2313..7e6af5d02 100644 + @Override public boolean teleportRandomly() { return getHandle().teleportRandomly(); } // Paper public MaterialData getCarriedMaterial() { IBlockData blockData = getHandle().getCarried(); - return (blockData == null) ? Material.AIR.getNewData((byte) 0) : CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData)); + return CraftMagicNumbers.getMaterial(blockData); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/EndermanEscapeEvent.patch b/Spigot-Server-Patches/EndermanEscapeEvent.patch index 387b686fdb..b51b2e660a 100644 --- a/Spigot-Server-Patches/EndermanEscapeEvent.patch +++ b/Spigot-Server-Patches/EndermanEscapeEvent.patch @@ -8,18 +8,22 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 2f59e7071..e8ea231dc 100644 +index 96e29539b..a9020083d 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ package net.minecraft.server; + import java.util.Optional; +import com.destroystokyo.paper.event.entity.EndermanEscapeEvent; - import com.google.common.base.Function; - import com.google.common.base.Optional; - import com.google.common.base.Predicate; ++import com.google.common.base.Function; ++import com.google.common.base.Predicate; ++ + import java.util.Random; + import java.util.UUID; + import java.util.function.Function; @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { - setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); + setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); } + // Paper start @@ -32,13 +36,13 @@ index 2f59e7071..e8ea231dc 100644 public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { - if (this.world.D() && this.ticksLived >= this.bA + 600) { - float f = this.aw(); + if (this.world.K() && this.ticksLived >= this.bE + 600) { + float f = this.az(); -- if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { -+ if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper +- if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { ++ if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper this.setGoalTarget((EntityLiving) null); - this.dm(); + this.dz(); } @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { public boolean damageEntity(DamageSource damagesource, float f) { @@ -47,7 +51,7 @@ index 2f59e7071..e8ea231dc 100644 - } else if (damagesource instanceof EntityDamageSourceIndirect) { + } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper for (int i = 0; i < 64; ++i) { - if (this.dm()) { + if (this.dz()) { return true; @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { } else { @@ -55,7 +59,7 @@ index 2f59e7071..e8ea231dc 100644 - if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) { + if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - this.dm(); + this.dz(); } @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -73,7 +77,7 @@ index 2f59e7071..e8ea231dc 100644 if (this.i.f((EntityHuman) this.d)) { - if (((EntityHuman) this.d).h(this.i) < 16.0D) { + if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper - this.i.dm(); + this.i.dz(); } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index 764fecb8db..42d2122901 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 5ec7f5819..fcb64666e 100644 +index ce8f76871..126c17d1b 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { @@ -33,16 +33,16 @@ index 5ec7f5819..fcb64666e 100644 + Block block = data.getBlock(); + // Send other half of the door + if (block instanceof BlockDoor) { -+ boolean bottom = data.get(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER; ++ boolean bottom = data.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? position.up() : position.down())); + } else if (block instanceof BlockTallPlant) { -+ boolean bottom = data.get(BlockTallPlant.HALF) == BlockTallPlant.EnumTallPlantHalf.LOWER; ++ boolean bottom = data.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.LOWER; + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? position.up() : position.down())); + } else if (block instanceof BlockPistonExtension) { + BlockPosition piston = position.shift(data.get(BlockPistonExtension.FACING).opposite()); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, piston)); + } else if (block instanceof BlockBed) { -+ if (data.get(BlockBed.PART) == BlockBed.EnumBedPart.FOOT) { ++ if (data.get(BlockBed.PART) == BlockPropertyBedPart.FOOT) { + // Restore head of bed + BlockPosition head = position.shift(data.get(BlockBed.FACING)); + this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, head)); @@ -57,15 +57,15 @@ index 5ec7f5819..fcb64666e 100644 + // Paper end + public boolean breakBlock(BlockPosition blockposition) { + IBlockData iblockdata = this.world.getType(blockposition); // CraftBukkit start - fire BlockBreakEvent - BlockBreakEvent event = null; @@ -0,0 +0,0 @@ public class PlayerInteractManager { } // Let the client know the block still exists ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); - // Send other half of the door - if (nmsBlock instanceof BlockDoor) { -- boolean bottom = nmsData.get(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER; +- boolean bottom = nmsData.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER; - ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down())); - } + cancelBreakBlock(blockposition, nmsData); // Paper - Move cancellation code to extra "cancelBreakBlock" method @@ -73,28 +73,29 @@ index 5ec7f5819..fcb64666e 100644 TileEntity tileentity = this.world.getTileEntity(blockposition); if (tileentity != null) { @@ -0,0 +0,0 @@ public class PlayerInteractManager { - ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down())); - } else if (blockdata.getBlock() instanceof BlockCake) { - ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate(); // SPIGOT-1341 - reset health for cake -+ // Paper start - extend Player Interact cancellation -+ } else if (blockdata.getBlock() instanceof BlockStructure) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down())); + } else if (iblockdata.getBlock() instanceof BlockCake) { + ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate(); // SPIGOT-1341 - reset health for cake ++ // Paper start - extend Player Interact cancellation // TODO: consider merging this into the extracted method ++ } else if (iblockdata.getBlock() instanceof BlockStructure) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutCloseWindow()); -+ } else if (blockdata.getBlock() instanceof BlockCommand) { ++ } else if (iblockdata.getBlock() instanceof BlockCommand) { + ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutCloseWindow()); -+ } else if (blockdata.getBlock() instanceof BlockFlowerPot) { -+ // Send a block change to air and then send back the correct block, just to make the client happy -+ PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition); -+ packet.block = Blocks.AIR.getBlockData(); -+ this.player.playerConnection.sendPacket(packet); ++ } else if (iblockdata.getBlock() instanceof BlockFlowerPot) { ++ // Send a block change to air and then send back the correct block, just to make the client happy ++ PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition); ++ packet.block = Blocks.AIR.getBlockData(); ++ this.player.playerConnection.sendPacket(packet); + -+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); ++ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition)); + -+ TileEntity tileentity = this.world.getTileEntity(blockposition); -+ if (tileentity != null) { -+ player.playerConnection.sendPacket(tileentity.getUpdatePacket()); -+ } -+ // Paper end - extend Player Interact cancellation - } - ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-2867 - enuminteractionresult = (event.useItemInHand() != Event.Result.ALLOW) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS; ++ TileEntity tileentity = this.world.getTileEntity(blockposition); ++ if (tileentity != null) { ++ player.playerConnection.sendPacket(tileentity.getUpdatePacket()); ++ } + } ++ // Paper end - extend Player Interact cancellation + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-2867 + enuminteractionresult = (event.useItemInHand() != Event.Result.ALLOW) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS; + } else if (this.gamemode == EnumGamemode.SPECTATOR) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch b/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch index 812b893070..72dc1536fd 100644 --- a/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch +++ b/Spigot-Server-Patches/Fix-Dragon-Server-Crashes.patch @@ -7,11 +7,11 @@ If the dragon tries to find "ground" and hits a hole, or off edge, it will infinitely keep looking for non air and eventually crash. diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index 054a7ef6c..deee5c4cc 100644 +index 41b5a4519..b78d3fe50 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -0,0 +0,0 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded - double d2 = this.a.bw.locY + (double) (this.a.bw.length / 2.0F); + double d2 = this.a.bD.locY + (double) (this.a.bD.length / 2.0F); BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1)); - while (this.a.world.isEmpty(blockposition_mutableblockposition)) { diff --git a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch index 6165793d77..5618746432 100644 --- a/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch +++ b/Spigot-Server-Patches/Fix-NPE-when-getting-location-from-InventoryEnderChe.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java -index cd7de2b53..37b494b78 100644 +index ac81d3f86..f50bae012 100644 --- a/src/main/java/net/minecraft/server/InventoryEnderChest.java +++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; diff --git a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch index b38a2617db..a35e1396c5 100644 --- a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 74a665142..4f82d8aae 100644 +index d71efd62f..5fe01e7ef 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { -- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a(astring[i])).toPlainText()); +- lines[i] = EnumChatFormat.b(new ChatComponentText(EnumChatFormat.b(astring[i])).getString()); + lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created. } SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); diff --git a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch index 8b1eb03330..9862afda98 100644 --- a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 598b210ce..c0f4cec4d 100644 +index 12af78209..3b76c7080 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -24,9 +24,9 @@ index 598b210ce..c0f4cec4d 100644 } public void addChannel(String channel) { -- com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot -+ com.google.common.base.Preconditions.checkState( DISABLE_CHANNEL_LIMIT || channels.size() < 128, "Too many channels registered" ); // Spigot // Paper - flag to disable channel limit +- com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot ++ com.google.common.base.Preconditions.checkState( DISABLE_CHANNEL_LIMIT || channels.size() < 128, "Too many channels registered" ); // Spigot // Paper - flag to disable channel limit + channel = StandardMessenger.validateAndCorrectChannel(channel); if (channels.add(channel)) { server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); - } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch b/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch deleted file mode 100644 index f9d465ac42..0000000000 --- a/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Tue, 17 Apr 2018 21:26:31 -0400 -Subject: [PATCH] Handle bad chunks more gracefully - -Prior to this change the server would crash when attempting to load a -chunk from a region with bad data. - -After this change the server will defer back to vanilla behavior. At -this time, that means attempting to generate a chunk in its place -(and occasionally just not generating anything and leaving small -holes in the world). - -Should Mojang choose to alter this behavior in the future, this change -will simply defer to whatever that new behavior is. - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index de859ffd1..55dada668 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - return null; - } else { - chunk = ChunkIOExecutor.syncChunkLoad(world, loader, this, i, j); -+ -+ // Paper start - If there was an issue loading the chunk from region, stage1 will fail and stage2 will load it sync -+ // all we need to do is fetch an instance -+ if (chunk == null) { -+ chunk = getChunkIfLoaded(i, j); -+ } -+ // Paper end - } - } else if (chunk == null && generate) { - chunk = originalGetChunkAt(i, j); -diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index ef9529add..cdf3b614c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -@@ -0,0 +0,0 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider= 5000000000L) { - this.Z = i; - this.q.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.I(), this.H())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.H(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.H(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = MathHelper.nextInt(this.r, 0, this.H() - agameprofile.length); +@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + if (i - this.Y >= 5000000000L) { + this.Y = i; + this.n.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.B(), this.A())); +- GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = MathHelper.nextInt(this.o, 0, this.A() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { -@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - return "1.12.2"; +@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + return "1.13-pre7"; } -+ public int getPlayerCount() { return H(); } // Paper - OBFHELPER - public int H() { - return this.v.getPlayerCount(); ++ public int getPlayerCount() { return A(); } // Paper - OBFHELPER + public int A() { + return this.s.getPlayerCount(); } -+ public int getMaxPlayers() { return I(); } // Paper - OBFHELPER - public int I() { - return this.v.getMaxPlayers(); ++ public int getMaxPlayers() { return B(); } // Paper - OBFHELPER + public int B() { + return this.s.getMaxPlayers(); } diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java -index 313bb0007..f3c25367d 100644 +index c9edd289a..8aa121e2f 100644 --- a/src/main/java/net/minecraft/server/PacketStatusListener.java +++ b/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -0,0 +0,0 @@ public class PacketStatusListener implements PacketStatusInListener { @@ -226,7 +226,7 @@ index 313bb0007..f3c25367d 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 981582212..ac161f505 100644 +index 2179664a0..616fcbf13 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java @@ -0,0 +0,0 @@ public class ServerPing { @@ -251,7 +251,7 @@ index 981582212..ac161f505 100644 this.c = agameprofile; } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index cc1f3ac96..4f9fd4bc6 100644 +index b39096f04..d89224e7d 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig diff --git a/Spigot-Server-Patches/Load-version-history-at-server-start.patch b/Spigot-Server-Patches/Load-version-history-at-server-start.patch index 5946492c5a..716b43e79f 100644 --- a/Spigot-Server-Patches/Load-version-history-at-server-start.patch +++ b/Spigot-Server-Patches/Load-version-history-at-server-start.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Load version history at server start diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 854455711..39a3d46ff 100644 +index 7ff2fa535..a329887ce 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/MC-124833.patch b/Spigot-Server-Patches/MC-124833.patch deleted file mode 100644 index 72d07d4fe3..0000000000 --- a/Spigot-Server-Patches/MC-124833.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Wed, 4 Apr 2018 21:00:43 -0400 -Subject: [PATCH] MC-124833 - -Conflicting reports of what software this bug does and does not affect. -Given the trivial impact of fixing it and an overabundance of caution, -we'll patch it in Paper as well. This will probably be a short lived -patch, with it being fixed in Vanilla proper 1.13 - -diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java -index 8b806c303..f0d6d6b85 100644 ---- a/src/main/java/net/minecraft/server/EntityItemFrame.java -+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java -@@ -0,0 +0,0 @@ public class EntityItemFrame extends EntityHanging { - } - - itemstack.a((EntityItemFrame) null); -+ -+ // Paper - MC-124833 - conflicting reports of what server software this does and doesn't affect. -+ // It's a one liner with near-zero impact so we'll patch it anyway just in case -+ this.setItem(ItemStack.a); // OBFHELPER - ItemStack.EMPTY - } - } - --- \ No newline at end of file diff --git a/Spigot-Server-Patches/MC-99321-Dont-check-for-blocked-double-chest-for-hop.patch b/Spigot-Server-Patches/MC-99321-Dont-check-for-blocked-double-chest-for-hop.patch index f7a0350716..28e2c26a90 100644 --- a/Spigot-Server-Patches/MC-99321-Dont-check-for-blocked-double-chest-for-hop.patch +++ b/Spigot-Server-Patches/MC-99321-Dont-check-for-blocked-double-chest-for-hop.patch @@ -11,15 +11,14 @@ This removes the necessity to disable the cat on chest behavior to improve perfo now performance will be improved even if you have cat chest detection on. diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 90267a1fb..91d3308c1 100644 +index 633c75ffe..68cdd3970 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity { - // Paper end +@@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC - if (block == this) { -- if (this.e(world, blockposition1)) { -+ if (!flag && this.e(world, blockposition1)) { // Paper - check for allowBlocked flag - MC-99321 + if (blockpropertychesttype1 != BlockPropertyChestType.SINGLE && blockpropertychesttype != blockpropertychesttype1 && iblockdata1.get(BlockChest.FACING) == iblockdata.get(BlockChest.FACING)) { + if (!flag && this.a(world, blockposition1)) { ++ //if (!flag && this.e(world, blockposition1)) { // Paper - check for allowBlocked flag - MC-99321 return null; } diff --git a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch index fa0c898157..938e4d6d25 100644 --- a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch @@ -28,7 +28,7 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 4c1a0181a..a89a86e6d 100644 +index 41115108f..07c53f505 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { @@ -58,25 +58,25 @@ index 4c1a0181a..a89a86e6d 100644 boolean flag = true; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - break; + break; - default: + default: + // Paper start - Replace with improved version below + if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return; + readLegacy1_6(channelhandlercontext, bytebuf); + /* - boolean flag1 = bytebuf.readUnsignedByte() == 1; + boolean flag1 = bytebuf.readUnsignedByte() == 1; - flag1 &= bytebuf.readUnsignedByte() == 250; + flag1 &= bytebuf.readUnsignedByte() == 250; @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { - } finally { - bytebuf1.release(); - } + } finally { + bytebuf1.release(); + } + */ + // Paper end - } + } - bytebuf.release(); + bytebuf.release(); @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { } diff --git a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch index 96aa776635..9243e77948 100644 --- a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch +++ b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch @@ -7,13 +7,25 @@ I don't know why upstream made only the minimum height configurable but whatever diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0ddf826f9..9fd76dcc9 100644 +index 49f282332..d80cd60ab 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { } + log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick); } - ++ ++ public int maxChunkGensPerTick = 10; ++ private void maxChunkGensPerTick() { ++ maxChunkGensPerTick = getInt("max-chunk-gens-per-tick", maxChunkGensPerTick); ++ if (maxChunkGensPerTick <= 0) { ++ maxChunkGensPerTick = Integer.MAX_VALUE; ++ log("Max Chunk Gens Per Tick: Unlimited (NOT RECOMMENDED)"); ++ } else { ++ log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); ++ } ++ } ++ + public double squidMaxSpawnHeight; + private void squidMaxSpawnHeight() { + squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); @@ -21,18 +33,19 @@ index 0ddf826f9..9fd76dcc9 100644 + } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 0ce16be65..58a902831 100644 +index ffc6d0b68..70b251210 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal { } - public boolean P() { -- return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) this.world.getSeaLevel() && super.P(); // Spigot + public boolean a(GeneratorAccess generatoraccess) { +- return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) generatoraccess.getSeaLevel(); // Spigot + // Paper - Make max spawn height configurable + final double maxHeight = world.paperConfig.squidMaxSpawnHeight > 0 ? world.paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); -+ return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < maxHeight && super.P(); // Spigot ++ return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < maxHeight; // Spigot ++ // Paper end } - public void b(float f, float f1, float f2) { + public void c(float f, float f1, float f2) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch index 5efe86b862..db4ae77296 100644 --- a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch @@ -23,7 +23,7 @@ index ec89ecfca..b602bbf12 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index eba1228fd..4e33cc2f2 100644 +index a562e1e46..cbfdb3cf7 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { @@ -33,5 +33,5 @@ index eba1228fd..4e33cc2f2 100644 + if(!com.destroystokyo.paper.PaperConfig.savePlayerData) return; // Paper - Make player data saving configurable try { NBTTagCompound nbttagcompound = entityhuman.save(new NBTTagCompound()); - File file = new File(this.playerDir, entityhuman.bn() + ".dat.tmp"); + File file = new File(this.playerDir, entityhuman.bu() + ".dat.tmp"); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 682633f774..6e424eab61 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -6,20 +6,20 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 4b82e43a8..35fde8b23 100644 +index 4fb300468..02f5d61c8 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { - protected int bS; - protected float bT = 0.02F; - private int f; -- private final GameProfile g; -+ private GameProfile g; public void setProfile(GameProfile profile) { this.g = profile; } // Paper - OBFHELPER - private ItemStack bV; - private final ItemCooldown bW; + protected int bZ; + protected float ca = 0.02F; + private int g; +- private final GameProfile h; ++ private final GameProfile h; public void setProfile(GameProfile profile) { this.h = profile; } // Paper - OBFHELPER + private ItemStack cd; + private final ItemCooldown ce; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 2842956bf..8aeded425 100644 +index 02bbb0d1d..e73b07f42 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -48,7 +48,7 @@ index 2842956bf..8aeded425 100644 uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 77c50ba14..598b210ce 100644 +index c2cd5ac4b..12af78209 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch index d8648145dd..e5432125b2 100644 --- a/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index 6896b7095..8913e2744 100644 +index 57918d3d6..67556ed32 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java @@ -0,0 +0,0 @@ public class AdvancementDataPlayer { diff --git a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch index 14bc6b7c7a..d3cb948f71 100644 --- a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch @@ -9,7 +9,7 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index e217d3340..46faa062d 100644 +index 8c6c68c9e..e7bf1e5fc 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch index b2dfcc1c6d..651d094301 100644 --- a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch @@ -15,7 +15,7 @@ instead and save a lot of server resources. See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 87fe4775f..9466bcdc7 100644 +index c76dbe74a..b88160a2e 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -0,0 +0,0 @@ @@ -27,9 +27,9 @@ index 87fe4775f..9466bcdc7 100644 import java.util.List; import javax.annotation.Nullable; @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { - double d3 = j >= 1 ? nbttaglist.f(0) : (double) blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; - double d4 = j >= 2 ? nbttaglist.f(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1); - double d5 = j >= 3 ? nbttaglist.f(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + double d3 = j >= 1 ? nbttaglist.k(0) : (double) blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + double d4 = j >= 2 ? nbttaglist.k(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1); + double d5 = j >= 3 ? nbttaglist.k(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; + // Paper start + if (this.getMobName() == null) { + return; @@ -55,33 +55,39 @@ index 87fe4775f..9466bcdc7 100644 if (entity == null) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 2cd063829..e217d3340 100644 +index 6d842df62..8c6c68c9e 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { - } - if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition) && a(EntityPositionTypes.a(biomebase_biomemeta.b), worldserver, blockposition_mutableblockposition)) { -+ // Paper start -+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; -+ Class cls = biomebase_biomemeta.b; -+ org.bukkit.entity.EntityType type = EntityTypes.clsToTypeMap.get(cls); -+ if (type != null) { -+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( -+ MCUtil.toLocation(worldserver, blockposition_mutableblockposition), -+ type, SpawnReason.NATURAL -+ ); -+ if (!event.callEvent()) { -+ if (event.shouldAbortSpawn()) { -+ continue label120; + if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) { + EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(biomebase_biomemeta.b); +- + if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) { + EntityInsentient entityinsentient; + ++ // Paper start ++ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; ++ EntityTypes cls = biomebase_biomemeta.b; ++ org.bukkit.entity.EntityType type = EntityTypes.clsToTypeMap.get(cls); ++ if (type != null) { ++ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( ++ MCUtil.toLocation(worldserver, blockposition_mutableblockposition), ++ type, SpawnReason.NATURAL ++ ); ++ if (!event.callEvent()) { ++ if (event.shouldAbortSpawn()) { ++ continue label128; // right above the iterator for c (Chunk Pos Set) ++ } ++ j1 += l2; ++ ++j4; ++ continue; + } -+ j1 += l2; -+ ++j4; -+ continue; + } -+ } -+ // Paper end - EntityInsentient entityinsentient; - - try { ++ // Paper end ++ ++ + try { + entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a((World) worldserver); + } catch (Exception exception) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch index 221a704014..d4db018b02 100644 --- a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch @@ -5,28 +5,31 @@ Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index a8dbbf20a..87f40bfcf 100644 +index 77cf6b8e9..9d9671eae 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { - for (int k = 0; k < j; ++k) { - EnumDirection enumdirection = aenumdirection[k]; + EnumDirection enumdirection = aenumdirection[j]; -- if (world.getType(blockposition.shift(enumdirection)).getBlock() == this) { -+ IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition.shift(enumdirection)); // Paper - don't load chunks -+ if (iblockdata1 == null) continue; // Paper -+ if (iblockdata1.getBlock() == this) { // Paper - ++i; - if (i >= 4) { - return i; + blockposition_b.j(blockposition).d(enumdirection); ++ ++ // Paper start - Prevent Frosted Ice from loading/holding chunks ++ if (!world.isChunkLoaded(blockposition_b.getX() >> 4, blockposition_b.getZ() >> 4, true)) ++ continue; ++ // Paper end - Prevent Frosted Ice from loading/holding chunks ++ + IBlockData iblockdata1 = world.getType(blockposition_b); + + if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) { @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { - for (int k = 0; k < j; ++k) { - EnumDirection enumdirection = aenumdirection[k]; - BlockPosition blockposition1 = blockposition.shift(enumdirection); -- IBlockData iblockdata1 = world.getType(blockposition1); -+ IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper - don't load chunks -+ if (iblockdata1 == null) continue; // Paper + EnumDirection enumdirection = aenumdirection[l]; - if (iblockdata1.getBlock() == this) { - this.a(world, blockposition1, iblockdata1, random, false); + blockposition_b.j(blockposition).d(enumdirection); ++ // Paper start - Prevent Frosted Ice from loading/holding chunks ++ if (!((World) iblockaccess).isChunkLoaded(blockposition_b.getX() >> 4, blockposition_b.getZ() >> 4, true)) ++ continue; ++ // Paper end - Prevent Frosted Ice from loading/holding chunks + if (iblockaccess.getType(blockposition_b).getBlock() == this) { + ++j; + if (j >= i) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch index e1c4431d19..0a757937f3 100644 --- a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 363e03b65..ef1fa8cf6 100644 +index d80cd60ab..830b99cd7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -21,14 +21,13 @@ index 363e03b65..ef1fa8cf6 100644 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 347237055..4b82e43a8 100644 +index ae4dd621d..4fb300468 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { - } - boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.m_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; -- + boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.z_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; + + flag2 = flag2 && !world.paperConfig.disablePlayerCrits; // Paper flag2 = flag2 && !this.isSprinting(); if (flag2) { diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index 2043a86ae2..c42450365f 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -20,28 +20,22 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 17bc80776..4dd5fed25 100644 +index 17bc80776..f9e225b73 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ + ${minecraft.version}-SNAPSHOT compile - +- - jline - jline - 2.12.1 - compile - -- -- org.ow2.asm -- asm -- 6.2 -+ net.sf.jopt-simple -+ jopt-simple -+ 5.0.4 - compile - + org.ow2.asm + asm @@ -0,0 +0,0 @@ 3.0.3 compile diff --git a/Spigot-Server-Patches/getPlayerUniqueId-API.patch b/Spigot-Server-Patches/getPlayerUniqueId-API.patch index 454909165e..57ae921785 100644 --- a/Spigot-Server-Patches/getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6095948e8..80702f6f6 100644 +index d605e5792..0b361d82f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server {