From 1638c2204602e25847880efe6183f5db25dcc30e Mon Sep 17 00:00:00 2001 From: granny Date: Wed, 3 Jun 2026 16:22:25 -0700 Subject: [PATCH] Initial 26.2 port --- gradle.properties | 8 +- purpur-server/build.gradle.kts.patch | 2 +- .../dispenser/DispenseItemBehavior.java.patch | 10 +- .../server/gui/MinecraftServerGui.java.patch | 31 +-- .../server/level/ServerLevel.java.patch | 32 +-- .../minecraft/world/entity/Entity.java.patch | 178 +++++++++++++++++ .../world/entity/EntityType.java.patch | 52 +++++ .../world/entity/LivingEntity.java.patch | 184 ++++++++++++++++++ .../entity/ai/behavior/AcquirePoi.java.patch | 10 +- .../world/entity/animal/bee/Bee.java.patch | 22 ++- .../entity/animal/squid/Squid.java.patch | 14 +- .../world/entity/animal/wolf/Wolf.java.patch | 24 ++- .../world/entity/monster/MagmaCube.java.patch | 10 +- .../world/entity/monster/Monster.java.patch | 14 +- .../world/entity/monster/Shulker.java.patch | 68 +++++++ .../world/entity/monster/Slime.java.patch | 10 +- .../WanderingTraderSpawner.java.patch | 10 +- .../world/entity/player/Player.java.patch | 119 +++++++++++ .../ThrownEnderpearl.java.patch | 12 +- .../world/inventory/GrindstoneMenu.java.patch | 18 +- .../net/minecraft/world/item/Items.java.patch | 12 +- .../world/level/ServerExplosion.java.patch | 10 +- .../world/level/block/BedBlock.java.patch | 14 +- .../level/block/RespawnAnchorBlock.java.patch | 10 +- .../storage/RegionFileStorage.java.patch | 10 +- .../world/level/portal/PortalShape.java.patch | 19 ++ .../activation/ActivationRange.java.patch | 4 +- .../net/minecraft/CrashReport.java.patch | 4 +- .../minecraft/commands/Commands.java.patch | 8 +- .../net/minecraft/core/BlockPos.java.patch | 2 +- .../framework/GameTestHelper.java.patch | 2 +- .../minecraft/network/Connection.java.patch | 2 +- .../net/minecraft/server/Main.java.patch | 2 +- .../server/MinecraftServer.java.patch | 16 +- .../server/PlayerAdvancements.java.patch | 4 +- .../dedicated/DedicatedServer.java.patch | 8 +- .../server/level/ServerPlayer.java.patch | 32 +-- .../server/level/WorldGenRegion.java.patch | 6 +- .../ServerGamePacketListenerImpl.java.patch | 32 +-- .../ServerLoginPacketListenerImpl.java.patch | 2 +- .../server/players/PlayerList.java.patch | 10 +- .../minecraft/world/entity/Entity.java.patch | 173 +--------------- .../world/entity/EntityType.java.patch | 51 +---- .../world/entity/ExperienceOrb.java.patch | 4 +- .../world/entity/LivingEntity.java.patch | 180 +---------------- .../net/minecraft/world/entity/Mob.java.patch | 14 +- .../entity/animal/cow/AbstractCow.java.patch | 6 +- .../entity/animal/cow/MushroomCow.java.patch | 4 +- .../entity/animal/dolphin/Dolphin.java.patch | 10 +- .../entity/animal/equine/Llama.java.patch | 10 +- .../world/entity/animal/feline/Cat.java.patch | 4 +- .../entity/animal/feline/Ocelot.java.patch | 2 +- .../world/entity/animal/fox/Fox.java.patch | 6 +- .../world/entity/animal/goat/Goat.java.patch | 2 +- .../entity/animal/golem/IronGolem.java.patch | 8 +- .../world/entity/animal/pig/Pig.java.patch | 2 +- .../animal/polarbear/PolarBear.java.patch | 8 +- .../entity/animal/rabbit/Rabbit.java.patch | 2 +- .../entity/animal/squid/GlowSquid.java.patch | 2 +- .../boss/enderdragon/EndCrystal.java.patch | 6 +- .../boss/enderdragon/EnderDragon.java.patch | 4 +- .../entity/decoration/ArmorStand.java.patch | 6 +- .../world/entity/item/ItemEntity.java.patch | 6 +- .../world/entity/item/PrimedTnt.java.patch | 2 +- .../world/entity/monster/Guardian.java.patch | 2 +- .../world/entity/monster/Ravager.java.patch | 4 +- .../world/entity/monster/Shulker.java.patch | 67 +------ .../world/entity/monster/Strider.java.patch | 2 +- .../entity/monster/hoglin/Hoglin.java.patch | 2 +- .../entity/monster/piglin/Piglin.java.patch | 2 +- .../entity/monster/piglin/PiglinAi.java.patch | 2 +- .../monster/skeleton/Skeleton.java.patch | 4 +- .../entity/monster/zombie/Drowned.java.patch | 2 +- .../entity/monster/zombie/Zombie.java.patch | 4 +- .../monster/zombie/ZombieVillager.java.patch | 2 +- .../entity/npc/villager/Villager.java.patch | 18 +- .../world/entity/player/Player.java.patch | 108 +--------- .../projectile/arrow/AbstractArrow.java.patch | 4 +- .../projectile/arrow/ThrownTrident.java.patch | 2 +- .../hurtingprojectile/WitherSkull.java.patch | 4 +- .../Snowball.java.patch | 2 +- .../minecart/NewMinecartBehavior.java.patch | 2 +- .../inventory/AbstractFurnaceMenu.java.patch | 2 +- .../minecraft/world/item/AxeItem.java.patch | 2 +- .../minecraft/world/item/BowItem.java.patch | 8 +- .../world/item/BucketItem.java.patch | 2 +- .../minecraft/world/item/DyeColor.java.patch | 2 +- .../minecraft/world/item/ItemStack.java.patch | 6 +- .../world/item/SpawnEggItem.java.patch | 2 +- .../world/level/BaseSpawner.java.patch | 2 +- .../world/level/EntityGetter.java.patch | 2 +- .../minecraft/world/level/Level.java.patch | 6 +- .../world/level/NaturalSpawner.java.patch | 2 +- .../world/level/block/Block.java.patch | 16 +- .../world/level/block/Blocks.java.patch | 4 +- .../level/block/CampfireBlock.java.patch | 2 +- .../level/block/CarvedPumpkinBlock.java.patch | 6 +- .../world/level/block/ChestBlock.java.patch | 2 +- .../level/block/NetherPortalBlock.java.patch | 8 +- .../block/PointedDripstoneBlock.java.patch | 2 +- .../level/block/SculkShriekerBlock.java.patch | 2 +- .../level/block/ShulkerBoxBlock.java.patch | 11 ++ .../world/level/block/SlabBlock.java.patch | 6 +- .../world/level/block/SpawnerBlock.java.patch | 8 +- .../block/entity/BeaconBlockEntity.java.patch | 8 +- .../entity/BeehiveBlockEntity.java.patch | 18 +- .../EnchantingTableBlockEntity.java.patch | 2 +- .../level/block/entity/FuelValues.java.patch | 11 ++ .../block/state/BlockBehaviour.java.patch | 11 ++ .../chunk/storage/EntityStorage.java.patch | 6 +- .../level/levelgen/PhantomSpawner.java.patch | 2 +- .../level/material/FlowingFluid.java.patch | 4 +- .../world/level/portal/PortalShape.java.patch | 2 +- .../0001-Ridables.patch | 0 ...-Configurable-entity-base-attributes.patch | 0 .../0003-Barrels-and-enderchests-6-rows.patch | 0 .../0004-Giants-AI-settings.patch | 0 .../0005-Chickens-can-retaliate.patch | 0 ...-Minecart-settings-and-WASD-controls.patch | 0 ...0007-Villagers-follow-emerald-blocks.patch | 0 .../0008-Implement-elytra-settings.patch | 0 .../0009-Configurable-jockey-options.patch | 0 ...ed-to-crystals-and-crystals-shoot-ph.patch | 0 .../0011-Phantoms-burn-in-light.patch | 0 ...e-entity-breeding-times-configurable.patch | 0 ...mes-from-item-forms-of-entities-to-e.patch | 0 ...Villager-Clerics-to-farm-Nether-Wart.patch | 0 ...fing-override-to-everything-affected.patch | 0 ...oggle-for-water-sensitive-mob-damage.patch | 0 ...017-API-for-any-mob-to-burn-daylight.patch | 0 ...turally-aggressive-to-players-chance.patch | 0 .../0019-Mobs-always-drop-experience.patch | 0 ...etting-to-reintroduce-end-void-rings.patch | 0 ...ob-mob_griefing-loot-pickup-override.patch | 0 .../paper/entity/ai/MobGoalHelper.java.patch | 2 +- .../bukkit/craftbukkit/CraftWorld.java.patch | 2 +- .../craftbukkit/entity/CraftEntity.java.patch | 2 +- .../craftbukkit/entity/CraftPlayer.java.patch | 6 +- .../util/CraftMagicNumbers.java.patch | 2 +- .../0001-Rebrand.patch | 0 .../0002-Ridables.patch | 0 .../0003-Barrels-and-enderchests-6-rows.patch | 0 ...004-API-for-any-mob-to-burn-daylight.patch | 0 ...etting-to-reintroduce-end-void-rings.patch | 0 144 files changed, 1133 insertions(+), 830 deletions(-) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch (77%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/server/gui/MinecraftServerGui.java.patch (83%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/server/level/ServerLevel.java.patch (88%) create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch (74%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/animal/bee/Bee.java.patch (81%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/animal/squid/Squid.java.patch (80%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/animal/wolf/Wolf.java.patch (89%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/monster/MagmaCube.java.patch (59%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/monster/Monster.java.patch (73%) create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/monster/Slime.java.patch (62%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch (73%) create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch (75%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/inventory/GrindstoneMenu.java.patch (89%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/item/Items.java.patch (79%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/level/ServerExplosion.java.patch (79%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/level/block/BedBlock.java.patch (73%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch (64%) rename purpur-server/minecraft-patches/{sources => rejected}/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch (65%) create mode 100644 purpur-server/minecraft-patches/rejected/net/minecraft/world/level/portal/PortalShape.java.patch create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ShulkerBoxBlock.java.patch create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch create mode 100644 purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch rename purpur-server/minecraft-patches/{features => unapplied-features}/0001-Ridables.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0002-Configurable-entity-base-attributes.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0003-Barrels-and-enderchests-6-rows.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0004-Giants-AI-settings.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0005-Chickens-can-retaliate.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0006-Minecart-settings-and-WASD-controls.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0007-Villagers-follow-emerald-blocks.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0008-Implement-elytra-settings.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0009-Configurable-jockey-options.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0010-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0011-Phantoms-burn-in-light.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0012-Make-entity-breeding-times-configurable.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0013-Apply-display-names-from-item-forms-of-entities-to-e.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0014-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0015-Add-mobGriefing-override-to-everything-affected.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0016-Toggle-for-water-sensitive-mob-damage.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0017-API-for-any-mob-to-burn-daylight.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0018-Cows-naturally-aggressive-to-players-chance.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0019-Mobs-always-drop-experience.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0020-Setting-to-reintroduce-end-void-rings.patch (100%) rename purpur-server/minecraft-patches/{features => unapplied-features}/0021-Per-mob-mob_griefing-loot-pickup-override.patch (100%) rename purpur-server/paper-patches/{features => unapplied-features}/0001-Rebrand.patch (100%) rename purpur-server/paper-patches/{features => unapplied-features}/0002-Ridables.patch (100%) rename purpur-server/paper-patches/{features => unapplied-features}/0003-Barrels-and-enderchests-6-rows.patch (100%) rename purpur-server/paper-patches/{features => unapplied-features}/0004-API-for-any-mob-to-burn-daylight.patch (100%) rename purpur-server/paper-patches/{features => unapplied-features}/0005-Setting-to-reintroduce-end-void-rings.patch (100%) diff --git a/gradle.properties b/gradle.properties index 55a398f3b..bfae0aae6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ group = org.purpurmc.purpur -mcVersion = 26.1.2 -apiVersion = 26.1.2 -channel=STABLE -paperCommit = 76d2ac758cb3abe75aceefa88207443768f585c6 +mcVersion = 26.2-pre-3 +apiVersion = 26.2 +channel=EXPERIMENTAL +paperCommit = 1bea43f2481fd75fc4474d5cbc8cf8633ac72ca5 org.gradle.configuration-cache = true org.gradle.caching = true diff --git a/purpur-server/build.gradle.kts.patch b/purpur-server/build.gradle.kts.patch index 7793cc0d6..0a730dd75 100644 --- a/purpur-server/build.gradle.kts.patch +++ b/purpur-server/build.gradle.kts.patch @@ -27,7 +27,7 @@ + // Purpur end - Rebrand + + /*updatingMinecraft { // Purpur start - TODO - snapshot - we don't need this - // oldPaperCommit = "711c5de2b05df39b72c44ff54e9f9381f8d153cb" + oldPaperCommit = "d4fe85375af18bfa88f44d7c1e6a61904ae550cc" - } + }*/ // Purpur end - TODO - snapshot - we don't need this } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch similarity index 77% rename from purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch index 5e753adf2..a5eafcade 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/core/dispenser/DispenseItemBehavior.java b/net/minecraft/core/dispenser/DispenseItemBehavior.java +index b851968a97a0f6df597a9f1fc91517b6835adf68..56b9f9016a652a704d785de683738efcf02a44f9 100644 --- a/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -683,5 +_,22 @@ +@@ -683,5 +683,22 @@ public interface DispenseItemBehavior { DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART)); DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART)); DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/gui/MinecraftServerGui.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/gui/MinecraftServerGui.java.patch similarity index 83% rename from purpur-server/minecraft-patches/sources/net/minecraft/server/gui/MinecraftServerGui.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/gui/MinecraftServerGui.java.patch index 018bbf945..52717b21f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/gui/MinecraftServerGui.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/server/gui/MinecraftServerGui.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/server/gui/MinecraftServerGui.java b/net/minecraft/server/gui/MinecraftServerGui.java +index b810cb0a9dd8713aed70cc9fdeea1bc249c8e0dc..f5c52f0aa85d8ae66215fbbe94773b16e06a72a5 100644 --- a/net/minecraft/server/gui/MinecraftServerGui.java +++ b/net/minecraft/server/gui/MinecraftServerGui.java -@@ -39,6 +_,11 @@ +@@ -39,6 +39,11 @@ public class MinecraftServerGui extends JComponent { private Thread logAppenderThread; private final Collection finalizers = Lists.newArrayList(); private final AtomicBoolean isClosing = new AtomicBoolean(); @@ -12,7 +20,7 @@ public static MinecraftServerGui showFrameFor(final DedicatedServer server) { try { -@@ -46,7 +_,7 @@ +@@ -46,7 +51,7 @@ public class MinecraftServerGui extends JComponent { } catch (Exception var3) { } @@ -21,7 +29,7 @@ final MinecraftServerGui gui = new MinecraftServerGui(server); frame.setDefaultCloseOperation(2); frame.add(gui); -@@ -54,7 +_,7 @@ +@@ -54,7 +59,7 @@ public class MinecraftServerGui extends JComponent { frame.setLocationRelativeTo(null); frame.setVisible(true); // Paper start - Improve ServerGUI @@ -30,7 +38,7 @@ try { frame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png")))); } catch (java.io.IOException ignore) { -@@ -64,7 +_,7 @@ +@@ -64,7 +69,7 @@ public class MinecraftServerGui extends JComponent { @Override public void windowClosing(final WindowEvent event) { if (!gui.isClosing.getAndSet(true)) { @@ -39,7 +47,7 @@ server.halt(true); gui.runFinalizers(); } -@@ -112,7 +_,7 @@ +@@ -112,7 +117,7 @@ public class MinecraftServerGui extends JComponent { private JComponent buildChatPanel() { JPanel panel = new JPanel(new BorderLayout()); @@ -48,7 +56,7 @@ JScrollPane scrollPane = new JScrollPane(chatArea, 22, 30); chatArea.setEditable(false); chatArea.setFont(MONOSPACED); -@@ -121,10 +_,43 @@ +@@ -121,10 +126,43 @@ public class MinecraftServerGui extends JComponent { String text = chatField.getText().trim(); if (!text.isEmpty()) { this.server.handleConsoleInput(text, this.server.createCommandSourceStack()); @@ -92,7 +100,7 @@ chatArea.addFocusListener(new FocusAdapter() { @Override public void focusGained(final FocusEvent arg0) { -@@ -159,7 +_,7 @@ +@@ -159,7 +197,7 @@ public class MinecraftServerGui extends JComponent { } private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper @@ -101,7 +109,7 @@ if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(() -> this.print(console, scrollPane, line)); } else { -@@ -170,16 +_,29 @@ +@@ -170,10 +208,11 @@ public class MinecraftServerGui extends JComponent { shouldScroll = scrollBar.getValue() + scrollBar.getSize().getHeight() + MONOSPACED.getSize() * 4 > scrollBar.getMaximum(); } @@ -115,10 +123,10 @@ if (shouldScroll) { scrollBar.setValue(Integer.MAX_VALUE); - } +@@ -181,6 +220,18 @@ public class MinecraftServerGui extends JComponent { } } -+ + + // Purpur start - GUI Improvements + public static class CommandHistory extends java.util.LinkedList { + @Override @@ -130,6 +138,7 @@ + } + } + // Purpur end - GUI Improvements - ++ // Paper start - Add onboarding message for initial server start private JComponent buildOnboardingPanel() { + String onboardingLink = "https://docs.papermc.io/paper/next-steps"; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerLevel.java.patch similarity index 88% rename from purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerLevel.java.patch index 2921271c7..536859e29 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerLevel.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerLevel.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java +index 229ff740e0418a05d824a67401ae6f105b4c3642..316fece122a3b71b5c809ed15c46c8cb37d1cdbf 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -219,6 +_,8 @@ +@@ -219,6 +219,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet private final StructureManager structureManager; private final StructureCheck structureCheck; private final boolean tickTime; @@ -9,7 +17,7 @@ private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this); // CraftBukkit start -@@ -643,8 +_,25 @@ +@@ -643,8 +645,25 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet // CraftBukkit end this.tickTime = tickTime; this.server = server; @@ -36,7 +44,7 @@ ChunkGenerator generator = levelStem.generator(); // CraftBukkit start // Paper start - per-world time -@@ -738,6 +_,7 @@ +@@ -738,6 +757,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler); // Paper end - rewrite chunk system this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit @@ -44,7 +52,7 @@ } // Paper start -@@ -794,7 +_,7 @@ +@@ -794,7 +814,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet } int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); @@ -53,7 +61,7 @@ Optional> defaultClock = this.dimensionType().defaultClock(); org.bukkit.event.world.ClockTimeSkipEvent event = null; // Paper - per-world time if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) { -@@ -1036,9 +_,18 @@ +@@ -1036,9 +1056,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet && this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses && !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS); if (isTrap) { @@ -73,7 +81,7 @@ horse.setAge(0); horse.setPos(pos.getX(), pos.getY(), pos.getZ()); this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit -@@ -1073,9 +_,35 @@ +@@ -1073,9 +1102,35 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet if (state.is(Blocks.SNOW)) { int currentLayers = state.getValue(SnowLayerBlock.LAYERS); if (currentLayers < Math.min(maxHeight, 8)) { @@ -109,7 +117,7 @@ } } else { org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit -@@ -1096,7 +_,7 @@ +@@ -1096,7 +1151,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet p -> p.is(PoiTypes.LIGHTNING_ROD), lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1, center, @@ -118,7 +126,7 @@ PoiManager.Occupancy.ANY ); return nearbyLightningRod.map(blockPos -> blockPos.above(1)); -@@ -1144,8 +_,26 @@ +@@ -1144,8 +1199,26 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); Component message; if (this.sleepStatus.areEnoughSleeping(percentage)) { @@ -145,7 +153,7 @@ message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage)); } -@@ -1311,6 +_,7 @@ +@@ -1311,6 +1384,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet public void resetWeatherCycle() { WeatherData weatherData = this.getWeatherData(); // CraftBukkit start @@ -153,7 +161,7 @@ weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... -@@ -1318,6 +_,7 @@ +@@ -1318,6 +1392,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet weatherData.setRainTime(0); } // CraftBukkit end @@ -161,7 +169,7 @@ weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents // CraftBukkit start // If we stop due to everyone sleeping we should reset the weather duration to some other random value. -@@ -1989,7 +_,7 @@ +@@ -1989,7 +2064,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet Explosion.BlockInteraction blockInteraction = switch (interactionType) { case NONE -> Explosion.BlockInteraction.KEEP; case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY); @@ -170,7 +178,7 @@ ? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY) : Explosion.BlockInteraction.KEEP; case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY); -@@ -2914,7 +_,7 @@ +@@ -2914,7 +2989,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet // Spigot start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch new file mode 100644 index 000000000..a6589a1e9 --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch @@ -0,0 +1,178 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java +index 3623fa8e923e3d417b073aed03f7be931285e3e5..a4a0683c0287da0543a5c869163c925f899b1550 100644 +--- a/net/minecraft/world/entity/Entity.java ++++ b/net/minecraft/world/entity/Entity.java +@@ -168,6 +168,7 @@ public abstract class Entity + SlotProvider, + DebugValueSource, + TypedInstance>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker ++ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes + // CraftBukkit start + private static final int CURRENT_LEVEL = 2; + static boolean isLevelAtLeast(ValueInput input, int level) { +@@ -297,8 +298,9 @@ public abstract class Entity + public double xOld; + public double yOld; + public double zOld; ++ public float maxUpStep; // Purpur - Add option to set armorstand step height + public boolean noPhysics; +- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random ++ public final RandomSource random; // Paper - Share random for entities to make them more random // Purpur - Add toggle for RNG manipulation + public int tickCount; + private int remainingFireTicks; + private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA)); +@@ -330,8 +332,8 @@ public abstract class Entity + public @Nullable PortalProcessor portalProcess; + public int portalCooldown; + private boolean invulnerable; +- protected UUID uuid = Mth.createInsecureUUID(this.random); +- protected String stringUUID = this.uuid.toString(); ++ protected UUID uuid; // Purpur - Add toggle for RNG manipulation ++ protected String stringUUID; // Purpur - Add toggle for RNG manipulation + private boolean hasGlowingTag; + private final Set tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl + private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0}; +@@ -382,6 +384,7 @@ public abstract class Entity + private final int despawnTime; // Paper - entity despawn time limit + public int totalEntityAge; // Paper - age-like counter for all entities + public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges ++ public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API + // Paper start - EAR 2 + public final boolean defaultActivationState; + public long activatedTick = Integer.MIN_VALUE; +@@ -549,10 +552,22 @@ public abstract class Entity + } + // Paper end - optimise entity tracker + ++ // Purpur start - Add canSaveToDisk to Entity ++ public boolean canSaveToDisk() { ++ return true; ++ } ++ // Purpur end - Add canSaveToDisk to Entity ++ + public Entity(final EntityType type, final Level level) { + this.type = type; + this.level = level; + this.dimensions = type.getDimensions(); ++ this.maxAirTicks = level == null || this.getDefaultMaxAirSupply() != Entity.TOTAL_AIR_SUPPLY ? this.getDefaultMaxAirSupply() : this.level.purpurConfig.drowningAirTicks; // Purpur - Drowning Settings ++ // Purpur start - Add toggle for RNG manipulation ++ this.random = level == null || level.purpurConfig.entitySharedRandom ? SHARED_RANDOM : RandomSource.create(); ++ this.uuid = Mth.createInsecureUUID(this.random); ++ this.stringUUID = this.uuid.toString(); ++ // Purpur end - Add toggle for RNG manipulation + this.position = Vec3.ZERO; + this.blockPosition = BlockPos.ZERO; + this.chunkPosition = ChunkPos.ZERO; +@@ -950,6 +965,7 @@ public abstract class Entity + && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) + && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { + // Paper end - Configurable nether ceiling damage ++ if (this.level.purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level.levelData.getRespawnData().pos(), this.level)); else // Purpur - Add option to teleport to spawn on nether ceiling damage + this.onBelowWorld(); + } + } +@@ -2007,7 +2023,7 @@ public abstract class Entity + } + + public boolean fireImmune() { +- return this.getType().fireImmune(); ++ return this.immuneToFire != null ? immuneToFire : this.getType().fireImmune(); // Purpur - add fire immune API + } + + public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) { +@@ -2593,7 +2609,7 @@ public abstract class Entity + output.putBoolean("Bukkit.invisible", this.persistentInvisibility); + } + // SPIGOT-6907: re-implement LivingEntity#setMaximumAir() +- if (this.maxAirTicks != this.getDefaultMaxAirSupply()) { ++ if (this.maxAirTicks != this.getDefaultMaxAirSupply() && this.getDefaultMaxAirSupply() != this.level().purpurConfig.drowningAirTicks) { // Purpur - Drowning Settings + output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply()); + } + output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper +@@ -2679,6 +2695,11 @@ public abstract class Entity + output.putBoolean("Paper.FreezeLock", true); + } + // Paper end ++ // Purpur start - Fire immune API ++ if (immuneToFire != null) { ++ output.putBoolean("Purpur.FireImmune", immuneToFire); ++ } ++ // Purpur end - Fire immune API + } catch (Throwable t) { + CrashReport report = CrashReport.forThrowable(t, "Saving entity NBT"); + CrashReportCategory category = report.addCategory("Entity being saved"); +@@ -2802,6 +2823,9 @@ public abstract class Entity + } + freezeLocked = input.getBooleanOr("Paper.FreezeLock", false); + // Paper end ++ ++ immuneToFire = input.read("Purpur.FireImmune", com.mojang.serialization.Codec.BOOL).orElse(null); // Purpur - Fire immune API ++ + } catch (Throwable t) { + CrashReport report = CrashReport.forThrowable(t, "Loading entity NBT"); + CrashReportCategory category = report.addCategory("Entity being loaded"); +@@ -3067,6 +3091,7 @@ public abstract class Entity + if (this.isAlive() && this instanceof Leashable leashable) { + if (leashable.getLeashHolder() == player) { + if (!this.level().isClientSide()) { ++ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.villager.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers + // Paper start - EntityUnleashEvent + if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent( + leashable, player, hand, !player.hasInfiniteMaterials(), true +@@ -3500,15 +3525,18 @@ public abstract class Entity + return Vec3.directionFromRotation(this.getRotationVector()); + } + ++ public BlockPos portalPos = BlockPos.ZERO; // Purpur - Fix stuck in portals + public void setAsInsidePortal(final Portal portal, final BlockPos pos) { + if (this.isOnPortalCooldown()) { ++ if (!(level().purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(this.portalPos))) // Purpur - Fix stuck in portals + this.setPortalCooldown(); +- } else { ++ } else if (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur - Entities can use portals + if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) { + this.portalProcess = new PortalProcessor(portal, pos.immutable()); + } else if (!this.portalProcess.isInsidePortalThisTick()) { + this.portalProcess.updateEntryPosition(pos.immutable()); + this.portalProcess.setAsInsidePortalThisTick(true); ++ this.portalPos = BlockPos.ZERO; // Purpur - Fix stuck in portals + } + } + } +@@ -4238,7 +4266,7 @@ public abstract class Entity + } + + public boolean canUsePortal(final boolean ignorePassenger) { +- return (ignorePassenger || !this.isPassenger()) && this.isAlive(); ++ return (ignorePassenger || !this.isPassenger()) && this.isAlive() && (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Purpur - Entities can use portals + } + + public boolean canTeleport(final Level from, final Level to) { +@@ -4788,6 +4816,12 @@ public abstract class Entity + return Mth.lerp(partial, this.yRotO, this.yRot); + } + ++ // Purpur start - Stop squids floating on top of water ++ public AABB getAxisForFluidCheck() { ++ return this.getBoundingBox().deflate(0.001D); ++ } ++ // Purpur end - Stop squids floating on top of water ++ + public boolean touchingUnloadedChunk() { + AABB box = this.getBoundingBox().inflate(1.0); + int x0 = Mth.floor(box.minX); +@@ -5091,7 +5125,7 @@ public abstract class Entity + } + + public float maxUpStep() { +- return 0.0F; ++ return maxUpStep; // Purpur - Add option to set armorstand step height + } + + public void onExplosionHit(final @Nullable Entity explosionCausedBy) { diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch new file mode 100644 index 000000000..32fb49511 --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch @@ -0,0 +1,52 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java +index 0840d69c9e80a2df01737a2980f0b5d6a6ca7691..c2d4f6a164a18c8809d143793921567907363a17 100644 +--- a/net/minecraft/world/entity/EntityType.java ++++ b/net/minecraft/world/entity/EntityType.java +@@ -1238,6 +1238,16 @@ public class EntityType implements EntityTypeTest, + return register(vanillaEntityId(vanillaId), builder); + } + ++ // Purpur start - PlayerSetSpawnerTypeWithEggEvent ++ public static EntityType getFromBukkitType(org.bukkit.entity.EntityType bukkitType) { ++ return getFromKey(Identifier.parse(bukkitType.getKey().toString())); ++ } ++ ++ public static EntityType getFromKey(Identifier location) { ++ return BuiltInRegistries.ENTITY_TYPE.getValue(location); ++ } ++ // Purpur end - PlayerSetSpawnerTypeWithEggEvent ++ + public static Identifier getKey(final EntityType type) { + return BuiltInRegistries.ENTITY_TYPE.getKey(type); + } +@@ -1495,6 +1505,16 @@ public class EntityType implements EntityTypeTest, + return this.category; + } + ++ // Purpur start - PlayerSetSpawnerTypeWithEggEvent ++ public String getName() { ++ return BuiltInRegistries.ENTITY_TYPE.getKey(this).getPath(); ++ } ++ ++ public String getTranslatedName() { ++ return getDescription().getString(); ++ } ++ // Purpur end - PlayerSetSpawnerTypeWithEggEvent ++ + public String getDescriptionId() { + return this.descriptionId; + } +@@ -1556,6 +1576,7 @@ public class EntityType implements EntityTypeTest, + // Paper start - Add logging for debugging entity tags with invalid ids + () -> { + LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]")); ++ LOGGER.warn("Location: {} {}", level.getWorld().getName(), input.read("Pos", net.minecraft.world.phys.Vec3.CODEC).orElse(net.minecraft.world.phys.Vec3.ZERO)); // Purpur - log skipped entity's position + if ((DEBUG_ENTITIES_WITH_INVALID_IDS || level.getCraftServer().getServer().isDebugging()) && input instanceof TagValueInput tagInput) { + LOGGER.warn("Skipped entity tag: {}", tagInput.input); + } diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch new file mode 100644 index 000000000..100eeb406 --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch @@ -0,0 +1,184 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java +index 4bb708ef6601ee0512974b23fd98acc4e6bf81bb..93191aa5a24f9390d0d8c7c384c700dbe18d0212 100644 +--- a/net/minecraft/world/entity/LivingEntity.java ++++ b/net/minecraft/world/entity/LivingEntity.java +@@ -441,6 +441,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + if (dist < 0.0) { + double damagePerBlock = level.getWorldBorder().getDamagePerBlock(); + if (damagePerBlock > 0.0) { ++ // Purpur start - Add option to teleport to spawn if outside world border ++ if (this.level().purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer serverPlayer) { ++ serverPlayer.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level().levelData.getRespawnData().pos(), this.level())); ++ return; ++ } ++ // Purpur end - Add option to teleport to spawn if outside world border + this.hurtServer(level, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-dist * damagePerBlock))); + } + } +@@ -456,7 +462,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + if (this.shouldTakeDrowningDamage()) { + this.setAirSupply(0); + level.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES); +- this.hurtServer(level, this.damageSources().drown(), 2.0F); ++ this.hurtServer(level, this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur - Drowning Settings + } + } else if (this.getAirSupply() < this.getMaxAirSupply() && MobEffectUtil.shouldEffectsRefillAirsupply(this)) { + this.setAirSupply(this.increaseAirSupply(this.getAirSupply())); +@@ -516,7 +522,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + } + + protected boolean shouldTakeDrowningDamage() { +- return this.getAirSupply() <= -20; ++ return this.getAirSupply() <= -this.level().purpurConfig.drowningDamageInterval; // Purpur - Drowning Settings + } + + @Override +@@ -1048,16 +1054,34 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + } + + if (targetingEntity != null) { +- ItemStack itemStack = this.getItemBySlot(EquipmentSlot.HEAD); +- if (targetingEntity.is(EntityType.SKELETON) && itemStack.is(Items.SKELETON_SKULL) +- || targetingEntity.is(EntityType.ZOMBIE) && itemStack.is(Items.ZOMBIE_HEAD) +- || targetingEntity.is(EntityType.PIGLIN) && itemStack.is(Items.PIGLIN_HEAD) +- || targetingEntity.is(EntityType.PIGLIN_BRUTE) && itemStack.is(Items.PIGLIN_HEAD) +- || targetingEntity.is(EntityType.CREEPER) && itemStack.is(Items.CREEPER_HEAD)) { +- visibilityPercent *= 0.5; ++ ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD); ++ // Purpur start - Mob head visibility percent ++ if (targetingEntity.is(EntityType.SKELETON) && itemBySlot.is(Items.SKELETON_SKULL)) { ++ visibilityPercent *= targetingEntity.level().purpurConfig.skeletonHeadVisibilityPercent; ++ } ++ else if (targetingEntity.is(EntityType.ZOMBIE) && itemBySlot.is(Items.ZOMBIE_HEAD)) { ++ visibilityPercent *= targetingEntity.level().purpurConfig.zombieHeadVisibilityPercent; + } ++ else if ((targetingEntity.is(EntityType.PIGLIN) || targetingEntity.is(EntityType.PIGLIN_BRUTE)) && itemBySlot.is(Items.PIGLIN_HEAD)) { ++ visibilityPercent *= targetingEntity.level().purpurConfig.piglinHeadVisibilityPercent; ++ } ++ else if (targetingEntity.is(EntityType.CREEPER) && itemBySlot.is(Items.CREEPER_HEAD)) { ++ visibilityPercent *= targetingEntity.level().purpurConfig.creeperHeadVisibilityPercent; ++ } ++ // Purpur end - Mob head visibility percent + } + ++ // Purpur start - Configurable mob blindness ++ if (targetingEntity instanceof LivingEntity entityliving) { ++ if (entityliving.hasEffect(MobEffects.BLINDNESS)) { ++ int amplifier = entityliving.getEffect(MobEffects.BLINDNESS).getAmplifier(); ++ for (int i = 0; i < amplifier; i++) { ++ amplifier *= this.level().purpurConfig.mobsBlindnessMultiplier; ++ } ++ } ++ } ++ // Purpur end - Configurable mob blindness ++ + return visibilityPercent; + } + +@@ -1106,6 +1130,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + Iterator iterator = this.activeEffects.values().iterator(); + while (iterator.hasNext()) { + MobEffectInstance effect = iterator.next(); ++ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur - Milk Keeps Beneficial Effects + EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); + if (event.isCancelled()) { + continue; +@@ -1438,7 +1463,23 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + this.stopSleeping(); + } + +- this.noActionTime = 0; ++ // Purpur start - One Punch Man! ++ if (source.getEntity() instanceof net.minecraft.world.entity.player.Player player && source.getEntity().level().purpurConfig.creativeOnePunch && !source.is(DamageTypeTags.IS_PROJECTILE)) { ++ if (player.isCreative()) { ++ org.apache.commons.lang3.mutable.MutableDouble attackDamage = new org.apache.commons.lang3.mutable.MutableDouble(); ++ player.getMainHandItem().forEachModifier(EquipmentSlot.MAINHAND, (attributeHolder, attributeModifier) -> { ++ if (attributeModifier.operation() == AttributeModifier.Operation.ADD_VALUE) { ++ attackDamage.addAndGet(attributeModifier.amount()); ++ } ++ }); ++ ++ if (attackDamage.doubleValue() == 0.0D) { ++ // One punch! ++ damage = this.getHealth(); ++ } ++ } ++ } ++ // Purpur end - One Punch Man!this.noActionTime = 0; + if (damage < 0.0F) { + damage = 0.0F; + } +@@ -1699,10 +1740,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + protected @Nullable Player resolvePlayerResponsibleForDamage(final DamageSource source) { + Entity sourceEntity = source.getEntity(); + if (sourceEntity instanceof Player playerSource) { +- this.setLastHurtByPlayer(playerSource, 100); ++ this.setLastHurtByPlayer(playerSource, this.level().purpurConfig.mobLastHurtByPlayerTime); // Purpur - Config for mob last hurt by player time + } else if (sourceEntity instanceof Wolf wolf && wolf.isTame()) { + if (wolf.getOwnerReference() != null) { +- this.setLastHurtByPlayer(wolf.getOwnerReference().getUUID(), 100); ++ this.setLastHurtByPlayer(wolf.getOwnerReference().getUUID(), this.level().purpurConfig.mobLastHurtByPlayerTime); // Purpur - Config for mob last hurt by player time + } else { + this.lastHurtByPlayer = null; + this.lastHurtByPlayerMemoryTime = 0; +@@ -1754,6 +1795,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + } + } + ++ // Purpur start - Totems work in inventory ++ if (level().purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer player && (itemStack == null || itemStack.getItem() != Items.TOTEM_OF_UNDYING) && player.getBukkitEntity().hasPermission("purpur.inventory_totem")) { ++ for (ItemStack item : player.getInventory().getNonEquipmentItems()) { ++ if (item.getItem() == Items.TOTEM_OF_UNDYING) { ++ itemStack = item; ++ protectionItem = item.copy(); ++ break; ++ } ++ } ++ } ++ // Purpur end - Totems work in inventory + final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null; + final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); + event.setCancelled(protectionItem == null); +@@ -1927,6 +1979,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + boolean playerKilled = this.lastHurtByPlayerMemoryTime > 0; + this.dropEquipment(level); // CraftBukkit - from below + if (this.shouldDropLoot(level)) { ++ if (!(source.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level().purpurConfig.disableDropsOnCrammingDeath)) { // Purpur - Disable loot drops on death by cramming + this.dropFromLootTable(level, source, playerKilled); + // Paper start + final boolean prev = this.clearEquipmentSlots; +@@ -1935,6 +1988,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + // Paper end + this.dropCustomDeathLoot(level, source, playerKilled); + this.clearEquipmentSlots = prev; // Paper ++ } // Purpur - Disable loot drops on death by cramming + } + + // CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment +@@ -3264,6 +3318,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + float dmg = (float)(diff * 10.0 - 3.0); + if (dmg > 0.0F) { + this.playSound(this.getFallDamageSound((int)dmg), 1.0F, 1.0F); ++ if (level().purpurConfig.elytraKineticDamage) // Purpur - Toggle for kinetic damage + this.hurt(this.damageSources().flyIntoWall(), dmg); + } + } +@@ -4750,6 +4805,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin + : slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.typeHolder()); + } + ++ // Purpur start - Dispenser curse of binding protection ++ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack itemstack) { ++ return EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BINDING_CURSE, itemstack) > 0 ? null : this.getEquipmentSlotForItem(itemstack); ++ } ++ // Purpur end - Dispenser curse of binding protection ++ + private static SlotAccess createEquipmentSlotAccess(final LivingEntity entity, final EquipmentSlot equipmentSlot) { + return equipmentSlot != EquipmentSlot.HEAD && equipmentSlot != EquipmentSlot.MAINHAND && equipmentSlot != EquipmentSlot.OFFHAND + ? SlotAccess.forEquipmentSlot(entity, equipmentSlot, stack -> stack.isEmpty() || entity.getEquipmentSlotForItem(stack) == equipmentSlot) diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch similarity index 74% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch index 113c6980d..567b93db3 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/AcquirePoi.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +index 2940dbc31a20eb49e24418ec84b73f2bfbdcfc32..812cd00f750197f9bdde6f2295c27172ae463414 100644 --- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java +++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java -@@ -96,7 +_,7 @@ +@@ -96,7 +96,7 @@ public class AcquirePoi { }; // Paper start - optimise POI searches java.util.List, BlockPos>> poiPositionsRaw = new java.util.ArrayList<>(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/bee/Bee.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/bee/Bee.java.patch similarity index 81% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/bee/Bee.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/bee/Bee.java.patch index 69afd3270..080d5899e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/bee/Bee.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/bee/Bee.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java +index 899481ad0108bd06fb09727bf59827a7227e0c80..28cf7f1b7b947639a686b83a5a7d617af9b83e15 100644 --- a/net/minecraft/world/entity/animal/bee/Bee.java +++ b/net/minecraft/world/entity/animal/bee/Bee.java -@@ -171,7 +_,7 @@ +@@ -171,7 +171,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { // Paper end - Fix MC-167279 this.lookControl = new Bee.BeeLookControl(this); this.setPathfindingMalus(PathType.FIRE_IN_NEIGHBOR, -1.0F); @@ -9,7 +17,7 @@ this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F); this.setPathfindingMalus(PathType.COCOA, -1.0F); this.setPathfindingMalus(PathType.FENCE, -1.0F); -@@ -362,13 +_,19 @@ +@@ -362,13 +362,19 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) { boolean wantsToEnterHive = this.hasNectar() || this.isTiredOfLookingForNectar() @@ -30,7 +38,7 @@ public void setStayOutOfHiveCountdown(final int ticks) { this.stayOutOfHiveCountdown = ticks; } -@@ -389,7 +_,7 @@ +@@ -389,7 +395,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { @Override protected void customServerAiStep(final ServerLevel level) { boolean hasStung = this.hasStung(); @@ -39,7 +47,7 @@ this.underWaterTicks++; } else { this.underWaterTicks = 0; -@@ -399,6 +_,7 @@ +@@ -399,6 +405,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { this.hurtServer(level, this.damageSources().drown(), 1.0F); } @@ -47,7 +55,7 @@ if (hasStung) { this.timeSinceSting++; if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) { -@@ -1132,6 +_,7 @@ +@@ -1132,6 +1139,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { Bee.this.savedFlowerPos = nearbyPos.get(); Bee.this.navigation .moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F); @@ -55,7 +63,7 @@ return true; } else { Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60); -@@ -1178,6 +_,7 @@ +@@ -1178,6 +1186,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { this.pollinating = false; Bee.this.navigation.stop(); Bee.this.remainingCooldownBeforeLocatingNewFlower = 200; @@ -63,7 +71,7 @@ } @Override -@@ -1224,6 +_,7 @@ +@@ -1224,6 +1233,7 @@ public class Bee extends Animal implements FlyingAnimal, NeutralMob { this.setWantedPos(); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/Squid.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/squid/Squid.java.patch similarity index 80% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/Squid.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/squid/Squid.java.patch index 84ca8fad1..46a7c62dd 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/Squid.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/squid/Squid.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/animal/squid/Squid.java b/net/minecraft/world/entity/animal/squid/Squid.java +index 637cdcf459aaf78dc381d8a990b0e2c571c06de8..45e170bbcc72206ed0018440c435359084749a7f 100644 --- a/net/minecraft/world/entity/animal/squid/Squid.java +++ b/net/minecraft/world/entity/animal/squid/Squid.java -@@ -51,10 +_,29 @@ +@@ -51,10 +51,29 @@ public class Squid extends AgeableWaterCreature { public Squid(final EntityType type, final Level level) { super(type, level); @@ -31,7 +39,7 @@ @Override protected void registerGoals() { this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this)); -@@ -131,6 +_,7 @@ +@@ -131,6 +150,7 @@ public class Squid extends AgeableWaterCreature { } if (this.isInWater()) { @@ -39,7 +47,7 @@ if (this.tentacleMovement < Mth.PI) { float tentacleScale = this.tentacleMovement / Mth.PI; this.tentacleAngle = Mth.sin(tentacleScale * tentacleScale * Mth.PI) * Mth.PI * 0.25F; -@@ -316,7 +_,7 @@ +@@ -316,7 +336,7 @@ public class Squid extends AgeableWaterCreature { int noActionTime = this.squid.getNoActionTime(); if (noActionTime > 100) { this.squid.movementVector = Vec3.ZERO; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/wolf/Wolf.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/wolf/Wolf.java.patch similarity index 89% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/wolf/Wolf.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/wolf/Wolf.java.patch index 1b77fb1bd..c2c83fa25 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/wolf/Wolf.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/wolf/Wolf.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/animal/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java +index a2e1cfc50356142e08134df9123139f2025cb414..3519e9289f79d89bcaa3ad51fe07657018aa607f 100644 --- a/net/minecraft/world/entity/animal/wolf/Wolf.java +++ b/net/minecraft/world/entity/animal/wolf/Wolf.java -@@ -96,6 +_,37 @@ +@@ -96,6 +96,37 @@ public class Wolf extends TamableAnimal implements NeutralMob { public static final TargetingConditions.Selector PREY_SELECTOR = (target, level) -> target.is(EntityType.SHEEP) || target.is(EntityType.RABBIT) || target.is(EntityType.FOX); @@ -38,7 +46,7 @@ private static final float START_HEALTH = 8.0F; private static final float TAME_HEALTH = 40.0F; private static final float ARMOR_REPAIR_UNIT = 0.125F; -@@ -117,12 +_,47 @@ +@@ -117,12 +148,47 @@ public class Wolf extends TamableAnimal implements NeutralMob { this.setPathfindingMalus(PathType.ON_TOP_OF_POWDER_SNOW, -1.0F); } @@ -86,7 +94,7 @@ this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F)); this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, true)); this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F)); -@@ -135,7 +_,7 @@ +@@ -135,7 +201,7 @@ public class Wolf extends TamableAnimal implements NeutralMob { this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this)); this.targetSelector.addGoal(3, new HurtByTargetGoal(this).setAlertOthers()); this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt)); @@ -95,7 +103,7 @@ this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false)); this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true)); -@@ -230,6 +_,7 @@ +@@ -230,6 +296,7 @@ public class Wolf extends TamableAnimal implements NeutralMob { protected void addAdditionalSaveData(final ValueOutput output) { super.addAdditionalSaveData(output); output.store("CollarColor", DyeColor.LEGACY_ID_CODEC, this.getCollarColor()); @@ -103,7 +111,7 @@ VariantUtils.writeVariant(output, this.getVariant()); this.addPersistentAngerSaveData(output); this.getSoundVariant() -@@ -244,6 +_,10 @@ +@@ -244,6 +311,10 @@ public class Wolf extends TamableAnimal implements NeutralMob { super.readAdditionalSaveData(input); VariantUtils.readVariant(input, Registries.WOLF_VARIANT).ifPresent(this::setVariant); this.setCollarColor(input.read("CollarColor", DyeColor.LEGACY_ID_CODEC).orElse(DEFAULT_COLLAR_COLOR)); @@ -114,7 +122,7 @@ this.readPersistentAngerSaveData(this.level(), input); input.read("sound_variant", ResourceKey.codec(Registries.WOLF_SOUND_VARIANT)) .flatMap(soundVariant -> this.registryAccess().lookupOrThrow(Registries.WOLF_SOUND_VARIANT).get((ResourceKey)soundVariant)) -@@ -267,6 +_,10 @@ +@@ -267,6 +338,10 @@ public class Wolf extends TamableAnimal implements NeutralMob { } this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom())); @@ -125,7 +133,7 @@ return super.finalizeSpawn(level, difficulty, spawnReason, groupData); } -@@ -315,6 +_,11 @@ +@@ -315,6 +390,11 @@ public class Wolf extends TamableAnimal implements NeutralMob { public void tick() { super.tick(); if (this.isAlive()) { @@ -137,7 +145,7 @@ this.interestedAngleO = this.interestedAngle; if (this.isInterested()) { this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F; -@@ -516,13 +_,27 @@ +@@ -516,13 +596,27 @@ public class Wolf extends TamableAnimal implements NeutralMob { itemStack.consume(1, player); this.tryToTame(player); return InteractionResult.SUCCESS_SERVER; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/MagmaCube.java.patch similarity index 59% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/MagmaCube.java.patch index bca3b3deb..2844ea648 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/MagmaCube.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/monster/MagmaCube.java b/net/minecraft/world/entity/monster/MagmaCube.java +index eed2e3f9f46f5950615b201706e9fecfae903e0f..f6021d3e41bcf7c65c708f9937bafafecea34ce3 100644 --- a/net/minecraft/world/entity/monster/MagmaCube.java +++ b/net/minecraft/world/entity/monster/MagmaCube.java -@@ -31,6 +_,11 @@ +@@ -31,6 +31,11 @@ public class MagmaCube extends Slime { public static boolean checkMagmaCubeSpawnRules( final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Monster.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Monster.java.patch similarity index 73% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Monster.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Monster.java.patch index aa209bf31..eee6154b6 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Monster.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Monster.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/monster/Monster.java b/net/minecraft/world/entity/monster/Monster.java +index c55b51ed7ed27cc658170d5c35c81a818b8867f2..0ce15ca820010f2dd44488e60ac06517968884bb 100644 --- a/net/minecraft/world/entity/monster/Monster.java +++ b/net/minecraft/world/entity/monster/Monster.java -@@ -84,6 +_,11 @@ +@@ -84,6 +84,11 @@ public abstract class Monster extends PathfinderMob implements Enemy { } public static boolean isDarkEnoughToSpawn(final ServerLevelAccessor level, final BlockPos pos, final RandomSource random) { @@ -12,7 +20,7 @@ if (level.getBrightness(LightLayer.SKY, pos) > random.nextInt(32)) { return false; } -@@ -113,6 +_,11 @@ +@@ -113,6 +118,11 @@ public abstract class Monster extends PathfinderMob implements Enemy { public static boolean checkAnyLightMonsterSpawnRules( final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { @@ -24,7 +32,7 @@ return level.getDifficulty() != Difficulty.PEACEFUL && checkMobSpawnRules(type, level, spawnReason, pos, random); } -@@ -154,4 +_,12 @@ +@@ -154,4 +164,12 @@ public abstract class Monster extends PathfinderMob implements Enemy { return ItemStack.EMPTY; } } diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch new file mode 100644 index 000000000..f7f7c39cb --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch @@ -0,0 +1,68 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/monster/Shulker.java b/net/minecraft/world/entity/monster/Shulker.java +index 86ca7f79741373fb54a4a90645fe080879edb416..1f7a8b12a37b42fa38cb7136cd9ef5b3bab45d6b 100644 +--- a/net/minecraft/world/entity/monster/Shulker.java ++++ b/net/minecraft/world/entity/monster/Shulker.java +@@ -93,6 +93,22 @@ public class Shulker extends AbstractGolem implements Enemy { + this.lookControl = new Shulker.ShulkerLookControl(this); + } + ++ // Purpur start - Shulker change color with dye ++ @Override ++ protected net.minecraft.world.InteractionResult mobInteract(Player player, net.minecraft.world.InteractionHand hand) { ++ net.minecraft.world.item.ItemStack itemstack = player.getItemInHand(hand); ++ DyeColor dyeColor = itemstack.get(DataComponents.DYE); ++ if (player.level().purpurConfig.shulkerChangeColorWithDye && dyeColor != null && dyeColor != this.getColor()) { ++ this.setVariant(Optional.of(dyeColor)); ++ if (!player.getAbilities().instabuild) { ++ itemstack.shrink(1); ++ } ++ return net.minecraft.world.InteractionResult.SUCCESS; ++ } ++ return super.mobInteract(player, hand); ++ } ++ // Purpur end - Shulker change color with dye ++ + @Override + protected void registerGoals() { + this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F, 0.02F, true)); +@@ -454,11 +470,21 @@ public class Shulker extends AbstractGolem implements Enemy { + private void hitByShulkerBullet() { + Vec3 oldPosition = this.position(); + AABB oldAabb = this.getBoundingBox(); +- if (!this.isClosed() && this.teleportSomewhere()) { +- int shulkerCount = this.level().getEntities(EntityType.SHULKER, oldAabb.inflate(8.0), Entity::isAlive).size(); +- float failureChance = (shulkerCount - 1) / 5.0F; +- if (!(this.level().getRandom().nextFloat() < failureChance)) { ++ // Purpur start - Shulker spawn from bullet options ++ if ((!this.level().purpurConfig.shulkerSpawnFromBulletRequireOpenLid || !this.isClosed()) && this.teleportSomewhere()) { ++ float failureChance = this.level().purpurConfig.shulkerSpawnFromBulletBaseChance; ++ if (!this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation.isBlank()) { ++ int shulkerCount = this.level().getEntities((net.minecraft.world.level.entity.EntityTypeTest) EntityType.SHULKER, oldAabb.inflate(this.level().purpurConfig.shulkerSpawnFromBulletNearbyRange), Entity::isAlive).size(); ++ try { ++ failureChance -= ((Number) scriptEngine.eval("let nearby = " + shulkerCount + "; " + this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation)).floatValue(); ++ } catch (javax.script.ScriptException e) { ++ e.printStackTrace(); ++ failureChance -= (shulkerCount - 1) / 5.0F; ++ } ++ } ++ if (this.level().getRandom().nextFloat() <= failureChance) { + Shulker baby = EntityType.SHULKER.create(this.level(), EntitySpawnReason.BREEDING); ++ // Purpur end - Shulker spawn from bullet options + if (baby != null) { + baby.setVariant(this.getVariant()); + baby.snapTo(oldPosition); +@@ -565,7 +591,7 @@ public class Shulker extends AbstractGolem implements Enemy { + } + + public Optional getVariant() { +- return Optional.ofNullable(this.getColor()); ++ return Optional.ofNullable(this.level().purpurConfig.shulkerSpawnFromBulletRandomColor ? DyeColor.random(this.level().getRandom()) : this.getColor()); // Purpur - Shulker spawn from bullet options + } + + public @Nullable DyeColor getColor() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Slime.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Slime.java.patch similarity index 62% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Slime.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Slime.java.patch index e24a27b21..75bf0dee2 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Slime.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Slime.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java +index e19da253db0b1840f582b09a45d73638438afcfd..04f0c15a891c86ab42fe5aa719cb1357f68dd0f6 100644 --- a/net/minecraft/world/entity/monster/Slime.java +++ b/net/minecraft/world/entity/monster/Slime.java -@@ -299,6 +_,11 @@ +@@ -299,6 +299,11 @@ public class Slime extends Mob implements Enemy { public static boolean checkSlimeSpawnRules( final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch similarity index 73% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch index c41868a16..45754a77d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java +index 4dea05ff63055803e7f41b729fdeca35879bc0d8..d53c8c684615421b982272bbb84a40cdcb0387f5 100644 --- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java +++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java -@@ -135,7 +_,17 @@ +@@ -135,7 +135,17 @@ public class WanderingTraderSpawner implements CustomSpawner { int xPosition = referencePosition.getX() + this.random.nextInt(radius * 2) - radius; int zPosition = referencePosition.getZ() + this.random.nextInt(radius * 2) - radius; int yPosition = level.getHeight(SpawnPlacements.getHeightmapType(EntityType.WANDERING_TRADER), xPosition, zPosition); diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch new file mode 100644 index 000000000..4bae07b5d --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch @@ -0,0 +1,119 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java +index 5788ace1dfaf600833d8ce5e3742fb3a907d87d4..7c4ae5904081da7b0e4c135c243f2d9cebb161d9 100644 +--- a/net/minecraft/world/entity/player/Player.java ++++ b/net/minecraft/world/entity/player/Player.java +@@ -173,11 +173,20 @@ public abstract class Player extends Avatar implements ContainerUser { + public float hurtDir; + public boolean affectsSpawning = true; // Paper - Affects Spawning API + public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage ++ public int burpDelay = 0; // Purpur - Burp delay ++ public boolean canPortalInstant = false; // Purpur - Add portal permission bypass + + // CraftBukkit start + public boolean fauxSleeping; + public int oldLevel = -1; + ++ // Purpur start - AFK API ++ public abstract void setAfk(boolean afk); ++ ++ public boolean isAfk() { ++ return false; ++ } ++ // Purpur end - AFK API + @Override + public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() { + return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity(); +@@ -242,6 +251,12 @@ public abstract class Player extends Avatar implements ContainerUser { + + @Override + public void tick() { ++ // Purpur start - Burp delay ++ if (this.burpDelay > 0 && --this.burpDelay == 0) { ++ this.level().playSound(null, getX(), getY(), getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 1.0F, this.level().getRandom().nextFloat() * 0.1F + 0.9F); ++ } ++ // Purpur end - Burp delay ++ + this.noPhysics = this.isSpectator(); + if (this.isSpectator() || this.isPassenger()) { + this.setOnGround(false); +@@ -299,6 +314,17 @@ public abstract class Player extends Avatar implements ContainerUser { + this.turtleHelmetTick(); + } + ++ // Purpur start - Full netherite armor grants fire resistance ++ if (this.level().purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.level().getGameTime() % 20 == 0) { ++ if (this.getItemBySlot(EquipmentSlot.HEAD).is(Items.NETHERITE_HELMET) ++ && this.getItemBySlot(EquipmentSlot.CHEST).is(Items.NETHERITE_CHESTPLATE) ++ && this.getItemBySlot(EquipmentSlot.LEGS).is(Items.NETHERITE_LEGGINGS) ++ && this.getItemBySlot(EquipmentSlot.FEET).is(Items.NETHERITE_BOOTS)) { ++ this.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, this.level().purpurConfig.playerNetheriteFireResistanceDuration, this.level().purpurConfig.playerNetheriteFireResistanceAmplifier, this.level().purpurConfig.playerNetheriteFireResistanceAmbient, this.level().purpurConfig.playerNetheriteFireResistanceShowParticles, this.level().purpurConfig.playerNetheriteFireResistanceShowIcon), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.NETHERITE_ARMOR); ++ } ++ } ++ // Purpur end - Full netherite armor grants fire resistance ++ + this.cooldowns.tick(); + this.updatePlayerPose(); + } +@@ -504,7 +530,7 @@ public abstract class Player extends Avatar implements ContainerUser { + List orbs = Lists.newArrayList(); + + for (Entity entity : entities) { +- if (entity.is(EntityType.EXPERIENCE_ORB)) { ++ if (entity.is(EntityType.EXPERIENCE_ORB) && entity.level().purpurConfig.playerExpPickupDelay >= 0) { // Purpur - Configurable player pickup exp delay + orbs.add(entity); + } else if (!entity.isRemoved()) { + this.touch(entity); +@@ -1052,7 +1078,7 @@ public abstract class Player extends Avatar implements ContainerUser { + criticalAttack = criticalAttack && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits + if (criticalAttack) { + damageSource = damageSource.critical(); // Paper - critical damage API +- baseDamage *= 1.5F; ++ baseDamage *= (float) this.level().purpurConfig.playerCriticalDamageMultiplier; // Purpur - Add config change multiplier critical damage value + } + + float totalDamage = baseDamage + magicBoost; +@@ -1748,7 +1774,23 @@ public abstract class Player extends Avatar implements ContainerUser { + + @Override + protected int getBaseExperienceReward(final ServerLevel level) { +- return !level.getGameRules().get(GameRules.KEEP_INVENTORY) && !this.isSpectator() ? Math.min(this.experienceLevel * 7, 100) : 0; ++ // Purpur start - Add player death exp control options ++ if (!level.getGameRules().get(GameRules.KEEP_INVENTORY) && !this.isSpectator()) { ++ int toDrop; ++ try { ++ toDrop = Math.round(((Number) scriptEngine.eval("let expLevel = " + experienceLevel + "; " + ++ "let expTotal = " + totalExperience + "; " + ++ "let exp = " + experienceProgress + "; " + ++ level().purpurConfig.playerDeathExpDropEquation)).floatValue()); ++ } catch (javax.script.ScriptException e) { ++ e.printStackTrace(); ++ toDrop = experienceLevel * 7; ++ } ++ return Math.min(toDrop, level().purpurConfig.playerDeathExpDropMax); ++ } else { ++ return 0; ++ } ++ // Purpur end - Add player death exp control options + } + + @Override +@@ -1792,6 +1834,13 @@ public abstract class Player extends Avatar implements ContainerUser { + return this.inventory.add(itemStack); + } + ++ // Purpur start - Player ridable in water option ++ @Override ++ public boolean dismountsUnderwater() { ++ return !level().purpurConfig.playerRidableInWater; ++ } ++ // Purpur end - Player ridable in water option ++ + public abstract @Nullable GameType gameMode(); + + @Override diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch similarity index 75% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch index 2fc857d67..5440f3399 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java +index cd0191ab65e7d829cfa055fe8978ea14c14a3bfe..5967bfd4e738b82480f158de0c144e4b416de9b8 100644 --- a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java +++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java -@@ -113,9 +_,10 @@ +@@ -113,9 +113,10 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { return; } // CraftBukkit end @@ -12,7 +20,7 @@ endermite.snapTo(preTeleportX, preTeleportY, preTeleportZ, preTeleportYRot, preTeleportXRot); // Paper - spawn endermite at pre teleport position as teleport has been moved up level.addFreshEntity(endermite, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.ENDER_PEARL); // Paper - add reason } -@@ -135,7 +_,7 @@ +@@ -135,7 +136,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { if (newOwner != null) { newOwner.resetFallDistance(); newOwner.resetCurrentImpulseContext(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/GrindstoneMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/GrindstoneMenu.java.patch similarity index 89% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/GrindstoneMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/GrindstoneMenu.java.patch index 991143398..c7beb4221 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/GrindstoneMenu.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/GrindstoneMenu.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/inventory/GrindstoneMenu.java b/net/minecraft/world/inventory/GrindstoneMenu.java +index e074c3f28599f650fab9bda25b69c596d6129781..cbb50aedac2a2cafa5ca34140ba28b02e118b458 100644 --- a/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/net/minecraft/world/inventory/GrindstoneMenu.java -@@ -92,11 +_,13 @@ +@@ -92,11 +92,13 @@ public class GrindstoneMenu extends AbstractContainerMenu { @Override public void onTake(final Player player, final ItemStack carried) { access.execute((level, pos) -> { @@ -15,7 +23,7 @@ // Paper end - Fire BlockExpEvent on grindstone use } -@@ -125,7 +_,7 @@ +@@ -125,7 +127,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { for (Entry> entry : enchantments.entrySet()) { Holder enchant = entry.getKey(); int lvl = entry.getIntValue(); @@ -24,7 +32,7 @@ amount += enchant.value().getMinCost(lvl); } } -@@ -205,16 +_,76 @@ +@@ -205,16 +207,76 @@ public class GrindstoneMenu extends AbstractContainerMenu { for (Entry> entry : enchantments.entrySet()) { Holder enchant = entry.getKey(); @@ -103,7 +111,7 @@ ); if (item.is(Items.ENCHANTED_BOOK) && newEnchantments.isEmpty()) { item = item.transmuteCopy(Items.BOOK); -@@ -227,6 +_,22 @@ +@@ -227,6 +289,22 @@ public class GrindstoneMenu extends AbstractContainerMenu { } item.set(DataComponents.REPAIR_COST, repairCost); @@ -126,7 +134,7 @@ return item; } -@@ -283,7 +_,9 @@ +@@ -283,7 +361,9 @@ public class GrindstoneMenu extends AbstractContainerMenu { return ItemStack.EMPTY; } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/item/Items.java.patch similarity index 79% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/item/Items.java.patch index e24954fc7..3bef6c55f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/item/Items.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/item/Items.java b/net/minecraft/world/item/Items.java +index 20738a373069ee391e7a9cdb99338028a7a1fff8..cb336a31df9f484f9dbee8ef744fd82ac363ed51 100644 --- a/net/minecraft/world/item/Items.java +++ b/net/minecraft/world/item/Items.java -@@ -396,7 +_,7 @@ +@@ -396,7 +396,7 @@ public class Items { public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK); public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR); public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS); @@ -9,7 +17,7 @@ public static final Item CREAKING_HEART = registerBlock(Blocks.CREAKING_HEART); public static final Item CHEST = registerBlock(Blocks.CHEST, p -> p.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE); -@@ -2105,7 +_,7 @@ +@@ -2105,7 +2105,7 @@ public class Items { "sweet_berries", createBlockItemWithCustomItemName(Blocks.SWEET_BERRY_BUSH), new Item.Properties().food(Foods.SWEET_BERRIES) ); public static final Item GLOW_BERRIES = registerItem( diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/ServerExplosion.java.patch similarity index 79% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/ServerExplosion.java.patch index 4a9c17fd9..138a1c1c1 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/ServerExplosion.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java +index 34d7eef8b2540172bd4dcdbf80df45e9cbfcb43c..be97308736a54c8415f1b32f66c42afe8e0e5b4f 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java -@@ -623,6 +_,23 @@ +@@ -623,6 +623,23 @@ public class ServerExplosion implements Explosion { } public int explode() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/BedBlock.java.patch similarity index 73% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/BedBlock.java.patch index 145df99a1..af9e5cf45 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/BedBlock.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/level/block/BedBlock.java b/net/minecraft/world/level/block/BedBlock.java +index 3ab00a55523bb4ab79c346df5c83993cecb3154c..23d6d30a386816c7af0fdafc4b446a61a7d66763 100644 --- a/net/minecraft/world/level/block/BedBlock.java +++ b/net/minecraft/world/level/block/BedBlock.java -@@ -101,7 +_,7 @@ +@@ -101,7 +101,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock } Vec3 boomPos = pos.getCenter(); @@ -9,7 +17,7 @@ return InteractionResult.SUCCESS_SERVER; } else if (state.getValue(OCCUPIED)) { if (bedRule.explodes()) return this.explodeBed(state, level, pos); // Paper - check explode first -@@ -153,7 +_,7 @@ +@@ -153,7 +153,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock } Vec3 boomPos = pos.getCenter(); @@ -18,7 +26,7 @@ return InteractionResult.SUCCESS_SERVER; } // CraftBukkit end -@@ -170,7 +_,7 @@ +@@ -170,7 +170,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock @Override public void fallOn(final Level level, final BlockState state, final BlockPos pos, final Entity entity, final double fallDistance) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch similarity index 64% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch index e3e9ac4e4..7dc2a50ac 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/level/block/RespawnAnchorBlock.java b/net/minecraft/world/level/block/RespawnAnchorBlock.java +index 8675c1f34cc595b3cf5fb7bcfebf3b17c9b959d7..9975afaca9702394a05da502b17badb0ba261575 100644 --- a/net/minecraft/world/level/block/RespawnAnchorBlock.java +++ b/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -176,7 +_,7 @@ +@@ -176,7 +176,7 @@ public class RespawnAnchorBlock extends Block { } }; Vec3 boomPos = pos.getCenter(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch similarity index 65% rename from purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch index 0c50605e5..6f7b5ca29 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/chunk/storage/RegionFileStorage.java.patch @@ -1,6 +1,14 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +index e47a91b1869801258d0db20c126722fb06522c80..76174967cc80e8b7024b4d8cf48289c5e14bc6f2 100644 --- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -309,7 +_,7 @@ +@@ -309,7 +309,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise // Paper start private static void printOversizedLog(String msg, Path file, int x, int z) { diff --git a/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/portal/PortalShape.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/portal/PortalShape.java.patch new file mode 100644 index 000000000..b6076c732 --- /dev/null +++ b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/portal/PortalShape.java.patch @@ -0,0 +1,19 @@ +From d44c75e006d2ffe1b3217d503036c0a070fc63ba Mon Sep 17 00:00:00 2001 +From: File +Date: Sun, 20 Apr 1997 06:37:42 -0700 +Subject: [PATCH] purpur File Patches + + +diff --git a/net/minecraft/world/level/portal/PortalShape.java b/net/minecraft/world/level/portal/PortalShape.java +index 45cad44bcc715d111c168bad84b7a7c47a6b7517..28760a5e04b659dd7eca7953d6a12e9818d4ada0 100644 +--- a/net/minecraft/world/level/portal/PortalShape.java ++++ b/net/minecraft/world/level/portal/PortalShape.java +@@ -29,7 +29,7 @@ public class PortalShape { + public static final int MAX_WIDTH = 21; + private static final int MIN_HEIGHT = 3; + public static final int MAX_HEIGHT = 21; +- public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN); ++ public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN) || (org.purpurmc.purpur.PurpurConfig.cryingObsidianValidForPortalFrame && state.is(Blocks.CRYING_OBSIDIAN)); // Purpur - Crying obsidian valid for portal frames + private static final float SAFE_TRAVEL_MAX_ENTITY_XY = 4.0F; + private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA = 1.0; + private final Direction.Axis axis; diff --git a/purpur-server/minecraft-patches/sources/io/papermc/paper/entity/activation/ActivationRange.java.patch b/purpur-server/minecraft-patches/sources/io/papermc/paper/entity/activation/ActivationRange.java.patch index 70f8de868..44c76b559 100644 --- a/purpur-server/minecraft-patches/sources/io/papermc/paper/entity/activation/ActivationRange.java.patch +++ b/purpur-server/minecraft-patches/sources/io/papermc/paper/entity/activation/ActivationRange.java.patch @@ -1,6 +1,6 @@ --- a/io/papermc/paper/entity/activation/ActivationRange.java +++ b/io/papermc/paper/entity/activation/ActivationRange.java -@@ -147,6 +_,8 @@ +@@ -148,6 +_,8 @@ continue; } @@ -9,7 +9,7 @@ final int worldHeight = world.getHeight(); ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange); ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange); -@@ -288,6 +_,7 @@ +@@ -289,6 +_,7 @@ * @return */ public static boolean checkIfActive(final Entity entity) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch index e5d6ab21a..28861e91f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch @@ -8,7 +8,7 @@ public CrashReport(final String title, final Throwable t) { this.title = title; -@@ -126,7 +_,7 @@ +@@ -147,7 +_,7 @@ } public String getFriendlyReport(final ReportType reportType) { @@ -17,7 +17,7 @@ } public @Nullable Path getSaveFile() { -@@ -156,7 +_,7 @@ +@@ -177,7 +_,7 @@ } public boolean saveToFile(final Path file, final ReportType reportType) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch index 7944d15e3..ff7f7f093 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/commands/Commands.java +++ b/net/minecraft/commands/Commands.java -@@ -267,11 +_,11 @@ +@@ -268,11 +_,11 @@ JfrCommand.register(this.dispatcher); } @@ -14,7 +14,7 @@ RaidCommand.register(this.dispatcher, context); DebugPathCommand.register(this.dispatcher); DebugMobSpawningCommand.register(this.dispatcher); -@@ -299,6 +_,14 @@ +@@ -300,6 +_,14 @@ StopCommand.register(this.dispatcher); TransferCommand.register(this.dispatcher); WhitelistCommand.register(this.dispatcher); @@ -29,7 +29,7 @@ } if (commandSelection.includeIntegrated) { -@@ -521,6 +_,7 @@ +@@ -523,6 +_,7 @@ private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode root) { // Paper end - Perf: Async command map building new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) root, true).callEvent(); // Paper - Brigadier API @@ -37,7 +37,7 @@ org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); -@@ -531,6 +_,8 @@ +@@ -533,6 +_,8 @@ } } // CraftBukkit end diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/core/BlockPos.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/core/BlockPos.java.patch index 310b3023b..21124ee66 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/core/BlockPos.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/core/BlockPos.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/core/BlockPos.java +++ b/net/minecraft/core/BlockPos.java -@@ -60,6 +_,12 @@ +@@ -59,6 +_,12 @@ public static final int MAX_HORIZONTAL_COORDINATE = 33554431; // Paper end - Optimize Bit Operations by inlining diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch index 9387ccf12..85ff34be3 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/gametest/framework/GameTestHelper.java +++ b/net/minecraft/gametest/framework/GameTestHelper.java -@@ -352,6 +_,8 @@ +@@ -361,6 +_,8 @@ return gameType; } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch index fbf7cd3ae..3e1616fba 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/network/Connection.java +++ b/net/minecraft/network/Connection.java -@@ -552,11 +_,20 @@ +@@ -553,11 +_,20 @@ private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world private static int joinAttemptsThisTick; // Paper - Buffer joins to world private static int currTick; // Paper - Buffer joins to world diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch index a5ed8bd61..4b3edae4f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/Main.java +++ b/net/minecraft/server/Main.java -@@ -104,6 +_,13 @@ +@@ -107,6 +_,13 @@ JvmProfiler.INSTANCE.start(Environment.SERVER); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch index a84ddd504..d0b7e0e6e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -320,6 +_,7 @@ +@@ -318,6 +_,7 @@ public joptsimple.OptionSet options; public org.bukkit.command.ConsoleCommandSender console; public static int currentTick; // Paper - improve tick loop @@ -8,7 +8,7 @@ public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; // Paper - don't store the vanilla dispatcher -@@ -336,6 +_,8 @@ +@@ -334,6 +_,8 @@ public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked private final Set pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation @@ -17,7 +17,7 @@ // Paper start - improve tick loop public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)); public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L)); -@@ -420,6 +_,7 @@ +@@ -418,6 +_,7 @@ public double[] computeTPS() { final long interval = this.tickRateManager().nanosecondsPerTick(); return new double[] { @@ -25,7 +25,7 @@ getTPS(this.tickTimes1m, interval), getTPS(this.tickTimes5m, interval), getTPS(this.tickTimes15m, interval) -@@ -1047,6 +_,15 @@ +@@ -955,6 +_,15 @@ LOGGER.info("Stopping server"); Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing @@ -41,7 +41,7 @@ // CraftBukkit start if (this.server != null) { this.server.spark.disable(); // Paper - spark -@@ -1141,6 +_,8 @@ +@@ -1044,6 +_,8 @@ this.safeShutdown(wait, false); } public void safeShutdown(final boolean wait, final boolean isRestarting) { @@ -50,7 +50,7 @@ this.isRestarting = isRestarting; this.hasLoggedStop = true; // Paper - Debugging if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging -@@ -1322,11 +_,21 @@ +@@ -1210,11 +_,21 @@ } // Paper end - Add onboarding message for initial server start // Paper start - Improve outdated version checking @@ -73,7 +73,7 @@ while (this.running) { final long tickStart = System.nanoTime(); // Paper - improve tick loop long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval -@@ -1340,9 +_,11 @@ +@@ -1228,9 +_,11 @@ final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart)); final long catchup = (long)Math.max( 1, @@ -86,7 +86,7 @@ // adjust ticksBehind so that it is not greater-than catchup if (ticksBehind - catchup > 0L) { final long difference = ticksBehind - catchup; -@@ -1973,7 +_,7 @@ +@@ -1853,7 +_,7 @@ } public String getServerModName() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch index 1e1afb420..48eddf9a0 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/PlayerAdvancements.java +++ b/net/minecraft/server/PlayerAdvancements.java -@@ -148,6 +_,7 @@ +@@ -146,6 +_,7 @@ AdvancementHolder advancement = manager.get(id); if (advancement == null) { if (!id.getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) return; // CraftBukkit @@ -8,7 +8,7 @@ LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", id, this.playerSavePath); } else { this.startProgress(advancement, progress); -@@ -195,6 +_,7 @@ +@@ -193,6 +_,7 @@ holder.value().display().ifPresent(display -> { // Paper start - Add Adventure message to PlayerAdvancementDoneEvent if (event.message() != null && this.player.level().getGameRules().get(GameRules.SHOW_ADVANCEMENT_MESSAGES)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch index b24488c45..f9b819d47 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -211,6 +_,7 @@ +@@ -172,6 +_,7 @@ public void run() { if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit // Paper start - Use TerminalConsoleAppender @@ -8,7 +8,7 @@ new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start(); /* BufferedReader reader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); -@@ -289,6 +_,15 @@ +@@ -250,6 +_,15 @@ io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics @@ -24,7 +24,7 @@ com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now // this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading -@@ -331,6 +_,30 @@ +@@ -292,6 +_,30 @@ if (true) throw new IllegalStateException("Failed to bind to port", e); // Paper - Propagate failed to bind to port error return false; } @@ -55,7 +55,7 @@ // CraftBukkit start this.server.loadPlugins(); -@@ -406,6 +_,9 @@ +@@ -366,6 +_,9 @@ MinecraftServerStatistics.registerJmxMonitoring(this); LOGGER.info("JMX monitoring enabled"); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 74c5d8203..818bca53e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -435,6 +_,9 @@ +@@ -436,6 +_,9 @@ public boolean isRealPlayer; // Paper public com.destroystokyo.paper.event.entity.@Nullable PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public org.bukkit.event.player.PlayerQuitEvent.@Nullable QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event @@ -8,9 +8,9 @@ + private boolean compassBar = false; // Purpur - Add compass command + private boolean ramBar = false; // Purpur - Implement rambar commands - // Paper start - rewrite chunk system - private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader; -@@ -508,6 +_,9 @@ + public ServerPlayer(final MinecraftServer server, final ServerLevel level, final GameProfile gameProfile, final ClientInformation clientInformation) { + super(level, gameProfile); +@@ -480,6 +_,9 @@ this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null); this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false); this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null); @@ -20,7 +20,7 @@ // Paper start - Expand PlayerGameModeChangeEvent this.loadGameTypes(input); } -@@ -549,6 +_,9 @@ +@@ -522,6 +_,9 @@ output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight()); } this.getBukkitEntity().setExtraData(output); // CraftBukkit @@ -30,7 +30,7 @@ } private void saveParentVehicle(final ValueOutput playerOutput) { -@@ -1179,6 +_,7 @@ +@@ -1158,6 +_,7 @@ // Paper - moved up to sendClientboundPlayerCombatKillPacket() sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent Team team = this.getTeam(); @@ -38,7 +38,7 @@ if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) { this.server.getPlayerList().broadcastSystemMessage(deathMessage, false); } else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) { -@@ -1288,6 +_,13 @@ +@@ -1267,6 +_,13 @@ return false; } @@ -52,7 +52,7 @@ Entity entity = source.getEntity(); if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false. !(entity instanceof Player player && !this.canHarmPlayer(player)) -@@ -1529,7 +_,7 @@ +@@ -1508,7 +_,7 @@ } if (newLevel.dimension() == lastDimension) { @@ -61,7 +61,7 @@ this.connection.resetPosition(); transition.postTeleportTransition().onTransition(this); return this; -@@ -1552,6 +_,7 @@ +@@ -1531,6 +_,7 @@ profiler.pop(); profiler.push("placing"); @@ -69,7 +69,7 @@ this.setServerLevel(newLevel); this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event this.connection.resetPosition(); -@@ -1664,7 +_,7 @@ +@@ -1643,7 +_,7 @@ new AABB(bedCenter.x() - 8.0, bedCenter.y() - 5.0, bedCenter.z() - 8.0, bedCenter.x() + 8.0, bedCenter.y() + 5.0, bedCenter.z() + 8.0), monster -> monster.isPreventingPlayerRest(this.level(), this) ); @@ -78,7 +78,7 @@ return Either.left(Player.BedSleepingProblem.NOT_SAFE); } } -@@ -1700,7 +_,17 @@ +@@ -1679,7 +_,17 @@ CriteriaTriggers.SLEPT_IN_BED.trigger(this); }); if (!this.level().canSleepThroughNights()) { @@ -97,7 +97,7 @@ } this.level().updateSleepingPlayerList(); -@@ -1794,6 +_,7 @@ +@@ -1774,6 +_,7 @@ @Override public void openTextEdit(final SignBlockEntity sign, final boolean isFrontText) { @@ -105,7 +105,7 @@ this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos())); this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), isFrontText)); } -@@ -2138,6 +_,26 @@ +@@ -2118,6 +_,26 @@ this.lastSentExp = -1; // CraftBukkit - Added to reset } @@ -132,7 +132,7 @@ @Override public void completeUsingItem() { if (!this.useItem.isEmpty() && this.isUsingItem()) { -@@ -2373,6 +_,20 @@ +@@ -2355,6 +_,20 @@ ); } @@ -153,7 +153,7 @@ @Override public void sendSystemMessage(final Component message) { this.sendSystemMessage(message, false); -@@ -2524,7 +_,67 @@ +@@ -2506,7 +_,67 @@ public void resetLastActionTime() { this.lastActionTime = Util.getMillis(); @@ -222,7 +222,7 @@ public ServerStatsCounter getStats() { return this.stats; -@@ -3149,4 +_,65 @@ +@@ -3131,4 +_,65 @@ return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity(); } // CraftBukkit end diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/WorldGenRegion.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/level/WorldGenRegion.java.patch index ad26078d3..67ddf8af5 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/level/WorldGenRegion.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/level/WorldGenRegion.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/server/level/WorldGenRegion.java +++ b/net/minecraft/server/level/WorldGenRegion.java -@@ -292,6 +_,7 @@ - return true; - } else { +@@ -297,6 +_,7 @@ + int chunkX = SectionPos.blockToSectionCoord(pos.getX()); + int chunkZ = SectionPos.blockToSectionCoord(pos.getZ()); // Paper start - Buffer OOB setBlock calls + if (!org.purpurmc.purpur.PurpurConfig.loggerSuppressSetBlockFarChunk) // Purpur - Logger settings (suppressing pointless logs) if (!hasSetFarWarned) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 45ac70785..149dc7d36 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -354,6 +_,20 @@ +@@ -357,6 +_,20 @@ } // Paper end - configuration phase API @@ -21,7 +21,7 @@ @Override public void tick() { if (this.ackBlockChangesUpTo > -1) { -@@ -371,6 +_,12 @@ +@@ -375,6 +_,12 @@ && this.server.playerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout()) && !this.player.wonGame) { @@ -34,7 +34,7 @@ this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } } -@@ -692,6 +_,8 @@ +@@ -685,6 +_,8 @@ this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -43,7 +43,7 @@ Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); this.cserver.getPluginManager().callEvent(event); -@@ -771,6 +_,7 @@ +@@ -741,6 +_,7 @@ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { @@ -51,7 +51,7 @@ this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause return; } -@@ -1339,6 +_,10 @@ +@@ -1312,6 +_,10 @@ final int maxBookPageSize = pageMax.intValue(); final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D); long byteAllowed = maxBookPageSize; @@ -62,7 +62,7 @@ for (final String page : pageList) { final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; byteTotal += byteLength; -@@ -1363,7 +_,8 @@ +@@ -1336,7 +_,8 @@ } if (byteTotal > byteAllowed) { @@ -72,7 +72,7 @@ this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect return; } -@@ -1382,31 +_,45 @@ +@@ -1355,31 +_,45 @@ Optional title = packet.title(); title.ifPresent(contents::add); contents.addAll(packet.pages()); @@ -122,7 +122,7 @@ writtenBook.set( DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, pages, true) ); -@@ -1419,6 +_,16 @@ +@@ -1392,6 +_,16 @@ return this.player.isTextFilteringEnabled() ? Filterable.passThrough(text.filteredOrEmpty()) : Filterable.from(text); } @@ -139,7 +139,7 @@ @Override public void handleEntityTagQuery(final ServerboundEntityTagQueryPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); -@@ -1458,7 +_,15 @@ +@@ -1431,7 +_,15 @@ @Override public void handleMovePlayer(final ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); @@ -156,7 +156,7 @@ this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause } else { ServerLevel level = this.player.level(); -@@ -1643,7 +_,7 @@ +@@ -1615,7 +_,7 @@ movedWrongly = true; if (event.getLogWarning()) // Paper end @@ -165,7 +165,7 @@ } // Paper } -@@ -1708,6 +_,8 @@ +@@ -1670,6 +_,8 @@ this.lastYaw = to.getYaw(); this.lastPitch = to.getPitch(); @@ -174,7 +174,7 @@ Location oldTo = to.clone(); PlayerMoveEvent event = new PlayerMoveEvent(player, from, to); this.cserver.getPluginManager().callEvent(event); -@@ -1763,6 +_,13 @@ +@@ -1725,6 +_,13 @@ this.player.tryResetCurrentImpulseContext(); } @@ -188,7 +188,7 @@ this.player.checkMovementStatistics(this.player.getX() - startX, this.player.getY() - startY, this.player.getZ() - startZ); this.lastGoodX = this.player.getX(); this.lastGoodY = this.player.getY(); -@@ -1783,6 +_,17 @@ +@@ -1745,6 +_,17 @@ } } @@ -206,7 +206,7 @@ private boolean shouldCheckPlayerMovement(final boolean isFallFlying) { if (this.isSingleplayerOwner()) { return false; -@@ -2229,6 +_,7 @@ +@@ -2158,6 +_,7 @@ boolean cancelled; if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) { @@ -214,7 +214,7 @@ org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemStack, hand); cancelled = event.useItemInHand() == Event.Result.DENY; } else { -@@ -2863,6 +_,7 @@ +@@ -2801,6 +_,7 @@ ItemStack mainHandItem = this.player.getMainHandItem(); if (this.player.isWithinAttackRange(mainHandItem, targetBounds, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience if (!mainHandItem.has(DataComponents.PIERCING_WEAPON)) { @@ -222,7 +222,7 @@ if (target instanceof ItemEntity || target instanceof ExperienceOrb || target == this.player -@@ -3644,7 +_,7 @@ +@@ -3584,7 +_,7 @@ @Override public void handleChangeGameMode(final ServerboundChangeGameModePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level()); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch index 06cd8e9a6..c703ad0db 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -284,7 +_,7 @@ +@@ -286,7 +_,7 @@ ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!"); ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(name)); // Spigot } else { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch index 1ca7cfcfd..6dfd0158f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -312,6 +_,7 @@ +@@ -313,6 +_,7 @@ scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); } // Paper end - Configurable player collision @@ -8,7 +8,7 @@ // CraftBukkit start - moved down LOGGER.info( "{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // Paper - add world identifier -@@ -432,6 +_,7 @@ +@@ -433,6 +_,7 @@ } public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player, final net.kyori.adventure.text.Component leaveMessage) { // Paper end - Fix kick event leave message not being sent @@ -16,7 +16,7 @@ ServerLevel level = player.level(); player.awardStat(Stats.LEAVE_GAME); // CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it -@@ -768,6 +_,20 @@ +@@ -769,6 +_,20 @@ } } @@ -37,7 +37,7 @@ public void broadcastAll(final Packet packet, final ResourceKey dimension) { for (ServerPlayer player : this.players) { if (player.level().dimension() == dimension) { -@@ -861,6 +_,7 @@ +@@ -862,6 +_,7 @@ case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS; case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS; }; @@ -45,7 +45,7 @@ player.connection.send(new ClientboundEntityEventPacket(player, eventId)); } -@@ -872,7 +_,7 @@ +@@ -873,7 +_,7 @@ // Paper start - whitelist verify event / login event public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch index 402f14bb1..b86c3bb48 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -1,170 +1,11 @@ --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -168,6 +_,7 @@ - SlotProvider, - DebugValueSource, - TypedInstance>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker -+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes - // CraftBukkit start - private static final int CURRENT_LEVEL = 2; - static boolean isLevelAtLeast(ValueInput input, int level) { -@@ -297,8 +_,9 @@ - public double xOld; - public double yOld; - public double zOld; -+ public float maxUpStep; // Purpur - Add option to set armorstand step height - public boolean noPhysics; -- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random -+ public final RandomSource random; // Paper - Share random for entities to make them more random // Purpur - Add toggle for RNG manipulation - public int tickCount; - private int remainingFireTicks; - private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA)); -@@ -330,8 +_,8 @@ - public @Nullable PortalProcessor portalProcess; - public int portalCooldown; - private boolean invulnerable; -- protected UUID uuid = Mth.createInsecureUUID(this.random); -- protected String stringUUID = this.uuid.toString(); -+ protected UUID uuid; // Purpur - Add toggle for RNG manipulation -+ protected String stringUUID; // Purpur - Add toggle for RNG manipulation - private boolean hasGlowingTag; +@@ -381,7 +_,7 @@ private final Set tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0}; -@@ -382,6 +_,7 @@ - private final int despawnTime; // Paper - entity despawn time limit - public int totalEntityAge; // Paper - age-like counter for all entities - public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges -+ public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API - // Paper start - EAR 2 - public final boolean defaultActivationState; - public long activatedTick = Integer.MIN_VALUE; -@@ -549,10 +_,22 @@ - } - // Paper end - optimise entity tracker - -+ // Purpur start - Add canSaveToDisk to Entity -+ public boolean canSaveToDisk() { -+ return true; -+ } -+ // Purpur end - Add canSaveToDisk to Entity -+ - public Entity(final EntityType type, final Level level) { - this.type = type; - this.level = level; - this.dimensions = type.getDimensions(); -+ this.maxAirTicks = level == null || this.getDefaultMaxAirSupply() != Entity.TOTAL_AIR_SUPPLY ? this.getDefaultMaxAirSupply() : this.level.purpurConfig.drowningAirTicks; // Purpur - Drowning Settings -+ // Purpur start - Add toggle for RNG manipulation -+ this.random = level == null || level.purpurConfig.entitySharedRandom ? SHARED_RANDOM : RandomSource.create(); -+ this.uuid = Mth.createInsecureUUID(this.random); -+ this.stringUUID = this.uuid.toString(); -+ // Purpur end - Add toggle for RNG manipulation - this.position = Vec3.ZERO; - this.blockPosition = BlockPos.ZERO; - this.chunkPosition = ChunkPos.ZERO; -@@ -950,6 +_,7 @@ - && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) - && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { - // Paper end - Configurable nether ceiling damage -+ if (this.level.purpurConfig.teleportOnNetherCeilingDamage && this.level.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER && this instanceof ServerPlayer player) player.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level.levelData.getRespawnData().pos(), this.level)); else // Purpur - Add option to teleport to spawn on nether ceiling damage - this.onBelowWorld(); - } - } -@@ -2007,7 +_,7 @@ - } - - public boolean fireImmune() { -- return this.getType().fireImmune(); -+ return this.immuneToFire != null ? immuneToFire : this.getType().fireImmune(); // Purpur - add fire immune API - } - - public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) { -@@ -2593,7 +_,7 @@ - output.putBoolean("Bukkit.invisible", this.persistentInvisibility); - } - // SPIGOT-6907: re-implement LivingEntity#setMaximumAir() -- if (this.maxAirTicks != this.getDefaultMaxAirSupply()) { -+ if (this.maxAirTicks != this.getDefaultMaxAirSupply() && this.getDefaultMaxAirSupply() != this.level().purpurConfig.drowningAirTicks) { // Purpur - Drowning Settings - output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply()); - } - output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper -@@ -2679,6 +_,11 @@ - output.putBoolean("Paper.FreezeLock", true); - } - // Paper end -+ // Purpur start - Fire immune API -+ if (immuneToFire != null) { -+ output.putBoolean("Purpur.FireImmune", immuneToFire); -+ } -+ // Purpur end - Fire immune API - } catch (Throwable t) { - CrashReport report = CrashReport.forThrowable(t, "Saving entity NBT"); - CrashReportCategory category = report.addCategory("Entity being saved"); -@@ -2802,6 +_,9 @@ - } - freezeLocked = input.getBooleanOr("Paper.FreezeLock", false); - // Paper end -+ -+ immuneToFire = input.read("Purpur.FireImmune", com.mojang.serialization.Codec.BOOL).orElse(null); // Purpur - Fire immune API -+ - } catch (Throwable t) { - CrashReport report = CrashReport.forThrowable(t, "Loading entity NBT"); - CrashReportCategory category = report.addCategory("Entity being loaded"); -@@ -3067,6 +_,7 @@ - if (this.isAlive() && this instanceof Leashable leashable) { - if (leashable.getLeashHolder() == player) { - if (!this.level().isClientSide()) { -+ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.villager.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers - // Paper start - EntityUnleashEvent - if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent( - leashable, player, hand, !player.hasInfiniteMaterials(), true -@@ -3500,15 +_,18 @@ - return Vec3.directionFromRotation(this.getRotationVector()); - } - -+ public BlockPos portalPos = BlockPos.ZERO; // Purpur - Fix stuck in portals - public void setAsInsidePortal(final Portal portal, final BlockPos pos) { - if (this.isOnPortalCooldown()) { -+ if (!(level().purpurConfig.playerFixStuckPortal && this instanceof Player && !pos.equals(this.portalPos))) // Purpur - Fix stuck in portals - this.setPortalCooldown(); -- } else { -+ } else if (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur - Entities can use portals - if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) { - this.portalProcess = new PortalProcessor(portal, pos.immutable()); - } else if (!this.portalProcess.isInsidePortalThisTick()) { - this.portalProcess.updateEntryPosition(pos.immutable()); - this.portalProcess.setAsInsidePortalThisTick(true); -+ this.portalPos = BlockPos.ZERO; // Purpur - Fix stuck in portals - } - } - } -@@ -4238,7 +_,7 @@ - } - - public boolean canUsePortal(final boolean ignorePassenger) { -- return (ignorePassenger || !this.isPassenger()) && this.isAlive(); -+ return (ignorePassenger || !this.isPassenger()) && this.isAlive() && (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Purpur - Entities can use portals - } - - public boolean canTeleport(final Level from, final Level to) { -@@ -4788,6 +_,12 @@ - return Mth.lerp(partial, this.yRotO, this.yRot); - } - -+ // Purpur start - Stop squids floating on top of water -+ public AABB getAxisForFluidCheck() { -+ return this.getBoundingBox().deflate(0.001D); -+ } -+ // Purpur end - Stop squids floating on top of water -+ - public boolean touchingUnloadedChunk() { - AABB box = this.getBoundingBox().inflate(1.0); - int x0 = Mth.floor(box.minX); -@@ -5091,7 +_,7 @@ - } - - public float maxUpStep() { -- return 0.0F; -+ return maxUpStep; // Purpur - Add option to set armorstand step height - } - - public void onExplosionHit(final @Nullable Entity explosionCausedBy) { + private long pistonDeltasGameTime; +- protected EntityDimensions dimensions; ++ private EntityDimensions dimensions; + private float eyeHeight; + public boolean isInPowderSnow; + public boolean wasInPowderSnow; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch index 81f93a652..ac122b531 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch @@ -1,44 +1,11 @@ --- a/net/minecraft/world/entity/EntityType.java +++ b/net/minecraft/world/entity/EntityType.java -@@ -1238,6 +_,16 @@ - return register(vanillaEntityId(vanillaId), builder); - } - -+ // Purpur start - PlayerSetSpawnerTypeWithEggEvent -+ public static EntityType getFromBukkitType(org.bukkit.entity.EntityType bukkitType) { -+ return getFromKey(Identifier.parse(bukkitType.getKey().toString())); -+ } -+ -+ public static EntityType getFromKey(Identifier location) { -+ return BuiltInRegistries.ENTITY_TYPE.getValue(location); -+ } -+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent -+ - public static Identifier getKey(final EntityType type) { - return BuiltInRegistries.ENTITY_TYPE.getKey(type); - } -@@ -1495,6 +_,16 @@ - return this.category; - } - -+ // Purpur start - PlayerSetSpawnerTypeWithEggEvent -+ public String getName() { -+ return BuiltInRegistries.ENTITY_TYPE.getKey(this).getPath(); -+ } -+ -+ public String getTranslatedName() { -+ return getDescription().getString(); -+ } -+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent -+ - public String getDescriptionId() { - return this.descriptionId; - } -@@ -1556,6 +_,7 @@ - // Paper start - Add logging for debugging entity tags with invalid ids - () -> { - LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]")); -+ LOGGER.warn("Location: {} {}", level.getWorld().getName(), input.read("Pos", net.minecraft.world.phys.Vec3.CODEC).orElse(net.minecraft.world.phys.Vec3.ZERO)); // Purpur - log skipped entity's position - if ((DEBUG_ENTITIES_WITH_INVALID_IDS || level.getCraftServer().getServer().isDebugging()) && input instanceof TagValueInput tagInput) { - LOGGER.warn("Skipped entity tag: {}", tagInput.input); - } +@@ -69,7 +_,7 @@ + private final String descriptionId; + private @Nullable Component description; + private final Optional> lootTable; +- public EntityDimensions dimensions; ++ private final EntityDimensions dimensions; + private final float spawnDimensionsScale; + private final FeatureFlagSet requiredFeatures; + private final boolean allowedInPeaceful; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ExperienceOrb.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ExperienceOrb.java.patch index 48508398d..566297000 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ExperienceOrb.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ExperienceOrb.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/ExperienceOrb.java +++ b/net/minecraft/world/entity/ExperienceOrb.java -@@ -352,7 +_,7 @@ +@@ -357,7 +_,7 @@ public void playerTouch(final Player player) { if (player instanceof ServerPlayer serverPlayer) { if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(serverPlayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent @@ -9,7 +9,7 @@ player.take(this, 1); int remaining = this.repairPlayerItems(serverPlayer, this.getValue()); if (remaining > 0) { -@@ -368,7 +_,8 @@ +@@ -373,7 +_,8 @@ } private int repairPlayerItems(final ServerPlayer player, final int amount) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch index dc0fa5ed3..7813d51f0 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch @@ -1,177 +1,11 @@ --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -441,6 +_,12 @@ - if (dist < 0.0) { - double damagePerBlock = level.getWorldBorder().getDamagePerBlock(); - if (damagePerBlock > 0.0) { -+ // Purpur start - Add option to teleport to spawn if outside world border -+ if (this.level().purpurConfig.teleportIfOutsideBorder && this instanceof ServerPlayer serverPlayer) { -+ serverPlayer.teleport(org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.level().levelData.getRespawnData().pos(), this.level())); -+ return; -+ } -+ // Purpur end - Add option to teleport to spawn if outside world border - this.hurtServer(level, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-dist * damagePerBlock))); - } - } -@@ -456,7 +_,7 @@ - if (this.shouldTakeDrowningDamage()) { - this.setAirSupply(0); - level.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES); -- this.hurtServer(level, this.damageSources().drown(), 2.0F); -+ this.hurtServer(level, this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur - Drowning Settings - } - } else if (this.getAirSupply() < this.getMaxAirSupply() && MobEffectUtil.shouldEffectsRefillAirsupply(this)) { - this.setAirSupply(this.increaseAirSupply(this.getAirSupply())); -@@ -516,7 +_,7 @@ +@@ -3914,7 +_,7 @@ + } } - protected boolean shouldTakeDrowningDamage() { -- return this.getAirSupply() <= -20; -+ return this.getAirSupply() <= -this.level().purpurConfig.drowningDamageInterval; // Purpur - Drowning Settings - } - - @Override -@@ -1048,15 +_,33 @@ - } - - if (targetingEntity != null) { -- ItemStack itemStack = this.getItemBySlot(EquipmentSlot.HEAD); -- if (targetingEntity.is(EntityType.SKELETON) && itemStack.is(Items.SKELETON_SKULL) -- || targetingEntity.is(EntityType.ZOMBIE) && itemStack.is(Items.ZOMBIE_HEAD) -- || targetingEntity.is(EntityType.PIGLIN) && itemStack.is(Items.PIGLIN_HEAD) -- || targetingEntity.is(EntityType.PIGLIN_BRUTE) && itemStack.is(Items.PIGLIN_HEAD) -- || targetingEntity.is(EntityType.CREEPER) && itemStack.is(Items.CREEPER_HEAD)) { -- visibilityPercent *= 0.5; -- } -- } -+ ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD); -+ // Purpur start - Mob head visibility percent -+ if (targetingEntity.is(EntityType.SKELETON) && itemBySlot.is(Items.SKELETON_SKULL)) { -+ visibilityPercent *= targetingEntity.level().purpurConfig.skeletonHeadVisibilityPercent; -+ } -+ else if (targetingEntity.is(EntityType.ZOMBIE) && itemBySlot.is(Items.ZOMBIE_HEAD)) { -+ visibilityPercent *= targetingEntity.level().purpurConfig.zombieHeadVisibilityPercent; -+ } -+ else if ((targetingEntity.is(EntityType.PIGLIN) || targetingEntity.is(EntityType.PIGLIN_BRUTE)) && itemBySlot.is(Items.PIGLIN_HEAD)) { -+ visibilityPercent *= targetingEntity.level().purpurConfig.piglinHeadVisibilityPercent; -+ } -+ else if (targetingEntity.is(EntityType.CREEPER) && itemBySlot.is(Items.CREEPER_HEAD)) { -+ visibilityPercent *= targetingEntity.level().purpurConfig.creeperHeadVisibilityPercent; -+ } -+ // Purpur end - Mob head visibility percent -+ } -+ -+ // Purpur start - Configurable mob blindness -+ if (targetingEntity instanceof LivingEntity entityliving) { -+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) { -+ int amplifier = entityliving.getEffect(MobEffects.BLINDNESS).getAmplifier(); -+ for (int i = 0; i < amplifier; i++) { -+ amplifier *= this.level().purpurConfig.mobsBlindnessMultiplier; -+ } -+ } -+ } -+ // Purpur end - Configurable mob blindness - - return visibilityPercent; - } -@@ -1106,6 +_,7 @@ - Iterator iterator = this.activeEffects.values().iterator(); - while (iterator.hasNext()) { - MobEffectInstance effect = iterator.next(); -+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur - Milk Keeps Beneficial Effects - EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED); - if (event.isCancelled()) { - continue; -@@ -1438,7 +_,23 @@ - this.stopSleeping(); - } - -- this.noActionTime = 0; -+ // Purpur start - One Punch Man! -+ if (source.getEntity() instanceof net.minecraft.world.entity.player.Player player && source.getEntity().level().purpurConfig.creativeOnePunch && !source.is(DamageTypeTags.IS_PROJECTILE)) { -+ if (player.isCreative()) { -+ org.apache.commons.lang3.mutable.MutableDouble attackDamage = new org.apache.commons.lang3.mutable.MutableDouble(); -+ player.getMainHandItem().forEachModifier(EquipmentSlot.MAINHAND, (attributeHolder, attributeModifier) -> { -+ if (attributeModifier.operation() == AttributeModifier.Operation.ADD_VALUE) { -+ attackDamage.addAndGet(attributeModifier.amount()); -+ } -+ }); -+ -+ if (attackDamage.doubleValue() == 0.0D) { -+ // One punch! -+ damage = this.getHealth(); -+ } -+ } -+ } -+ // Purpur end - One Punch Man!this.noActionTime = 0; - if (damage < 0.0F) { - damage = 0.0F; - } -@@ -1699,10 +_,10 @@ - protected @Nullable Player resolvePlayerResponsibleForDamage(final DamageSource source) { - Entity sourceEntity = source.getEntity(); - if (sourceEntity instanceof Player playerSource) { -- this.setLastHurtByPlayer(playerSource, 100); -+ this.setLastHurtByPlayer(playerSource, this.level().purpurConfig.mobLastHurtByPlayerTime); // Purpur - Config for mob last hurt by player time - } else if (sourceEntity instanceof Wolf wolf && wolf.isTame()) { - if (wolf.getOwnerReference() != null) { -- this.setLastHurtByPlayer(wolf.getOwnerReference().getUUID(), 100); -+ this.setLastHurtByPlayer(wolf.getOwnerReference().getUUID(), this.level().purpurConfig.mobLastHurtByPlayerTime); // Purpur - Config for mob last hurt by player time - } else { - this.lastHurtByPlayer = null; - this.lastHurtByPlayerMemoryTime = 0; -@@ -1754,6 +_,17 @@ - } - } - -+ // Purpur start - Totems work in inventory -+ if (level().purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer player && (itemStack == null || itemStack.getItem() != Items.TOTEM_OF_UNDYING) && player.getBukkitEntity().hasPermission("purpur.inventory_totem")) { -+ for (ItemStack item : player.getInventory().getNonEquipmentItems()) { -+ if (item.getItem() == Items.TOTEM_OF_UNDYING) { -+ itemStack = item; -+ protectionItem = item.copy(); -+ break; -+ } -+ } -+ } -+ // Purpur end - Totems work in inventory - final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null; - final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot); - event.setCancelled(protectionItem == null); -@@ -1927,6 +_,7 @@ - boolean playerKilled = this.lastHurtByPlayerMemoryTime > 0; - this.dropEquipment(level); // CraftBukkit - from below - if (this.shouldDropLoot(level)) { -+ if (!(source.is(net.minecraft.world.damagesource.DamageTypes.CRAMMING) && level().purpurConfig.disableDropsOnCrammingDeath)) { // Purpur - Disable loot drops on death by cramming - this.dropFromLootTable(level, source, playerKilled); - // Paper start - final boolean prev = this.clearEquipmentSlots; -@@ -1935,6 +_,7 @@ - // Paper end - this.dropCustomDeathLoot(level, source, playerKilled); - this.clearEquipmentSlots = prev; // Paper -+ } // Purpur - Disable loot drops on death by cramming - } - - // CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment -@@ -3264,6 +_,7 @@ - float dmg = (float)(diff * 10.0 - 3.0); - if (dmg > 0.0F) { - this.playSound(this.getFallDamageSound((int)dmg), 1.0F, 1.0F); -+ if (level().purpurConfig.elytraKineticDamage) // Purpur - Toggle for kinetic damage - this.hurt(this.damageSources().flyIntoWall(), dmg); - } - } -@@ -4749,6 +_,12 @@ - ? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND) - : slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.typeHolder()); - } -+ -+ // Purpur start - Dispenser curse of binding protection -+ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack itemstack) { -+ return EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BINDING_CURSE, itemstack) > 0 ? null : this.getEquipmentSlotForItem(itemstack); -+ } -+ // Purpur end - Dispenser curse of binding protection - - private static SlotAccess createEquipmentSlotAccess(final LivingEntity entity, final EquipmentSlot equipmentSlot) { - return equipmentSlot != EquipmentSlot.HEAD && equipmentSlot != EquipmentSlot.MAINHAND && equipmentSlot != EquipmentSlot.OFFHAND +- public boolean canGlide() { ++ protected boolean canGlide() { + if (!this.onGround() && !this.isPassenger() && !this.hasEffect(MobEffects.LEVITATION)) { + for (EquipmentSlot slot : EquipmentSlot.VALUES) { + if (canGlideUsing(this.getItemBySlot(slot), slot)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Mob.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Mob.java.patch index 9b61ca446..99b1dacd4 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Mob.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Mob.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -150,6 +_,7 @@ +@@ -155,6 +_,7 @@ private int homeRadius = -1; public boolean aware = true; // CraftBukkit public net.kyori.adventure.util.TriState despawnInPeacefulOverride = net.kyori.adventure.util.TriState.NOT_SET; // Paper - allow changing despawnInPeaceful @@ -8,7 +8,7 @@ protected Mob(final EntityType type, final Level level) { super(type, level); -@@ -304,6 +_,7 @@ +@@ -309,6 +_,7 @@ target = null; } } @@ -16,7 +16,7 @@ this.target = target; return true; // CraftBukkit end -@@ -347,7 +_,27 @@ +@@ -352,7 +_,27 @@ } profiler.pop(); @@ -45,7 +45,7 @@ @Override protected void playHurtSound(final DamageSource source) { -@@ -451,6 +_,7 @@ +@@ -456,6 +_,7 @@ output.putString("Paper.DespawnInPeacefulOverride", this.despawnInPeacefulOverride.name()); } // Paper end - allow changing despawnInPeaceful @@ -53,7 +53,7 @@ } @Override -@@ -478,6 +_,7 @@ +@@ -483,6 +_,7 @@ this.lootTableSeed = input.getLongOr("DeathLootTableSeed", 0L); this.setNoAi(input.getBooleanOr("NoAI", false)); this.aware = input.getBooleanOr("Bukkit.Aware", true); // CraftBukkit @@ -61,7 +61,7 @@ // Paper start - allow changing despawnInPeaceful this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input); } -@@ -1257,7 +_,7 @@ +@@ -1289,7 +_,7 @@ ); } @@ -70,7 +70,7 @@ return groupData; } -@@ -1614,6 +_,7 @@ +@@ -1646,6 +_,7 @@ } this.postPiercingAttack(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch index d5ca5321f..aee5b290c 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/cow/AbstractCow.java +++ b/net/minecraft/world/entity/animal/cow/AbstractCow.java -@@ -40,7 +_,7 @@ +@@ -41,7 +_,7 @@ this.goalSelector.addGoal(0, new FloatGoal(this)); this.goalSelector.addGoal(1, new PanicGoal(this, 2.0)); this.goalSelector.addGoal(2, new BreedGoal(this, 1.0)); @@ -9,7 +9,7 @@ this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); -@@ -100,6 +_,10 @@ +@@ -101,6 +_,10 @@ ItemStack bucketOrMilkBucket = ItemUtils.createFilledResult(itemStack, player, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit player.setItemInHand(hand, bucketOrMilkBucket); return InteractionResult.SUCCESS; @@ -20,7 +20,7 @@ } else { return super.mobInteract(player, hand); } -@@ -109,4 +_,67 @@ +@@ -110,4 +_,67 @@ public EntityDimensions getDefaultDimensions(final Pose pose) { return this.isBaby() ? BABY_DIMENSIONS : super.getDefaultDimensions(pose); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch index df8a3b1fc..2ce6f5a3a 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/entity/animal/cow/MushroomCow.java +++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java -@@ -199,6 +_,13 @@ +@@ -207,6 +_,13 @@ level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, soundSource, 1.0F, 1.0F); - this.convertTo(EntityType.COW, ConversionParams.single(this, false, false), cow -> { + this.convertTo(EntityTypes.COW, ConversionParams.single(this, false, false), cow -> { level.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5), this.getZ(), 1, 0.0, 0.0, 0.0, 0.0); + // Purpur start - Fix cow rotation when shearing mooshroom + cow.copyPosition(this); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch index 5072bb8b2..bcde96b4c 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/world/entity/animal/dolphin/Dolphin.java +++ b/net/minecraft/world/entity/animal/dolphin/Dolphin.java -@@ -77,6 +_,7 @@ - public static final float BABY_SCALE = 0.65F; +@@ -86,6 +_,7 @@ + .withAttachments(EntityAttachments.builder().attach(EntityAttachment.PASSENGER, 0.0F, 0.3125F, 0.0F)); private static final boolean DEFAULT_GOT_FISH = false; public @Nullable BlockPos treasurePos; + private boolean isNaturallyAggressiveToPlayers; // Purpur - Dolphins naturally aggressive to players chance public Dolphin(final EntityType type, final Level level) { super(type, level); -@@ -92,6 +_,7 @@ +@@ -101,6 +_,7 @@ this.setAirSupply(this.getMaxAirSupply()); this.setXRot(0.0F); SpawnGroupData spawnGroupData = Objects.requireNonNullElseGet(groupData, () -> new AgeableMob.AgeableMobGroupData(0.1F)); @@ -16,7 +16,7 @@ return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData); } -@@ -157,18 +_,20 @@ +@@ -166,18 +_,20 @@ protected void registerGoals() { this.goalSelector.addGoal(0, new BreathAirGoal(this)); this.goalSelector.addGoal(0, new TryFindWaterGoal(this)); @@ -38,7 +38,7 @@ } public static AttributeSupplier.Builder createAttributes() { -@@ -395,6 +_,7 @@ +@@ -404,6 +_,7 @@ @Override public boolean canUse() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/equine/Llama.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/equine/Llama.java.patch index cf1072c8d..529feff18 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/equine/Llama.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/equine/Llama.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/equine/Llama.java +++ b/net/minecraft/world/entity/animal/equine/Llama.java -@@ -75,6 +_,7 @@ +@@ -76,6 +_,7 @@ private boolean didSpit; private @Nullable Llama caravanHead; public @Nullable Llama caravanTail; // Paper - public @@ -8,7 +8,7 @@ public Llama(final EntityType type, final Level level) { super(type, level); -@@ -104,6 +_,7 @@ +@@ -105,6 +_,7 @@ super.addAdditionalSaveData(output); output.store("Variant", Llama.Variant.LEGACY_CODEC, this.getVariant()); output.putInt("Strength", this.getStrength()); @@ -16,7 +16,7 @@ } @Override -@@ -111,6 +_,7 @@ +@@ -112,6 +_,7 @@ this.setStrength(input.getIntOr("Strength", 0)); super.readAdditionalSaveData(input); this.setVariant(input.read("Variant", Llama.Variant.LEGACY_CODEC).orElse(Llama.Variant.DEFAULT)); @@ -24,7 +24,7 @@ } @Override -@@ -387,6 +_,7 @@ +@@ -388,6 +_,7 @@ public void leaveCaravan() { if (this.caravanHead != null) { @@ -32,7 +32,7 @@ this.caravanHead.caravanTail = null; } -@@ -394,6 +_,7 @@ +@@ -395,6 +_,7 @@ } public void joinCaravan(final Llama tail) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Cat.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Cat.java.patch index ac135b32d..ddb417847 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Cat.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Cat.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/feline/Cat.java +++ b/net/minecraft/world/entity/animal/feline/Cat.java -@@ -382,6 +_,14 @@ +@@ -394,6 +_,14 @@ return this.isTame() && partner instanceof Cat cat && cat.isTame() && super.canMate(partner); } @@ -15,7 +15,7 @@ @Override public @Nullable SpawnGroupData finalizeSpawn( final ServerLevelAccessor level, final DifficultyInstance difficulty, final EntitySpawnReason spawnReason, @Nullable SpawnGroupData groupData -@@ -476,7 +_,7 @@ +@@ -488,7 +_,7 @@ } private void tryToTame(final Player player) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch index 22b5567e9..09dd2b42b 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/feline/Ocelot.java +++ b/net/minecraft/world/entity/animal/feline/Ocelot.java -@@ -234,7 +_,7 @@ +@@ -246,7 +_,7 @@ public boolean checkSpawnObstruction(final LevelReader level) { if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) { BlockPos pos = this.blockPosition(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/fox/Fox.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/fox/Fox.java.patch index ec370fb45..052de2479 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/fox/Fox.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/fox/Fox.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/fox/Fox.java +++ b/net/minecraft/world/entity/animal/fox/Fox.java -@@ -363,6 +_,11 @@ +@@ -370,6 +_,11 @@ } private void setTargetGoals() { @@ -12,7 +12,7 @@ if (this.getVariant() == Fox.Variant.RED) { this.targetSelector.addGoal(4, this.landTargetGoal); this.targetSelector.addGoal(4, this.turtleEggTargetGoal); -@@ -390,6 +_,7 @@ +@@ -397,6 +_,7 @@ public void setVariant(final Fox.Variant variant) { this.entityData.set(DATA_TYPE_ID, variant.getId()); @@ -20,7 +20,7 @@ } @Override -@@ -715,6 +_,29 @@ +@@ -722,6 +_,29 @@ return slot == EquipmentSlot.MAINHAND; } // Paper end diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/goat/Goat.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/goat/Goat.java.patch index 8661d8521..3eed87571 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/goat/Goat.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/goat/Goat.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/goat/Goat.java +++ b/net/minecraft/world/entity/animal/goat/Goat.java -@@ -362,6 +_,7 @@ +@@ -369,6 +_,7 @@ // Paper start - Goat ram API public void ram(net.minecraft.world.entity.LivingEntity entity) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch index 5acd74a74..22b37d2d1 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/golem/IronGolem.java +++ b/net/minecraft/world/entity/animal/golem/IronGolem.java -@@ -58,13 +_,25 @@ +@@ -59,13 +_,25 @@ private static final UniformInt PERSISTENT_ANGER_TIME = TimeUtil.rangeOfSeconds(20, 39); private long persistentAngerEndTime; private @Nullable EntityReference persistentAngerTarget; @@ -26,7 +26,7 @@ this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true)); this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F)); this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false)); -@@ -142,6 +_,7 @@ +@@ -143,6 +_,7 @@ protected void addAdditionalSaveData(final ValueOutput output) { super.addAdditionalSaveData(output); output.putBoolean("PlayerCreated", this.isPlayerCreated()); @@ -34,7 +34,7 @@ this.addPersistentAngerSaveData(output); } -@@ -149,6 +_,7 @@ +@@ -150,6 +_,7 @@ protected void readAdditionalSaveData(final ValueInput input) { super.readAdditionalSaveData(input); this.setPlayerCreated(input.getBooleanOr("PlayerCreated", false)); @@ -42,7 +42,7 @@ this.readPersistentAngerSaveData(this.level(), input); } -@@ -269,6 +_,7 @@ +@@ -270,6 +_,7 @@ float pitch = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F; this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, pitch); itemStack.consume(1, player); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/pig/Pig.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/pig/Pig.java.patch index 01e1e7375..7d4c42fe4 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/pig/Pig.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/pig/Pig.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/pig/Pig.java +++ b/net/minecraft/world/entity/animal/pig/Pig.java -@@ -158,6 +_,19 @@ +@@ -166,6 +_,19 @@ @Override public InteractionResult mobInteract(final Player player, final InteractionHand hand) { boolean hasFood = this.isFood(player.getItemInHand(hand)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch index 54842b6ad..c8349cede 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/polarbear/PolarBear.java +++ b/net/minecraft/world/entity/animal/polarbear/PolarBear.java -@@ -66,6 +_,29 @@ +@@ -72,6 +_,29 @@ super(type, level); } @@ -29,8 +29,8 @@ + @Override public @Nullable AgeableMob getBreedOffspring(final ServerLevel level, final AgeableMob partner) { - return EntityType.POLAR_BEAR.create(level, EntitySpawnReason.BREEDING); -@@ -73,7 +_,7 @@ + return EntityTypes.POLAR_BEAR.create(level, EntitySpawnReason.BREEDING); +@@ -79,7 +_,7 @@ @Override public boolean isFood(final ItemStack itemStack) { @@ -39,7 +39,7 @@ } @Override -@@ -82,6 +_,12 @@ +@@ -88,6 +_,12 @@ this.goalSelector.addGoal(0, new FloatGoal(this)); this.goalSelector.addGoal(1, new PolarBear.PolarBearMeleeAttackGoal()); this.goalSelector.addGoal(1, new PanicGoal(this, 2.0, bear -> bear.isBaby() ? DamageTypeTags.PANIC_CAUSES : DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch index 0258be4fe..35f6fb0c2 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/rabbit/Rabbit.java +++ b/net/minecraft/world/entity/animal/rabbit/Rabbit.java -@@ -419,10 +_,23 @@ +@@ -420,10 +_,23 @@ } this.setVariant(variant); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch index 00859fa4c..6e29acda3 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/squid/GlowSquid.java +++ b/net/minecraft/world/entity/animal/squid/GlowSquid.java -@@ -30,6 +_,13 @@ +@@ -31,6 +_,13 @@ super(type, level); } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch index 9d05de133..32b6d9471 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java +++ b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java -@@ -39,6 +_,24 @@ +@@ -40,6 +_,24 @@ this.setPos(x, y, z); } @@ -25,7 +25,7 @@ @Override protected Entity.MovementEmission getMovementEmission() { return Entity.MovementEmission.NONE; -@@ -75,6 +_,8 @@ +@@ -76,6 +_,8 @@ } } // Paper end - Fix invulnerable end crystals @@ -34,7 +34,7 @@ } @Override -@@ -118,15 +_,17 @@ +@@ -119,15 +_,17 @@ } // CraftBukkit end if (!source.is(DamageTypeTags.IS_EXPLOSION)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch index 8672e1a24..f55ea27b2 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -960,6 +_,7 @@ +@@ -964,6 +_,7 @@ @Override protected boolean canRide(final Entity vehicle) { @@ -8,7 +8,7 @@ return false; } -@@ -995,7 +_,7 @@ +@@ -999,7 +_,7 @@ boolean shouldDrop = level.getGameRules().get(GameRules.MOB_DROPS); int xpCount = 500; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch index f643d58da..8f9396cc5 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -94,10 +_,13 @@ +@@ -95,10 +_,13 @@ public boolean canTickSetByAPI = false; private boolean noTickEquipmentDirty = false; // Paper end - Allow ArmorStands not to tick @@ -14,7 +14,7 @@ } public ArmorStand(final Level level, final double x, final double y, final double z) { -@@ -546,6 +_,7 @@ +@@ -547,6 +_,7 @@ // Paper start - Allow ArmorStands not to tick @Override public void tick() { @@ -22,7 +22,7 @@ if (!this.canTick) { if (this.noTickEquipmentDirty) { this.noTickEquipmentDirty = false; -@@ -832,4 +_,19 @@ +@@ -833,4 +_,19 @@ } } // Paper end diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/ItemEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/ItemEntity.java.patch index bc0f6cc28..7df5123b4 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/ItemEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/ItemEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -54,6 +_,12 @@ +@@ -55,6 +_,12 @@ public boolean canMobPickup = true; // Paper - Item#canEntityPickup private int despawnRate = -1; // Paper - Alternative item-despawn-rate public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API @@ -13,7 +13,7 @@ public ItemEntity(final EntityType type, final Level level) { super(type, level); -@@ -339,7 +_,16 @@ +@@ -341,7 +_,16 @@ @Override public final boolean hurtServer(final ServerLevel level, final DamageSource source, final float damage) { @@ -31,7 +31,7 @@ return false; } -@@ -521,6 +_,12 @@ +@@ -523,6 +_,12 @@ public void setItem(final ItemStack itemStack) { this.getEntityData().set(DATA_ITEM, itemStack); this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(itemStack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch index c3288bf9a..c57dd020d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/item/PrimedTnt.java +++ b/net/minecraft/world/entity/item/PrimedTnt.java -@@ -237,4 +_,32 @@ +@@ -244,4 +_,32 @@ return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid(); } // Paper end - Option to prevent TNT from moving in water diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Guardian.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Guardian.java.patch index 9283c41f1..58cfbf885 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Guardian.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Guardian.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/Guardian.java +++ b/net/minecraft/world/entity/monster/Guardian.java -@@ -310,6 +_,11 @@ +@@ -307,6 +_,11 @@ final BlockPos pos, final RandomSource random ) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Ravager.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Ravager.java.patch index 1d4cd02c4..6f67b7985 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Ravager.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Ravager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/Ravager.java +++ b/net/minecraft/world/entity/monster/Ravager.java -@@ -74,6 +_,7 @@ +@@ -75,6 +_,7 @@ protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(0, new FloatGoal(this)); @@ -8,7 +8,7 @@ this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0, true)); this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); -@@ -152,7 +_,7 @@ +@@ -153,7 +_,7 @@ )) { BlockState state = serverLevel.getBlockState(pos); Block block = state.getBlock(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch index ee9c486db..4cf520819 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch @@ -1,60 +1,11 @@ --- a/net/minecraft/world/entity/monster/Shulker.java +++ b/net/minecraft/world/entity/monster/Shulker.java -@@ -93,6 +_,22 @@ - this.lookControl = new Shulker.ShulkerLookControl(this); - } - -+ // Purpur start - Shulker change color with dye -+ @Override -+ protected net.minecraft.world.InteractionResult mobInteract(Player player, net.minecraft.world.InteractionHand hand) { -+ net.minecraft.world.item.ItemStack itemstack = player.getItemInHand(hand); -+ DyeColor dyeColor = itemstack.get(DataComponents.DYE); -+ if (player.level().purpurConfig.shulkerChangeColorWithDye && dyeColor != null && dyeColor != this.getColor()) { -+ this.setVariant(Optional.of(dyeColor)); -+ if (!player.getAbilities().instabuild) { -+ itemstack.shrink(1); -+ } -+ return net.minecraft.world.InteractionResult.SUCCESS; -+ } -+ return super.mobInteract(player, hand); -+ } -+ // Purpur end - Shulker change color with dye -+ - @Override - protected void registerGoals() { - this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F, 0.02F, true)); -@@ -454,11 +_,21 @@ - private void hitByShulkerBullet() { - Vec3 oldPosition = this.position(); - AABB oldAabb = this.getBoundingBox(); -- if (!this.isClosed() && this.teleportSomewhere()) { -- int shulkerCount = this.level().getEntities(EntityType.SHULKER, oldAabb.inflate(8.0), Entity::isAlive).size(); -- float failureChance = (shulkerCount - 1) / 5.0F; -- if (!(this.level().getRandom().nextFloat() < failureChance)) { -+ // Purpur start - Shulker spawn from bullet options -+ if ((!this.level().purpurConfig.shulkerSpawnFromBulletRequireOpenLid || !this.isClosed()) && this.teleportSomewhere()) { -+ float failureChance = this.level().purpurConfig.shulkerSpawnFromBulletBaseChance; -+ if (!this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation.isBlank()) { -+ int shulkerCount = this.level().getEntities((net.minecraft.world.level.entity.EntityTypeTest) EntityType.SHULKER, oldAabb.inflate(this.level().purpurConfig.shulkerSpawnFromBulletNearbyRange), Entity::isAlive).size(); -+ try { -+ failureChance -= ((Number) scriptEngine.eval("let nearby = " + shulkerCount + "; " + this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation)).floatValue(); -+ } catch (javax.script.ScriptException e) { -+ e.printStackTrace(); -+ failureChance -= (shulkerCount - 1) / 5.0F; -+ } -+ } -+ if (this.level().getRandom().nextFloat() <= failureChance) { - Shulker baby = EntityType.SHULKER.create(this.level(), EntitySpawnReason.BREEDING); -+ // Purpur end - Shulker spawn from bullet options - if (baby != null) { - baby.setVariant(this.getVariant()); - baby.snapTo(oldPosition); -@@ -565,7 +_,7 @@ - } - - public Optional getVariant() { -- return Optional.ofNullable(this.getColor()); -+ return Optional.ofNullable(this.level().purpurConfig.shulkerSpawnFromBulletRandomColor ? DyeColor.random(this.level().getRandom()) : this.getColor()); // Purpur - Shulker spawn from bullet options - } - - public @Nullable DyeColor getColor() { +@@ -80,7 +_,7 @@ + private static final byte DEFAULT_PEEK = 0; + private static final Direction DEFAULT_ATTACH_FACE = Direction.DOWN; + private static final Vector3fc FORWARD = Direction.SOUTH.getUnitVec3f(); +- public static final float MAX_SCALE = 3.0F; ++ private static final float MAX_SCALE = 3.0F; + private float currentPeekAmountO; + private float currentPeekAmount; + private @Nullable BlockPos clientOldAttachPosition; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Strider.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Strider.java.patch index d3022a833..be75af1ee 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Strider.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Strider.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/Strider.java +++ b/net/minecraft/world/entity/monster/Strider.java -@@ -400,6 +_,18 @@ +@@ -411,6 +_,18 @@ @Override public InteractionResult mobInteract(final Player player, final InteractionHand hand) { boolean hasFood = this.isFood(player.getItemInHand(hand)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch index 9556d11f0..c35fb1c75 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -173,6 +_,11 @@ +@@ -186,6 +_,11 @@ public static boolean checkHoglinSpawnRules( final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch index 5a45b44ec..dbdf274c0 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -181,6 +_,11 @@ +@@ -182,6 +_,11 @@ public static boolean checkPiglinSpawnRules( final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch index c0a4a032f..22e6ce42e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/net/minecraft/world/entity/monster/piglin/PiglinAi.java -@@ -666,14 +_,24 @@ +@@ -664,14 +_,24 @@ } public static boolean isWearingSafeArmor(final LivingEntity livingEntity) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch index 5982e0484..fa10a4f63 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/world/entity/monster/skeleton/Skeleton.java +++ b/net/minecraft/world/entity/monster/skeleton/Skeleton.java -@@ -130,4 +_,64 @@ - SoundEvent getStepSound() { +@@ -131,4 +_,64 @@ + protected SoundEvent getStepSound() { return SoundEvents.SKELETON_STEP; } + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch index cbe6f8b9a..2ac51475d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/zombie/Drowned.java +++ b/net/minecraft/world/entity/monster/zombie/Drowned.java -@@ -93,10 +_,23 @@ +@@ -94,10 +_,23 @@ this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false)); this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0)); this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel())); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch index 48ef1be87..71384ed5e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/zombie/Zombie.java +++ b/net/minecraft/world/entity/monster/zombie/Zombie.java -@@ -127,7 +_,19 @@ +@@ -128,7 +_,19 @@ this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0)); this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true)); @@ -21,7 +21,7 @@ this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true)); this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR)); } -@@ -540,7 +_,7 @@ +@@ -542,7 +_,7 @@ } } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch index eca220352..8953dab89 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/monster/zombie/ZombieVillager.java +++ b/net/minecraft/world/entity/monster/zombie/ZombieVillager.java -@@ -170,10 +_,10 @@ +@@ -166,10 +_,10 @@ public InteractionResult mobInteract(final Player player, final InteractionHand hand) { ItemStack itemStack = player.getItemInHand(hand); if (itemStack.is(Items.GOLDEN_APPLE)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/villager/Villager.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/villager/Villager.java.patch index 8606700d4..4341c8c12 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/villager/Villager.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/npc/villager/Villager.java.patch @@ -7,10 +7,10 @@ + private boolean isLobotomized = false; public boolean isLobotomized() { return this.isLobotomized; } // Purpur - Lobotomize stuck villagers + private int notLobotomizedCount = 0; // Purpur - Lobotomize stuck villagers - public Villager(final EntityType type, final Level level) { - this(type, level, VillagerType.PLAINS); -@@ -199,6 +_,57 @@ - this.setVillagerData(this.getVillagerData().withType(type).withProfession(level.registryAccess(), VillagerProfession.NONE)); + public Villager(final EntityType entityType, final Level level) { + super(entityType, level); +@@ -190,6 +_,57 @@ + this.setCanPickUpLoot(true); } + // Purpur start - Allow leashing villagers @@ -66,8 +66,8 @@ + @Override public Brain getBrain() { - return (Brain) super.getBrain(); -@@ -268,11 +_,22 @@ + return (Brain)super.getBrain(); +@@ -259,11 +_,22 @@ // Paper start - EAR 2 this.customServerAiStep(level, false); } @@ -92,7 +92,7 @@ profiler.pop(); if (this.assignProfessionWhenSpawned) { this.assignProfessionWhenSpawned = false; -@@ -347,6 +_,7 @@ +@@ -338,6 +_,7 @@ return InteractionResult.CONSUME; } @@ -100,7 +100,7 @@ this.startTrading(player); } -@@ -487,7 +_,7 @@ +@@ -478,7 +_,7 @@ public void updateDemand() { for (MerchantOffer offer : this.getOffers()) { @@ -109,7 +109,7 @@ } } -@@ -687,7 +_,7 @@ +@@ -688,7 +_,7 @@ @Override public boolean canBreed() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index eed5fb8e3..a7cf5349d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -1,111 +1,11 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -173,11 +_,20 @@ - public float hurtDir; - public boolean affectsSpawning = true; // Paper - Affects Spawning API - public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage -+ public int burpDelay = 0; // Purpur - Burp delay -+ public boolean canPortalInstant = false; // Purpur - Add portal permission bypass - - // CraftBukkit start - public boolean fauxSleeping; - public int oldLevel = -1; - -+ // Purpur start - AFK API -+ public abstract void setAfk(boolean afk); -+ -+ public boolean isAfk() { -+ return false; -+ } -+ // Purpur end - AFK API - @Override - public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() { - return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity(); -@@ -242,6 +_,12 @@ - - @Override - public void tick() { -+ // Purpur start - Burp delay -+ if (this.burpDelay > 0 && --this.burpDelay == 0) { -+ this.level().playSound(null, getX(), getY(), getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 1.0F, this.level().getRandom().nextFloat() * 0.1F + 0.9F); -+ } -+ // Purpur end - Burp delay -+ - this.noPhysics = this.isSpectator(); - if (this.isSpectator() || this.isPassenger()) { - this.setOnGround(false); -@@ -299,6 +_,17 @@ - this.turtleHelmetTick(); - } - -+ // Purpur start - Full netherite armor grants fire resistance -+ if (this.level().purpurConfig.playerNetheriteFireResistanceDuration > 0 && this.level().getGameTime() % 20 == 0) { -+ if (this.getItemBySlot(EquipmentSlot.HEAD).is(Items.NETHERITE_HELMET) -+ && this.getItemBySlot(EquipmentSlot.CHEST).is(Items.NETHERITE_CHESTPLATE) -+ && this.getItemBySlot(EquipmentSlot.LEGS).is(Items.NETHERITE_LEGGINGS) -+ && this.getItemBySlot(EquipmentSlot.FEET).is(Items.NETHERITE_BOOTS)) { -+ this.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, this.level().purpurConfig.playerNetheriteFireResistanceDuration, this.level().purpurConfig.playerNetheriteFireResistanceAmplifier, this.level().purpurConfig.playerNetheriteFireResistanceAmbient, this.level().purpurConfig.playerNetheriteFireResistanceShowParticles, this.level().purpurConfig.playerNetheriteFireResistanceShowIcon), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.NETHERITE_ARMOR); -+ } -+ } -+ // Purpur end - Full netherite armor grants fire resistance -+ - this.cooldowns.tick(); - this.updatePlayerPose(); - } -@@ -504,7 +_,7 @@ - List orbs = Lists.newArrayList(); - - for (Entity entity : entities) { -- if (entity.is(EntityType.EXPERIENCE_ORB)) { -+ if (entity.is(EntityType.EXPERIENCE_ORB) && entity.level().purpurConfig.playerExpPickupDelay >= 0) { // Purpur - Configurable player pickup exp delay - orbs.add(entity); - } else if (!entity.isRemoved()) { - this.touch(entity); -@@ -1052,7 +_,7 @@ - criticalAttack = criticalAttack && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits - if (criticalAttack) { - damageSource = damageSource.critical(); // Paper - critical damage API -- baseDamage *= 1.5F; -+ baseDamage *= (float) this.level().purpurConfig.playerCriticalDamageMultiplier; // Purpur - Add config change multiplier critical damage value - } - - float totalDamage = baseDamage + magicBoost; -@@ -1748,7 +_,23 @@ - - @Override - protected int getBaseExperienceReward(final ServerLevel level) { -- return !level.getGameRules().get(GameRules.KEEP_INVENTORY) && !this.isSpectator() ? Math.min(this.experienceLevel * 7, 100) : 0; -+ // Purpur start - Add player death exp control options -+ if (!level.getGameRules().get(GameRules.KEEP_INVENTORY) && !this.isSpectator()) { -+ int toDrop; -+ try { -+ toDrop = Math.round(((Number) scriptEngine.eval("let expLevel = " + experienceLevel + "; " + -+ "let expTotal = " + totalExperience + "; " + -+ "let exp = " + experienceProgress + "; " + -+ level().purpurConfig.playerDeathExpDropEquation)).floatValue()); -+ } catch (javax.script.ScriptException e) { -+ e.printStackTrace(); -+ toDrop = experienceLevel * 7; -+ } -+ return Math.min(toDrop, level().purpurConfig.playerDeathExpDropMax); -+ } else { -+ return 0; -+ } -+ // Purpur end - Add player death exp control options +@@ -1529,7 +_,7 @@ } @Override -@@ -1791,6 +_,13 @@ - public boolean addItem(final ItemStack itemStack) { - return this.inventory.add(itemStack); +- public boolean canGlide() { ++ protected boolean canGlide() { + return !this.abilities.flying && super.canGlide(); } -+ -+ // Purpur start - Player ridable in water option -+ @Override -+ public boolean dismountsUnderwater() { -+ return !level().purpurConfig.playerRidableInWater; -+ } -+ // Purpur end - Player ridable in water option - - public abstract @Nullable GameType gameMode(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch index 3197c970c..41affda87 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java +++ b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java -@@ -78,6 +_,7 @@ +@@ -79,6 +_,7 @@ private @Nullable List piercedAndKilledEntities; public ItemStack pickupItemStack = this.getDefaultPickupItem(); public @Nullable ItemStack firedFromWeapon = null; @@ -8,7 +8,7 @@ protected AbstractArrow(final EntityType type, final Level level) { super(type, level); -@@ -605,6 +_,12 @@ +@@ -611,6 +_,12 @@ public @Nullable ItemStack getWeaponItem() { return this.firedFromWeapon; } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch index 5f3c42406..85610e9f5 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java +++ b/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java -@@ -72,7 +_,7 @@ +@@ -73,7 +_,7 @@ Entity currentOwner = this.getOwner(); int loyalty = this.entityData.get(ID_LOYALTY); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch index 09d142213..5bb017184 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java +++ b/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java -@@ -94,7 +_,7 @@ +@@ -95,7 +_,7 @@ super.onHit(hitResult); if (!this.level().isClientSide()) { // CraftBukkit start @@ -9,7 +9,7 @@ if (event.callEvent()) { this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); } -@@ -102,6 +_,13 @@ +@@ -103,6 +_,13 @@ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause } } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch index cd762b68b..7aacf3216 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java +++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java -@@ -54,9 +_,39 @@ +@@ -55,9 +_,39 @@ protected void onHitEntity(final EntityHitResult hitResult) { super.onHitEntity(hitResult); Entity entity = hitResult.getEntity(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch index 0b55a70f5..e5880ff35 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java +++ b/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java -@@ -394,7 +_,7 @@ +@@ -396,7 +_,7 @@ private Vec3 calculateBoostTrackSpeed(final Vec3 deltaMovement, final BlockPos pos, final BlockState state) { if (state.is(Blocks.POWERED_RAIL) && state.getValue(PoweredRailBlock.POWERED)) { if (deltaMovement.length() > 0.01) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch index ad08a7d2a..0ec089841 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/inventory/AbstractFurnaceMenu.java +++ b/net/minecraft/world/inventory/AbstractFurnaceMenu.java -@@ -121,7 +_,13 @@ +@@ -116,7 +_,13 @@ } else if (slotIndex != 1 && slotIndex != 0) { if (this.canSmelt(stack)) { if (!this.moveItemStackTo(stack, 0, 1, false)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/AxeItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/AxeItem.java.patch index 995ce8a8a..9433f75dc 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/AxeItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/AxeItem.java.patch @@ -20,7 +20,7 @@ } // Paper end @@ -81,8 +_,15 @@ - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, pos, itemInHand); + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(serverPlayer, pos, itemInHand); } - level.setBlock(pos, newBlock.get(), Block.UPDATE_ALL_IMMEDIATE); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BowItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BowItem.java.patch index 2da33f90a..4768ea4d4 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BowItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BowItem.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/item/BowItem.java +++ b/net/minecraft/world/item/BowItem.java -@@ -28,6 +_,11 @@ - return false; - } else { +@@ -26,6 +_,11 @@ + public boolean releaseUsing(final ItemStack itemStack, final Level level, final LivingEntity entity, final int remainingTime) { + if (entity instanceof Player player) { ItemStack projectile = player.getProjectile(itemStack); + // Purpur start - Infinity bow settings + if (level.purpurConfig.infinityWorksWithoutArrows && projectile.isEmpty() && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0) { @@ -12,7 +12,7 @@ if (projectile.isEmpty()) { return false; } -@@ -40,7 +_,7 @@ +@@ -38,7 +_,7 @@ List firedProjectiles = draw(itemStack, projectile, player); if (level instanceof ServerLevel serverLevel && !firedProjectiles.isEmpty()) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch index 5f620b3e4..aedf7994a 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/BucketItem.java +++ b/net/minecraft/world/item/BucketItem.java -@@ -152,7 +_,7 @@ +@@ -154,7 +_,7 @@ return hitResult != null && this.emptyContents(user, level, hitResult.getBlockPos().relative(hitResult.getDirection()), null, direction, clicked, itemStack, hand); // CraftBukkit } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/DyeColor.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/DyeColor.java.patch index e5e6a6ce2..32820ca6b 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/DyeColor.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/DyeColor.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/DyeColor.java +++ b/net/minecraft/world/item/DyeColor.java -@@ -154,4 +_,10 @@ +@@ -168,4 +_,10 @@ return null; } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch index e28c7e6a2..783a8e778 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -453,6 +_,7 @@ +@@ -452,6 +_,7 @@ // revert back all captured blocks for (org.bukkit.block.BlockState blockstate : blocks) { ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace(); @@ -8,7 +8,7 @@ } SignItem.openSign = null; // SPIGOT-6758 - Reset on early return -@@ -476,6 +_,7 @@ +@@ -475,6 +_,7 @@ if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically block.onPlace(level, newPos, oldBlock, true, context); } @@ -16,7 +16,7 @@ level.notifyAndUpdatePhysics(newPos, null, oldBlock, block, level.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point } -@@ -591,6 +_,26 @@ +@@ -590,6 +_,26 @@ return this.isDamageableItem() && this.getDamageValue() > 0; } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch index 705575fa3..8f6919f5e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/item/SpawnEggItem.java +++ b/net/minecraft/world/item/SpawnEggItem.java -@@ -64,6 +_,23 @@ +@@ -61,6 +_,23 @@ return InteractionResult.FAIL; } else { if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch index 2a0a35441..610e6e70a 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/BaseSpawner.java +++ b/net/minecraft/world/level/BaseSpawner.java -@@ -60,6 +_,7 @@ +@@ -66,6 +_,7 @@ } public boolean isNearPlayer(final Level level, final BlockPos pos) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/EntityGetter.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/EntityGetter.java.patch index 46c66d714..c2b67fa57 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/EntityGetter.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/EntityGetter.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/EntityGetter.java +++ b/net/minecraft/world/level/EntityGetter.java -@@ -183,7 +_,7 @@ +@@ -142,7 +_,7 @@ default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) { for (Player player : this.players()) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch index 7e083fcae..55b298309 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch @@ -55,7 +55,7 @@ public CraftWorld getWorld() { return this.world; } -@@ -852,6 +_,8 @@ +@@ -220,6 +_,8 @@ final org.bukkit.NamespacedKey worldKey = CraftNamespacedKey.fromMinecraft(dimension.identifier()); // Paper this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName, worldKey); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config @@ -64,8 +64,8 @@ this.generator = generator; this.world = new CraftWorld((ServerLevel) this, worldKey, biomeProvider, environment); -@@ -2197,4 +_,14 @@ - return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system +@@ -1504,4 +_,14 @@ + return ret; } // Paper end - allow patching this logic + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch index 5263d526d..0dc8bc103 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/NaturalSpawner.java +++ b/net/minecraft/world/level/NaturalSpawner.java -@@ -289,7 +_,7 @@ +@@ -213,7 +_,7 @@ pos.set(x, yStart, z); double xx = x + 0.5; double zz = z + 0.5; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch index 985f77d60..625c1a72f 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -114,6 +_,10 @@ +@@ -111,6 +_,10 @@ public static final int UPDATE_LIMIT = 512; protected final StateDefinition stateDefinition; private BlockState defaultBlockState; @@ -11,7 +11,7 @@ // Paper start - Protect Bedrock and End Portal/Frames from being destroyed public final boolean isDestroyable() { return io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits || -@@ -415,7 +_,7 @@ +@@ -412,7 +_,7 @@ event.setExpToDrop(block.getExpDrop(state, serverLevel, pos, net.minecraft.world.item.ItemStack.EMPTY, true)); // Paper - Properly handle xp dropping event.callEvent(); for (org.bukkit.inventory.ItemStack drop : event.getDrops()) { @@ -20,7 +20,7 @@ } state.spawnAfterBreak(serverLevel, pos, ItemStack.EMPTY, false); // Paper - Properly handle xp dropping block.popExperience(serverLevel, pos, event.getExpToDrop()); // Paper - Properly handle xp dropping -@@ -433,7 +_,7 @@ +@@ -430,7 +_,7 @@ public static void dropResources(final BlockState state, final LevelAccessor level, final BlockPos pos, final @Nullable BlockEntity blockEntity) { if (level instanceof ServerLevel serverLevel) { @@ -29,7 +29,7 @@ state.spawnAfterBreak(serverLevel, pos, ItemStack.EMPTY, true); } } -@@ -454,11 +_,30 @@ +@@ -451,11 +_,30 @@ , final boolean dropExperience // Paper - Properly handle xp dropping ) { if (level instanceof ServerLevel serverLevel) { @@ -59,9 +59,9 @@ + // Purpur end - Persistent BlockEntity Lore and DisplayName + public static void popResource(final Level level, final BlockPos pos, final ItemStack itemStack) { - double halfHeight = EntityType.ITEM.getHeight() / 2.0; + double halfHeight = EntityTypes.ITEM.getHeight() / 2.0; RandomSource random = level.getRandom(); -@@ -548,7 +_,15 @@ +@@ -545,7 +_,15 @@ } public void setPlacedBy(final Level level, final BlockPos pos, final BlockState state, final @Nullable LivingEntity by, final ItemStack itemStack) { @@ -78,7 +78,7 @@ public boolean isPossibleToRespawnInThis(final BlockState state) { return !state.isSolid() && !state.liquid(); -@@ -559,7 +_,7 @@ +@@ -556,7 +_,7 @@ } public void fallOn(final Level level, final BlockState state, final BlockPos pos, final Entity entity, final double fallDistance) { @@ -86,4 +86,4 @@ + entity.causeFallDamage(fallDistance * fallDistanceMultiplier, fallDamageMultiplier, entity.damageSources().fall()); // Purpur - Configurable block fall damage modifiers } - public void updateEntityMovementAfterFallOn(final BlockGetter level, final Entity entity) { + public float getBounceRestitution() { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch index ef7b93e66..eb8cb3b83 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Blocks.java +++ b/net/minecraft/world/level/block/Blocks.java -@@ -6727,6 +_,7 @@ +@@ -5519,6 +_,7 @@ BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() @@ -8,7 +8,7 @@ .instabreak() .sound(SoundType.AZALEA) .noOcclusion() -@@ -6738,6 +_,7 @@ +@@ -5530,6 +_,7 @@ BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch index b4334e407..18298f0af 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/CampfireBlock.java +++ b/net/minecraft/world/level/block/CampfireBlock.java -@@ -136,7 +_,7 @@ +@@ -137,7 +_,7 @@ return this.defaultBlockState() .setValue(WATERLOGGED, replacedWater) .setValue(SIGNAL_FIRE, this.isSmokeSource(level.getBlockState(pos.below()))) diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch index feaa44a3c..40b971cde 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/world/level/block/CarvedPumpkinBlock.java @@ -67,7 +_,7 @@ if (snowGolemMatch != null) { - SnowGolem snowGolem = EntityType.SNOW_GOLEM.create(level, EntitySpawnReason.TRIGGERED); + SnowGolem snowGolem = EntityTypes.SNOW_GOLEM.create(level, EntitySpawnReason.TRIGGERED); if (snowGolem != null) { - spawnGolemInWorld(level, snowGolemMatch, snowGolem, snowGolemMatch.getBlock(0, 2, 0).getPos()); + spawnGolemInWorld(level, snowGolemMatch, snowGolem, snowGolemMatch.getBlock(0, 2, 0).getPos(), this.placer); // Purpur - Summoner API @@ -10,7 +10,7 @@ } } @@ -77,7 +_,7 @@ - IronGolem ironGolem = EntityType.IRON_GOLEM.create(level, EntitySpawnReason.TRIGGERED); + IronGolem ironGolem = EntityTypes.IRON_GOLEM.create(level, EntitySpawnReason.TRIGGERED); if (ironGolem != null) { ironGolem.setPlayerCreated(true); - spawnGolemInWorld(level, ironGolemMatch, ironGolem, ironGolemMatch.getBlock(1, 2, 0).getPos()); @@ -20,7 +20,7 @@ } @@ -86,7 +_,7 @@ if (copperGolemMatch != null) { - CopperGolem copperGolem = EntityType.COPPER_GOLEM.create(level, EntitySpawnReason.TRIGGERED); + CopperGolem copperGolem = EntityTypes.COPPER_GOLEM.create(level, EntitySpawnReason.TRIGGERED); if (copperGolem != null) { - spawnGolemInWorld(level, copperGolemMatch, copperGolem, copperGolemMatch.getBlock(0, 0, 0).getPos()); + spawnGolemInWorld(level, copperGolemMatch, copperGolem, copperGolemMatch.getBlock(0, 0, 0).getPos(), this.placer); // Purpur - Summoner API diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChestBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChestBlock.java.patch index f98e35878..e14b756bf 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChestBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChestBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/ChestBlock.java +++ b/net/minecraft/world/level/block/ChestBlock.java -@@ -347,6 +_,7 @@ +@@ -348,6 +_,7 @@ } public static boolean isBlockedChestByBlock(final BlockGetter level, final BlockPos pos) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch index 34f372af9..e0cd39718 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/net/minecraft/world/level/block/NetherPortalBlock.java -@@ -68,7 +_,7 @@ - protected void randomTick(final BlockState state, final ServerLevel level, BlockPos pos, final RandomSource random) { - if (level.spigotConfig.enableZombiePigmenPortalSpawns && level.isSpawningMonsters() // Spigot +@@ -70,7 +_,7 @@ + if (level.spigotConfig.enableZombiePigmenPortalSpawns && level.isSpawningMonsters() // Paper + && level.getLevelData().getDifficulty() != Difficulty.PEACEFUL && level.environmentAttributes().getValue(EnvironmentAttributes.NETHER_PORTAL_SPAWNS_PIGLINS, pos) - && random.nextInt(2000) < level.getDifficulty().getId() + && random.nextInt(level.purpurConfig.piglinPortalSpawnModifier) < level.getDifficulty().getId() // Purpur - Piglin portal spawn modifier && level.anyPlayerCloseEnoughForSpawning(pos)) { while (level.getBlockState(pos).is(this)) { pos = pos.below(); -@@ -133,7 +_,7 @@ +@@ -135,7 +_,7 @@ @Override public int getPortalTransitionTime(final ServerLevel level, final Entity entity) { return entity instanceof Player player diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch index 56c4112a3..f36b91f3b 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java -@@ -196,20 +_,20 @@ +@@ -89,20 +_,20 @@ @VisibleForTesting public static void maybeTransferFluid(final BlockState state, final ServerLevel level, final BlockPos pos, final float randomValue) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch index 5785d589b..70b57d59c 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SculkShriekerBlock.java +++ b/net/minecraft/world/level/block/SculkShriekerBlock.java -@@ -116,7 +_,7 @@ +@@ -117,7 +_,7 @@ @Override public @Nullable BlockState getStateForPlacement(final BlockPlaceContext context) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ShulkerBoxBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ShulkerBoxBlock.java.patch new file mode 100644 index 000000000..0b1ad5d00 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ShulkerBoxBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/ShulkerBoxBlock.java ++++ b/net/minecraft/world/level/block/ShulkerBoxBlock.java +@@ -87,7 +_,7 @@ + return InteractionResult.SUCCESS; + } + +- public static boolean canOpen(final BlockState state, final Level level, final BlockPos pos, final ShulkerBoxBlockEntity blockEntity) { ++ private static boolean canOpen(final BlockState state, final Level level, final BlockPos pos, final ShulkerBoxBlockEntity blockEntity) { + if (blockEntity.getAnimationStatus() != ShulkerBoxBlockEntity.AnimationStatus.CLOSED) { + return true; + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch index d26a15acf..a19039e6c 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/level/block/SlabBlock.java +++ b/net/minecraft/world/level/block/SlabBlock.java -@@ -143,4 +_,25 @@ - return false; - } +@@ -139,4 +_,25 @@ + default -> false; + }; } + + // Purpur start - Break individual slabs when sneaking diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch index 29afa8563..84acc625e 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/SpawnerBlock.java +++ b/net/minecraft/world/level/block/SpawnerBlock.java -@@ -15,6 +_,7 @@ +@@ -16,6 +_,7 @@ import org.jspecify.annotations.Nullable; public class SpawnerBlock extends BaseEntityBlock { @@ -8,8 +8,8 @@ public static final MapCodec CODEC = simpleCodec(SpawnerBlock::new); @Override -@@ -36,6 +_,62 @@ - return createTickerHelper(type, BlockEntityType.MOB_SPAWNER, level.isClientSide() ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick); +@@ -37,6 +_,62 @@ + return createTickerHelper(type, BlockEntityTypes.MOB_SPAWNER, level.isClientSide() ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick); } + // Purpur start - Silk touch spawners @@ -71,7 +71,7 @@ @Override protected void spawnAfterBreak(final BlockState state, final ServerLevel level, final BlockPos pos, final ItemStack tool, final boolean dropExperience) { super.spawnAfterBreak(state, level, pos, tool, dropExperience); -@@ -44,6 +_,7 @@ +@@ -45,6 +_,7 @@ @Override public int getExpDrop(final BlockState state, final ServerLevel level, final BlockPos pos, final ItemStack tool, final boolean dropExperience) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch index cbf2b09ce..5cd24c273 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -@@ -138,6 +_,16 @@ +@@ -140,6 +_,16 @@ public double getEffectRange() { if (this.effectRange < 0) { @@ -17,7 +17,7 @@ return this.levels * 10 + 10; } else { return effectRange; -@@ -166,6 +_,7 @@ +@@ -168,6 +_,7 @@ int y = pos.getY(); int z = pos.getZ(); BlockPos checkPos; @@ -25,7 +25,7 @@ if (entity.lastCheckY < y) { checkPos = pos; entity.checkingBeamSections = Lists.newArrayList(); -@@ -195,11 +_,15 @@ +@@ -197,11 +_,15 @@ } } } else { @@ -42,7 +42,7 @@ lastBeamSection.increaseHeight(); } -@@ -210,11 +_,11 @@ +@@ -212,11 +_,11 @@ int previousLevels = entity.levels; if (level.getGameTime() % 80L == 0L) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch index 959ae3309..f7e6fa8a1 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch @@ -9,7 +9,7 @@ private static final int MIN_TICKS_BEFORE_REENTERING_HIVE = 400; private static final int MIN_OCCUPATION_TICKS_NECTAR = 2400; public static final int MIN_OCCUPATION_TICKS_NECTARLESS = 600; -@@ -157,10 +_,32 @@ +@@ -157,11 +_,33 @@ return spawned; } @@ -33,12 +33,24 @@ public int getOccupantCount() { return this.stored.size(); } -+ + + // Purpur start - Stored Bee API + public List getStored() { + return stored; + } + // Purpur end - Stored Bee API - ++ // Paper start - Add EntityBlockStorage clearEntities public void clearBees() { + this.stored.clear(); +@@ -390,8 +_,8 @@ + registration.register(DebugSubscriptions.BEE_HIVES, () -> DebugHiveInfo.pack(this)); + } + +- public static class BeeData { +- public final BeehiveBlockEntity.Occupant occupant; ++ private static class BeeData { ++ private final BeehiveBlockEntity.Occupant occupant; + private int exitTickCounter; // Paper - Fix bees aging inside hives; separate counter for checking if bee should exit to reduce exit attempts + private int ticksInHive; + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch index e21531325..71fde3078 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch @@ -7,7 +7,7 @@ + private int lapis = 0; // Purpur - Enchantment Table Persists Lapis public EnchantingTableBlockEntity(final BlockPos worldPosition, final BlockState blockState) { - super(BlockEntityType.ENCHANTING_TABLE, worldPosition, blockState); + super(BlockEntityTypes.ENCHANTING_TABLE, worldPosition, blockState); @@ -39,12 +_,14 @@ protected void saveAdditional(final ValueOutput output) { super.saveAdditional(output); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch new file mode 100644 index 000000000..e400cb692 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/FuelValues.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/entity/FuelValues.java ++++ b/net/minecraft/world/level/block/entity/FuelValues.java +@@ -17,7 +_,7 @@ + import net.minecraft.world.level.block.Blocks; + + public class FuelValues { +- public final Object2IntSortedMap values; ++ private final Object2IntSortedMap values; + + private FuelValues(final Object2IntSortedMap values) { + this.values = values; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch new file mode 100644 index 000000000..9c2ff67c2 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/state/BlockBehaviour.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/state/BlockBehaviour.java ++++ b/net/minecraft/world/level/block/state/BlockBehaviour.java +@@ -88,7 +_,7 @@ + Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP + }; + public final boolean hasCollision; +- public float explosionResistance; ++ protected final float explosionResistance; + protected final boolean isRandomlyTicking; + protected final SoundType soundType; + protected final float friction; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch index 40fdcd525..bd09af517 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/level/chunk/storage/EntityStorage.java +++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java -@@ -105,6 +_,7 @@ - } - // Paper end - Entity load/save limit per chunk +@@ -94,6 +_,7 @@ + ListTag entities = new ListTag(); + chunk.getEntities().forEach(e -> { TagValueOutput output = TagValueOutput.createWithContext(reporter.forChild(e.problemPath()), e.registryAccess()); + if (!e.canSaveToDisk()) return; // Purpur - Add canSaveToDisk to Entity if (e.save(output)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch index 454a21b0e..df0d6078b 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch @@ -19,7 +19,7 @@ int dayLength = 24000; @@ -56,7 +_,7 @@ FluidState fluidState = level.getFluidState(spawnPos); - if (NaturalSpawner.isValidEmptySpawnBlock(level, spawnPos, blockState, fluidState, EntityType.PHANTOM)) { + if (NaturalSpawner.isValidEmptySpawnBlock(level, spawnPos, blockState, fluidState, EntityTypes.PHANTOM)) { SpawnGroupData groupData = null; - int groupSize = 1 + random.nextInt(difficulty.getDifficulty().getId() + 1); + int groupSize = level.purpurConfig.phantomSpawnMinPerAttempt + random.nextInt((level.purpurConfig.phantomSpawnMaxPerAttempt < 0 ? difficulty.getDifficulty().getId() : level.purpurConfig.phantomSpawnMaxPerAttempt - level.purpurConfig.phantomSpawnMinPerAttempt) + 1); // Purpur - Add phantom spawning options diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/FlowingFluid.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/FlowingFluid.java.patch index fb5f5f004..230045c8d 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/FlowingFluid.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/FlowingFluid.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/material/FlowingFluid.java +++ b/net/minecraft/world/level/material/FlowingFluid.java -@@ -234,7 +_,7 @@ +@@ -192,7 +_,7 @@ } } @@ -9,7 +9,7 @@ BlockState belowState = level.getBlockState(mutablePos.setWithOffset(pos, Direction.DOWN)); FluidState belowFluid = belowState.getFluidState(); if (belowState.isSolid() || this.isSourceBlockOfThisType(belowFluid)) { -@@ -320,6 +_,12 @@ +@@ -280,6 +_,12 @@ } protected abstract boolean canConvertToSource(ServerLevel level); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch index 3fee8ca9f..aadfaf447 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch @@ -5,7 +5,7 @@ private static final int MIN_HEIGHT = 3; public static final int MAX_HEIGHT = 21; - public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN); -+ public static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN) || (org.purpurmc.purpur.PurpurConfig.cryingObsidianValidForPortalFrame && state.is(Blocks.CRYING_OBSIDIAN)); // Purpur - Crying obsidian valid for portal frames ++ private static final BlockBehaviour.StatePredicate FRAME = (state, level, pos) -> state.is(Blocks.OBSIDIAN); private static final float SAFE_TRAVEL_MAX_ENTITY_XY = 4.0F; private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA = 1.0; private final Direction.Axis axis; diff --git a/purpur-server/minecraft-patches/features/0001-Ridables.patch b/purpur-server/minecraft-patches/unapplied-features/0001-Ridables.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0001-Ridables.patch rename to purpur-server/minecraft-patches/unapplied-features/0001-Ridables.patch diff --git a/purpur-server/minecraft-patches/features/0002-Configurable-entity-base-attributes.patch b/purpur-server/minecraft-patches/unapplied-features/0002-Configurable-entity-base-attributes.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0002-Configurable-entity-base-attributes.patch rename to purpur-server/minecraft-patches/unapplied-features/0002-Configurable-entity-base-attributes.patch diff --git a/purpur-server/minecraft-patches/features/0003-Barrels-and-enderchests-6-rows.patch b/purpur-server/minecraft-patches/unapplied-features/0003-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0003-Barrels-and-enderchests-6-rows.patch rename to purpur-server/minecraft-patches/unapplied-features/0003-Barrels-and-enderchests-6-rows.patch diff --git a/purpur-server/minecraft-patches/features/0004-Giants-AI-settings.patch b/purpur-server/minecraft-patches/unapplied-features/0004-Giants-AI-settings.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0004-Giants-AI-settings.patch rename to purpur-server/minecraft-patches/unapplied-features/0004-Giants-AI-settings.patch diff --git a/purpur-server/minecraft-patches/features/0005-Chickens-can-retaliate.patch b/purpur-server/minecraft-patches/unapplied-features/0005-Chickens-can-retaliate.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0005-Chickens-can-retaliate.patch rename to purpur-server/minecraft-patches/unapplied-features/0005-Chickens-can-retaliate.patch diff --git a/purpur-server/minecraft-patches/features/0006-Minecart-settings-and-WASD-controls.patch b/purpur-server/minecraft-patches/unapplied-features/0006-Minecart-settings-and-WASD-controls.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0006-Minecart-settings-and-WASD-controls.patch rename to purpur-server/minecraft-patches/unapplied-features/0006-Minecart-settings-and-WASD-controls.patch diff --git a/purpur-server/minecraft-patches/features/0007-Villagers-follow-emerald-blocks.patch b/purpur-server/minecraft-patches/unapplied-features/0007-Villagers-follow-emerald-blocks.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0007-Villagers-follow-emerald-blocks.patch rename to purpur-server/minecraft-patches/unapplied-features/0007-Villagers-follow-emerald-blocks.patch diff --git a/purpur-server/minecraft-patches/features/0008-Implement-elytra-settings.patch b/purpur-server/minecraft-patches/unapplied-features/0008-Implement-elytra-settings.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0008-Implement-elytra-settings.patch rename to purpur-server/minecraft-patches/unapplied-features/0008-Implement-elytra-settings.patch diff --git a/purpur-server/minecraft-patches/features/0009-Configurable-jockey-options.patch b/purpur-server/minecraft-patches/unapplied-features/0009-Configurable-jockey-options.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0009-Configurable-jockey-options.patch rename to purpur-server/minecraft-patches/unapplied-features/0009-Configurable-jockey-options.patch diff --git a/purpur-server/minecraft-patches/features/0010-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch b/purpur-server/minecraft-patches/unapplied-features/0010-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0010-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch rename to purpur-server/minecraft-patches/unapplied-features/0010-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch diff --git a/purpur-server/minecraft-patches/features/0011-Phantoms-burn-in-light.patch b/purpur-server/minecraft-patches/unapplied-features/0011-Phantoms-burn-in-light.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0011-Phantoms-burn-in-light.patch rename to purpur-server/minecraft-patches/unapplied-features/0011-Phantoms-burn-in-light.patch diff --git a/purpur-server/minecraft-patches/features/0012-Make-entity-breeding-times-configurable.patch b/purpur-server/minecraft-patches/unapplied-features/0012-Make-entity-breeding-times-configurable.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0012-Make-entity-breeding-times-configurable.patch rename to purpur-server/minecraft-patches/unapplied-features/0012-Make-entity-breeding-times-configurable.patch diff --git a/purpur-server/minecraft-patches/features/0013-Apply-display-names-from-item-forms-of-entities-to-e.patch b/purpur-server/minecraft-patches/unapplied-features/0013-Apply-display-names-from-item-forms-of-entities-to-e.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0013-Apply-display-names-from-item-forms-of-entities-to-e.patch rename to purpur-server/minecraft-patches/unapplied-features/0013-Apply-display-names-from-item-forms-of-entities-to-e.patch diff --git a/purpur-server/minecraft-patches/features/0014-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch b/purpur-server/minecraft-patches/unapplied-features/0014-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0014-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch rename to purpur-server/minecraft-patches/unapplied-features/0014-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch diff --git a/purpur-server/minecraft-patches/features/0015-Add-mobGriefing-override-to-everything-affected.patch b/purpur-server/minecraft-patches/unapplied-features/0015-Add-mobGriefing-override-to-everything-affected.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0015-Add-mobGriefing-override-to-everything-affected.patch rename to purpur-server/minecraft-patches/unapplied-features/0015-Add-mobGriefing-override-to-everything-affected.patch diff --git a/purpur-server/minecraft-patches/features/0016-Toggle-for-water-sensitive-mob-damage.patch b/purpur-server/minecraft-patches/unapplied-features/0016-Toggle-for-water-sensitive-mob-damage.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0016-Toggle-for-water-sensitive-mob-damage.patch rename to purpur-server/minecraft-patches/unapplied-features/0016-Toggle-for-water-sensitive-mob-damage.patch diff --git a/purpur-server/minecraft-patches/features/0017-API-for-any-mob-to-burn-daylight.patch b/purpur-server/minecraft-patches/unapplied-features/0017-API-for-any-mob-to-burn-daylight.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0017-API-for-any-mob-to-burn-daylight.patch rename to purpur-server/minecraft-patches/unapplied-features/0017-API-for-any-mob-to-burn-daylight.patch diff --git a/purpur-server/minecraft-patches/features/0018-Cows-naturally-aggressive-to-players-chance.patch b/purpur-server/minecraft-patches/unapplied-features/0018-Cows-naturally-aggressive-to-players-chance.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0018-Cows-naturally-aggressive-to-players-chance.patch rename to purpur-server/minecraft-patches/unapplied-features/0018-Cows-naturally-aggressive-to-players-chance.patch diff --git a/purpur-server/minecraft-patches/features/0019-Mobs-always-drop-experience.patch b/purpur-server/minecraft-patches/unapplied-features/0019-Mobs-always-drop-experience.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0019-Mobs-always-drop-experience.patch rename to purpur-server/minecraft-patches/unapplied-features/0019-Mobs-always-drop-experience.patch diff --git a/purpur-server/minecraft-patches/features/0020-Setting-to-reintroduce-end-void-rings.patch b/purpur-server/minecraft-patches/unapplied-features/0020-Setting-to-reintroduce-end-void-rings.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0020-Setting-to-reintroduce-end-void-rings.patch rename to purpur-server/minecraft-patches/unapplied-features/0020-Setting-to-reintroduce-end-void-rings.patch diff --git a/purpur-server/minecraft-patches/features/0021-Per-mob-mob_griefing-loot-pickup-override.patch b/purpur-server/minecraft-patches/unapplied-features/0021-Per-mob-mob_griefing-loot-pickup-override.patch similarity index 100% rename from purpur-server/minecraft-patches/features/0021-Per-mob-mob_griefing-loot-pickup-override.patch rename to purpur-server/minecraft-patches/unapplied-features/0021-Per-mob-mob_griefing-loot-pickup-override.patch diff --git a/purpur-server/paper-patches/files/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java.patch b/purpur-server/paper-patches/files/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java.patch index 5c11cc994..0904ec25d 100644 --- a/purpur-server/paper-patches/files/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -147,6 +_,11 @@ +@@ -149,6 +_,11 @@ private static final Map RENAMES = Util.make(new HashMap<>(), map -> { map.put("AbstractSkeleton$1", "AbstractSkeletonMelee"); diff --git a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch index c184cedb1..0e1cd4db9 100644 --- a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/CraftWorld.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1948,6 +_,52 @@ +@@ -1947,6 +_,52 @@ return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); } diff --git a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch index 8fd4ad85d..90e1f3f57 100644 --- a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -114,6 +_,18 @@ +@@ -115,6 +_,18 @@ this.entityType = CraftEntityType.minecraftToBukkit(entity.getType()); } diff --git a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch index 6578b7677..665626d93 100644 --- a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -582,10 +_,15 @@ +@@ -583,10 +_,15 @@ @Override public void setPlayerListName(String name) { @@ -17,7 +17,7 @@ if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined for (ServerPlayer player : this.server.getHandle().players) { if (player.getBukkitEntity().canSee(this)) { -@@ -986,6 +_,80 @@ +@@ -987,6 +_,80 @@ } } @@ -98,7 +98,7 @@ @Override public void sendBlockDamage(Location loc, float progress, org.bukkit.entity.Entity source) { Preconditions.checkArgument(source != null, "source must not be null"); -@@ -2490,6 +_,28 @@ +@@ -2491,6 +_,28 @@ public float getWalkSpeed() { return this.getHandle().getAbilities().walkingSpeed * 2f; } diff --git a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java.patch b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java.patch index 38e5d110f..b004650c1 100644 --- a/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java.patch +++ b/purpur-server/paper-patches/files/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java.patch @@ -1,6 +1,6 @@ --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -489,7 +_,7 @@ +@@ -492,7 +_,7 @@ @Override public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { diff --git a/purpur-server/paper-patches/features/0001-Rebrand.patch b/purpur-server/paper-patches/unapplied-features/0001-Rebrand.patch similarity index 100% rename from purpur-server/paper-patches/features/0001-Rebrand.patch rename to purpur-server/paper-patches/unapplied-features/0001-Rebrand.patch diff --git a/purpur-server/paper-patches/features/0002-Ridables.patch b/purpur-server/paper-patches/unapplied-features/0002-Ridables.patch similarity index 100% rename from purpur-server/paper-patches/features/0002-Ridables.patch rename to purpur-server/paper-patches/unapplied-features/0002-Ridables.patch diff --git a/purpur-server/paper-patches/features/0003-Barrels-and-enderchests-6-rows.patch b/purpur-server/paper-patches/unapplied-features/0003-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from purpur-server/paper-patches/features/0003-Barrels-and-enderchests-6-rows.patch rename to purpur-server/paper-patches/unapplied-features/0003-Barrels-and-enderchests-6-rows.patch diff --git a/purpur-server/paper-patches/features/0004-API-for-any-mob-to-burn-daylight.patch b/purpur-server/paper-patches/unapplied-features/0004-API-for-any-mob-to-burn-daylight.patch similarity index 100% rename from purpur-server/paper-patches/features/0004-API-for-any-mob-to-burn-daylight.patch rename to purpur-server/paper-patches/unapplied-features/0004-API-for-any-mob-to-burn-daylight.patch diff --git a/purpur-server/paper-patches/features/0005-Setting-to-reintroduce-end-void-rings.patch b/purpur-server/paper-patches/unapplied-features/0005-Setting-to-reintroduce-end-void-rings.patch similarity index 100% rename from purpur-server/paper-patches/features/0005-Setting-to-reintroduce-end-void-rings.patch rename to purpur-server/paper-patches/unapplied-features/0005-Setting-to-reintroduce-end-void-rings.patch