diff --git a/purpur-server/minecraft-patches/unapplied-sources/io/papermc/paper/entity/activation/ActivationRange.java.patch b/purpur-server/minecraft-patches/rejected/io/papermc/paper/entity/activation/ActivationRange.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/io/papermc/paper/entity/activation/ActivationRange.java.patch rename to purpur-server/minecraft-patches/rejected/io/papermc/paper/entity/activation/ActivationRange.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/CommandSourceStack.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/commands/CommandSourceStack.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/CommandSourceStack.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/commands/CommandSourceStack.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/Commands.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/commands/Commands.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/Commands.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/commands/Commands.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/arguments/selector/EntitySelector.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/commands/arguments/selector/EntitySelector.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/commands/arguments/selector/EntitySelector.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/commands/arguments/selector/EntitySelector.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/BlockPos.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/core/BlockPos.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/BlockPos.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/core/BlockPos.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/gametest/framework/TestCommand.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/gametest/framework/TestCommand.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/gametest/framework/TestCommand.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/gametest/framework/TestCommand.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/Main.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/Main.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/Main.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/Main.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/MinecraftServer.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/MinecraftServer.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/MinecraftServer.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/MinecraftServer.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/PlayerAdvancements.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/PlayerAdvancements.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/PlayerAdvancements.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/PlayerAdvancements.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/EnchantCommand.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/EnchantCommand.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/EnchantCommand.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/EnchantCommand.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/GameModeCommand.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/GameModeCommand.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/GameModeCommand.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/GameModeCommand.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/GiveCommand.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/GiveCommand.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/commands/GiveCommand.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/commands/GiveCommand.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/gui/MinecraftServerGui.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/gui/MinecraftServerGui.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/gui/MinecraftServerGui.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/gui/MinecraftServerGui.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerLevel.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerLevel.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerLevel.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerLevel.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerPlayer.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerPlayer.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerPlayer.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerPlayer.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerPlayerGameMode.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerPlayerGameMode.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/level/ServerPlayerGameMode.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/level/ServerPlayerGameMode.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerCommonPacketListenerImpl.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/network/ServerLoginPacketListenerImpl.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/players/PlayerList.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/players/PlayerList.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/players/PlayerList.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/players/PlayerList.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/players/SleepStatus.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/server/players/SleepStatus.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/players/SleepStatus.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/server/players/SleepStatus.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/stats/ServerRecipeBook.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/stats/ServerRecipeBook.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/stats/ServerRecipeBook.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/stats/ServerRecipeBook.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/CombatRules.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/CombatRules.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/CombatRules.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/CombatRules.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/CombatTracker.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/CombatTracker.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/CombatTracker.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/CombatTracker.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/DamageSource.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/DamageSource.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/DamageSource.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/damagesource/DamageSource.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/HungerMobEffect.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/HungerMobEffect.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/HungerMobEffect.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/HungerMobEffect.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/PoisonMobEffect.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/PoisonMobEffect.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/PoisonMobEffect.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/PoisonMobEffect.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/RegenerationMobEffect.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/RegenerationMobEffect.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/RegenerationMobEffect.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/RegenerationMobEffect.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/WitherMobEffect.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/WitherMobEffect.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/WitherMobEffect.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/effect/WitherMobEffect.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/Entity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/Entity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Entity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/EntityType.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/EntityType.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/EntityType.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ExperienceOrb.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ExperienceOrb.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ExperienceOrb.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ExperienceOrb.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/LivingEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/LivingEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/LivingEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/Mob.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Mob.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/Mob.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/Mob.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/attributes/RangedAttribute.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/attributes/RangedAttribute.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/attributes/RangedAttribute.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/attributes/RangedAttribute.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/SwellGoal.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/goal/SwellGoal.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/SwellGoal.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/goal/SwellGoal.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/Animal.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/Animal.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/Animal.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/Animal.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/cow/AbstractCow.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/dolphin/Dolphin.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/equine/Llama.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/equine/Llama.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/equine/Llama.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/equine/Llama.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/feline/Cat.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/feline/Cat.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/feline/Cat.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/feline/Cat.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/feline/Ocelot.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/feline/Ocelot.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/feline/Ocelot.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/fish/WaterAnimal.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/fish/WaterAnimal.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/fish/WaterAnimal.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/fish/WaterAnimal.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/CopperGolemAi.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/golem/CopperGolemAi.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/CopperGolemAi.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/golem/CopperGolemAi.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/golem/IronGolem.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/IronGolem.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/golem/IronGolem.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/parrot/Parrot.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/parrot/Parrot.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/parrot/Parrot.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/parrot/Parrot.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/pig/Pig.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/pig/Pig.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/pig/Pig.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/pig/Pig.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/polarbear/PolarBear.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/animal/rabbit/Rabbit.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/boss/wither/WitherBoss.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/item/ItemEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/item/ItemEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/item/ItemEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/item/ItemEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Creeper.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Creeper.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Creeper.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Creeper.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Ghast.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Ghast.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Ghast.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Ghast.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Monster.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Monster.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Phantom.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Phantom.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Phantom.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Phantom.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Ravager.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Ravager.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Ravager.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Ravager.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Shulker.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Shulker.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Shulker.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Strider.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Strider.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Strider.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/Strider.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/illager/Vindicator.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/illager/Vindicator.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/illager/Vindicator.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/illager/Vindicator.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/piglin/PiglinAi.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/zombie/Drowned.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/Drowned.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/zombie/Drowned.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/monster/zombie/ZombieVillager.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/CatSpawner.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/CatSpawner.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/CatSpawner.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/CatSpawner.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/villager/Villager.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/villager/Villager.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/villager/Villager.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/villager/Villager.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/player/Player.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/player/Player.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/player/Player.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/arrow/ThrownTrident.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/projectile/throwableitemprojectile/Snowball.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/raid/Raids.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/raid/Raids.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/raid/Raids.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/raid/Raids.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/boat/AbstractBoat.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/minecart/NewMinecartBehavior.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/minecart/OldMinecartBehavior.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/minecart/OldMinecartBehavior.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/vehicle/minecart/OldMinecartBehavior.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/entity/vehicle/minecart/OldMinecartBehavior.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/food/FoodData.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/food/FoodData.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/food/FoodData.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/food/FoodData.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/AbstractFurnaceMenu.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AnvilMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/AnvilMenu.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AnvilMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/AnvilMenu.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/ArmorSlot.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/ArmorSlot.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/ArmorSlot.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/ArmorSlot.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/EnchantmentMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/EnchantmentMenu.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/EnchantmentMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/EnchantmentMenu.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/GrindstoneMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/GrindstoneMenu.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/GrindstoneMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/GrindstoneMenu.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/ItemCombinerMenu.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/ItemCombinerMenu.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/ItemCombinerMenu.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/inventory/ItemCombinerMenu.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/FarmBlock.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/FarmBlock.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/FarmBlock.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/FarmBlock.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/BlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/BlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/ConduitBlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/piston/PistonStructureResolver.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/piston/PistonStructureResolver.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/piston/PistonStructureResolver.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/block/piston/PistonStructureResolver.java.patch diff --git a/purpur-server/minecraft-patches/unapplied-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 100% rename from purpur-server/minecraft-patches/unapplied-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 diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch b/purpur-server/minecraft-patches/rejected/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch similarity index 100% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch rename to purpur-server/minecraft-patches/rejected/net/minecraft/world/level/levelgen/PhantomSpawner.java.patch diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch new file mode 100644 index 000000000..935faf03f --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/CrashReport.java.patch @@ -0,0 +1,28 @@ +--- a/net/minecraft/CrashReport.java ++++ b/net/minecraft/CrashReport.java +@@ -30,6 +_,7 @@ + private boolean trackingStackTrace = true; + private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0]; + private final SystemReport systemReport = new SystemReport(); ++ private List extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!", ""); // Purpur - Rebrand + + public CrashReport(final String title, final Throwable t) { + this.title = title; +@@ -129,7 +_,7 @@ + } + + public String getFriendlyReport(final ReportType reportType) { +- return this.getFriendlyReport(reportType, List.of()); ++ return this.getFriendlyReport(reportType, extraInfo); // Purpur - Rebrand + } + + public @Nullable Path getSaveFile() { +@@ -159,7 +_,7 @@ + } + + public boolean saveToFile(final Path file, final ReportType reportType) { +- return this.saveToFile(file, reportType, List.of()); ++ return this.saveToFile(file, reportType, extraInfo); // Purpur - Rebrand + } + + public SystemReport getSystemReport() { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch similarity index 77% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch index 879aa1ae0..8ad4bfc72 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/core/dispenser/DispenseItemBehavior.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/core/dispenser/DispenseItemBehavior.java b/net/minecraft/core/dispenser/DispenseItemBehavior.java -index bfefb5031544caa59230f0073e8880c2b39ebf4d..ff32a89a720676c5a9f34ea7c859f03d47545b72 100644 --- a/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -750,5 +750,22 @@ public interface DispenseItemBehavior { +@@ -690,5 +_,22 @@ 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/gametest/framework/GameTestHelper.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch new file mode 100644 index 000000000..f1295b105 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/gametest/framework/GameTestHelper.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/gametest/framework/GameTestHelper.java ++++ b/net/minecraft/gametest/framework/GameTestHelper.java +@@ -349,6 +_,8 @@ + return gameType; + } + ++ public void setAfk(final boolean afk) {} // Purpur - AFK API ++ + @Override + public boolean isClientAuthoritative() { + return false; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/network/Connection.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch similarity index 71% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/network/Connection.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch index 7fcde9eb1..058fc3f22 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/network/Connection.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java -index 19ec939529eb638bdc4d7fd9260f161fae118314..21e891ecdb90a1828428441aef9c2593253751f8 100644 --- a/net/minecraft/network/Connection.java +++ b/net/minecraft/network/Connection.java -@@ -554,11 +554,20 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -460,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/unapplied-sources/net/minecraft/network/chat/SignedMessageChain.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch similarity index 58% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/network/chat/SignedMessageChain.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch index aa80e4a20..924aea872 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/network/chat/SignedMessageChain.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/network/chat/SignedMessageChain.java.patch @@ -1,16 +1,8 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/network/chat/SignedMessageChain.java b/net/minecraft/network/chat/SignedMessageChain.java -index 67b2f87f8424c5642010b3d9852b55c40d4947e1..37549fba0ad31db502354c7b101a56d8f2e4c473 100644 --- a/net/minecraft/network/chat/SignedMessageChain.java +++ b/net/minecraft/network/chat/SignedMessageChain.java -@@ -44,7 +44,7 @@ public class SignedMessageChain { - SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink; - if (signedMessageLink == null) { +@@ -49,7 +_,7 @@ + SignedMessageLink link = SignedMessageChain.this.nextLink; + if (link == null) { throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.CHAIN_BROKEN); - } else if (body.timeStamp().isBefore(SignedMessageChain.this.lastTimeStamp)) { + } else if (org.purpurmc.purpur.PurpurConfig.kickForOutOfOrderChat && body.timeStamp().isBefore(SignedMessageChain.this.lastTimeStamp)) { // Purpur - Option to disable kick for out of order chat diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch similarity index 78% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServer.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch index 022c55151..07a41db2b 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -1,22 +1,14 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java -index eb06d8f012684845146429832e977e6c1ddcd62b..6a0ccd6eb3e355348c68db3de980f4eddea1aaea 100644 --- a/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java -@@ -195,6 +195,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -216,6 +_,7 @@ public void run() { if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit // Paper start - Use TerminalConsoleAppender + if (DedicatedServer.this.gui == null || System.console() != null) // Purpur - GUI Improvements - has no GUI or has console (did not double-click) new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start(); /* - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); -@@ -273,6 +274,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface + BufferedReader reader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8)); +@@ -294,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 @@ -32,7 +24,7 @@ index eb06d8f012684845146429832e977e6c1ddcd62b..6a0ccd6eb3e355348c68db3de980f4ed com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now // this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading -@@ -315,6 +325,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -336,6 +_,30 @@ if (true) throw new IllegalStateException("Failed to bind to port", var11); // Paper - Propagate failed to bind to port error return false; } @@ -63,13 +55,13 @@ index eb06d8f012684845146429832e977e6c1ddcd62b..6a0ccd6eb3e355348c68db3de980f4ed // CraftBukkit start this.server.loadPlugins(); -@@ -390,6 +424,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface +@@ -410,6 +_,9 @@ + MinecraftServerStatistics.registerJmxMonitoring(this); LOGGER.info("JMX monitoring enabled"); } - ++ + org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur - Implement TPSBar + if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients -+ + this.notificationManager().serverStarted(); return true; - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch similarity index 61% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch index 0623a6a86..1a7ed8c07 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/dedicated/DedicatedServerProperties.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java -index bbd8f68d166ebd0370f4b39362468fdc7d70f7f0..2a3b10c5e031ef44a2b53bc4fdc6e86c917f75d4 100644 --- a/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java -@@ -57,6 +57,7 @@ public class DedicatedServerProperties extends Settings -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/server/level/WorldGenRegion.java b/net/minecraft/server/level/WorldGenRegion.java -index bf5e460b89d7c0fcdcb8826ba693bd23761df430..04f06861cc84c00a71a165ecf59920b5b5900c69 100644 --- a/net/minecraft/server/level/WorldGenRegion.java +++ b/net/minecraft/server/level/WorldGenRegion.java -@@ -311,6 +311,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -262,6 +_,7 @@ return true; } else { // Paper start - Buffer OOB setBlock calls diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch similarity index 59% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch index 761850383..3fc9d014a 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -index 465559113071a47e706f77a5b0996597ee986b3d..1b966dc52b067cd9d1fa9f500b692e3f75f1cc90 100644 --- a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java -@@ -37,6 +37,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene +@@ -37,6 +_,7 @@ } else { this.hasRequestedStatus = true; // this.connection.send(new ClientboundStatusResponsePacket(this.status)); // Paper diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/util/StringUtil.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/util/StringUtil.java.patch similarity index 52% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/util/StringUtil.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/util/StringUtil.java.patch index c54d139c2..b8d231182 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/util/StringUtil.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/util/StringUtil.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/util/StringUtil.java b/net/minecraft/util/StringUtil.java -index bd57f9a4224fc236cccecfd13b03f27d20ed15e9..da0018214439511288a43ca665abec6f01441f47 100644 --- a/net/minecraft/util/StringUtil.java +++ b/net/minecraft/util/StringUtil.java -@@ -87,6 +87,7 @@ public class StringUtil { +@@ -87,6 +_,7 @@ // Paper start - Username validation public static boolean isReasonablePlayerName(final String name) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/DamageSources.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/damagesource/DamageSources.java.patch similarity index 58% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/DamageSources.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/damagesource/DamageSources.java.patch index 2fa141b87..3f392fa5f 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/damagesource/DamageSources.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/damagesource/DamageSources.java.patch @@ -1,23 +1,15 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/damagesource/DamageSources.java b/net/minecraft/world/damagesource/DamageSources.java -index e45891d10dfab44d3aa584cc7db3fbc3c7654af5..1e1b773d88917b251d71aad40b85fbc5fffce8c8 100644 --- a/net/minecraft/world/damagesource/DamageSources.java +++ b/net/minecraft/world/damagesource/DamageSources.java -@@ -42,6 +42,8 @@ public class DamageSources { +@@ -42,6 +_,8 @@ private final DamageSource stalagmite; private final DamageSource outsideBorder; private final DamageSource genericKill; + private final DamageSource scissors; // Purpur - Dont run with scissors! + private final DamageSource stonecutter; // Purpur - Stonecutter damage - public DamageSources(RegistryAccess registry) { - this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE); -@@ -70,6 +72,8 @@ public class DamageSources { + public DamageSources(final RegistryAccess registries) { + this.damageTypes = registries.lookupOrThrow(Registries.DAMAGE_TYPE); +@@ -70,6 +_,8 @@ this.stalagmite = this.source(DamageTypes.STALAGMITE); this.outsideBorder = this.source(DamageTypes.OUTSIDE_BORDER); this.genericKill = this.source(DamageTypes.GENERIC_KILL); @@ -25,11 +17,12 @@ index e45891d10dfab44d3aa584cc7db3fbc3c7654af5..1e1b773d88917b251d71aad40b85fbc5 + this.stonecutter = this.source(DamageTypes.MAGIC).stonecutter(); // Purpur - Stonecutter damage } - private DamageSource source(ResourceKey damageTypeKey) { -@@ -84,6 +88,18 @@ public class DamageSources { - return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity); + private DamageSource source(final ResourceKey key) { +@@ -83,6 +_,18 @@ + private DamageSource source(final ResourceKey key, final @Nullable Entity directEntity, final @Nullable Entity causingEntity) { + return new DamageSource(this.damageTypes.getOrThrow(key), directEntity, causingEntity); } - ++ + // Purpur start - Dont run with scissor + public DamageSource scissors() { + return this.scissors; @@ -41,7 +34,6 @@ index e45891d10dfab44d3aa584cc7db3fbc3c7654af5..1e1b773d88917b251d71aad40b85fbc5 + return this.stonecutter; + } + // Purpur end - Stonecutter damage -+ + public DamageSource inFire() { return this.inFire; - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/SaturationMobEffect.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/effect/SaturationMobEffect.java.patch similarity index 63% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/SaturationMobEffect.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/effect/SaturationMobEffect.java.patch index 66cd7e20c..149d84488 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/effect/SaturationMobEffect.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/effect/SaturationMobEffect.java.patch @@ -1,16 +1,8 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/effect/SaturationMobEffect.java b/net/minecraft/world/effect/SaturationMobEffect.java -index c192165910f6b139df6f604d0bce989061efa9cb..622c23f4570d07de8bee9623bf900aabb3331ded 100644 --- a/net/minecraft/world/effect/SaturationMobEffect.java +++ b/net/minecraft/world/effect/SaturationMobEffect.java -@@ -16,7 +16,8 @@ class SaturationMobEffect extends InstantenousMobEffect { +@@ -16,7 +_,8 @@ int oldFoodLevel = player.getFoodData().foodLevel; - org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplifier + 1 + oldFoodLevel); + org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplification + 1 + oldFoodLevel); if (!event.isCancelled()) { - player.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 1.0F); + if (player.level().purpurConfig.playerBurpWhenFull && event.getFoodLevel() == 20 && oldFoodLevel < 20) player.burpDelay = player.level().purpurConfig.playerBurpDelay; // Purpur - Burp delay 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 new file mode 100644 index 000000000..9c77f8af6 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/Entity.java ++++ b/net/minecraft/world/entity/Entity.java +@@ -380,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}; + 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/unapplied-sources/net/minecraft/world/entity/EntitySelector.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntitySelector.java.patch similarity index 62% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/EntitySelector.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntitySelector.java.patch index a1dd6d606..ff1e039a1 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/EntitySelector.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntitySelector.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/EntitySelector.java b/net/minecraft/world/entity/EntitySelector.java -index b9ca072041f5fec0010017877a2821cd650023c5..cd8e22171449049b23823da9b5be6ede2c3f38d0 100644 --- a/net/minecraft/world/entity/EntitySelector.java +++ b/net/minecraft/world/entity/EntitySelector.java -@@ -28,6 +28,8 @@ public final class EntitySelector { +@@ -28,6 +_,8 @@ return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks; }; // Paper end - Ability to control player's insomnia and phantoms 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 new file mode 100644 index 000000000..c2a2888d4 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/EntityType.java ++++ b/net/minecraft/world/entity/EntityType.java +@@ -1221,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/LivingEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch new file mode 100644 index 000000000..c7632f6ce --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/LivingEntity.java ++++ b/net/minecraft/world/entity/LivingEntity.java +@@ -3852,7 +_,7 @@ + } + } + +- 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/ai/goal/LlamaFollowCaravanGoal.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java.patch new file mode 100644 index 000000000..ce04e2591 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java.patch @@ -0,0 +1,18 @@ +--- a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java ++++ b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java +@@ -22,6 +_,7 @@ + + @Override + public boolean canUse() { ++ if (!this.llama.level().purpurConfig.llamaJoinCaravans || !this.llama.shouldJoinCaravan) return false; // Purpur - Llama API // Purpur - Config to disable Llama caravans + if (!this.llama.isLeashed() && !this.llama.inCaravan()) { + List llamas = this.llama + .level() +@@ -70,6 +_,7 @@ + + @Override + public boolean canContinueToUse() { ++ if (!this.llama.shouldJoinCaravan) return false; // Purpur - Llama API + if (this.llama.inCaravan() && this.llama.getCaravanHead().isAlive() && this.firstIsLeashed(this.llama, 0)) { + double distSqr = this.llama.distanceToSqr(this.llama.getCaravanHead()); + if (distSqr > 676.0) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch similarity index 53% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch index 6d3c664e7..f623c03a9 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java -index 722f378bb3726200b6fe88948bf1e1d3514a7b5c..e337e22c2cf82b0c1cab3fe0a9ff894c0c718716 100644 --- a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java +++ b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java -@@ -116,9 +116,9 @@ public class RangedBowAttackGoal extends Go +@@ -116,9 +_,9 @@ } this.mob.lookAt(target, 30.0F, 30.0F); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch similarity index 67% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch index e72783e8c..1a81c2233 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java.patch @@ -1,15 +1,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java -index 5360b2137116ff76361dab29a4ef2a0bc0228a02..f67e762a50b85a95a3d466aff7572b48d0338e72 100644 --- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java +++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java -@@ -59,7 +59,7 @@ public class RunAroundLikeCrazyGoal extends Goal { - if (firstPassenger instanceof Player player) { +@@ -59,7 +_,7 @@ + if (passenger instanceof Player player) { int temper = this.horse.getTemper(); int maxTemper = this.horse.getMaxTemper(); - if (maxTemper > 0 && this.horse.getRandom().nextInt(maxTemper) < temper && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this.horse, ((org.bukkit.craftbukkit.entity.CraftHumanEntity) this.horse.getBukkitEntity().getPassenger()).getHandle()).isCancelled()) { // CraftBukkit - fire EntityTameEvent diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch similarity index 56% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch index d0639c750..fa9a7b5ba 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/ai/targeting/TargetingConditions.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java -index e4beea8dcf9db2211ae838470daf060074dd8ec2..8307ed8d1c86ed0243c038420d2c44b02df21fe3 100644 --- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java +++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java -@@ -63,6 +63,10 @@ public class TargetingConditions { +@@ -63,6 +_,10 @@ return false; } else if (this.selector != null && !this.selector.test(target, level)) { return false; @@ -17,5 +9,5 @@ index e4beea8dcf9db2211ae838470daf060074dd8ec2..8307ed8d1c86ed0243c038420d2c44b0 + return false; + // Purpur end - AFK API } else { - if (entity == null) { + if (targeter == null) { if (this.isCombat && (!target.canBeSeenAsEnemy() || level.getDifficulty() == Difficulty.PEACEFUL)) { diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 65% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/cow/MushroomCow.java.patch index 3bc90a834..df8a3b1fc 100644 --- a/purpur-server/minecraft-patches/unapplied-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,15 +1,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/cow/MushroomCow.java b/net/minecraft/world/entity/animal/cow/MushroomCow.java -index b4b59e3973f7a3fe8b94ff337e87cbe735b2285c..ea6299e728d7c7e7a52d7c65d759407ba27c8eac 100644 --- a/net/minecraft/world/entity/animal/cow/MushroomCow.java +++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java -@@ -199,6 +199,13 @@ public class MushroomCow extends AbstractCow implements Shearable { - level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, source, 1.0F, 1.0F); +@@ -199,6 +_,13 @@ + level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, soundSource, 1.0F, 1.0F); this.convertTo(EntityType.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 diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 73% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/fox/Fox.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/fox/Fox.java.patch index a7917f225..4e81f1d86 100644 --- a/purpur-server/minecraft-patches/unapplied-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,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/fox/Fox.java b/net/minecraft/world/entity/animal/fox/Fox.java -index 6fb314b49b7a482d4092d5a63c06abab69845c85..6d0eb7e0310b3fdd234dee5b8bf993d1c5ef27f1 100644 --- a/net/minecraft/world/entity/animal/fox/Fox.java +++ b/net/minecraft/world/entity/animal/fox/Fox.java -@@ -357,6 +357,11 @@ public class Fox extends Animal { +@@ -364,6 +_,11 @@ } private void setTargetGoals() { @@ -20,18 +12,19 @@ index 6fb314b49b7a482d4092d5a63c06abab69845c85..6d0eb7e0310b3fdd234dee5b8bf993d1 if (this.getVariant() == Fox.Variant.RED) { this.targetSelector.addGoal(4, this.landTargetGoal); this.targetSelector.addGoal(4, this.turtleEggTargetGoal); -@@ -384,6 +389,7 @@ public class Fox extends Animal { +@@ -391,6 +_,7 @@ - public void setVariant(Fox.Variant variant) { + public void setVariant(final Fox.Variant variant) { this.entityData.set(DATA_TYPE_ID, variant.getId()); + this.setTargetGoals(); // Purpur - Tulips change fox type - fix API bug not updating pathfinders on type change } @Override -@@ -710,6 +716,29 @@ public class Fox extends Animal { +@@ -716,6 +_,29 @@ + return slot == EquipmentSlot.MAINHAND; } // Paper end - ++ + // Purpur start - Tulips change fox type + @Override + public net.minecraft.world.InteractionResult mobInteract(Player player, net.minecraft.world.InteractionHand hand) { @@ -54,7 +47,6 @@ index 6fb314b49b7a482d4092d5a63c06abab69845c85..6d0eb7e0310b3fdd234dee5b8bf993d1 + return super.mobInteract(player, hand); + } + // Purpur end - Tulips change fox type -+ + @Override // Paper start - Cancellable death event - protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(ServerLevel level, DamageSource damageSource) { 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 new file mode 100644 index 000000000..e89bce186 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/goat/Goat.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/entity/animal/goat/Goat.java ++++ b/net/minecraft/world/entity/animal/goat/Goat.java +@@ -363,6 +_,7 @@ + + // Paper start - Goat ram API + public void ram(net.minecraft.world.entity.LivingEntity entity) { ++ if(!new org.purpurmc.purpur.event.entity.GoatRamEntityEvent((org.bukkit.entity.Goat) getBukkitEntity(), entity.getBukkitLivingEntity()).callEvent()) return; // Purpur - Added goat ram event + Brain brain = this.getBrain(); + brain.setMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.RAM_TARGET, entity.position()); + brain.eraseMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.RAM_COOLDOWN_TICKS); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch similarity index 67% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch index 7a5a5141a..98e869787 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/CopperGolem.java.patch @@ -1,22 +1,14 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/golem/CopperGolem.java b/net/minecraft/world/entity/animal/golem/CopperGolem.java -index f9a6aba1037e41836b69cd5e66195cdc0b1f7725..28cd2deeb5c92f599f7f1b19a2794b98994409c3 100644 --- a/net/minecraft/world/entity/animal/golem/CopperGolem.java +++ b/net/minecraft/world/entity/animal/golem/CopperGolem.java -@@ -83,6 +83,7 @@ public class CopperGolem extends AbstractGolem implements ContainerUser, Shearab +@@ -87,6 +_,7 @@ private final AnimationState interactionDropItemAnimationState = new AnimationState(); private final AnimationState interactionDropNoItemAnimationState = new AnimationState(); public static final EquipmentSlot EQUIPMENT_SLOT_ANTENNA = EquipmentSlot.SADDLE; + @Nullable private UUID summoner; // Purpur - Summoner API - public CopperGolem(EntityType type, Level level) { + public CopperGolem(final EntityType type, final Level level) { super(type, level); -@@ -96,6 +97,17 @@ public class CopperGolem extends AbstractGolem implements ContainerUser, Shearab +@@ -100,6 +_,17 @@ this.getBrain().setMemory(MemoryModuleType.TRANSPORT_ITEMS_COOLDOWN_TICKS, this.getRandom().nextInt(60, 100)); } @@ -34,7 +26,7 @@ index f9a6aba1037e41836b69cd5e66195cdc0b1f7725..28cd2deeb5c92f599f7f1b19a2794b98 public static AttributeSupplier.Builder createAttributes() { return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F).add(Attributes.STEP_HEIGHT, 1.0).add(Attributes.MAX_HEALTH, 12.0); } -@@ -171,6 +183,7 @@ public class CopperGolem extends AbstractGolem implements ContainerUser, Shearab +@@ -170,6 +_,7 @@ super.addAdditionalSaveData(output); output.putLong("next_weather_age", this.nextWeatheringTick); output.store("weather_state", WeatheringCopper.WeatherState.CODEC, this.getWeatherState()); @@ -42,7 +34,7 @@ index f9a6aba1037e41836b69cd5e66195cdc0b1f7725..28cd2deeb5c92f599f7f1b19a2794b98 } @Override -@@ -178,6 +191,7 @@ public class CopperGolem extends AbstractGolem implements ContainerUser, Shearab +@@ -177,6 +_,7 @@ super.readAdditionalSaveData(input); this.nextWeatheringTick = input.getLongOr("next_weather_age", -1L); this.setWeatherState(input.read("weather_state", WeatheringCopper.WeatherState.CODEC).orElse(WeatheringCopper.WeatherState.UNAFFECTED)); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch similarity index 72% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch index 0de7aaf7e..67276234d 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/golem/SnowGolem.java.patch @@ -1,20 +1,12 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/golem/SnowGolem.java b/net/minecraft/world/entity/animal/golem/SnowGolem.java -index f6e8e0c3a9532aaa1034c8a31b32da54d17ef151..620af577fa9fa4b16f6651b427d25af93b0e02c6 100644 --- a/net/minecraft/world/entity/animal/golem/SnowGolem.java +++ b/net/minecraft/world/entity/animal/golem/SnowGolem.java -@@ -46,15 +46,26 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -46,15 +_,26 @@ private static final EntityDataAccessor DATA_PUMPKIN_ID = SynchedEntityData.defineId(SnowGolem.class, EntityDataSerializers.BYTE); private static final byte PUMPKIN_FLAG = 16; private static final boolean DEFAULT_PUMPKIN = true; + private java.util.@Nullable UUID summoner; // Purpur - Summoner API - public SnowGolem(EntityType type, Level level) { + public SnowGolem(final EntityType type, final Level level) { super(type, level); } @@ -36,23 +28,23 @@ index f6e8e0c3a9532aaa1034c8a31b32da54d17ef151..620af577fa9fa4b16f6651b427d25af9 + this.goalSelector.addGoal(2, new WaterAvoidingRandomStrollGoal(this, 1.0D, 1.0000001E-5F)); this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(4, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 10, true, false, (entity, level) -> entity instanceof Enemy)); -@@ -74,12 +85,14 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM - protected void addAdditionalSaveData(ValueOutput output) { + this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 10, true, false, (target, level) -> target instanceof Enemy)); +@@ -74,12 +_,14 @@ + protected void addAdditionalSaveData(final ValueOutput output) { super.addAdditionalSaveData(output); output.putBoolean("Pumpkin", this.hasPumpkin()); + output.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API } @Override - protected void readAdditionalSaveData(ValueInput input) { + protected void readAdditionalSaveData(final ValueInput input) { super.readAdditionalSaveData(input); this.setPumpkin(input.getBooleanOr("Pumpkin", true)); + this.setSummoner(input.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API } @Override -@@ -153,6 +166,14 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -156,6 +_,14 @@ } return InteractionResult.SUCCESS; diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 50% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/animal/squid/GlowSquid.java.patch index 0efd2257e..00859fa4c 100644 --- a/purpur-server/minecraft-patches/unapplied-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,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/squid/GlowSquid.java b/net/minecraft/world/entity/animal/squid/GlowSquid.java -index 1012da8b64b0b7a4f832eab48239b2c65bd20eaf..2b1ece8ff62376a0851c18c39f43882abf2abaca 100644 --- a/net/minecraft/world/entity/animal/squid/GlowSquid.java +++ b/net/minecraft/world/entity/animal/squid/GlowSquid.java -@@ -30,6 +30,13 @@ public class GlowSquid extends Squid { +@@ -30,6 +_,13 @@ super(type, level); } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch similarity index 70% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch index 8c4dcb339..3be285e76 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/decoration/ArmorStand.java.patch @@ -1,28 +1,20 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java -index 79ae039d1908830e81912d230b3540a4920e2017..959037a01841de06767522512b92e96be7c72b56 100644 --- a/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -92,10 +92,13 @@ public class ArmorStand extends LivingEntity { +@@ -92,10 +_,13 @@ public boolean canTickSetByAPI = false; private boolean noTickEquipmentDirty = false; // Paper end - Allow ArmorStands not to tick + public boolean canMovementTick = true; // Purpur - Movement options for armor stands - public ArmorStand(EntityType type, Level level) { + public ArmorStand(final EntityType type, final Level level) { super(type, level); if (level != null) this.canTick = level.paperConfig().entities.armorStands.tick; // Paper - Allow ArmorStands not to tick + if (level != null) this.canMovementTick = level.purpurConfig.armorstandMovement; // Purpur - Movement options for armor stands + this.setShowArms(level != null && level.purpurConfig.armorstandPlaceWithArms); // Purpur - Config to show Armor Stand arms on spawn } - public ArmorStand(Level level, double x, double y, double z) { -@@ -522,6 +525,7 @@ public class ArmorStand extends LivingEntity { + public ArmorStand(final Level level, final double x, final double y, final double z) { +@@ -521,6 +_,7 @@ // Paper start - Allow ArmorStands not to tick @Override public void tick() { @@ -30,7 +22,7 @@ index 79ae039d1908830e81912d230b3540a4920e2017..959037a01841de06767522512b92e96b if (!this.canTick) { if (this.noTickEquipmentDirty) { this.noTickEquipmentDirty = false; -@@ -810,4 +814,18 @@ public class ArmorStand extends LivingEntity { +@@ -807,4 +_,18 @@ } } // Paper end diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/item/PrimedTnt.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch similarity index 78% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/item/PrimedTnt.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch index 0c0cfcf2b..d59d94234 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/item/PrimedTnt.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/item/PrimedTnt.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java -index 910e7739aea98d6dfa603072acf5e9936dbb2c5e..5dccf56d19dd217ec4b18a390779f0da0c428b98 100644 --- a/net/minecraft/world/entity/item/PrimedTnt.java +++ b/net/minecraft/world/entity/item/PrimedTnt.java -@@ -235,4 +235,32 @@ public class PrimedTnt extends Entity implements TraceableEntity { +@@ -237,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/unapplied-sources/net/minecraft/world/entity/monster/EnderMan.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/EnderMan.java.patch similarity index 69% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/EnderMan.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/EnderMan.java.patch index f76a6977a..97d214498 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/EnderMan.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/EnderMan.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java -index 6516cccada06a9a7d3d743929712970fe0a2b8c8..2d903c77017ae356eb309df3c2c43b91c4e52f2f 100644 --- a/net/minecraft/world/entity/monster/EnderMan.java +++ b/net/minecraft/world/entity/monster/EnderMan.java -@@ -101,7 +101,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -101,7 +_,7 @@ this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this)); this.targetSelector.addGoal(1, new EnderMan.EndermanLookForPlayerGoal(this, this::isAngryAt)); this.targetSelector.addGoal(2, new HurtByTargetGoal(this)); @@ -17,32 +9,32 @@ index 6516cccada06a9a7d3d743929712970fe0a2b8c8..2d903c77017ae356eb309df3c2c43b91 this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false)); } -@@ -220,7 +220,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -220,7 +_,7 @@ - boolean isBeingStaredBy(Player player) { + private boolean isBeingStaredBy(final Player player) { // Paper start - EndermanAttackPlayerEvent - final boolean shouldAttack = this.isBeingStaredBy0(player); + final boolean shouldAttack = !this.level().purpurConfig.endermanDisableStareAggro && this.isBeingStaredBy0(player); // Purpur - Config to ignore Dragon Head wearers and stare aggro final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity()); event.setCancelled(!shouldAttack); return event.callEvent(); -@@ -375,6 +375,7 @@ public class EnderMan extends Monster implements NeutralMob { - public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) { - if (this.isInvulnerableTo(level, damageSource)) { +@@ -373,6 +_,7 @@ + public boolean hurtServer(final ServerLevel level, final DamageSource source, final float damage) { + if (this.isInvulnerableTo(level, source)) { return false; + } else if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && damageSource.is(net.minecraft.world.damagesource.DamageTypes.IN_WALL)) { return false; // Purpur - no suffocation damage if short height - Short enderman height } else { - AbstractThrownPotion abstractThrownPotion1 = damageSource.getDirectEntity() instanceof AbstractThrownPotion abstractThrownPotion - ? abstractThrownPotion -@@ -391,6 +392,7 @@ public class EnderMan extends Monster implements NeutralMob { + AbstractThrownPotion thrownPotion = source.getDirectEntity() instanceof AbstractThrownPotion potion ? potion : null; + if (!source.is(DamageTypeTags.IS_PROJECTILE) && thrownPotion == null) { // Paper - EndermanEscapeEvent - diff on change - below logic relies on this path covering non-projectile damage. +@@ -387,6 +_,7 @@ } else { - boolean flag = abstractThrownPotion1 != null && this.hurtWithCleanWater(level, damageSource, abstractThrownPotion1, amount); + boolean hurtWithCleanWater = thrownPotion != null && this.hurtWithCleanWater(level, source, thrownPotion, damage); + if (!flag && level.purpurConfig.endermanIgnoreProjectiles) return super.hurtServer(level, damageSource, amount); // Purpur - Config to disable Enderman teleport on projectile hit if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent for (int i = 0; i < 64; i++) { if (this.teleport()) { -@@ -434,7 +436,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -430,7 +_,7 @@ @Override public boolean requiresCustomPersistence() { @@ -50,8 +42,8 @@ index 6516cccada06a9a7d3d743929712970fe0a2b8c8..2d903c77017ae356eb309df3c2c43b91 + return super.requiresCustomPersistence() || (!this.level().purpurConfig.endermanDespawnEvenWithBlock && this.getCarriedBlock() != null); // Purpur - Add config for allowing Endermen to despawn even while holding a block } - static class EndermanFreezeWhenLookedAt extends Goal { -@@ -477,6 +479,7 @@ public class EnderMan extends Monster implements NeutralMob { + private static class EndermanFreezeWhenLookedAt extends Goal { +@@ -473,6 +_,7 @@ @Override public boolean canUse() { @@ -59,7 +51,7 @@ index 6516cccada06a9a7d3d743929712970fe0a2b8c8..2d903c77017ae356eb309df3c2c43b91 return this.enderman.getCarriedBlock() != null && getServerLevel(this.enderman).getGameRules().get(GameRules.MOB_GRIEFING) && this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0; -@@ -625,6 +628,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -616,6 +_,7 @@ @Override public boolean canUse() { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Endermite.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Endermite.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Endermite.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Endermite.java.patch index 567f518e6..0c16ec2b7 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Endermite.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Endermite.java.patch @@ -1,20 +1,12 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/Endermite.java b/net/minecraft/world/entity/monster/Endermite.java -index 99e262040639ca9fe9caffb71a54319eabcdc0c7..815649e51cc2748f8672441ce709e08365294787 100644 --- a/net/minecraft/world/entity/monster/Endermite.java +++ b/net/minecraft/world/entity/monster/Endermite.java -@@ -30,12 +30,23 @@ public class Endermite extends Monster { +@@ -30,12 +_,23 @@ private static final int MAX_LIFE = 2400; private static final int DEFAULT_LIFE = 0; public int life = 0; + private boolean isPlayerSpawned; // Purpur - Add back player spawned endermite API - public Endermite(EntityType type, Level level) { + public Endermite(final EntityType type, final Level level) { super(type, level); this.xpReward = 3; } @@ -32,15 +24,15 @@ index 99e262040639ca9fe9caffb71a54319eabcdc0c7..815649e51cc2748f8672441ce709e083 @Override protected void registerGoals() { this.goalSelector.addGoal(1, new FloatGoal(this)); -@@ -81,12 +92,14 @@ public class Endermite extends Monster { - protected void readAdditionalSaveData(ValueInput input) { +@@ -81,12 +_,14 @@ + protected void readAdditionalSaveData(final ValueInput input) { super.readAdditionalSaveData(input); this.life = input.getIntOr("Lifetime", 0); + this.isPlayerSpawned = input.getBooleanOr("PlayerSpawned", false); // Purpur - Add back player spawned endermite API } @Override - protected void addAdditionalSaveData(ValueOutput output) { + protected void addAdditionalSaveData(final ValueOutput output) { super.addAdditionalSaveData(output); output.putInt("Lifetime", this.life); + output.putBoolean("PlayerSpawned", this.isPlayerSpawned); // Purpur - Add back player spawned endermite API 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 new file mode 100644 index 000000000..68f4646c6 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Guardian.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/entity/monster/Guardian.java ++++ b/net/minecraft/world/entity/monster/Guardian.java +@@ -308,6 +_,11 @@ + final BlockPos pos, + final RandomSource random + ) { ++ // Purpur start - Config to disable hostile mob spawn on ice ++ if (canSpawnInBlueAndPackedIce(level, pos)) { ++ return false; ++ } ++ // Purpur end - Config to disable hostile mob spawn on ice + return (random.nextInt(20) == 0 || !level.canSeeSkyFromBelowWater(pos)) + && level.getDifficulty() != Difficulty.PEACEFUL + && (EntitySpawnReason.isSpawner(spawnReason) || level.getFluidState(pos).is(FluidTags.WATER)) diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch new file mode 100644 index 000000000..bca3b3deb --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/MagmaCube.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/entity/monster/MagmaCube.java ++++ b/net/minecraft/world/entity/monster/MagmaCube.java +@@ -31,6 +_,11 @@ + public static boolean checkMagmaCubeSpawnRules( + final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random + ) { ++ // Purpur start - Config to disable hostile mob spawn on ice ++ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { ++ return false; ++ } ++ // Purpur end - Config to disable hostile mob spawn on ice + return level.getDifficulty() != Difficulty.PEACEFUL; + } + 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 new file mode 100644 index 000000000..bf0da031b --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Shulker.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/monster/Shulker.java ++++ b/net/minecraft/world/entity/monster/Shulker.java +@@ -81,7 +_,7 @@ + Vec3i forwardNormal = Direction.SOUTH.getUnitVec3i(); + return new Vector3f(forwardNormal.getX(), forwardNormal.getY(), forwardNormal.getZ()); + }); +- 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/Slime.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Slime.java.patch new file mode 100644 index 000000000..e24a27b21 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/Slime.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/entity/monster/Slime.java ++++ b/net/minecraft/world/entity/monster/Slime.java +@@ -299,6 +_,11 @@ + public static boolean checkSlimeSpawnRules( + final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random + ) { ++ // Purpur start - Config to disable hostile mob spawn on ice ++ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { ++ return false; ++ } ++ // Purpur end - Config to disable hostile mob spawn on ice + if (level.getDifficulty() != Difficulty.PEACEFUL) { + if (EntitySpawnReason.isSpawner(spawnReason)) { + return checkMobSpawnRules(type, level, spawnReason, pos, random); 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 new file mode 100644 index 000000000..9556d11f0 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -173,6 +_,11 @@ + public static boolean checkHoglinSpawnRules( + final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random + ) { ++ // Purpur start - Config to disable hostile mob spawn on ice ++ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { ++ return false; ++ } ++ // Purpur end - Config to disable hostile mob spawn on ice + return !level.getBlockState(pos.below()).is(Blocks.NETHER_WART_BLOCK); + } + 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 new file mode 100644 index 000000000..5a45b44ec --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/entity/monster/piglin/Piglin.java ++++ b/net/minecraft/world/entity/monster/piglin/Piglin.java +@@ -181,6 +_,11 @@ + public static boolean checkPiglinSpawnRules( + final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random + ) { ++ // Purpur start - Config to disable hostile mob spawn on ice ++ if (canSpawnInBlueAndPackedIce(level, pos)) { ++ return false; ++ } ++ // Purpur end - Config to disable hostile mob spawn on ice + return !level.getBlockState(pos.below()).is(Blocks.NETHER_WART_BLOCK); + } + diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 86% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/skeleton/Skeleton.java.patch index e7f30825c..5982e0484 100644 --- a/purpur-server/minecraft-patches/unapplied-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,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/skeleton/Skeleton.java b/net/minecraft/world/entity/monster/skeleton/Skeleton.java -index 94a01d35457053bb4265acb5542ae2f83671d9bb..d995572427844540a98d76b2926eb15a018230fa 100644 --- a/net/minecraft/world/entity/monster/skeleton/Skeleton.java +++ b/net/minecraft/world/entity/monster/skeleton/Skeleton.java -@@ -130,4 +130,64 @@ public class Skeleton extends AbstractSkeleton { +@@ -130,4 +_,64 @@ SoundEvent getStepSound() { return SoundEvents.SKELETON_STEP; } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch similarity index 53% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch index 3dc7f74a9..f76e9bcf4 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/warden/WardenAi.java.patch @@ -1,24 +1,16 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/warden/WardenAi.java b/net/minecraft/world/entity/monster/warden/WardenAi.java -index b1bca206a880f763c5e9234a20943e9918889b44..5fc0c82231f3407199f1bf0db8ac278e4b29d1e2 100644 --- a/net/minecraft/world/entity/monster/warden/WardenAi.java +++ b/net/minecraft/world/entity/monster/warden/WardenAi.java -@@ -175,15 +175,16 @@ public class WardenAi { - brain.addActivityAndRemoveMemoryWhenStopped( +@@ -139,15 +_,16 @@ + return ActivityData.create( Activity.FIGHT, 10, - ImmutableList.of( + ImmutableList.copyOf(java.util.stream.Stream.>of( // Purpur - configurable warden sonic boom DIG_COOLDOWN_SETTER, StopAttackingIfTargetInvalid.create( - (level, entity) -> !warden.getAngerLevel().isAngry() || !warden.canTargetEntity(entity), WardenAi::onTargetInvalid, false + (level, target) -> !body.getAngerLevel().isAngry() || !body.canTargetEntity(target), WardenAi::onTargetInvalid, false ), - SetEntityLookTarget.create(entity -> isTarget(warden, entity), (float)warden.getAttributeValue(Attributes.FOLLOW_RANGE)), + SetEntityLookTarget.create(entity -> isTarget(body, entity), (float)body.getAttributeValue(Attributes.FOLLOW_RANGE)), SetWalkTargetFromAttackTargetIfTargetOutOfReach.create(1.2F), - new SonicBoom(), + warden.level().purpurConfig.wardenCanUseSonicBoom ? new SonicBoom() : null, // Purpur - configurable warden sonic boom diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 81% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/Zombie.java.patch index 2b2b8a735..1f92d692c 100644 --- a/purpur-server/minecraft-patches/unapplied-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,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java -index d1b91335b1e979a2e64e6f0ec95dbe32023a25b7..34891f05809550256c07683c2d0c28d55c342758 100644 --- a/net/minecraft/world/entity/monster/zombie/Zombie.java +++ b/net/minecraft/world/entity/monster/zombie/Zombie.java -@@ -118,7 +118,19 @@ public class Zombie extends Monster { +@@ -127,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)); @@ -29,7 +21,7 @@ index d1b91335b1e979a2e64e6f0ec95dbe32023a25b7..34891f05809550256c07683c2d0c28d5 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)); } -@@ -524,7 +536,7 @@ public class Zombie extends Monster { +@@ -542,7 +_,7 @@ } } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch similarity index 66% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch index 6d0850a4f..1a46b5d44 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java -index 8fcb6cd1cefa6c9e1809944b4720cfdc35325729..ef6a4aff03c1a85535b15e653714751e79f61090 100644 --- a/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java +++ b/net/minecraft/world/entity/monster/zombie/ZombifiedPiglin.java -@@ -109,6 +109,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -113,6 +_,12 @@ this.maybeAlertOthers(); } @@ -21,7 +13,7 @@ index 8fcb6cd1cefa6c9e1809944b4720cfdc35325729..ef6a4aff03c1a85535b15e653714751e super.customServerAiStep(level); } -@@ -156,6 +162,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -160,6 +_,12 @@ this.ticksUntilNextAlert = ALERT_INTERVAL.sample(this.random); } @@ -34,9 +26,9 @@ index 8fcb6cd1cefa6c9e1809944b4720cfdc35325729..ef6a4aff03c1a85535b15e653714751e return super.setTarget(target, reason); // CraftBukkit } -@@ -176,6 +188,11 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -180,6 +_,11 @@ public static boolean checkZombifiedPiglinSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random + final EntityType type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random ) { + // Purpur start - Config to disable hostile mob spawn on ice + if (canSpawnInBlueAndPackedIce(level, pos)) { 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 new file mode 100644 index 000000000..459d3bea3 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/entity/player/Player.java ++++ b/net/minecraft/world/entity/player/Player.java +@@ -1519,7 +_,7 @@ + } + + @Override +- public boolean canGlide() { ++ protected boolean canGlide() { + return !this.abilities.flying && super.canGlide(); + } + diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 60% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java.patch index 185efbba8..3197c970c 100644 --- a/purpur-server/minecraft-patches/unapplied-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,31 +1,23 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java -index 51d3560c5d8cba89469c07fe6b13f0016adc6db7..d4c6a68c59b710cd3d158c674df03cbc2f2f307b 100644 --- a/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java +++ b/net/minecraft/world/entity/projectile/arrow/AbstractArrow.java -@@ -78,6 +78,7 @@ public abstract class AbstractArrow extends Projectile { +@@ -78,6 +_,7 @@ private @Nullable List piercedAndKilledEntities; public ItemStack pickupItemStack = this.getDefaultPickupItem(); public @Nullable ItemStack firedFromWeapon = null; + public net.minecraft.world.item.enchantment.ItemEnchantments actualEnchantments = net.minecraft.world.item.enchantment.ItemEnchantments.EMPTY; // Purpur - Add an option to fix MC-3304 projectile looting - protected AbstractArrow(EntityType type, Level level) { + protected AbstractArrow(final EntityType type, final Level level) { super(type, level); -@@ -594,6 +595,12 @@ public abstract class AbstractArrow extends Projectile { +@@ -605,6 +_,12 @@ + public @Nullable ItemStack getWeaponItem() { return this.firedFromWeapon; } - ++ + // Purpur start - Add an option to fix MC-3304 projectile looting + public void setActualEnchantments(net.minecraft.world.item.enchantment.ItemEnchantments actualEnchantments) { + this.actualEnchantments = actualEnchantments; + } + // Purpur end - Add an option to fix MC-3304 projectile looting -+ + protected SoundEvent getDefaultHitGroundSoundEvent() { return SoundEvents.ARROW_HIT; - } diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 58% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java.patch index d628007ad..09d142213 100644 --- a/purpur-server/minecraft-patches/unapplied-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,15 +1,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java b/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java -index 31125bf31c2e1e749873a0387aea6040f5f832dd..1020e835f24bc25e032335f739d526bc0bd4ecc4 100644 --- a/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java +++ b/net/minecraft/world/entity/projectile/hurtingprojectile/WitherSkull.java -@@ -94,7 +94,7 @@ public class WitherSkull extends AbstractHurtingProjectile { - super.onHit(result); +@@ -94,7 +_,7 @@ + super.onHit(hitResult); if (!this.level().isClientSide()) { // CraftBukkit start - org.bukkit.event.entity.ExplosionPrimeEvent event = new org.bukkit.event.entity.ExplosionPrimeEvent(this.getBukkitEntity(), 1.0F, false); @@ -17,17 +9,17 @@ index 31125bf31c2e1e749873a0387aea6040f5f832dd..1020e835f24bc25e032335f739d526bc if (event.callEvent()) { this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB); } -@@ -103,6 +103,13 @@ public class WitherSkull extends AbstractHurtingProjectile { +@@ -102,6 +_,13 @@ + this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause } } - ++ + // Purpur start - Add canSaveToDisk to Entity + @Override + public boolean canSaveToDisk() { + return false; + } + // Purpur end - Add canSaveToDisk to Entity -+ + @Override - protected void defineSynchedData(SynchedEntityData.Builder builder) { - builder.define(DATA_DANGEROUS, false); + protected void defineSynchedData(final SynchedEntityData.Builder entityData) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/food/FoodProperties.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/food/FoodProperties.java.patch similarity index 52% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/food/FoodProperties.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/food/FoodProperties.java.patch index 6660b8cab..d8a974be1 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/food/FoodProperties.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/food/FoodProperties.java.patch @@ -1,16 +1,8 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/food/FoodProperties.java b/net/minecraft/world/food/FoodProperties.java -index 793e4528755fa5688efbad75418188e693ad0157..20f702c8266eb54a8835861188eb937f4732e078 100644 --- a/net/minecraft/world/food/FoodProperties.java +++ b/net/minecraft/world/food/FoodProperties.java -@@ -42,9 +42,11 @@ public record FoodProperties(int nutrition, float saturation, boolean canAlwaysE - level.playSound(null, entity.getX(), entity.getY(), entity.getZ(), consumable.sound().value(), SoundSource.NEUTRAL, 1.0F, random.triangle(1.0F, 0.4F)); - if (entity instanceof Player player) { +@@ -42,9 +_,11 @@ + level.playSound(null, user.getX(), user.getY(), user.getZ(), consumable.sound().value(), SoundSource.NEUTRAL, 1.0F, random.triangle(1.0F, 0.4F)); + if (user instanceof Player player) { player.getFoodData().eat(this, stack, (net.minecraft.server.level.ServerPlayer) player); // CraftBukkit - level.playSound( - null, player.getX(), player.getY(), player.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, Mth.randomBetween(random, 0.9F, 1.0F) diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch similarity index 52% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch index 36a439758..0183c15fa 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java -index f51dbc45204c2727122aeb6b5002216e3200680d..19bdb38a69dcdb3d30f08a85b3e9c3d6d723191f 100644 --- a/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -63,6 +63,7 @@ public abstract class AbstractContainerMenu { +@@ -64,6 +_,7 @@ private final List containerListeners = Lists.newArrayList(); private @Nullable ContainerSynchronizer synchronizer; private boolean suppressRemoteUpdates; 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 new file mode 100644 index 000000000..1a0d1448b --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/AxeItem.java.patch @@ -0,0 +1,72 @@ +--- a/net/minecraft/world/item/AxeItem.java ++++ b/net/minecraft/world/item/AxeItem.java +@@ -65,13 +_,15 @@ + if (playerHasBlockingItemUseIntent(context)) { + return InteractionResult.PASS; + } else { +- Optional newBlock = this.evaluateNewBlockState(level, pos, player, level.getBlockState(pos)); ++ Optional newBlock = this.evaluateActionable(level, pos, player, level.getBlockState(pos)); // Purpur - Tool actionable options + if (newBlock.isEmpty()) { + return InteractionResult.PASS; + } else { ++ org.purpurmc.purpur.tool.Actionable actionable = newBlock.get(); // Purpur - Tool actionable options ++ BlockState state = actionable.into().withPropertiesOf(level.getBlockState(pos)); // Purpur - Tool actionable options + ItemStack itemInHand = context.getItemInHand(); + // Paper start - EntityChangeBlockEvent +- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, newBlock.get())) { ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, state)) { // Purpur - Tool actionable options + return InteractionResult.PASS; + } + // Paper end +@@ -79,8 +_,15 @@ + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, pos, itemInHand); + } + +- level.setBlock(pos, newBlock.get(), Block.UPDATE_ALL_IMMEDIATE); +- level.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, newBlock.get())); ++ // Purpur start - Tool actionable options ++ level.setBlock(pos, state, Block.UPDATE_ALL_IMMEDIATE); ++ actionable.drops().forEach((drop, chance) -> { ++ if (level.random.nextDouble() < chance) { ++ Block.popResourceFromFace(level, pos, context.getClickedFace(), new ItemStack(drop)); ++ } ++ }); ++ level.gameEvent(GameEvent.BLOCK_CHANGE, pos, GameEvent.Context.of(player, state)); ++ // Purpur end - Tool actionable options + if (player != null) { + itemInHand.hurtAndBreak(1, player, context.getHand().asEquipmentSlot()); + } +@@ -97,21 +_,23 @@ + && !player.isSecondaryUseActive(); + } + +- private Optional evaluateNewBlockState(final Level level, final BlockPos pos, final @Nullable Player player, final BlockState oldState) { +- Optional strippedBlock = this.getStripped(oldState); +- if (strippedBlock.isPresent()) { +- level.playSound(player, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); +- return strippedBlock; ++ private Optional evaluateActionable(final Level level, final BlockPos pos, final @Nullable Player player, final BlockState oldState) { // Purpur - Tool actionable options ++ Optional stripped = Optional.ofNullable(level.purpurConfig.axeStrippables.get(oldState.getBlock())); // Purpur - Tool actionable options ++ if (stripped.isPresent()) { ++ level.playSound(STRIPPABLES.containsKey(oldState.getBlock()) ? player : null, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound ++ return stripped; + } else { +- Optional scrapedBlock = WeatheringCopper.getPrevious(oldState); ++ Optional scrapedBlock = Optional.ofNullable(level.purpurConfig.axeWeatherables.get(oldState.getBlock())); // Purpur - Tool actionable options + if (scrapedBlock.isPresent()) { +- spawnSoundAndParticle(level, pos, player, oldState, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); ++ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(oldState).isPresent() ? player : null, oldState, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); // Purpur - Tool actionable options - force sound + return scrapedBlock; + } else { +- Optional waxoffBlock = Optional.ofNullable(HoneycombItem.WAX_OFF_BY_BLOCK.get().get(oldState.getBlock())) +- .map(b -> b.withPropertiesOf(oldState)); ++ // Purpur start - Tool actionable options ++ Optional waxoffBlock = Optional.ofNullable(level.purpurConfig.axeWaxables.get(oldState.getBlock())); ++ // .map(b -> b.withPropertiesOf(oldState)); ++ // Purpur end - Tool actionable options + if (waxoffBlock.isPresent()) { +- spawnSoundAndParticle(level, pos, player, oldState, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); ++ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(oldState.getBlock()) ? player : null, oldState, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); // Purpur - Tool actionable options - force sound + return waxoffBlock; + } else { + return Optional.empty(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BlockItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BlockItem.java.patch new file mode 100644 index 000000000..2862b98d0 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BlockItem.java.patch @@ -0,0 +1,36 @@ +--- a/net/minecraft/world/item/BlockItem.java ++++ b/net/minecraft/world/item/BlockItem.java +@@ -139,7 +_,16 @@ + protected boolean updateCustomBlockEntityTag( + final BlockPos pos, final Level level, final @Nullable Player player, final ItemStack itemStack, final BlockState placedState + ) { +- return updateCustomBlockEntityTag(level, player, pos, itemStack); ++ // Purpur start - Persistent BlockEntity Lore and DisplayName ++ boolean handled = updateCustomBlockEntityTag(level, player, pos, itemStack); ++ if (level.purpurConfig.persistentTileEntityLore) { ++ BlockEntity blockEntity1 = level.getBlockEntity(pos); ++ if (blockEntity1 != null) { ++ blockEntity1.setPersistentLore(stack.getOrDefault(DataComponents.LORE, net.minecraft.world.item.component.ItemLore.EMPTY)); ++ } ++ } ++ return handled; ++ // Purpur end - Persistent BlockEntity Lore and DisplayName + } + + protected @Nullable BlockState getPlacementState(final BlockPlaceContext context) { +@@ -201,6 +_,7 @@ + } + + if (!type.onlyOpCanSetNbt() || player != null && (player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place")))) { // Spigot - add permission ++ if (!(level.purpurConfig.silkTouchEnabled && blockEntity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) // Purpur - Silk touch spawners + return customData.loadInto(blockEntity, level.registryAccess()); + } + +@@ -241,6 +_,7 @@ + public void onDestroyed(final ItemEntity entity) { + ItemContainerContents container = entity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY); + if (container != null) { ++ if (entity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && this.getBlock() instanceof ShulkerBoxBlock) // Purpur - option to disable shulker box items from dropping contents when destroyed + ItemUtils.onContainerDestroyed(entity, container.nonEmptyItemCopyStream()); + } + } 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 new file mode 100644 index 000000000..e6aaabf5c --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BowItem.java.patch @@ -0,0 +1,32 @@ +--- a/net/minecraft/world/item/BowItem.java ++++ b/net/minecraft/world/item/BowItem.java +@@ -28,6 +_,11 @@ + return false; + } else { + 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) { ++ projectile = new ItemStack(Items.ARROW); ++ } ++ // Purpur end - Infinity bow settings + if (projectile.isEmpty()) { + return false; + } else { +@@ -38,7 +_,7 @@ + } else { + List firedProjectiles = draw(itemStack, projectile, player); + if (level instanceof ServerLevel serverLevel && !firedProjectiles.isEmpty()) { +- this.shoot(serverLevel, player, player.getUsedItemHand(), itemStack, firedProjectiles, pow * 3.0F, 1.0F, pow == 1.0F, null, pow); // Paper - Pass draw strength ++ this.shoot(serverLevel, player, player.getUsedItemHand(), itemStack, firedProjectiles, pow * 3.0F, (float) serverLevel.purpurConfig.bowProjectileOffset, pow == 1.0F, null, pow); // Paper - Pass draw strength // Purpur - Projectile offset config + } + + level.playSound( +@@ -95,7 +_,7 @@ + public InteractionResult use(final Level level, final Player player, final InteractionHand hand) { + ItemStack itemStack = player.getItemInHand(hand); + boolean foundProjectile = !player.getProjectile(itemStack).isEmpty(); +- if (!player.hasInfiniteMaterials() && !foundProjectile) { ++ if (!player.hasInfiniteMaterials() && !foundProjectile && !(level.purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0)) { // Purpur - Infinity bow settings + return InteractionResult.FAIL; + } else { + player.startUsingItem(hand); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BucketItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch similarity index 53% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BucketItem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch index 24d6f5bbe..e73f1140a 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BucketItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/BucketItem.java.patch @@ -1,17 +1,9 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/BucketItem.java b/net/minecraft/world/item/BucketItem.java -index 9d6485148393292006ed4453e0ed228b6197b239..0ffdbcd75fa57feb2ada835c0189246821d279d1 100644 --- a/net/minecraft/world/item/BucketItem.java +++ b/net/minecraft/world/item/BucketItem.java -@@ -148,7 +148,7 @@ public class BucketItem extends Item implements DispensibleContainerItem { +@@ -146,7 +_,7 @@ // CraftBukkit end - if (!flag2) { - return hitResult != null && this.emptyContents(entity, level, hitResult.getBlockPos().relative(hitResult.getDirection()), null, direction, clicked, itemstack, hand); // CraftBukkit + if (!canPlaceFluidInsideBlock) { + return hitResult != null && this.emptyContents(user, level, hitResult.getBlockPos().relative(hitResult.getDirection()), null, direction, clicked, itemStack, hand); // CraftBukkit - } else if (level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos) && this.content.is(FluidTags.WATER)) { + } else if ((level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos) || (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd)) && this.content.is(FluidTags.WATER)) { // Purpur - Add allow water in end world option int x = pos.getX(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/CrossbowItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/CrossbowItem.java.patch new file mode 100644 index 000000000..b5d5cdc0e --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/CrossbowItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/CrossbowItem.java ++++ b/net/minecraft/world/item/CrossbowItem.java +@@ -66,7 +_,7 @@ + ItemStack itemStack = player.getItemInHand(hand); + ChargedProjectiles chargedProjectiles = itemStack.get(DataComponents.CHARGED_PROJECTILES); + if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) { +- this.performShooting(level, player, hand, itemStack, getShootingPower(chargedProjectiles), 1.0F, null); ++ this.performShooting(level, player, hand, itemStack, getShootingPower(chargedProjectiles), (float) level.purpurConfig.crossbowProjectileOffset, null); // Purpur - Projectile offset config + return InteractionResult.CONSUME; + } else if (!player.getProjectile(itemStack).isEmpty()) { + this.startSoundPlayed = false; 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 new file mode 100644 index 000000000..a60285f13 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/DyeColor.java.patch @@ -0,0 +1,13 @@ +--- a/net/minecraft/world/item/DyeColor.java ++++ b/net/minecraft/world/item/DyeColor.java +@@ -154,4 +_,10 @@ + } + } + } ++ ++ // Purpur start - Shulker spawn from bullet options ++ public static DyeColor random(net.minecraft.util.RandomSource random) { ++ return values()[random.nextInt(values().length)]; ++ } ++ // Purpur end - Shulker spawn from bullet options + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EggItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EggItem.java.patch new file mode 100644 index 000000000..7f3e02270 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EggItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/EggItem.java ++++ b/net/minecraft/world/item/EggItem.java +@@ -24,7 +_,7 @@ + public InteractionResult use(final Level level, final Player player, final InteractionHand hand) { + ItemStack itemStack = player.getItemInHand(hand); + // Paper start +- final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, (ServerLevel) level, itemStack, player, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, (ServerLevel) level, itemStack, player, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, (float) level.purpurConfig.eggProjectileOffset); // Purpur - Projectile offset config + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) thrownEgg.projectile().getBukkitEntity()); + if (event.callEvent() && thrownEgg.attemptSpawn()) { + if (event.shouldConsume()) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch new file mode 100644 index 000000000..ebe8fc052 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EndCrystalItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/EndCrystalItem.java ++++ b/net/minecraft/world/item/EndCrystalItem.java +@@ -24,7 +_,7 @@ + Level level = context.getLevel(); + BlockPos pos = context.getClickedPos(); + BlockState blockState = level.getBlockState(pos); +- if (!blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { ++ if (!level.purpurConfig.endCrystalPlaceAnywhere && !blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { // Purpur - place end crystal on any block + return InteractionResult.FAIL; + } else { + BlockPos above = pos.above(); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EnderpearlItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EnderpearlItem.java.patch similarity index 61% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EnderpearlItem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/EnderpearlItem.java.patch index c52dc5347..16aee2c4c 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EnderpearlItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/EnderpearlItem.java.patch @@ -1,23 +1,15 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/EnderpearlItem.java b/net/minecraft/world/item/EnderpearlItem.java -index 7f1bc41d2ad20f2d96397e6e2eaedc4bbe5a7ba1..647f2fb76b1e1d8ca5046348b216a8ca0fa02de9 100644 --- a/net/minecraft/world/item/EnderpearlItem.java +++ b/net/minecraft/world/item/EnderpearlItem.java -@@ -24,7 +24,7 @@ public class EnderpearlItem extends Item { +@@ -24,7 +_,7 @@ if (level instanceof ServerLevel serverLevel) { // CraftBukkit start // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, serverLevel, itemInHand, player, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, 1.0F); -+ final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, serverLevel, itemInHand, player, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.enderPearlProjectileOffset); // Purpur - Projectile offset config - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemInHand), (org.bukkit.entity.Projectile) thrownEnderpearl.projectile().getBukkitEntity()); +- final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, serverLevel, itemStack, player, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed thrownEnderpearl = Projectile.spawnProjectileFromRotationDelayed(ThrownEnderpearl::new, serverLevel, itemStack, player, 0.0F, EnderpearlItem.PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.enderPearlProjectileOffset); // Purpur - Projectile offset config + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) thrownEnderpearl.projectile().getBukkitEntity()); if (event.callEvent() && thrownEnderpearl.attemptSpawn()) { if (event.shouldConsume()) { -@@ -44,6 +44,7 @@ public class EnderpearlItem extends Item { +@@ -44,6 +_,7 @@ 0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F) ); player.awardStat(Stats.ITEM_USED.get(this)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/HoeItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/HoeItem.java.patch new file mode 100644 index 000000000..9b1c4ddb2 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/HoeItem.java.patch @@ -0,0 +1,33 @@ +--- a/net/minecraft/world/item/HoeItem.java ++++ b/net/minecraft/world/item/HoeItem.java +@@ -44,15 +_,25 @@ + public InteractionResult useOn(final UseOnContext context) { + Level level = context.getLevel(); + BlockPos pos = context.getClickedPos(); +- Pair, Consumer> logicPair = TILLABLES.get(level.getBlockState(pos).getBlock()); +- if (logicPair == null) { ++ // Purpur start - Tool actionable options ++ Block clickedBlock = level.getBlockState(pos).getBlock(); ++ org.purpurmc.purpur.tool.Tillable tillable = level.purpurConfig.hoeTillables.get(clickedBlock); ++ if (tillable == null) { + return InteractionResult.PASS; + } else { +- Predicate predicate = logicPair.getFirst(); +- Consumer action = logicPair.getSecond(); ++ Predicate predicate = tillable.condition().predicate(); ++ Consumer action = (ctx) -> { ++ level.setBlock(pos, tillable.into().defaultBlockState(), 11); ++ tillable.drops().forEach((drop, chance) -> { ++ if (level.random.nextDouble() < chance) { ++ Block.popResourceFromFace(level, pos, ctx.getClickedFace(), new ItemStack(drop)); ++ } ++ }); ++ }; ++ // Purpur end - Tool actionable options + if (predicate.test(context)) { + Player player = context.getPlayer(); +- level.playSound(player, pos, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1.0F, 1.0F); ++ if (!TILLABLES.containsKey(clickedBlock)) level.playSound(null, pos, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - Tool actionable options - force sound + if (!level.isClientSide()) { + action.accept(context); + if (player != null) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ItemStack.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch similarity index 78% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ItemStack.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch index efd6cdb1a..85273bf04 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ItemStack.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ItemStack.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java -index ed06cffe8a5eba2ca4a34ade81f8185e21d7b651..e38ed1b4f9cfa104da317e80d615b38d5121ea97 100644 --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java -@@ -456,6 +456,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -453,6 +_,7 @@ // revert back all captured blocks for (org.bukkit.block.BlockState blockstate : blocks) { ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace(); @@ -16,7 +8,7 @@ index ed06cffe8a5eba2ca4a34ade81f8185e21d7b651..e38ed1b4f9cfa104da317e80d615b38d } SignItem.openSign = null; // SPIGOT-6758 - Reset on early return -@@ -479,6 +480,7 @@ public final class ItemStack implements DataComponentHolder { +@@ -476,6 +_,7 @@ if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically block.onPlace(serverLevel, newPos, oldBlock, true, context); } @@ -24,7 +16,7 @@ index ed06cffe8a5eba2ca4a34ade81f8185e21d7b651..e38ed1b4f9cfa104da317e80d615b38d serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point } -@@ -599,6 +601,26 @@ public final class ItemStack implements DataComponentHolder { +@@ -592,6 +_,26 @@ return this.isDamageableItem() && this.getDamageValue() > 0; } @@ -51,16 +43,16 @@ index ed06cffe8a5eba2ca4a34ade81f8185e21d7b651..e38ed1b4f9cfa104da317e80d615b38d public int getDamageValue() { return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage()); } -@@ -1248,6 +1270,12 @@ public final class ItemStack implements DataComponentHolder { +@@ -1241,6 +_,12 @@ + public boolean isEnchanted() { return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty(); } - ++ + // Purpur start - Config to allow unsafe enchants + public boolean hasEnchantment(Holder enchantment) { + return this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).getLevel(enchantment) > 0; + } + // Purpur end - Config to allow unsafe enchants -+ + public ItemEnchantments getEnchantments() { return this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/Items.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch similarity index 65% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/Items.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch index 7fe42ffe8..3b88823f1 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/Items.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/Items.java.patch @@ -1,28 +1,20 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/Items.java b/net/minecraft/world/item/Items.java -index 3e0ae17bf7129aa62765be453edba1bdd50324ab..310e61a9bbece157d81095130ecb3131deef9288 100644 --- a/net/minecraft/world/item/Items.java +++ b/net/minecraft/world/item/Items.java -@@ -420,7 +420,7 @@ public class Items { +@@ -396,7 +_,7 @@ 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); - public static final Item SPAWNER = registerBlock(Blocks.SPAWNER); + public static final Item SPAWNER = registerBlock(Blocks.SPAWNER, org.purpurmc.purpur.item.SpawnerItem::new, new Item.Properties().rarity(Rarity.EPIC)); // Purpur - Silk touch spawners public static final Item CREAKING_HEART = registerBlock(Blocks.CREAKING_HEART); - public static final Item CHEST = registerBlock(Blocks.CHEST, properties -> properties.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); + 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); -@@ -2169,7 +2169,7 @@ public class Items { +@@ -2077,7 +_,7 @@ "sweet_berries", createBlockItemWithCustomItemName(Blocks.SWEET_BERRY_BUSH), new Item.Properties().food(Foods.SWEET_BERRIES) ); public static final Item GLOW_BERRIES = registerItem( - "glow_berries", createBlockItemWithCustomItemName(Blocks.CAVE_VINES), new Item.Properties().food(Foods.GLOW_BERRIES) + "glow_berries", settings -> new org.purpurmc.purpur.item.GlowBerryItem(Blocks.CAVE_VINES, settings.useItemDescriptionPrefix()), new Item.Properties().food(Foods.GLOW_BERRIES) // Purpur - Eating glow berries adds glow effect ); - public static final Item CAMPFIRE = registerBlock( - Blocks.CAMPFIRE, properties -> properties.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY) + public static final Item CAMPFIRE = registerBlock(Blocks.CAMPFIRE, p -> p.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); + public static final Item SOUL_CAMPFIRE = registerBlock(Blocks.SOUL_CAMPFIRE, p -> p.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY)); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/MapItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/MapItem.java.patch new file mode 100644 index 000000000..3e2d25bd8 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/MapItem.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/item/MapItem.java ++++ b/net/minecraft/world/item/MapItem.java +@@ -202,6 +_,7 @@ + public static void renderBiomePreviewMap(final ServerLevel level, final ItemStack mapItemStack) { + MapItemSavedData data = getSavedData(mapItemStack, level); + if (data != null) { ++ data.isExplorerMap = true; // Purpur - Explorer Map API + if (level.dimension() == data.dimension) { + int scale = 1 << data.scale; + int centerX = data.centerX; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/NameTagItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/NameTagItem.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/NameTagItem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/NameTagItem.java.patch index 17d4874c2..2a8639361 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/NameTagItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/NameTagItem.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/NameTagItem.java b/net/minecraft/world/item/NameTagItem.java -index 24bf4cd320c67b852d3905c50740c8006592bd68..7ee4bd968a43123e21e65f77f30495e65146aca5 100644 --- a/net/minecraft/world/item/NameTagItem.java +++ b/net/minecraft/world/item/NameTagItem.java -@@ -24,6 +24,7 @@ public class NameTagItem extends Item { +@@ -24,6 +_,7 @@ LivingEntity newEntity = ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getEntity()).getHandle(); newEntity.setCustomName(event.getName() != null ? io.papermc.paper.adventure.PaperAdventure.asVanilla(event.getName()) : null); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch new file mode 100644 index 000000000..4b5ba7adb --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/ProjectileWeaponItem.java ++++ b/net/minecraft/world/item/ProjectileWeaponItem.java +@@ -114,6 +_,8 @@ + arrowx.setCritArrow(true); + } + ++ arrowx.setActualEnchantments(weapon.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting ++ + return arrowx; + } + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ShovelItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ShovelItem.java.patch new file mode 100644 index 000000000..56e3343c4 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ShovelItem.java.patch @@ -0,0 +1,17 @@ +--- a/net/minecraft/world/item/ShovelItem.java ++++ b/net/minecraft/world/item/ShovelItem.java +@@ -46,9 +_,12 @@ + BlockState newState = FLATTENABLES.get(blockState.getBlock()); + BlockState updatedState = null; + Runnable afterAction = null; // Paper ++ org.purpurmc.purpur.tool.Flattenable flattenable = level.purpurConfig.shovelFlattenables.get(blockState.getBlock()); // Purpur - Tool actionable options + if (newState != null && level.getBlockState(pos.above()).isAir()) { +- afterAction = () -> level.playSound(player, pos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); // Paper +- updatedState = newState; ++ // Purpur start - Tool actionable options ++ afterAction = () -> {if (!FLATTENABLES.containsKey(blockState.getBlock())) level.playSound(player, pos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);}; // Paper ++ updatedState = flattenable.into().defaultBlockState(); ++ // Purpur end - Tool actionable options + } else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) { + afterAction = () -> { // Paper + if (!level.isClientSide()) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SnowballItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SnowballItem.java.patch similarity index 52% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SnowballItem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/SnowballItem.java.patch index 961fc2548..2ce74f262 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SnowballItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SnowballItem.java.patch @@ -1,19 +1,11 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/SnowballItem.java b/net/minecraft/world/item/SnowballItem.java -index a5bfd497a07f2e2311db8eca5b8ba8af9f4d1080..67145fd5adc5ebb38efb978119ba1f7e4f2c563f 100644 --- a/net/minecraft/world/item/SnowballItem.java +++ b/net/minecraft/world/item/SnowballItem.java -@@ -26,7 +26,7 @@ public class SnowballItem extends Item implements ProjectileItem { +@@ -26,7 +_,7 @@ // CraftBukkit start - moved down if (level instanceof ServerLevel serverLevel) { // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, serverLevel, itemInHand, player, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, 1.0F); -+ final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, serverLevel, itemInHand, player, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.snowballProjectileOffset); // Purpur - Projectile offset config - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemInHand), (org.bukkit.entity.Projectile) snowball.projectile().getBukkitEntity()); +- final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, serverLevel, itemStack, player, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, 1.0F); ++ final Projectile.Delayed snowball = Projectile.spawnProjectileFromRotationDelayed(Snowball::new, serverLevel, itemStack, player, 0.0F, SnowballItem.PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.snowballProjectileOffset); // Purpur - Projectile offset config + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) snowball.projectile().getBukkitEntity()); if (event.callEvent() && snowball.attemptSpawn()) { player.awardStat(Stats.ITEM_USED.get(this)); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SpawnEggItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SpawnEggItem.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch index cf0a713cf..461fb60ed 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/SpawnEggItem.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch @@ -1,27 +1,19 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/SpawnEggItem.java b/net/minecraft/world/item/SpawnEggItem.java -index 079cccadfca55cd718bf75b244901f774c818811..8ab8f00995136c81abf7855e02b186a3df9a02d9 100644 --- a/net/minecraft/world/item/SpawnEggItem.java +++ b/net/minecraft/world/item/SpawnEggItem.java -@@ -70,6 +70,23 @@ public class SpawnEggItem extends Item { +@@ -63,6 +_,23 @@ return InteractionResult.FAIL; } else { if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation + // Purpur start - PlayerSetSpawnerTypeWithEggEvent -+ if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) { -+ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ()); ++ if (spawnerHolder instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) { ++ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); + org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.CreatureSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName())); + if (!event.callEvent()) { + return InteractionResult.FAIL; + } + type = EntityType.getFromBukkitType(event.getEntityType()); -+ } else if (spawner instanceof net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity) { -+ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(clickedPos.getX(), clickedPos.getY(), clickedPos.getZ()); ++ } else if (spawnerHolder instanceof net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity) { ++ org.bukkit.block.Block bukkitBlock = level.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); + org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.TrialSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(type.getName())); + if (!event.callEvent()) { + return InteractionResult.FAIL; @@ -29,6 +21,6 @@ index 079cccadfca55cd718bf75b244901f774c818811..8ab8f00995136c81abf7855e02b186a3 + type = EntityType.getFromBukkitType(event.getEntityType()); + } + // Purpur end - PlayerSetSpawnerTypeWithEggEvent - spawner.setEntityId(type, level.getRandom()); - level.sendBlockUpdated(clickedPos, blockState, blockState, Block.UPDATE_ALL); - level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos); + spawnerHolder.setEntityId(type, level.getRandom()); + level.sendBlockUpdated(pos, blockState, blockState, Block.UPDATE_ALL); + level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, pos); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ThrowablePotionItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ThrowablePotionItem.java.patch new file mode 100644 index 000000000..9087458d1 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/ThrowablePotionItem.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/item/ThrowablePotionItem.java ++++ b/net/minecraft/world/item/ThrowablePotionItem.java +@@ -24,7 +_,7 @@ + ItemStack itemStack = player.getItemInHand(hand); + if (level instanceof ServerLevel serverLevel) { + // Paper start - PlayerLaunchProjectileEvent +- final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(this::createPotion, serverLevel, itemStack, player, -20.0F, 0.5F, 1.0F); ++ final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(this::createPotion, serverLevel, itemStack, player, -20.0F, 0.5F, (float) serverLevel.purpurConfig.throwablePotionProjectileOffset); // Purpur - Projectile offset config + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) thrownPotion.projectile().getBukkitEntity()); + if (event.callEvent() && thrownPotion.attemptSpawn()) { + if (event.shouldConsume()) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/TridentItem.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/TridentItem.java.patch new file mode 100644 index 000000000..d81323526 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/TridentItem.java.patch @@ -0,0 +1,19 @@ +--- a/net/minecraft/world/item/TridentItem.java ++++ b/net/minecraft/world/item/TridentItem.java +@@ -82,7 +_,7 @@ + if (riptideStrength == 0.0F) { + ItemStack thrownItemStack = itemStack.copyWithCount(1); // Paper + Projectile.Delayed tridentDelayed = Projectile.spawnProjectileFromRotationDelayed( // Paper - PlayerLaunchProjectileEvent( +- ThrownTrident::new, serverLevel, thrownItemStack, player, 0.0F, 2.5F, 1.0F ++ ThrownTrident::new, serverLevel, thrownItemStack, player, 0.0F, 2.5F, (float) serverLevel.purpurConfig.tridentProjectileOffset // Purpur - Projectile offset config + ); + // Paper start - PlayerLaunchProjectileEvent + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemStack), (org.bukkit.entity.Projectile) tridentDelayed.projectile().getBukkitEntity()); +@@ -92,6 +_,7 @@ + return false; + } + ThrownTrident trident = tridentDelayed.projectile(); // Paper - PlayerLaunchProjectileEvent ++ trident.setActualEnchantments(itemStack.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting + if (event.shouldConsume()) { + thrownItemStack.hurtWithoutBreaking(1, player); // Paper - PlayerLaunchProjectileEvent - use thrownItemStack; pickup item damage + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch new file mode 100644 index 000000000..3af9e4a18 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch @@ -0,0 +1,15 @@ +--- a/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java ++++ b/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java +@@ -20,6 +_,12 @@ + @Override + // CraftBukkit start + public boolean apply(final Level level, final ItemStack stack, final LivingEntity user, org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause) { ++ // Purpur start - Option to toggle milk curing bad omen ++ net.minecraft.world.effect.MobEffectInstance badOmen = user.getEffect(net.minecraft.world.effect.MobEffects.BAD_OMEN); ++ if (!level.purpurConfig.milkCuresBadOmen && stack.is(net.minecraft.world.item.Items.MILK_BUCKET) && badOmen != null) { ++ return user.removeAllEffects(cause) && user.addEffect(badOmen); ++ } ++ // Purpur end - Option to toggle milk curing bad omen + return user.removeAllEffects(cause); + // CraftBukkit end + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/crafting/Ingredient.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/crafting/Ingredient.java.patch new file mode 100644 index 000000000..ae8dbcf1d --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/crafting/Ingredient.java.patch @@ -0,0 +1,22 @@ +--- a/net/minecraft/world/item/crafting/Ingredient.java ++++ b/net/minecraft/world/item/crafting/Ingredient.java +@@ -35,6 +_,7 @@ + public final HolderSet values; + // CraftBukkit start + private java.util.@org.jspecify.annotations.Nullable List itemStacks; ++ public Predicate predicate; // Purpur - Add predicate to recipe's ExactChoice ingredient + + public boolean isExact() { + return this.itemStacks != null; +@@ -88,6 +_,11 @@ + return false; + } + // CraftBukkit end ++ // Purpur start - Add predicate to recipe's ExactChoice ingredient ++ if (predicate != null) { ++ return predicate.test(input.asBukkitCopy()); ++ } ++ // Purpur end - Add predicate to recipe's ExactChoice ingredient + return input.is(this.values); + } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch similarity index 83% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch index 6004b134e..575c2a8fa 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/EnchantmentHelper.java.patch @@ -1,15 +1,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index b61e0e179e78f37f670ad86476b5a533e7835948..d9eed93017906785716cf747317be7737bc2a38e 100644 --- a/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/net/minecraft/world/item/enchantment/EnchantmentHelper.java -@@ -616,4 +616,58 @@ public class EnchantmentHelper { - interface EnchantmentVisitor { +@@ -643,4 +_,58 @@ + private interface EnchantmentVisitor { void accept(Holder enchantment, int level); } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch similarity index 65% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch index 37b5628f0..450ee9984 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/enchantment/ItemEnchantments.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/enchantment/ItemEnchantments.java b/net/minecraft/world/item/enchantment/ItemEnchantments.java -index 40e94e008ddf8d7670496f3f30a3e6320a11c936..b666181af7d6663f2fce58a7d9a4c805687f5409 100644 --- a/net/minecraft/world/item/enchantment/ItemEnchantments.java +++ b/net/minecraft/world/item/enchantment/ItemEnchantments.java -@@ -32,7 +32,7 @@ public class ItemEnchantments implements TooltipProvider { +@@ -32,7 +_,7 @@ private static final java.util.Comparator> ENCHANTMENT_ORDER = java.util.Comparator.comparing(Holder::getRegisteredName); public static final ItemEnchantments EMPTY = new ItemEnchantments(new it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER)); // Paper end - sort enchantments @@ -17,16 +9,16 @@ index 40e94e008ddf8d7670496f3f30a3e6320a11c936..b666181af7d6663f2fce58a7d9a4c805 public static final Codec CODEC = Codec.unboundedMap(Enchantment.CODEC, LEVEL_CODEC) .xmap( map -> new net.minecraft.world.item.enchantment.ItemEnchantments(net.minecraft.util.Util.make(new it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER), m -> m.putAll(map))), // Paper - sort enchantments -@@ -50,7 +50,7 @@ public class ItemEnchantments implements TooltipProvider { +@@ -48,7 +_,7 @@ for (Entry> entry : enchantments.object2IntEntrySet()) { - int intValue = entry.getIntValue(); -- if (intValue < 0 || intValue > 255) { -+ if (intValue < 0 || intValue > (org.purpurmc.purpur.PurpurConfig.clampEnchantLevels ? 255 : 32767)) { // Purpur - Add toggle for enchant level clamping - throw new IllegalArgumentException("Enchantment " + entry.getKey() + " has invalid level " + intValue); + int level = entry.getIntValue(); +- if (level < 0 || level > 255) { ++ if (level < 0 || level > (org.purpurmc.purpur.PurpurConfig.clampEnchantLevels ? 255 : 32767)) { // Purpur - Add toggle for enchant level clamping + throw new IllegalArgumentException("Enchantment " + entry.getKey() + " has invalid level " + level); } } -@@ -133,13 +133,13 @@ public class ItemEnchantments implements TooltipProvider { +@@ -135,13 +_,13 @@ if (level <= 0) { this.enchantments.removeInt(enchantment); } else { @@ -35,7 +27,7 @@ index 40e94e008ddf8d7670496f3f30a3e6320a11c936..b666181af7d6663f2fce58a7d9a4c805 } } - public void upgrade(Holder enchantment, int level) { + public void upgrade(final Holder enchantment, final int level) { if (level > 0) { - this.enchantments.merge(enchantment, Math.min(level, 255), Integer::max); + this.enchantments.merge(enchantment, Math.min(level, (org.purpurmc.purpur.PurpurConfig.clampEnchantLevels ? 255 : 32767)), Integer::max); // Purpur - Add toggle for enchant level clamping diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/trading/MerchantOffer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch similarity index 66% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/trading/MerchantOffer.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch index f0c7c9748..6c422ac14 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/trading/MerchantOffer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/trading/MerchantOffer.java b/net/minecraft/world/item/trading/MerchantOffer.java -index 6afeb92c2e00ca5b945b7c7de9257bd741d53c3d..3e2a1b3f1098bf4f45fed76b6ca4f9a3d5add6ee 100644 --- a/net/minecraft/world/item/trading/MerchantOffer.java +++ b/net/minecraft/world/item/trading/MerchantOffer.java -@@ -143,8 +143,13 @@ public class MerchantOffer { +@@ -162,8 +_,13 @@ } public void updateDemand() { 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 new file mode 100644 index 000000000..2a0a35441 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/BaseSpawner.java ++++ b/net/minecraft/world/level/BaseSpawner.java +@@ -60,6 +_,7 @@ + } + + public boolean isNearPlayer(final Level level, final BlockPos pos) { ++ if (level.purpurConfig.spawnerDeactivateByRedstone && level.hasNeighborSignal(pos)) return false; // Purpur - Redstone deactivates spawners + return level.hasNearbyAlivePlayerThatAffectsSpawning(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, this.requiredPlayerRange); // Paper - Affects Spawning API + } + 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 new file mode 100644 index 000000000..c75f581bb --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/EntityGetter.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/EntityGetter.java ++++ b/net/minecraft/world/level/EntityGetter.java +@@ -146,7 +_,7 @@ + + default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) { + for (Player player : this.players()) { +- if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { ++ if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player) && EntitySelector.notAfk.test(player)) { // Purpur - AFK API + double playerDist = player.distanceToSqr(x, y, z); + if (range < 0.0 || playerDist < range * range) { + return true; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/Level.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch similarity index 81% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/Level.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch index 113cde743..2d0ac315e 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/Level.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch @@ -1,20 +1,11 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 579bbba4e823d4d0318e58759ca732b7c8e4d865..87ba05261739c64c1534df9721e0b067a6191af6 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -165,11 +165,55 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -162,10 +_,54 @@ } // Paper end - add paper world config + public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files public static @Nullable BlockPos lastPhysicsProblem; // Spigot - private int tileTickPosition; public final Map explosionDensityCache = new java.util.HashMap<>(); // Paper - Optimize explosions public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here @@ -64,8 +55,8 @@ index 579bbba4e823d4d0318e58759ca732b7c8e4d865..87ba05261739c64c1534df9721e0b067 public CraftWorld getWorld() { return this.world; } -@@ -845,6 +889,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - // Paper end - getblock optimisations - cache world height/sections +@@ -208,6 +_,8 @@ + ) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config + this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), environment); // Purpur - Purpur config files @@ -73,8 +64,8 @@ index 579bbba4e823d4d0318e58759ca732b7c8e4d865..87ba05261739c64c1534df9721e0b067 this.generator = generator; this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment); -@@ -2090,4 +2136,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl - return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system +@@ -1472,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 new file mode 100644 index 000000000..d0b2a30a8 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/NaturalSpawner.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/NaturalSpawner.java ++++ b/net/minecraft/world/level/NaturalSpawner.java +@@ -216,7 +_,7 @@ + pos.set(x, yStart, z); + double xx = x + 0.5; + double zz = z + 0.5; +- Player nearestPlayer = level.getNearestPlayer(xx, yStart, zz, -1.0, false); ++ Player nearestPlayer = level.getNearestPlayer(xx, yStart, zz, -1.0, level.purpurConfig.mobSpawningIgnoreCreativePlayers); // Purpur - mob spawning option to ignore creative players + if (nearestPlayer != null) { + double nearestPlayerDistanceSqr = nearestPlayer.distanceToSqr(xx, yStart, zz); + if (level.isLoadedAndInBounds(pos) && isRightDistanceToPlayerAndSpawnPoint(level, chunk, pos, nearestPlayerDistanceSqr)) { // Paper - don't load chunks for mob spawn diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/ServerExplosion.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch similarity index 56% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/ServerExplosion.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch index 5c000cbd5..dc9611b8a 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/ServerExplosion.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/ServerExplosion.java.patch @@ -1,26 +1,18 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 1e94326047622d8975fd1cc5f44e75104fd56946..bcbf7daa2c2b7941ab7cb333de15494969ca665c 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java -@@ -640,6 +640,23 @@ public class ServerExplosion implements Explosion { - this.directMappedBlockCache = new ca.spottedleaf.moonrise.patches.collisions.ExplosionBlockCache[BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH]; - this.mutablePos = new BlockPos.MutableBlockPos(); - // Paper end - collision optimisations +@@ -340,6 +_,23 @@ + } + + public int explode() { + // Purpur start - add PreExplodeEvents + if (this.source != null) { -+ Location location = new Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); ++ org.bukkit.Location location = new org.bukkit.Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); + if(!new org.purpurmc.purpur.event.entity.PreEntityExplodeEvent(this.source.getBukkitEntity(), location, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, org.bukkit.craftbukkit.CraftExplosionResult.toExplosionResult(getBlockInteraction())).callEvent()) { + this.wasCanceled = true; + return 0; + } + } else { -+ Location location = new Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); ++ org.bukkit.Location location = new org.bukkit.Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z); + org.bukkit.block.Block block = location.getBlock(); + org.bukkit.block.BlockState blockState = (this.damageSource.causingBlockSnapshot() != null) ? this.damageSource.causingBlockSnapshot() : block.getState(); + if(!new org.purpurmc.purpur.event.PreBlockExplodeEvent(location.getBlock(), this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, blockState, org.bukkit.craftbukkit.CraftExplosionResult.toExplosionResult(getBlockInteraction())).callEvent()) { @@ -30,5 +22,5 @@ index 1e94326047622d8975fd1cc5f44e75104fd56946..bcbf7daa2c2b7941ab7cb333de154949 + } + // Purpur end - Add PreExplodeEvents this.level.gameEvent(this.source, GameEvent.EXPLODE, this.center); - List list = this.calculateExplodedPositions(); + List toBlow = this.calculateExplodedPositions(); this.hurtEntities(); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AnvilBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AnvilBlock.java.patch similarity index 85% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AnvilBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AnvilBlock.java.patch index 8758114e7..827b69321 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AnvilBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AnvilBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/AnvilBlock.java b/net/minecraft/world/level/block/AnvilBlock.java -index bfcf55cf52b468fbb3fe60daae1068b6e54524a2..ac01a06e000354356c5f3b2e0a8049bd742b0727 100644 --- a/net/minecraft/world/level/block/AnvilBlock.java +++ b/net/minecraft/world/level/block/AnvilBlock.java -@@ -54,6 +54,53 @@ public class AnvilBlock extends FallingBlock { +@@ -54,6 +_,53 @@ return this.defaultBlockState().setValue(FACING, context.getHorizontalDirection().getClockWise()); } @@ -60,5 +52,5 @@ index bfcf55cf52b468fbb3fe60daae1068b6e54524a2..ac01a06e000354356c5f3b2e0a8049bd + // Purpur end - Anvil repair/damage options + @Override - protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { - if (!level.isClientSide()) { + protected InteractionResult useWithoutItem( + final BlockState state, final Level level, final BlockPos pos, final Player player, final BlockHitResult hitResult diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AzaleaBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AzaleaBlock.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AzaleaBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AzaleaBlock.java.patch index 4b3ed4f66..da3e2d0a5 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/AzaleaBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/AzaleaBlock.java.patch @@ -1,17 +1,9 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/AzaleaBlock.java b/net/minecraft/world/level/block/AzaleaBlock.java -index 435a455ad2ec3dfb142d570a51a720bc6c49dac3..32a1dc20202bad7a15794e98cdc1bf2fb2ad5308 100644 --- a/net/minecraft/world/level/block/AzaleaBlock.java +++ b/net/minecraft/world/level/block/AzaleaBlock.java -@@ -50,6 +50,20 @@ public class AzaleaBlock extends VegetationBlock implements BonemealableBlock { +@@ -56,6 +_,20 @@ @Override - public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) { + public void performBonemeal(final ServerLevel level, final RandomSource random, final BlockPos pos, final BlockState state) { + // Purpur start - Chance for azalea blocks to grow into trees naturally + growTree(level, random, pos, state); + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch new file mode 100644 index 000000000..92cdbe3f9 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java ++++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java +@@ -41,6 +_,7 @@ + } + + protected static boolean scanForWater(final BlockState state, final BlockGetter level, final BlockPos blockPos) { ++ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die + if (state.getValue(WATERLOGGED)) { + return true; + } else { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch new file mode 100644 index 000000000..380ceb5b8 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BaseFireBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/BaseFireBlock.java ++++ b/net/minecraft/world/level/block/BaseFireBlock.java +@@ -215,7 +_,7 @@ + boolean hasObsidian = false; + + for (Direction face : Direction.values()) { +- if (level.getBlockState(testPos.set(pos).move(face)).is(Blocks.OBSIDIAN)) { ++ if (PortalShape.FRAME.test(level.getBlockState(testPos.set(pos).move(face)), level, testPos)) { // Purpur - Crying obsidian valid for portal frames + hasObsidian = true; + break; + } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BedBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch similarity index 54% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BedBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch index 62d2d0448..7ddb5d798 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BedBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BedBlock.java.patch @@ -1,23 +1,15 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/BedBlock.java b/net/minecraft/world/level/block/BedBlock.java -index 7bfc62120cae4c5e83cb0d86b759b7ffb2336a95..c4823d0538558b674457c99dc540a6a5757492e7 100644 --- a/net/minecraft/world/level/block/BedBlock.java +++ b/net/minecraft/world/level/block/BedBlock.java -@@ -100,7 +100,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -100,7 +_,7 @@ } - Vec3 center = pos.getCenter(); -- level.explode(null, level.damageSources().badRespawnPointExplosion(center), null, center, 5.0F, true, Level.ExplosionInteraction.BLOCK); -+ if (level.purpurConfig.bedExplode) level.explode(null, level.damageSources().badRespawnPointExplosion(center), null, center, (float) level.purpurConfig.bedExplosionPower, level.purpurConfig.bedExplosionFire, level.purpurConfig.bedExplosionEffect); // Purpur - Implement bed explosion options + Vec3 boomPos = pos.getCenter(); +- level.explode(null, level.damageSources().badRespawnPointExplosion(boomPos), null, boomPos, 5.0F, true, Level.ExplosionInteraction.BLOCK); ++ if (level.purpurConfig.bedExplode) level.explode(null, level.damageSources().badRespawnPointExplosion(boomPos), null, boomPos, (float) level.purpurConfig.bedExplosionPower, level.purpurConfig.bedExplosionFire, level.purpurConfig.bedExplosionEffect); // Purpur - Implement bed explosion options return InteractionResult.SUCCESS_SERVER; } else if (state.getValue(OCCUPIED)) { if (bedRule.explodes()) return this.explodeBed(state, level, pos); // Paper - check explode first -@@ -153,7 +153,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -153,7 +_,7 @@ } Vec3 center = pos.getCenter(); @@ -26,10 +18,10 @@ index 7bfc62120cae4c5e83cb0d86b759b7ffb2336a95..c4823d0538558b674457c99dc540a6a5 return InteractionResult.SUCCESS_SERVER; } // CraftBukkit end -@@ -170,7 +170,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock +@@ -170,7 +_,7 @@ @Override - public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance) { + public void fallOn(final Level level, final BlockState state, final BlockPos pos, final Entity entity, final double fallDistance) { - super.fallOn(level, state, pos, entity, fallDistance * 0.5); + super.fallOn(level, state, pos, entity, fallDistance); // Purpur - Configurable block fall damage modifiers } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch new file mode 100644 index 000000000..142592a2f --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/BigDripleafBlock.java ++++ b/net/minecraft/world/level/block/BigDripleafBlock.java +@@ -259,7 +_,7 @@ + playTiltSound(level, pos, sound); + } + +- int tickDelay = DELAY_UNTIL_NEXT_TILT_STATE.getInt(tilt); ++ int tickDelay = level.purpurConfig.bigDripleafTiltDelay.getOrDefault(tilt, -1); // Purpur - Big dripleaf tilt delay + if (tickDelay != -1) { + level.scheduleTick(pos, this, tickDelay); + } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Block.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch similarity index 54% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Block.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch index 57c9de350..05fc4daf6 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Block.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Block.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java -index 94b4143449c99ee35db44ab8e2a766d924aa6410..f6dcd981b6bddadb7618f022908cbbad67095e1b 100644 --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -113,6 +113,10 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -114,6 +_,10 @@ public static final int UPDATE_LIMIT = 512; protected final StateDefinition stateDefinition; private BlockState defaultBlockState; @@ -19,7 +11,7 @@ index 94b4143449c99ee35db44ab8e2a766d924aa6410..f6dcd981b6bddadb7618f022908cbbad // Paper start - Protect Bedrock and End Portal/Frames from being destroyed public final boolean isDestroyable() { return io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits || -@@ -395,7 +399,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -411,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()) { @@ -28,22 +20,22 @@ index 94b4143449c99ee35db44ab8e2a766d924aa6410..f6dcd981b6bddadb7618f022908cbbad } state.spawnAfterBreak(serverLevel, pos, ItemStack.EMPTY, false); // Paper - Properly handle xp dropping block.popExperience(serverLevel, pos, event.getExpToDrop()); // Paper - Properly handle xp dropping -@@ -413,7 +417,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -429,7 +_,7 @@ - public static void dropResources(BlockState state, LevelAccessor level, BlockPos pos, @Nullable BlockEntity blockEntity) { - if (level instanceof ServerLevel) { -- getDrops(state, (ServerLevel)level, pos, blockEntity).forEach(stack -> popResource((ServerLevel)level, pos, stack)); -+ getDrops(state, (ServerLevel)level, pos, blockEntity).forEach(stack -> popResource((ServerLevel)level, pos, applyLoreFromTile(stack, blockEntity))); // Purpur - Persistent BlockEntity Lore and DisplayName - state.spawnAfterBreak((ServerLevel)level, pos, ItemStack.EMPTY, true); + public static void dropResources(final BlockState state, final LevelAccessor level, final BlockPos pos, final @Nullable BlockEntity blockEntity) { + if (level instanceof ServerLevel serverLevel) { +- getDrops(state, serverLevel, pos, blockEntity).forEach(stack -> popResource(serverLevel, pos, stack)); ++ getDrops(state, serverLevel, pos, blockEntity).forEach(stack -> popResource(serverLevel, pos, applyLoreFromTile(stack, blockEntity))); // Purpur - Persistent BlockEntity Lore and DisplayName + state.spawnAfterBreak(serverLevel, pos, ItemStack.EMPTY, true); } } -@@ -425,11 +429,30 @@ public class Block extends BlockBehaviour implements ItemLike { - public static void dropResources(BlockState state, Level level, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool, boolean dropExperience) { - // Paper end - Properly handle xp dropping - if (level instanceof ServerLevel) { -- getDrops(state, (ServerLevel)level, pos, blockEntity, entity, tool).forEach(stack -> popResource(level, pos, stack)); -+ getDrops(state, (ServerLevel)level, pos, blockEntity, entity, tool).forEach(stack -> popResource(level, pos, applyLoreFromTile(stack, blockEntity))); // Purpur - Persistent BlockEntity Lore and DisplayName - state.spawnAfterBreak((ServerLevel)level, pos, tool, dropExperience); // Paper - Properly handle xp dropping +@@ -450,11 +_,30 @@ + , final boolean dropExperience // Paper - Properly handle xp dropping + ) { + if (level instanceof ServerLevel serverLevel) { +- getDrops(state, serverLevel, pos, blockEntity, breaker, tool).forEach(stack -> popResource(level, pos, stack)); ++ getDrops(state, serverLevel, pos, blockEntity, breaker, tool).forEach(stack -> popResource(level, pos, applyLoreFromTile(stack, blockEntity))); // Purpur - Persistent BlockEntity Lore and DisplayName + state.spawnAfterBreak(serverLevel, pos, tool, dropExperience); // Paper - Properly handle xp dropping } } @@ -66,13 +58,14 @@ index 94b4143449c99ee35db44ab8e2a766d924aa6410..f6dcd981b6bddadb7618f022908cbbad + } + // Purpur end - Persistent BlockEntity Lore and DisplayName + - public static void popResource(Level level, BlockPos pos, ItemStack stack) { - double d = EntityType.ITEM.getHeight() / 2.0; - double d1 = pos.getX() + 0.5 + Mth.nextDouble(level.random, -0.25, 0.25); -@@ -509,7 +532,15 @@ public class Block extends BlockBehaviour implements ItemLike { + public static void popResource(final Level level, final BlockPos pos, final ItemStack itemStack) { + double halfHeight = EntityType.ITEM.getHeight() / 2.0; + RandomSource random = level.getRandom(); +@@ -544,7 +_,15 @@ } - public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + public void setPlacedBy(final Level level, final BlockPos pos, final BlockState state, final @Nullable LivingEntity by, final ItemStack itemStack) { +- } + this.placer = placer; // Purpur - Store placer on Block when placed + } + @@ -80,17 +73,17 @@ index 94b4143449c99ee35db44ab8e2a766d924aa6410..f6dcd981b6bddadb7618f022908cbbad + @Nullable protected LivingEntity placer = null; + public void forgetPlacer() { + this.placer = null; - } ++ } + // Purpur end - Store placer on Block when placed - public boolean isPossibleToRespawnInThis(BlockState state) { + public boolean isPossibleToRespawnInThis(final BlockState state) { return !state.isSolid() && !state.liquid(); -@@ -520,7 +551,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -555,7 +_,7 @@ } - public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance) { + public void fallOn(final Level level, final BlockState state, final BlockPos pos, final Entity entity, final double fallDistance) { - entity.causeFallDamage(fallDistance, 1.0F, entity.damageSources().fall()); + entity.causeFallDamage(fallDistance * fallDistanceMultiplier, fallDamageMultiplier, entity.damageSources().fall()); // Purpur - Configurable block fall damage modifiers } - public void updateEntityMovementAfterFallOn(BlockGetter level, Entity entity) { + public void updateEntityMovementAfterFallOn(final BlockGetter level, final Entity entity) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Blocks.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch similarity index 59% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Blocks.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch index 45e9d9216..7522dd712 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/Blocks.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/Blocks.java b/net/minecraft/world/level/block/Blocks.java -index 2eb6fe73adeda3e525e147b7f7034bdec651e04a..4001a0c25796cd33d110b4f534590c342b1f37fc 100644 --- a/net/minecraft/world/level/block/Blocks.java +++ b/net/minecraft/world/level/block/Blocks.java -@@ -6806,6 +6806,7 @@ public class Blocks { +@@ -6726,6 +_,7 @@ BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() @@ -16,7 +8,7 @@ index 2eb6fe73adeda3e525e147b7f7034bdec651e04a..4001a0c25796cd33d110b4f534590c34 .instabreak() .sound(SoundType.AZALEA) .noOcclusion() -@@ -6817,6 +6818,7 @@ public class Blocks { +@@ -6737,6 +_,7 @@ BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch new file mode 100644 index 000000000..b281dfb7b --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch @@ -0,0 +1,17 @@ +--- a/net/minecraft/world/level/block/BubbleColumnBlock.java ++++ b/net/minecraft/world/level/block/BubbleColumnBlock.java +@@ -118,11 +_,11 @@ + if (belowState.is(bubbleColumn)) { + return belowState; + } else if (belowState.is(BlockTags.ENABLES_BUBBLE_COLUMN_PUSH_UP)) { +- return bubbleColumn.defaultBlockState().setValue(DRAG_DOWN, false); ++ return bubbleColumn.defaultBlockState().setValue(DRAG_DOWN, org.purpurmc.purpur.PurpurConfig.soulSandBlockReverseBubbleColumnFlow); // Purpur - Config to reverse bubble column flow + } else if (belowState.is(BlockTags.ENABLES_BUBBLE_COLUMN_DRAG_DOWN)) { +- return bubbleColumn.defaultBlockState().setValue(DRAG_DOWN, true); ++ return bubbleColumn.defaultBlockState().setValue(DRAG_DOWN, !org.purpurmc.purpur.PurpurConfig.magmaBlockReverseBubbleColumnFlow); + } else { +- return occupyState.is(bubbleColumn) ? Blocks.WATER.defaultBlockState() : occupyState; ++ return occupyState.is(bubbleColumn) ? Blocks.WATER.defaultBlockState() : occupyState; // Purpur - Config to reverse bubble column flow + } + } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CactusBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CactusBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch index bf7cb9526..9e0b334fe 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CactusBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CactusBlock.java b/net/minecraft/world/level/block/CactusBlock.java -index 9662828596de15e5b855f12d2a3b014763b3fc2e..f6a20e5676136389cd504af503c1207d339aa70c 100644 --- a/net/minecraft/world/level/block/CactusBlock.java +++ b/net/minecraft/world/level/block/CactusBlock.java -@@ -22,7 +22,7 @@ import net.minecraft.world.level.pathfinder.PathComputationType; +@@ -22,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -17,17 +9,17 @@ index 9662828596de15e5b855f12d2a3b014763b3fc2e..f6a20e5676136389cd504af503c1207d public static final MapCodec CODEC = simpleCodec(CactusBlock::new); public static final IntegerProperty AGE = BlockStateProperties.AGE_15; public static final int MAX_AGE = 15; -@@ -117,7 +117,7 @@ public class CactusBlock extends Block { - protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { +@@ -117,7 +_,7 @@ + protected boolean canSurvive(final BlockState state, final LevelReader level, final BlockPos pos) { for (Direction direction : Direction.Plane.HORIZONTAL) { - BlockState blockState = level.getBlockState(pos.relative(direction)); -- if (blockState.isSolid() || level.getFluidState(pos.relative(direction)).is(FluidTags.LAVA)) { -+ if ((level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.cactusBreaksFromSolidNeighbors) && blockState.isSolid() || level.getFluidState(pos.relative(direction)).is(FluidTags.LAVA)) { // Purpur - Cactus breaks from solid neighbors config + BlockState neighbor = level.getBlockState(pos.relative(direction)); +- if (neighbor.isSolid() || level.getFluidState(pos.relative(direction)).is(FluidTags.LAVA)) { ++ if ((level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.cactusBreaksFromSolidNeighbors) && neighbor.isSolid() || level.getFluidState(pos.relative(direction)).is(FluidTags.LAVA)) { // Purpur - Cactus breaks from solid neighbors config return false; } } -@@ -141,4 +141,34 @@ public class CactusBlock extends Block { - protected boolean isPathfindable(BlockState state, PathComputationType pathComputationType) { +@@ -148,4 +_,34 @@ + protected boolean isPathfindable(final BlockState state, final PathComputationType type) { return false; } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CakeBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CakeBlock.java.patch similarity index 59% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CakeBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CakeBlock.java.patch index 8814e9c35..2ae18d122 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CakeBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CakeBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CakeBlock.java b/net/minecraft/world/level/block/CakeBlock.java -index cca7bde128f88df4327e6b011c301f60d909bb4d..576e00d1e9eb2a692b1ee0f1086ee0db230d4e7e 100644 --- a/net/minecraft/world/level/block/CakeBlock.java +++ b/net/minecraft/world/level/block/CakeBlock.java -@@ -109,6 +109,7 @@ public class CakeBlock extends Block { +@@ -118,6 +_,7 @@ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, 2 + oldFoodLevel); if (!event.isCancelled()) { 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 new file mode 100644 index 000000000..b4334e407 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CampfireBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/CampfireBlock.java ++++ b/net/minecraft/world/level/block/CampfireBlock.java +@@ -136,7 +_,7 @@ + return this.defaultBlockState() + .setValue(WATERLOGGED, replacedWater) + .setValue(SIGNAL_FIRE, this.isSmokeSource(level.getBlockState(pos.below()))) +- .setValue(LIT, !replacedWater) ++ .setValue(LIT, level.getMinecraftWorld().purpurConfig.campFireLitWhenPlaced && !replacedWater) // Purpur - Campfire option for lit when placed + .setValue(FACING, context.getHorizontalDirection()); + } + 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 new file mode 100644 index 000000000..feaa44a3c --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch @@ -0,0 +1,50 @@ +--- a/net/minecraft/world/level/block/CarvedPumpkinBlock.java ++++ b/net/minecraft/world/level/block/CarvedPumpkinBlock.java +@@ -67,7 +_,7 @@ + if (snowGolemMatch != null) { + SnowGolem snowGolem = EntityType.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 + return; + } + } +@@ -77,7 +_,7 @@ + IronGolem ironGolem = EntityType.IRON_GOLEM.create(level, EntitySpawnReason.TRIGGERED); + if (ironGolem != null) { + ironGolem.setPlayerCreated(true); +- spawnGolemInWorld(level, ironGolemMatch, ironGolem, ironGolemMatch.getBlock(1, 2, 0).getPos()); ++ spawnGolemInWorld(level, ironGolemMatch, ironGolem, ironGolemMatch.getBlock(1, 2, 0).getPos(), this.placer); // Purpur - Summoner API + return; + } + } +@@ -86,7 +_,7 @@ + if (copperGolemMatch != null) { + CopperGolem copperGolem = EntityType.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 + if (!copperGolem.valid) return; // Paper - entityspawnevent - entity was not added to the world so prevent world mutation + this.replaceCopperBlockWithChest(level, copperGolemMatch); + copperGolem.spawn(this.getWeatherStateFromPattern(copperGolemMatch)); +@@ -105,7 +_,20 @@ + .getAge(); + } + ++ @io.papermc.paper.annotation.DoNotUse + private static void spawnGolemInWorld(final Level level, final BlockPattern.BlockPatternMatch match, final Entity golem, final BlockPos spawnPos) { ++ // Purpur start - Summoner API ++ spawnGolemInWorld(level, match, golem, spawnPos, null); ++ } ++ private static void spawnGolemInWorld(final Level level, final BlockPattern.BlockPatternMatch match, final Entity golem, final BlockPos spawnPos, final net.minecraft.world.entity.LivingEntity placer) { ++ java.util.UUID summoner = placer == null ? null : placer.getUUID(); ++ switch (golem) { ++ case SnowGolem snowGolem -> snowGolem.setSummoner(summoner); ++ case IronGolem ironGolem -> ironGolem.setSummoner(summoner); ++ case CopperGolem copperGolem -> copperGolem.setSummoner(summoner); ++ default -> throw new IllegalStateException("Unexpected value: " + golem); ++ } ++ // Purpur end - Summoner API + // clearPatternBlocks(level, patternMatch); // Paper - moved down + golem.snapTo(spawnPos.getX() + 0.5, spawnPos.getY() + 0.05, spawnPos.getZ() + 0.5, 0.0F, 0.0F); + // Paper start diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CauldronBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CauldronBlock.java.patch similarity index 52% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CauldronBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CauldronBlock.java.patch index bb22bb26d..62d14bb02 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CauldronBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CauldronBlock.java.patch @@ -1,16 +1,8 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CauldronBlock.java b/net/minecraft/world/level/block/CauldronBlock.java -index 523a769ce8f73b2f216d0768ab8f2f9f1bfa949d..703c15dfc3dd0b209502c0a0b75d714318e608a8 100644 --- a/net/minecraft/world/level/block/CauldronBlock.java +++ b/net/minecraft/world/level/block/CauldronBlock.java -@@ -32,8 +32,8 @@ public class CauldronBlock extends AbstractCauldronBlock { +@@ -32,8 +_,8 @@ - protected static boolean shouldHandlePrecipitation(Level level, Biome.Precipitation precipitation) { + protected static boolean shouldHandlePrecipitation(final Level level, final Biome.Precipitation precipitation) { return precipitation == Biome.Precipitation.RAIN - ? level.getRandom().nextFloat() < 0.05F - : precipitation == Biome.Precipitation.SNOW && level.getRandom().nextFloat() < 0.1F; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch new file mode 100644 index 000000000..da733faab --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/level/block/CaveVinesBlock.java ++++ b/net/minecraft/world/level/block/CaveVinesBlock.java +@@ -95,4 +_,11 @@ + public void performBonemeal(final ServerLevel level, final RandomSource random, final BlockPos pos, final BlockState state) { + level.setBlock(pos, state.setValue(BERRIES, true), Block.UPDATE_CLIENTS); + } ++ ++ // Purpur start - cave vines configurable max growth age ++ @Override ++ public int getMaxGrowthAge() { ++ return org.purpurmc.purpur.PurpurConfig.caveVinesMaxGrowthAge; ++ } ++ // Purpur end - cave vines configurable max growth age + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch new file mode 100644 index 000000000..d68bac732 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/ChangeOverTimeBlock.java ++++ b/net/minecraft/world/level/block/ChangeOverTimeBlock.java +@@ -51,7 +_,7 @@ + } + + float chance = (float)(olderCount + 1) / (olderCount + sameAgeCount + 1); +- float actualChance = chance * chance * this.getChanceModifier(); ++ float actualChance = level.purpurConfig.disableOxidationProximityPenalty ? this.getChanceModifier() : chance * chance * this.getChanceModifier(); // Purpur - option to disable the copper oxidation proximity penalty + return random.nextFloat() < actualChance ? this.getNext(state) : Optional.empty(); + } + } 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 new file mode 100644 index 000000000..a4633db1b --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ChestBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/ChestBlock.java ++++ b/net/minecraft/world/level/block/ChestBlock.java +@@ -380,6 +_,7 @@ + } + + public static boolean isBlockedChestByBlock(final BlockGetter level, final BlockPos pos) { ++ if (level instanceof Level level1 && level1.purpurConfig.chestOpenWithBlockOnTop) return false; // Purpur - Option for chests to open even with a solid block on top + BlockPos above = pos.above(); + return level.getBlockState(above).isRedstoneConductor(level, above); + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ComposterBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ComposterBlock.java.patch new file mode 100644 index 000000000..a0e7dc452 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ComposterBlock.java.patch @@ -0,0 +1,66 @@ +--- a/net/minecraft/world/level/block/ComposterBlock.java ++++ b/net/minecraft/world/level/block/ComposterBlock.java +@@ -256,23 +_,52 @@ + ) { + int fillLevel = state.getValue(LEVEL); + if (fillLevel < 8 && COMPOSTABLES.containsKey(itemStack.getItem())) { +- if (fillLevel < 7 && !level.isClientSide()) { +- BlockState newState = addItem(player, state, level, pos, itemStack); +- // Paper start - handle cancelled events +- if (newState == null) { +- return InteractionResult.PASS; +- } +- // Paper end +- level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != newState ? 1 : 0); +- player.awardStat(Stats.ITEM_USED.get(itemStack.getItem())); +- itemStack.consume(1, player); +- } ++ // Purpur start - sneak to bulk process composter ++ BlockState newState = process(fillLevel, player, state, level, pos, itemStack); ++ if (newState == null) { ++ return InteractionResult.PASS; ++ } ++ if (level.purpurConfig.composterBulkProcess && player.isShiftKeyDown() && newState != state) { ++ BlockState oldState; ++ int oldCount, newCount, oldLevel, newLevel; ++ do { ++ oldState = newState; ++ oldCount = itemStack.getCount(); ++ oldLevel = oldState.getValue(ComposterBlock.LEVEL); ++ newState = process(oldLevel, player, oldState, level, pos, itemStack); ++ if (newState == null) { ++ return InteractionResult.PASS; ++ } ++ newCount = itemStack.getCount(); ++ newLevel = newState.getValue(ComposterBlock.LEVEL); ++ } while (newCount > 0 && (newCount != oldCount || newLevel != oldLevel || newState != oldState)); ++ } ++ // Purpur end - Sneak to bulk process composter + + return InteractionResult.SUCCESS; + } else { + return super.useItemOn(itemStack, state, level, pos, player, hand, hitResult); + } + } ++ ++ // Purpur start - sneak to bulk process composter ++ private static @Nullable BlockState process(int fillLevel, Player player, BlockState state, Level level, BlockPos pos, ItemStack itemStack) { ++ if (fillLevel < 7 && !level.isClientSide()) { ++ BlockState newState = ComposterBlock.addItem(player, state, level, pos, itemStack); ++ // Paper start - handle cancelled events ++ if (newState == null) { ++ return null; ++ } ++ // Paper end ++ ++ level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != newState ? 1 : 0); ++ player.awardStat(Stats.ITEM_USED.get(itemStack.getItem())); ++ itemStack.consume(1, player); ++ return newState; ++ } ++ return state; ++ } ++ // Purpur end - Sneak to bulk process composter + + @Override + protected InteractionResult useWithoutItem( diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CoralBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CoralBlock.java.patch new file mode 100644 index 000000000..e9c5540b2 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CoralBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/CoralBlock.java ++++ b/net/minecraft/world/level/block/CoralBlock.java +@@ -65,6 +_,7 @@ + } + + protected boolean scanForWater(final BlockGetter level, final BlockPos blockPos) { ++ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die + for (Direction direction : Direction.values()) { + FluidState fluidState = level.getFluidState(blockPos.relative(direction)); + if (fluidState.is(FluidTags.WATER)) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CropBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CropBlock.java.patch similarity index 69% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CropBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CropBlock.java.patch index fd5704f4e..d88f01f66 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CropBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/CropBlock.java.patch @@ -1,24 +1,16 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CropBlock.java b/net/minecraft/world/level/block/CropBlock.java -index 1cf40fafd822d976ef4822335c60d8017659916f..3983a5fa08f748ed26caa1d16e194676baa8028e 100644 --- a/net/minecraft/world/level/block/CropBlock.java +++ b/net/minecraft/world/level/block/CropBlock.java -@@ -169,7 +169,7 @@ public class CropBlock extends VegetationBlock implements BonemealableBlock { - @Override - protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier, boolean pastEdges) { +@@ -177,7 +_,7 @@ + final boolean isPrecise + ) { if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent - if (level instanceof ServerLevel serverLevel && entity instanceof Ravager && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !serverLevel.getGameRules().get(GameRules.MOB_GRIEFING))) { // CraftBukkit + if (level instanceof ServerLevel serverLevel && entity instanceof Ravager && serverLevel.purpurConfig.ravagerGriefableBlocks.contains(serverLevel.getBlockState(pos).getBlock()) && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !serverLevel.getGameRules().get(GameRules.MOB_GRIEFING))) { // CraftBukkit // Purpur - Configurable ravager griefable blocks list serverLevel.destroyBlock(pos, true, entity); } -@@ -204,4 +204,15 @@ public class CropBlock extends VegetationBlock implements BonemealableBlock { - protected void createBlockStateDefinition(StateDefinition.Builder builder) { +@@ -212,4 +_,15 @@ + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { builder.add(AGE); } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DoorBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DoorBlock.java.patch similarity index 63% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DoorBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DoorBlock.java.patch index 161b2691c..daba7e98b 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DoorBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DoorBlock.java.patch @@ -1,24 +1,16 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/DoorBlock.java b/net/minecraft/world/level/block/DoorBlock.java -index d4239343b15203caafa9da762cbce206cc1d9b33..523bab9194e6fa5145fbf31f0bee9a4792ad6315 100644 --- a/net/minecraft/world/level/block/DoorBlock.java +++ b/net/minecraft/world/level/block/DoorBlock.java -@@ -198,6 +198,7 @@ public class DoorBlock extends Block { - protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { +@@ -200,6 +_,7 @@ + protected InteractionResult useWithoutItem(BlockState state, final Level level, final BlockPos pos, final Player player, final BlockHitResult hitResult) { if (!this.type.canOpenByHand()) { return InteractionResult.PASS; + } else if (requiresRedstone(level, state, pos)) { return InteractionResult.CONSUME; // Purpur - Option to make doors require redstone } else { state = state.cycle(OPEN); level.setBlock(pos, state, Block.UPDATE_CLIENTS | Block.UPDATE_IMMEDIATE); -@@ -286,4 +287,18 @@ public class DoorBlock extends Block { - public static boolean isWoodenDoor(BlockState state) { - return state.getBlock() instanceof DoorBlock doorBlock && doorBlock.type().canOpenByHand(); +@@ -288,4 +_,18 @@ + public static boolean isWoodenDoor(final BlockState state) { + return state.getBlock() instanceof DoorBlock door && door.type().canOpenByHand(); } + + // Purpur start - Option to make doors require redstone diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DragonEggBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DragonEggBlock.java.patch new file mode 100644 index 000000000..088122b0c --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/DragonEggBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/DragonEggBlock.java ++++ b/net/minecraft/world/level/block/DragonEggBlock.java +@@ -49,6 +_,7 @@ + } + + private void teleport(final BlockState state, final Level level, final BlockPos pos) { ++ if (!level.purpurConfig.dragonEggTeleport) return; // Purpur - Option to disable dragon egg teleporting + WorldBorder worldBorder = level.getWorldBorder(); + RandomSource random = level.getRandom(); + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch new file mode 100644 index 000000000..7237e82a9 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch @@ -0,0 +1,63 @@ +--- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java ++++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +@@ -38,12 +_,12 @@ + + @Override + public BlockState getStateForPlacement(final RandomSource random) { +- return this.defaultBlockState().setValue(AGE, random.nextInt(25)); ++ return this.defaultBlockState().setValue(AGE, getMaxGrowthAge() == 0 ? 0 : random.nextInt(getMaxGrowthAge())); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } + + @Override + protected boolean isRandomlyTicking(final BlockState state) { +- return state.getValue(AGE) < 25; ++ return state.getValue(AGE) < getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } + + @Override +@@ -59,7 +_,7 @@ + } else if (this == Blocks.CAVE_VINES) { + modifier = level.spigotConfig.caveVinesModifier; + } +- if (state.getValue(AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution ++ if (state.getValue(AGE) < getMaxGrowthAge() && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution // Purpur - kelp, cave, weeping, and twisting configurable max growth age + // Spigot end + BlockPos growthPos = pos.relative(this.growthDirection); + if (this.canGrowInto(level.getBlockState(growthPos))) { +@@ -79,11 +_,11 @@ + } + + public BlockState getMaxAgeState(final BlockState fromState) { +- return fromState.setValue(AGE, 25); ++ return fromState.setValue(AGE, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } + + public boolean isMaxAge(final BlockState state) { +- return state.getValue(AGE) == 25; ++ return state.getValue(AGE) >= getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } + + protected BlockState updateBodyAfterConvertedFromHead(final BlockState headState, final BlockState bodyState) { +@@ -142,13 +_,13 @@ + @Override + public void performBonemeal(final ServerLevel level, final RandomSource random, final BlockPos pos, final BlockState state) { + BlockPos forwardPos = pos.relative(this.growthDirection); +- int nextAge = Math.min(state.getValue(AGE) + 1, 25); ++ int nextAge = Math.min(state.getValue(AGE) + 1, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + int blocksToGrow = this.getBlocksToGrowWhenBonemealed(random); + + for (int i = 0; i < blocksToGrow && this.canGrowInto(level.getBlockState(forwardPos)) && !level.isOutsideBuildHeight(forwardPos); i++) { + level.setBlockAndUpdate(forwardPos, state.setValue(AGE, nextAge)); + forwardPos = forwardPos.relative(this.growthDirection); +- nextAge = Math.min(nextAge + 1, 25); ++ nextAge = Math.min(nextAge + 1, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } + } + +@@ -160,4 +_,6 @@ + protected GrowingPlantHeadBlock getHeadBlock() { + return this; + } ++ ++ public abstract int getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/HayBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/HayBlock.java.patch new file mode 100644 index 000000000..bab838945 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/HayBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/HayBlock.java ++++ b/net/minecraft/world/level/block/HayBlock.java +@@ -23,6 +_,6 @@ + + @Override + public void fallOn(final Level level, final BlockState state, final BlockPos pos, final Entity entity, final double fallDistance) { +- entity.causeFallDamage(fallDistance, 0.2F, level.damageSources().fall()); ++ super.fallOn(level, state, pos, entity, fallDistance); // Purpur - Configurable block fall damage modifiers + } + } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/IceBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/IceBlock.java.patch similarity index 64% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/IceBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/IceBlock.java.patch index 0fd0c5b4a..e76374e26 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/IceBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/IceBlock.java.patch @@ -1,25 +1,17 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/IceBlock.java b/net/minecraft/world/level/block/IceBlock.java -index f29af8c07b80192bf8518ea6b356a52cda94b0f1..759671ad9bab4a00dcf0e970579c2be5c957e2ab 100644 --- a/net/minecraft/world/level/block/IceBlock.java +++ b/net/minecraft/world/level/block/IceBlock.java -@@ -41,7 +41,7 @@ public class IceBlock extends HalfTransparentBlock { - public void afterDestroy(Level level, BlockPos pos, ItemStack stack) { +@@ -49,7 +_,7 @@ + public void afterDestroy(Level level, BlockPos pos, ItemStack destroyedWith) { // Paper end - Improve Block#breakNaturally API - if (!EnchantmentHelper.hasTag(stack, EnchantmentTags.PREVENTS_ICE_MELTING)) { + if (!EnchantmentHelper.hasTag(destroyedWith, EnchantmentTags.PREVENTS_ICE_MELTING)) { - if (level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos)) { + if ((level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd) || level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos)) { // Purpur - Add allow water in end world option level.removeBlock(pos, false); return; } -@@ -62,7 +62,7 @@ public class IceBlock extends HalfTransparentBlock { +@@ -70,7 +_,7 @@ - protected void melt(BlockState state, Level level, BlockPos pos) { + protected void melt(final BlockState state, final Level level, final BlockPos pos) { // Paper start - call BlockFadeEvent - final boolean waterEvaporates = level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos); + final boolean waterEvaporates = (level.isTheEnd() && !org.purpurmc.purpur.PurpurConfig.allowWaterPlacementInTheEnd) || level.environmentAttributes().getValue(EnvironmentAttributes.WATER_EVAPORATES, pos); // Purpur - Add allow water in end diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/KelpBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/KelpBlock.java.patch new file mode 100644 index 000000000..b9063f6a6 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/KelpBlock.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/level/block/KelpBlock.java ++++ b/net/minecraft/world/level/block/KelpBlock.java +@@ -72,4 +_,11 @@ + protected FluidState getFluidState(final BlockState state) { + return Fluids.WATER.getSource(false); + } ++ ++ // Purpur start - kelp vines configurable max growth age ++ @Override ++ public int getMaxGrowthAge() { ++ return org.purpurmc.purpur.PurpurConfig.kelpMaxGrowthAge; ++ } ++ // Purpur end - kelp vines configurable max growth age + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/LiquidBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/LiquidBlock.java.patch new file mode 100644 index 000000000..a90ace456 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/LiquidBlock.java.patch @@ -0,0 +1,29 @@ +--- a/net/minecraft/world/level/block/LiquidBlock.java ++++ b/net/minecraft/world/level/block/LiquidBlock.java +@@ -149,7 +_,7 @@ + + @Override + protected void onPlace(final BlockState state, final Level level, final BlockPos pos, final BlockState oldState, final boolean movedByPiston) { +- if (this.shouldSpreadLiquid(level, pos, state)) { ++ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config + level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava + } + +@@ -199,7 +_,7 @@ + final BlockState neighbourState, + final RandomSource random + ) { +- if (state.getFluidState().isSource() || neighbourState.getFluidState().isSource()) { ++ if ((level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.tickFluids) && state.getFluidState().isSource() || neighbourState.getFluidState().isSource()) { // Purpur - Tick fluids config + ticks.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(level)); + } + +@@ -218,7 +_,7 @@ + protected void neighborChanged( + final BlockState state, final Level level, final BlockPos pos, final Block block, final @Nullable Orientation orientation, final boolean movedByPiston + ) { +- if (this.shouldSpreadLiquid(level, pos, state)) { ++ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config + level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava + } + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/MagmaBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/MagmaBlock.java.patch new file mode 100644 index 000000000..48e46157f --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/MagmaBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/MagmaBlock.java ++++ b/net/minecraft/world/level/block/MagmaBlock.java +@@ -22,7 +_,7 @@ + + @Override + public void stepOn(final Level level, final BlockPos pos, final BlockState onState, final Entity entity) { +- if (!entity.isSteppingCarefully() && entity instanceof LivingEntity) { ++ if ((!entity.isSteppingCarefully() || level.purpurConfig.magmaBlockDamageWhenSneaking) && entity instanceof LivingEntity) { // Purpur - Configurable damage settings for magma blocks + entity.hurt(level.damageSources().hotFloor().eventBlockDamager(level, pos), 1.0F); // CraftBukkit + } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch similarity index 59% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch index da4b6004b..34f372af9 100644 --- a/purpur-server/minecraft-patches/unapplied-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,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java -index 653b72855197733b33e310b0ccd4fbf04e22e95f..860e0c3ab118d8c6863936b9c2603bf6a278ca99 100644 --- a/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/net/minecraft/world/level/block/NetherPortalBlock.java -@@ -68,7 +68,7 @@ public class NetherPortalBlock extends Block implements Portal { - protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { +@@ -68,7 +_,7 @@ + protected void randomTick(final BlockState state, final ServerLevel level, BlockPos pos, final RandomSource random) { if (level.spigotConfig.enableZombiePigmenPortalSpawns && level.isSpawningMonsters() // Spigot && level.environmentAttributes().getValue(EnvironmentAttributes.NETHER_PORTAL_SPAWNS_PIGLINS, pos) - && random.nextInt(2000) < level.getDifficulty().getId() @@ -17,9 +9,9 @@ index 653b72855197733b33e310b0ccd4fbf04e22e95f..860e0c3ab118d8c6863936b9c2603bf6 && level.anyPlayerCloseEnoughForSpawning(pos)) { while (level.getBlockState(pos).is(this)) { pos = pos.below(); -@@ -126,7 +126,7 @@ public class NetherPortalBlock extends Block implements Portal { +@@ -133,7 +_,7 @@ @Override - public int getPortalTransitionTime(ServerLevel level, Entity entity) { + public int getPortalTransitionTime(final ServerLevel level, final Entity entity) { return entity instanceof Player player - ? Math.max( + ? player.canPortalInstant ? 1 : Math.max( // Purpur - Add portal permission bypass diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NetherWartBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch similarity index 78% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NetherWartBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch index 9d6e52fe9..5e4ed3477 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NetherWartBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NetherWartBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/NetherWartBlock.java b/net/minecraft/world/level/block/NetherWartBlock.java -index 40f90b2822cc1e6ddb759f38098e7dc49b53b8b8..5676fc8ff8ec4edb4d83c5a0e6529af3b5a18dc6 100644 --- a/net/minecraft/world/level/block/NetherWartBlock.java +++ b/net/minecraft/world/level/block/NetherWartBlock.java -@@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty; +@@ -17,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -17,8 +9,8 @@ index 40f90b2822cc1e6ddb759f38098e7dc49b53b8b8..5676fc8ff8ec4edb4d83c5a0e6529af3 public static final MapCodec CODEC = simpleCodec(NetherWartBlock::new); public static final int MAX_AGE = 3; public static final IntegerProperty AGE = BlockStateProperties.AGE_3; -@@ -65,4 +65,34 @@ public class NetherWartBlock extends VegetationBlock { - protected void createBlockStateDefinition(StateDefinition.Builder builder) { +@@ -66,4 +_,34 @@ + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { builder.add(AGE); } + diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NoteBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NoteBlock.java.patch new file mode 100644 index 000000000..7c2337a5a --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/NoteBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/NoteBlock.java ++++ b/net/minecraft/world/level/block/NoteBlock.java +@@ -103,7 +_,7 @@ + } + + private void playNote(final @Nullable Entity source, final BlockState state, final Level level, final BlockPos pos) { +- if (state.getValue(INSTRUMENT).worksAboveNoteBlock() || level.getBlockState(pos.above()).isAir()) { ++ if (level.purpurConfig.noteBlockIgnoreAbove || state.getValue(INSTRUMENT).worksAboveNoteBlock() || level.getBlockState(pos.above()).isAir()) { // Purpur - Config to allow Note Block sounds when blocked + level.blockEvent(pos, this, 0, 0); + level.gameEvent(source, GameEvent.NOTE_BLOCK_PLAY, pos); + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ObserverBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ObserverBlock.java.patch new file mode 100644 index 000000000..26c62a2d5 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/ObserverBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/ObserverBlock.java ++++ b/net/minecraft/world/level/block/ObserverBlock.java +@@ -81,6 +_,7 @@ + final RandomSource random + ) { + if (state.getValue(FACING) == directionToNeighbour && !state.getValue(POWERED)) { ++ if (!(level.getWorldBorder().world != null && level.getWorldBorder().world.purpurConfig.disableObserverClocks) || !(neighbourState.getBlock() instanceof ObserverBlock) || neighbourState.getValue(ObserverBlock.FACING).getOpposite() != directionToNeighbour) // Purpur - Add Option for disable observer clocks + this.startSignal(level, ticks, pos); + } + 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 new file mode 100644 index 000000000..e194d2759 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch @@ -0,0 +1,26 @@ +--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java ++++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java +@@ -194,20 +_,20 @@ + + @VisibleForTesting + public static void maybeTransferFluid(final BlockState state, final ServerLevel level, final BlockPos pos, final float randomValue) { +- if (!(randomValue > 0.17578125F) || !(randomValue > 0.05859375F)) { ++ if (!(randomValue > level.purpurConfig.cauldronDripstoneWaterFillChance) || !(randomValue > level.purpurConfig.cauldronDripstoneLavaFillChance)) { // Purpur - Cauldron fill chances + if (isStalactiteStartPos(state, level, pos)) { + Optional fluidInfo = getFluidAboveStalactite(level, pos, state); + if (!fluidInfo.isEmpty()) { + Fluid fluid = fluidInfo.get().fluid; + float transferProbability; + if (fluid == Fluids.WATER) { +- transferProbability = 0.17578125F; ++ transferProbability = level.purpurConfig.cauldronDripstoneWaterFillChance; // Purpur - Cauldron fill chances + } else { + if (fluid != Fluids.LAVA) { + return; + } + +- transferProbability = 0.05859375F; ++ transferProbability = level.purpurConfig.cauldronDripstoneLavaFillChance; // Purpur - Cauldron fill chances + } + + if (!(randomValue >= transferProbability)) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch new file mode 100644 index 000000000..3f1ed1d51 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/PoweredRailBlock.java ++++ b/net/minecraft/world/level/block/PoweredRailBlock.java +@@ -28,7 +_,7 @@ + } + + protected boolean findPoweredRailSignal(final Level level, final BlockPos pos, final BlockState state, final boolean forward, final int searchDepth) { +- if (searchDepth >= 8) { ++ if (searchDepth >= level.purpurConfig.railActivationRange) { // Purpur - Config for powered rail activation distance + return false; + } else { + int x = pos.getX(); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch new file mode 100644 index 000000000..6108d0a7f --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/RespawnAnchorBlock.java ++++ b/net/minecraft/world/level/block/RespawnAnchorBlock.java +@@ -180,7 +_,7 @@ + } + }; + Vec3 boomPos = pos.getCenter(); +- level.explode(null, level.damageSources().badRespawnPointExplosion(boomPos).causingBlockSnapshot(blockState), damageCalculator, boomPos, 5.0F, true, Level.ExplosionInteraction.BLOCK); // CraftBukkit - add state ++ level.explode(null, level.damageSources().badRespawnPointExplosion(boomPos).causingBlockSnapshot(blockState), damageCalculator, boomPos, (float) level.purpurConfig.respawnAnchorExplosionPower, level.purpurConfig.respawnAnchorExplosionFire, level.purpurConfig.respawnAnchorExplosionEffect); // CraftBukkit - add state // Purpur - Implement respawn anchor explosion options + } + + public static boolean canSetSpawn(final ServerLevel level, final BlockPos pos) { 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 new file mode 100644 index 000000000..5785d589b --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/block/SculkShriekerBlock.java ++++ b/net/minecraft/world/level/block/SculkShriekerBlock.java +@@ -116,7 +_,7 @@ + + @Override + public @Nullable BlockState getStateForPlacement(final BlockPlaceContext context) { +- return this.defaultBlockState().setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).is(Fluids.WATER)); ++ return this.defaultBlockState().setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).is(Fluids.WATER)).setValue(SculkShriekerBlock.CAN_SUMMON, context.getLevel().purpurConfig.sculkShriekerCanSummonDefault); // Purpur - Config for sculk shrieker can_summon state; + } + + @Override 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..a9e3deee4 --- /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 +@@ -85,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; + } else { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SlabBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch similarity index 73% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SlabBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch index 34a7fd948..d26a15acf 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SlabBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SlabBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SlabBlock.java b/net/minecraft/world/level/block/SlabBlock.java -index 6d7b63e9afd60ef7cf5332077b13941914a32109..20a7a75c5fb9171c0f8d91b09a2d2865b196ce97 100644 --- a/net/minecraft/world/level/block/SlabBlock.java +++ b/net/minecraft/world/level/block/SlabBlock.java -@@ -143,4 +143,25 @@ public class SlabBlock extends Block implements SimpleWaterloggedBlock { +@@ -143,4 +_,25 @@ return false; } } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch new file mode 100644 index 000000000..d45e0b517 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/SnowLayerBlock.java ++++ b/net/minecraft/world/level/block/SnowLayerBlock.java +@@ -76,6 +_,7 @@ + @Override + protected boolean canSurvive(final BlockState state, final LevelReader level, final BlockPos pos) { + BlockState belowState = level.getBlockState(pos.below()); ++ if (belowState.is(Blocks.BLUE_ICE) && !(level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.snowOnBlueIce)) return false; // Purpur - Add config for snow on blue ice + return !belowState.is(BlockTags.CANNOT_SUPPORT_SNOW_LAYER) + && ( + belowState.is(BlockTags.SUPPORT_OVERRIDE_SNOW_LAYER) diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpawnerBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch similarity index 82% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpawnerBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch index 7783ee91c..29afa8563 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpawnerBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpawnerBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SpawnerBlock.java b/net/minecraft/world/level/block/SpawnerBlock.java -index 119ed91439909d44d36c3a9822d2b11525a22f00..fbcb5183d188bc1caa74ebbbb475d15a6d19dc61 100644 --- a/net/minecraft/world/level/block/SpawnerBlock.java +++ b/net/minecraft/world/level/block/SpawnerBlock.java -@@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockState; +@@ -15,6 +_,7 @@ import org.jspecify.annotations.Nullable; public class SpawnerBlock extends BaseEntityBlock { @@ -16,8 +8,8 @@ index 119ed91439909d44d36c3a9822d2b11525a22f00..fbcb5183d188bc1caa74ebbbb475d15a public static final MapCodec CODEC = simpleCodec(SpawnerBlock::new); @Override -@@ -37,6 +38,62 @@ public class SpawnerBlock extends BaseEntityBlock { - ); +@@ -36,6 +_,62 @@ + return createTickerHelper(type, BlockEntityType.MOB_SPAWNER, level.isClientSide() ? SpawnerBlockEntity::clientTick : SpawnerBlockEntity::serverTick); } + // Purpur start - Silk touch spawners @@ -77,13 +69,13 @@ index 119ed91439909d44d36c3a9822d2b11525a22f00..fbcb5183d188bc1caa74ebbbb475d15a + // Purpur end - Silk touch spawners + @Override - protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { - super.spawnAfterBreak(state, level, pos, stack, dropExperience); -@@ -45,6 +102,7 @@ public class SpawnerBlock extends BaseEntityBlock { + 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 @@ @Override - public int getExpDrop(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) { -+ if (level.purpurConfig.silkTouchEnabled && isSilkTouch(level, stack)) return 0; // Purpur - Silk touch spawners + public int getExpDrop(final BlockState state, final ServerLevel level, final BlockPos pos, final ItemStack tool, final boolean dropExperience) { ++ if (level.purpurConfig.silkTouchEnabled && isSilkTouch(level, tool)) return 0; // Purpur - Silk touch spawners if (dropExperience) { - int i = 15 + level.random.nextInt(15) + level.random.nextInt(15); - // this.popExperience(level, pos, i); + RandomSource random = level.getRandom(); + int magicCount = 15 + random.nextInt(15) + random.nextInt(15); diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpongeBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpongeBlock.java.patch new file mode 100644 index 000000000..8a57548dc --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SpongeBlock.java.patch @@ -0,0 +1,31 @@ +--- a/net/minecraft/world/level/block/SpongeBlock.java ++++ b/net/minecraft/world/level/block/SpongeBlock.java +@@ -53,7 +_,7 @@ + + private boolean removeWaterBreadthFirstSearch(final Level level, final BlockPos startPos) { + org.bukkit.craftbukkit.util.BlockStateListPopulator blockList = new org.bukkit.craftbukkit.util.BlockStateListPopulator(level); // CraftBukkit - Use BlockStateListPopulator +- BlockPos.breadthFirstTraversal(startPos, 6, 65, (pos, consumer) -> { ++ BlockPos.breadthFirstTraversal(startPos, level.purpurConfig.spongeAbsorptionRadius, level.purpurConfig.spongeAbsorptionArea, (pos, consumer) -> { // Purpur - Configurable sponge absorption + for (Direction direction : ALL_DIRECTIONS) { + consumer.accept(pos.relative(direction)); + } +@@ -65,7 +_,7 @@ + BlockState blockState = blockList.getBlockState(pos); + FluidState fluidState = blockList.getFluidState(pos); + // CraftBukkit end +- if (!fluidState.is(FluidTags.WATER)) { ++ if (!fluidState.is(FluidTags.WATER) && (!level.purpurConfig.spongeAbsorbsLava || !fluidState.is(FluidTags.LAVA)) && (!level.purpurConfig.spongeAbsorbsWaterFromMud || !blockState.is(Blocks.MUD))) { // Purpur - Option for sponges to work on lava and mud + return BlockPos.TraversalNodeStatus.SKIP; + } else if (blockState.getBlock() instanceof BucketPickup bucketPickup + && !bucketPickup.pickupBlock(null, blockList, pos, blockState).isEmpty()) { // CraftBukkit +@@ -73,6 +_,10 @@ + } else { + if (blockState.getBlock() instanceof LiquidBlock) { + blockList.setBlock(pos, Blocks.AIR.defaultBlockState(), Block.UPDATE_ALL); // CraftBukkit ++ // Purpur start - Option for sponges to work on lava and mud ++ } else if (blockState.is(Blocks.MUD)) { ++ blockList.setBlock(pos, Blocks.CLAY.defaultBlockState(), Block.UPDATE_ALL); ++ // Purpur end - Option for sponges to work on lava and mud + } else { + if (!blockState.is(Blocks.KELP) && !blockState.is(Blocks.KELP_PLANT) && !blockState.is(Blocks.SEAGRASS) && !blockState.is(Blocks.TALL_SEAGRASS)) { + return BlockPos.TraversalNodeStatus.SKIP; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/StonecutterBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/StonecutterBlock.java.patch similarity index 56% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/StonecutterBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/StonecutterBlock.java.patch index b82b2fedc..13c61805f 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/StonecutterBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/StonecutterBlock.java.patch @@ -1,15 +1,7 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/StonecutterBlock.java b/net/minecraft/world/level/block/StonecutterBlock.java -index 19657ae67244224bc77b0a2620c097afa97dddf6..6ab51fcf42b9ca7ab46ea66498eea14250fc7444 100644 --- a/net/minecraft/world/level/block/StonecutterBlock.java +++ b/net/minecraft/world/level/block/StonecutterBlock.java -@@ -92,4 +92,14 @@ public class StonecutterBlock extends Block { - protected boolean isPathfindable(BlockState state, PathComputationType pathComputationType) { +@@ -94,4 +_,14 @@ + protected boolean isPathfindable(final BlockState state, final PathComputationType type) { return false; } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch similarity index 75% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch index 17191818f..e7137e604 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SugarCaneBlock.java b/net/minecraft/world/level/block/SugarCaneBlock.java -index 4437fd5724e094e8d2edb97ca9bf494ef57f5b79..9e5cf7766848540a5ae2c38522e865a0b4601d00 100644 --- a/net/minecraft/world/level/block/SugarCaneBlock.java +++ b/net/minecraft/world/level/block/SugarCaneBlock.java -@@ -19,7 +19,7 @@ import net.minecraft.world.level.material.FluidState; +@@ -19,7 +_,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -17,8 +9,8 @@ index 4437fd5724e094e8d2edb97ca9bf494ef57f5b79..9e5cf7766848540a5ae2c38522e865a0 public static final MapCodec CODEC = simpleCodec(SugarCaneBlock::new); public static final IntegerProperty AGE = BlockStateProperties.AGE_15; private static final VoxelShape SHAPE = Block.column(12.0, 0.0, 16.0); -@@ -112,4 +112,34 @@ public class SugarCaneBlock extends Block { - protected void createBlockStateDefinition(StateDefinition.Builder builder) { +@@ -112,4 +_,34 @@ + protected void createBlockStateDefinition(final StateDefinition.Builder builder) { builder.add(AGE); } + diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch similarity index 63% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch index 4209b5ff9..c63284a3d 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TurtleEggBlock.java.patch @@ -1,26 +1,18 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/TurtleEggBlock.java b/net/minecraft/world/level/block/TurtleEggBlock.java -index 732f244b0265477434b26a47ddedab10f49b06a3..912c36c2e814cf763b4fa01d149979be9ef460de 100644 --- a/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/net/minecraft/world/level/block/TurtleEggBlock.java -@@ -156,7 +156,7 @@ public class TurtleEggBlock extends Block { +@@ -156,7 +_,7 @@ } - private boolean shouldUpdateHatchLevel(Level level, BlockPos pos) { -- float value = level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos); -+ float value = level.purpurConfig.turtleEggsRandomTickCrackChance == 500 ? level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos) : level.purpurConfig.turtleEggsRandomTickCrackChance; // Purpur - Turtle eggs random tick crack chance - return value > 0.0F && level.random.nextFloat() < value; + private boolean shouldUpdateHatchLevel(final Level level, final BlockPos pos) { +- float chance = level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos); ++ float chance = level.purpurConfig.turtleEggsRandomTickCrackChance == 500 ? level.environmentAttributes().getValue(EnvironmentAttributes.TURTLE_EGG_HATCH_CHANCE, pos) : level.purpurConfig.turtleEggsRandomTickCrackChance; // Purpur - Turtle eggs random tick crack chance + return chance > 0.0F && level.getRandom().nextFloat() < chance; } -@@ -189,9 +189,32 @@ public class TurtleEggBlock extends Block { +@@ -196,9 +_,32 @@ } - private boolean canDestroyEgg(ServerLevel level, Entity entity) { + private boolean canDestroyEgg(final ServerLevel level, final Entity entity) { - return !(entity instanceof Turtle) - && !(entity instanceof Bat) - && entity instanceof LivingEntity diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch new file mode 100644 index 000000000..2a9e1c134 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/level/block/TwistingVinesBlock.java ++++ b/net/minecraft/world/level/block/TwistingVinesBlock.java +@@ -34,4 +_,11 @@ + protected boolean canGrowInto(final BlockState state) { + return NetherVines.isValidGrowthState(state); + } ++ ++ // Purpur start - twisting vines configurable max growth age ++ @Override ++ public int getMaxGrowthAge() { ++ return org.purpurmc.purpur.PurpurConfig.twistingVinesMaxGrowthAge; ++ } ++ // Purpur end - twisting vines configurable max growth age + } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/VegetationBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/VegetationBlock.java.patch similarity index 67% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/VegetationBlock.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/VegetationBlock.java.patch index 860c68fc7..47d5b039c 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/VegetationBlock.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/VegetationBlock.java.patch @@ -1,16 +1,8 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/VegetationBlock.java b/net/minecraft/world/level/block/VegetationBlock.java -index 0aa7c1084fd6ed35260469572cdd914d87f3922a..a1b5e815425fccbc601c8062fcc24598512e47dd 100644 --- a/net/minecraft/world/level/block/VegetationBlock.java +++ b/net/minecraft/world/level/block/VegetationBlock.java -@@ -61,4 +61,24 @@ public abstract class VegetationBlock extends Block { - protected boolean isPathfindable(BlockState state, PathComputationType pathComputationType) { - return pathComputationType == PathComputationType.AIR && !this.hasCollision || super.isPathfindable(state, pathComputationType); +@@ -61,4 +_,24 @@ + protected boolean isPathfindable(final BlockState state, final PathComputationType type) { + return type == PathComputationType.AIR && !this.hasCollision || super.isPathfindable(state, type); } + + // Purpur start - Ability for hoe to replant crops diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch new file mode 100644 index 000000000..3ba829fac --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/level/block/WeepingVinesBlock.java ++++ b/net/minecraft/world/level/block/WeepingVinesBlock.java +@@ -34,4 +_,11 @@ + protected boolean canGrowInto(final BlockState state) { + return NetherVines.isValidGrowthState(state); + } ++ ++ // Purpur start - weeping vines configurable max growth age ++ @Override ++ public int getMaxGrowthAge() { ++ return org.purpurmc.purpur.PurpurConfig.weepingVinesMaxGrowthAge; ++ } ++ // Purpur end - weeping vines configurable max growth age + } diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch new file mode 100644 index 000000000..b16d9e4ba --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/block/WitherSkullBlock.java ++++ b/net/minecraft/world/level/block/WitherSkullBlock.java +@@ -69,6 +_,7 @@ + ); + witherBoss.yBodyRot = match.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F; + witherBoss.makeInvulnerable(); ++ witherBoss.setSummoner(blockState.getBlock().placer == null ? null : blockState.getBlock().placer.getUUID()); // Purpur - Summoner API + // CraftBukkit start + if (!level.addFreshEntity(witherBoss, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_WITHER)) { + return; diff --git a/purpur-server/minecraft-patches/unapplied-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 similarity index 56% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java.patch index 2d24479cd..e21531325 100644 --- a/purpur-server/minecraft-patches/unapplied-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 @@ -1,38 +1,30 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java -index bf3b57723943e5c62071740c66c345c02a7c978f..4c98157666146ec2727f41edc6de9b3cc2d51848 100644 --- a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java +++ b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java -@@ -30,6 +30,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable +@@ -30,6 +_,7 @@ public float tRot; private static final RandomSource RANDOM = RandomSource.create(); private @Nullable Component name; + private int lapis = 0; // Purpur - Enchantment Table Persists Lapis - public EnchantingTableBlockEntity(BlockPos pos, BlockState blockState) { - super(BlockEntityType.ENCHANTING_TABLE, pos, blockState); -@@ -39,12 +40,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable - protected void saveAdditional(ValueOutput output) { + public EnchantingTableBlockEntity(final BlockPos worldPosition, final BlockState blockState) { + super(BlockEntityType.ENCHANTING_TABLE, worldPosition, blockState); +@@ -39,12 +_,14 @@ + protected void saveAdditional(final ValueOutput output) { super.saveAdditional(output); output.storeNullable("CustomName", ComponentSerialization.CODEC, this.name); + output.putInt("Purpur.Lapis", this.lapis); // Purpur - Enchantment Table Persists Lapis } @Override - protected void loadAdditional(ValueInput input) { + protected void loadAdditional(final ValueInput input) { super.loadAdditional(input); this.name = parseCustomNameSafe(input, "CustomName"); + this.lapis = input.getIntOr("Purpur.Lapis", 0); // Purpur - Enchantment Table Persists Lapis } - public static void bookAnimationTick(Level level, BlockPos pos, BlockState state, EnchantingTableBlockEntity enchantingTable) { -@@ -135,4 +138,22 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable - public void removeComponentsFromTag(ValueOutput output) { + public static void bookAnimationTick(final Level level, final BlockPos worldPosition, final BlockState state, final EnchantingTableBlockEntity entity) { +@@ -135,4 +_,22 @@ + public void removeComponentsFromTag(final ValueOutput output) { output.discard("CustomName"); } + 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 new file mode 100644 index 000000000..3ec11f5d8 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/world/level/chunk/storage/EntityStorage.java ++++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java +@@ -97,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)) { + CompoundTag result = output.buildResult(); + entities.add(result); 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 new file mode 100644 index 000000000..f66e66d1f --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/FlowingFluid.java.patch @@ -0,0 +1,24 @@ +--- a/net/minecraft/world/level/material/FlowingFluid.java ++++ b/net/minecraft/world/level/material/FlowingFluid.java +@@ -193,7 +_,7 @@ + } + } + +- if (neighbourSources >= 2 && this.canConvertToSource(level)) { ++ if (neighbourSources >= this.getRequiredSources(level) && this.canConvertToSource(level)) { // Purpur - Implement infinite liquids + BlockState belowState = level.getBlockState(mutablePos.setWithOffset(pos, Direction.DOWN)); + FluidState belowFluid = belowState.getFluidState(); + if (belowState.isSolid() || this.isSourceBlockOfThisType(belowFluid)) { +@@ -279,6 +_,12 @@ + } + + protected abstract boolean canConvertToSource(ServerLevel level); ++ ++ // Purpur start - Implement infinite liquids ++ protected int getRequiredSources(Level level) { ++ return 2; ++ } ++ // Purpur end - Implement infinite liquids + + protected void spreadTo(final LevelAccessor level, final BlockPos pos, final BlockState state, final Direction direction, final FluidState target) { + if (state.getBlock() instanceof LiquidBlockContainer container) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/LavaFluid.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch similarity index 51% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/LavaFluid.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch index 2f9d086c5..8a893cdd5 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/LavaFluid.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch @@ -1,33 +1,25 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java -index a42878c191445ba4b0d50dd2b789a132d5cf6a3e..3e81c98e2e6b0f1424429ab52aa43d229c867cc7 100644 --- a/net/minecraft/world/level/material/LavaFluid.java +++ b/net/minecraft/world/level/material/LavaFluid.java -@@ -190,7 +190,7 @@ public abstract class LavaFluid extends FlowingFluid { +@@ -191,7 +_,7 @@ @Override - public int getTickDelay(LevelReader level) { + public int getTickDelay(final LevelReader level) { - return isFastLava(level) ? 10 : 30; + return level.getWorldBorder().world != null ? (isFastLava(level) ? level.getWorldBorder().world.purpurConfig.lavaSpeedNether : level.getWorldBorder().world.purpurConfig.lavaSpeedNotNether) : (isFastLava(level) ? 10 : 30); // Purpur - Make lava flow speed configurable } @Override -@@ -212,6 +212,13 @@ public abstract class LavaFluid extends FlowingFluid { +@@ -212,6 +_,13 @@ + private void fizz(final LevelAccessor level, final BlockPos pos) { level.levelEvent(LevelEvent.LAVA_FIZZ, pos, 0); } - ++ + // Purpur start - Implement infinite liquids + @Override + protected int getRequiredSources(Level level) { + return level.purpurConfig.lavaInfiniteRequiredSources; + } + // Purpur end - Implement infinite liquids -+ + @Override - protected boolean canConvertToSource(ServerLevel level) { - return level.getGameRules().get(GameRules.LAVA_SOURCE_CONVERSION); + protected boolean canConvertToSource(final ServerLevel level) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/WaterFluid.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/WaterFluid.java.patch similarity index 54% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/WaterFluid.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/WaterFluid.java.patch index 4f51bb5b7..115e0cd83 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/WaterFluid.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/material/WaterFluid.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/material/WaterFluid.java b/net/minecraft/world/level/material/WaterFluid.java -index 45ade22e8f69609598725a94a0581251cf3f384f..4533d9f76f4ea21cee3c3114bcfcded40fe7321b 100644 --- a/net/minecraft/world/level/material/WaterFluid.java +++ b/net/minecraft/world/level/material/WaterFluid.java -@@ -77,6 +77,13 @@ public abstract class WaterFluid extends FlowingFluid { +@@ -77,6 +_,13 @@ return level.getGameRules().get(GameRules.WATER_SOURCE_CONVERSION); } @@ -20,5 +12,5 @@ index 45ade22e8f69609598725a94a0581251cf3f384f..4533d9f76f4ea21cee3c3114bcfcded4 + // Purpur end - Implement infinite liquids + // Paper start - Add BlockBreakBlockEvent - @Override + @Override protected void beforeDestroyingBlock(LevelAccessor level, BlockPos pos, BlockState state, BlockPos source) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch new file mode 100644 index 000000000..a74beadd6 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch @@ -0,0 +1,20 @@ +--- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java ++++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +@@ -249,7 +_,7 @@ + if ((best == null || best.costMalus < 0.0F) + && jumpSize > 0 + && (pathType != PathType.FENCE || this.canWalkOverFences()) +- && pathType != PathType.UNPASSABLE_RAIL ++ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur - Config to allow mobs to pathfind over rails + && pathType != PathType.TRAPDOOR + && pathType != PathType.POWDER_SNOW) { + best = this.tryJumpOn(x, y, z, jumpSize, nodeHeight, travelDirection, blockPathTypeCurrent, reusablePos); +@@ -517,7 +_,7 @@ + return PathType.TRAPDOOR; + } else if (blockState.is(Blocks.POWDER_SNOW)) { + return PathType.POWDER_SNOW; +- } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { ++ } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - Stonecutter damage + return PathType.DAMAGING; + } else if (blockState.is(Blocks.HONEY_BLOCK)) { + return PathType.STICKY_HONEY; 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 new file mode 100644 index 000000000..dc476e7e5 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/portal/PortalShape.java.patch @@ -0,0 +1,11 @@ +--- a/net/minecraft/world/level/portal/PortalShape.java ++++ b/net/minecraft/world/level/portal/PortalShape.java +@@ -29,7 +_,7 @@ + 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); ++ private 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/unapplied-sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch similarity index 50% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch index 010325abf..2e7cc92dc 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 1af585f9554278983148096c73c86e18166f5471..cd2719b0ac30654ce7e8247850f4512810b352e6 100644 --- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -@@ -81,6 +81,7 @@ public class MapItemSavedData extends SavedData { +@@ -76,6 +_,7 @@ public final Map decorations = Maps.newLinkedHashMap(); private final Map frameMarkers = Maps.newHashMap(); private int trackedDecorationCount; diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch new file mode 100644 index 000000000..548c6e4d0 --- /dev/null +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java ++++ b/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java +@@ -74,6 +_,11 @@ + Entity killer = context.getOptionalParameter(LootContextParams.ATTACKING_ENTITY); + if (killer instanceof LivingEntity entity) { + int level = EnchantmentHelper.getEnchantmentLevel(this.enchantment, entity); ++ // Purpur start - Add an option to fix MC-3304 projectile looting ++ if (org.purpurmc.purpur.PurpurConfig.fixProjectileLootingTransfer && context.getOptionalParameter(LootContextParams.DIRECT_ATTACKING_ENTITY) instanceof net.minecraft.world.entity.projectile.arrow.AbstractArrow arrow) { ++ enchantmentLevel = arrow.actualEnchantments.getLevel(this.enchantment); ++ } ++ // Purpur end - Add an option to fix MC-3304 projectile looting + if (level == 0) { + return itemStack; + } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/phys/AABB.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/phys/AABB.java.patch similarity index 54% rename from purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/phys/AABB.java.patch rename to purpur-server/minecraft-patches/sources/net/minecraft/world/phys/AABB.java.patch index ba14b4f58..1545fd15f 100644 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/phys/AABB.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/phys/AABB.java.patch @@ -1,14 +1,6 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java -index 7f0ff1bf4ddf7bfe1d3cad472416dd032806066b..120e432df71eaee94225555d24c82e6d05b34b9f 100644 --- a/net/minecraft/world/phys/AABB.java +++ b/net/minecraft/world/phys/AABB.java -@@ -474,4 +474,10 @@ public class AABB { +@@ -476,4 +_,10 @@ return new AABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); } } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/CrashReport.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/CrashReport.java.patch deleted file mode 100644 index 58071343c..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/CrashReport.java.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/CrashReport.java b/net/minecraft/CrashReport.java -index ad10eda79e6b76fc1896b4cdb27546b515d1cfa4..2c60f1d955b17cbc79b5372c536e5463f6c0a186 100644 ---- a/net/minecraft/CrashReport.java -+++ b/net/minecraft/CrashReport.java -@@ -30,6 +30,7 @@ public class CrashReport { - private boolean trackingStackTrace = true; - private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0]; - private final SystemReport systemReport = new SystemReport(); -+ private List extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!", ""); // Purpur - Rebrand - - public CrashReport(String title, Throwable exception) { - this.title = title; -@@ -129,7 +130,7 @@ public class CrashReport { - } - - public String getFriendlyReport(ReportType type) { -- return this.getFriendlyReport(type, List.of()); -+ return this.getFriendlyReport(type, extraInfo); // Purpur - Rebrand - } - - public @Nullable Path getSaveFile() { -@@ -159,7 +160,7 @@ public class CrashReport { - } - - public boolean saveToFile(Path path, ReportType type) { -- return this.saveToFile(path, type, List.of()); -+ return this.saveToFile(path, type, extraInfo); // Purpur - Rebrand - } - - public SystemReport getSystemReport() { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/gametest/framework/GameTestHelper.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/gametest/framework/GameTestHelper.java.patch deleted file mode 100644 index d41fabb1f..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/gametest/framework/GameTestHelper.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/gametest/framework/GameTestHelper.java b/net/minecraft/gametest/framework/GameTestHelper.java -index 2a1aef6bfa15882748b98b5257baaced107ba194..05eb0c3273ffa1b5a1ebd8f8ae42c11830d755c7 100644 ---- a/net/minecraft/gametest/framework/GameTestHelper.java -+++ b/net/minecraft/gametest/framework/GameTestHelper.java -@@ -322,6 +322,8 @@ public class GameTestHelper { - return gameType; - } - -+ public void setAfk(final boolean afk) {} // Purpur - AFK API -+ - @Override - public boolean isClientAuthoritative() { - return false; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/gui/StatsComponent.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/gui/StatsComponent.java.patch deleted file mode 100644 index 15073a172..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/server/gui/StatsComponent.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/server/gui/StatsComponent.java b/net/minecraft/server/gui/StatsComponent.java -index f485e83fa6cbf510472bcffd18d29a41e177e856..84b72e8a44ef8f964079faddd3bff29601a8a3c9 100644 ---- a/net/minecraft/server/gui/StatsComponent.java -+++ b/net/minecraft/server/gui/StatsComponent.java -@@ -41,7 +41,7 @@ public class StatsComponent extends JComponent { - } - this.msgs[0] = "Memory use: " + l / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)"; - this.msgs[1] = "Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms"; -- this.msgs[2] = "TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg); -+ this.msgs[2] = "TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg); // Purpur - Add 5 second tps average in /tps - // Paper end - Improve ServerGUI - this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory()); - this.repaint(); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java.patch deleted file mode 100644 index c05812ea6..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java -index 12a8326af5100d243983c101c5ba9e5f30fb0811..2a7c913aadd839ca90edaed4254d5ced260700ac 100644 ---- a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java -+++ b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java -@@ -22,6 +22,7 @@ public class LlamaFollowCaravanGoal extends Goal { - - @Override - public boolean canUse() { -+ if (!this.llama.level().purpurConfig.llamaJoinCaravans || !this.llama.shouldJoinCaravan) return false; // Purpur - Llama API // Purpur - Config to disable Llama caravans - if (!this.llama.isLeashed() && !this.llama.inCaravan()) { - List entities = this.llama.level().getEntities(this.llama, this.llama.getBoundingBox().inflate(9.0, 4.0, 9.0), entity1 -> { - EntityType type = entity1.getType(); -@@ -71,6 +72,7 @@ public class LlamaFollowCaravanGoal extends Goal { - - @Override - public boolean canContinueToUse() { -+ if (!this.llama.shouldJoinCaravan) return false; // Purpur - Llama API - if (this.llama.inCaravan() && this.llama.getCaravanHead().isAlive() && this.firstIsLeashed(this.llama, 0)) { - double d = this.llama.distanceToSqr(this.llama.getCaravanHead()); - if (d > 676.0) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/goat/Goat.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/goat/Goat.java.patch deleted file mode 100644 index b45613e9d..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/animal/goat/Goat.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java -index 9f41c1ff3e75cf9164dee0853aeef4bfc473126b..566390c9258c1132c9ffa2df8ecc3e713963787f 100644 ---- a/net/minecraft/world/entity/animal/goat/Goat.java -+++ b/net/minecraft/world/entity/animal/goat/Goat.java -@@ -389,6 +389,7 @@ public class Goat extends Animal { - - // Paper start - Goat ram API - public void ram(net.minecraft.world.entity.LivingEntity entity) { -+ if(!new org.purpurmc.purpur.event.entity.GoatRamEntityEvent((org.bukkit.entity.Goat) getBukkitEntity(), entity.getBukkitLivingEntity()).callEvent()) return; // Purpur - Added goat ram event - Brain brain = this.getBrain(); - brain.setMemory(MemoryModuleType.RAM_TARGET, entity.position()); - brain.eraseMemory(MemoryModuleType.RAM_COOLDOWN_TICKS); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Guardian.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Guardian.java.patch deleted file mode 100644 index 4f7ab4d10..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Guardian.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/Guardian.java b/net/minecraft/world/entity/monster/Guardian.java -index 8229de18fbac59493b377b12a281f3f4d74731d7..9c91fbfd39af513668bd94578810cef7e283abd9 100644 ---- a/net/minecraft/world/entity/monster/Guardian.java -+++ b/net/minecraft/world/entity/monster/Guardian.java -@@ -312,6 +312,11 @@ public class Guardian extends Monster { - public static boolean checkGuardianSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random - ) { -+ // Purpur start - Config to disable hostile mob spawn on ice -+ if (canSpawnInBlueAndPackedIce(level, pos)) { -+ return false; -+ } -+ // Purpur end - Config to disable hostile mob spawn on ice - return (random.nextInt(20) == 0 || !level.canSeeSkyFromBelowWater(pos)) - && level.getDifficulty() != Difficulty.PEACEFUL - && (EntitySpawnReason.isSpawner(spawnReason) || level.getFluidState(pos).is(FluidTags.WATER)) diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/MagmaCube.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/MagmaCube.java.patch deleted file mode 100644 index 7e5477050..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/MagmaCube.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/MagmaCube.java b/net/minecraft/world/entity/monster/MagmaCube.java -index c534fd2a8639ed6a587692a7e85e560a2fc0b3e5..969736a46c85b2fcaa641c2863e6000b51611df5 100644 ---- a/net/minecraft/world/entity/monster/MagmaCube.java -+++ b/net/minecraft/world/entity/monster/MagmaCube.java -@@ -31,6 +31,11 @@ public class MagmaCube extends Slime { - public static boolean checkMagmaCubeSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random - ) { -+ // Purpur start - Config to disable hostile mob spawn on ice -+ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { -+ return false; -+ } -+ // Purpur end - Config to disable hostile mob spawn on ice - return level.getDifficulty() != Difficulty.PEACEFUL; - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Slime.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Slime.java.patch deleted file mode 100644 index 325dba0fe..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/Slime.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java -index f1eb8c9120a4794b1b70777c272e1a0491fa5164..e433eacd865f620a9c336a1976fd017b8053cf6a 100644 ---- a/net/minecraft/world/entity/monster/Slime.java -+++ b/net/minecraft/world/entity/monster/Slime.java -@@ -302,6 +302,11 @@ public class Slime extends Mob implements Enemy { - public static boolean checkSlimeSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random - ) { -+ // Purpur start - Config to disable hostile mob spawn on ice -+ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { -+ return false; -+ } -+ // Purpur end - Config to disable hostile mob spawn on ice - if (level.getDifficulty() != Difficulty.PEACEFUL) { - if (EntitySpawnReason.isSpawner(spawnReason)) { - return checkMobSpawnRules(entityType, level, spawnReason, pos, random); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch deleted file mode 100644 index 7cfd62681..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/hoglin/Hoglin.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -index 330d831abb22aba9f6f60c0174769a0e78411dfd..d1749ac82cdbd73422e6229e98eb034978f50fc2 100644 ---- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java -+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -202,6 +202,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { - public static boolean checkHoglinSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random - ) { -+ // Purpur start - Config to disable hostile mob spawn on ice -+ if (net.minecraft.world.entity.monster.Monster.canSpawnInBlueAndPackedIce(level, pos)) { -+ return false; -+ } -+ // Purpur end - Config to disable hostile mob spawn on ice - return !level.getBlockState(pos.below()).is(Blocks.NETHER_WART_BLOCK); - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch deleted file mode 100644 index 696e954a5..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/entity/monster/piglin/Piglin.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java -index 2497779f96e3b6c7e7aa048c2047c04f06cb7ede..fb2ff2b9712f95429bde04d35baddc2da3e3fb52 100644 ---- a/net/minecraft/world/entity/monster/piglin/Piglin.java -+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -208,6 +208,11 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento - public static boolean checkPiglinSpawnRules( - EntityType entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random - ) { -+ // Purpur start - Config to disable hostile mob spawn on ice -+ if (canSpawnInBlueAndPackedIce(level, pos)) { -+ return false; -+ } -+ // Purpur end - Config to disable hostile mob spawn on ice - return !level.getBlockState(pos.below()).is(Blocks.NETHER_WART_BLOCK); - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/AxeItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/AxeItem.java.patch deleted file mode 100644 index 60ee2e508..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/AxeItem.java.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/AxeItem.java b/net/minecraft/world/item/AxeItem.java -index 8b006edd6f766f942d691f5271a7505a75700d0c..443410efadc9b8e919a23e475ff9457b93e8f156 100644 ---- a/net/minecraft/world/item/AxeItem.java -+++ b/net/minecraft/world/item/AxeItem.java -@@ -65,13 +65,15 @@ public class AxeItem extends Item { - if (playerHasBlockingItemUseIntent(context)) { - return InteractionResult.PASS; - } else { -- Optional optional = this.evaluateNewBlockState(level, clickedPos, player, level.getBlockState(clickedPos)); -+ Optional optional = this.evaluateActionable(level, clickedPos, player, level.getBlockState(clickedPos)); // Purpur - Tool actionable options - if (optional.isEmpty()) { - return InteractionResult.PASS; - } else { -+ org.purpurmc.purpur.tool.Actionable actionable = optional.get(); // Purpur - Tool actionable options -+ BlockState state = actionable.into().withPropertiesOf(level.getBlockState(clickedPos)); // Purpur - Tool actionable options - ItemStack itemInHand = context.getItemInHand(); - // Paper start - EntityChangeBlockEvent -- if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, clickedPos, optional.get())) { -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, clickedPos, state)) { // Purpur - Tool actionable options - return InteractionResult.PASS; - } - // Paper end -@@ -79,8 +81,15 @@ public class AxeItem extends Item { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, clickedPos, itemInHand); - } - -- level.setBlock(clickedPos, optional.get(), Block.UPDATE_ALL_IMMEDIATE); -- level.gameEvent(GameEvent.BLOCK_CHANGE, clickedPos, GameEvent.Context.of(player, optional.get())); -+ // Purpur start - Tool actionable options -+ level.setBlock(clickedPos, state, Block.UPDATE_ALL_IMMEDIATE); -+ actionable.drops().forEach((drop, chance) -> { -+ if (level.random.nextDouble() < chance) { -+ Block.popResourceFromFace(level, clickedPos, context.getClickedFace(), new ItemStack(drop)); -+ } -+ }); -+ level.gameEvent(GameEvent.BLOCK_CHANGE, clickedPos, GameEvent.Context.of(player, state)); -+ // Purpur end - Tool actionable options - if (player != null) { - itemInHand.hurtAndBreak(1, player, context.getHand().asEquipmentSlot()); - } -@@ -97,21 +106,23 @@ public class AxeItem extends Item { - && !player.isSecondaryUseActive(); - } - -- private Optional evaluateNewBlockState(Level level, BlockPos pos, @Nullable Player player, BlockState state) { -- Optional stripped = this.getStripped(state); -+ private Optional evaluateActionable(Level level, BlockPos pos, @Nullable Player player, BlockState state) { // Purpur - Tool actionable options -+ Optional stripped = Optional.ofNullable(level.purpurConfig.axeStrippables.get(state.getBlock())); // Purpur - Tool actionable options - if (stripped.isPresent()) { -- level.playSound(player, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); -+ level.playSound(STRIPPABLES.containsKey(state.getBlock()) ? player : null, pos, SoundEvents.AXE_STRIP, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - force sound - return stripped; - } else { -- Optional previous = WeatheringCopper.getPrevious(state); -+ Optional previous = Optional.ofNullable(level.purpurConfig.axeWeatherables.get(state.getBlock())); // Purpur - Tool actionable options - if (previous.isPresent()) { -- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); -+ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(state).isPresent() ? player : null, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); // Purpur - Tool actionable options - force sound - return previous; - } else { -- Optional optional = Optional.ofNullable(HoneycombItem.WAX_OFF_BY_BLOCK.get().get(state.getBlock())) -- .map(block -> block.withPropertiesOf(state)); -+ // Purpur start - Tool actionable options -+ Optional optional = Optional.ofNullable(level.purpurConfig.axeWaxables.get(state.getBlock())); -+ // .map(block -> block.withPropertiesOf(state)); -+ // Purpur end - Tool actionable options - if (optional.isPresent()) { -- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); -+ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); // Purpur - Tool actionable options - force sound - return optional; - } else { - return Optional.empty(); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BlockItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BlockItem.java.patch deleted file mode 100644 index 08bce65b0..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BlockItem.java.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java -index 73ce7c82c0bd28c2e43ca40ba35c4603b21375ad..60261f504dc5669f9e2d0a2aee5dbd33c62c8893 100644 ---- a/net/minecraft/world/item/BlockItem.java -+++ b/net/minecraft/world/item/BlockItem.java -@@ -143,7 +143,16 @@ public class BlockItem extends Item { - } - - protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, @Nullable Player player, ItemStack stack, BlockState state) { -- return updateCustomBlockEntityTag(level, player, pos, stack); -+ // Purpur start - Persistent BlockEntity Lore and DisplayName -+ boolean handled = updateCustomBlockEntityTag(level, player, pos, stack); -+ if (level.purpurConfig.persistentTileEntityLore) { -+ BlockEntity blockEntity1 = level.getBlockEntity(pos); -+ if (blockEntity1 != null) { -+ blockEntity1.setPersistentLore(stack.getOrDefault(DataComponents.LORE, net.minecraft.world.item.component.ItemLore.EMPTY)); -+ } -+ } -+ return handled; -+ // Purpur end - Persistent BlockEntity Lore and DisplayName - } - - protected @Nullable BlockState getPlacementState(BlockPlaceContext context) { -@@ -204,6 +213,7 @@ public class BlockItem extends Item { - } - - if (!type.onlyOpCanSetNbt() || player != null && (player.canUseGameMasterBlocks() || (player.getAbilities().instabuild && player.getBukkitEntity().hasPermission("minecraft.nbt.place")))) { // Spigot - add permission -+ if (!(level.purpurConfig.silkTouchEnabled && blockEntity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity && player.getBukkitEntity().hasPermission("purpur.drop.spawners"))) // Purpur - Silk touch spawners - return typedEntityData.loadInto(blockEntity, level.registryAccess()); - } - -@@ -244,6 +254,7 @@ public class BlockItem extends Item { - public void onDestroyed(ItemEntity itemEntity) { - ItemContainerContents itemContainerContents = itemEntity.getItem().set(DataComponents.CONTAINER, ItemContainerContents.EMPTY); - if (itemContainerContents != null) { -+ if (itemEntity.level().purpurConfig.shulkerBoxItemDropContentsWhenDestroyed && this.getBlock() instanceof ShulkerBoxBlock) // Purpur - option to disable shulker box items from dropping contents when destroyed - ItemUtils.onContainerDestroyed(itemEntity, itemContainerContents.nonEmptyItemsCopy()); - } - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BowItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BowItem.java.patch deleted file mode 100644 index 1c4577457..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/BowItem.java.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/BowItem.java b/net/minecraft/world/item/BowItem.java -index 616f17713c43b6b28cb58c45071f1a7a74010261..0a14a098f3aa40c8195c3a3bdf61ad6ae0fcc9d2 100644 ---- a/net/minecraft/world/item/BowItem.java -+++ b/net/minecraft/world/item/BowItem.java -@@ -28,6 +28,11 @@ public class BowItem extends ProjectileWeaponItem { - return false; - } else { - ItemStack projectile = player.getProjectile(stack); -+ // 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, stack) > 0) { -+ projectile = new ItemStack(Items.ARROW); -+ } -+ // Purpur end - Infinity bow settings - if (projectile.isEmpty()) { - return false; - } else { -@@ -38,7 +43,7 @@ public class BowItem extends ProjectileWeaponItem { - } else { - List list = draw(stack, projectile, player); - if (level instanceof ServerLevel serverLevel && !list.isEmpty()) { -- this.shoot(serverLevel, player, player.getUsedItemHand(), stack, list, powerForTime * 3.0F, 1.0F, powerForTime == 1.0F, null, powerForTime); // Paper - Pass draw strength -+ this.shoot(serverLevel, player, player.getUsedItemHand(), stack, list, powerForTime * 3.0F, (float) serverLevel.purpurConfig.bowProjectileOffset, powerForTime == 1.0F, null, powerForTime); // Paper - Pass draw strength // Purpur - Projectile offset config - } - - level.playSound( -@@ -89,7 +94,7 @@ public class BowItem extends ProjectileWeaponItem { - public InteractionResult use(Level level, Player player, InteractionHand hand) { - ItemStack itemInHand = player.getItemInHand(hand); - boolean flag = !player.getProjectile(itemInHand).isEmpty(); -- if (!player.hasInfiniteMaterials() && !flag) { -+ if (!player.hasInfiniteMaterials() && !flag && !(level.purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemInHand) > 0)) { // Purpur - Infinity bow settings - return InteractionResult.FAIL; - } else { - player.startUsingItem(hand); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/CrossbowItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/CrossbowItem.java.patch deleted file mode 100644 index e6936166a..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/CrossbowItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/CrossbowItem.java b/net/minecraft/world/item/CrossbowItem.java -index 664e633f6d93c1569895f9cccb90e3bc8922e56d..a29ff7584371d35d9b0fff71681f672b76dea07c 100644 ---- a/net/minecraft/world/item/CrossbowItem.java -+++ b/net/minecraft/world/item/CrossbowItem.java -@@ -66,7 +66,7 @@ public class CrossbowItem extends ProjectileWeaponItem { - ItemStack itemInHand = player.getItemInHand(hand); - ChargedProjectiles chargedProjectiles = itemInHand.get(DataComponents.CHARGED_PROJECTILES); - if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) { -- this.performShooting(level, player, hand, itemInHand, getShootingPower(chargedProjectiles), 1.0F, null); -+ this.performShooting(level, player, hand, itemInHand, getShootingPower(chargedProjectiles), (float) level.purpurConfig.crossbowProjectileOffset, null); // Purpur - Projectile offset config - return InteractionResult.CONSUME; - } else if (!player.getProjectile(itemInHand).isEmpty()) { - this.startSoundPlayed = false; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/DyeColor.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/DyeColor.java.patch deleted file mode 100644 index 199315bc0..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/DyeColor.java.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/DyeColor.java b/net/minecraft/world/item/DyeColor.java -index 083ec53b1e46b8ad23db7e57296c222ad4c3cd4b..f2e761f253969ca01b78c7ddc7a571ecc9655432 100644 ---- a/net/minecraft/world/item/DyeColor.java -+++ b/net/minecraft/world/item/DyeColor.java -@@ -124,4 +124,10 @@ public enum DyeColor implements StringRepresentable { - private static CraftingInput makeCraftColorInput(DyeColor first, DyeColor second) { - return CraftingInput.of(2, 1, List.of(new ItemStack(DyeItem.byColor(first)), new ItemStack(DyeItem.byColor(second)))); - } -+ -+ // Purpur start - Shulker spawn from bullet options -+ public static DyeColor random(net.minecraft.util.RandomSource random) { -+ return values()[random.nextInt(values().length)]; -+ } -+ // Purpur end - Shulker spawn from bullet options - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EggItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EggItem.java.patch deleted file mode 100644 index e2c5f64d4..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EggItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/EggItem.java b/net/minecraft/world/item/EggItem.java -index 848144ce792de422921242282cefb2077a56563d..654d67dfc38b872352ea1cb6314f989c464a4ce1 100644 ---- a/net/minecraft/world/item/EggItem.java -+++ b/net/minecraft/world/item/EggItem.java -@@ -24,7 +24,7 @@ public class EggItem extends Item implements ProjectileItem { - public InteractionResult use(Level level, Player player, InteractionHand hand) { - ItemStack itemInHand = player.getItemInHand(hand); - // Paper start -- final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, (ServerLevel) level, itemInHand, player, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, 1.0F); -+ final Projectile.Delayed thrownEgg = Projectile.spawnProjectileFromRotationDelayed(ThrownEgg::new, (ServerLevel) level, itemInHand, player, 0.0F, EggItem.PROJECTILE_SHOOT_POWER, (float) level.purpurConfig.eggProjectileOffset); // Purpur - Projectile offset config - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemInHand), (org.bukkit.entity.Projectile) thrownEgg.projectile().getBukkitEntity()); - if (event.callEvent() && thrownEgg.attemptSpawn()) { - if (event.shouldConsume()) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EndCrystalItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EndCrystalItem.java.patch deleted file mode 100644 index 6a43396ce..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/EndCrystalItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/EndCrystalItem.java b/net/minecraft/world/item/EndCrystalItem.java -index 05ec512839898f96d9769bb0d00f6ba11dda0c4b..6e4a3c9c090a68bf5785a01d815c275411859c7b 100644 ---- a/net/minecraft/world/item/EndCrystalItem.java -+++ b/net/minecraft/world/item/EndCrystalItem.java -@@ -24,7 +24,7 @@ public class EndCrystalItem extends Item { - Level level = context.getLevel(); - BlockPos clickedPos = context.getClickedPos(); - BlockState blockState = level.getBlockState(clickedPos); -- if (!blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { -+ if (!level.purpurConfig.endCrystalPlaceAnywhere && !blockState.is(Blocks.OBSIDIAN) && !blockState.is(Blocks.BEDROCK)) { // Purpur - place end crystal on any block - return InteractionResult.FAIL; - } else { - BlockPos blockPos = clickedPos.above(); final BlockPos aboveBlockPos = blockPos; // Paper - OBFHELPER diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/HoeItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/HoeItem.java.patch deleted file mode 100644 index fc57690de..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/HoeItem.java.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/HoeItem.java b/net/minecraft/world/item/HoeItem.java -index d9d03bfcb1cb10aa03b35255c4237760bc836752..bf14cbcc6ed4c89ef6f15b3cb248a599cbc26e29 100644 ---- a/net/minecraft/world/item/HoeItem.java -+++ b/net/minecraft/world/item/HoeItem.java -@@ -44,15 +44,25 @@ public class HoeItem extends Item { - public InteractionResult useOn(UseOnContext context) { - Level level = context.getLevel(); - BlockPos clickedPos = context.getClickedPos(); -- Pair, Consumer> pair = TILLABLES.get(level.getBlockState(clickedPos).getBlock()); -- if (pair == null) { -+ // Purpur start - Tool actionable options -+ Block clickedBlock = level.getBlockState(clickedPos).getBlock(); -+ org.purpurmc.purpur.tool.Tillable tillable = level.purpurConfig.hoeTillables.get(clickedBlock); -+ if (tillable == null) { - return InteractionResult.PASS; - } else { -- Predicate predicate = pair.getFirst(); -- Consumer consumer = pair.getSecond(); -+ Predicate predicate = tillable.condition().predicate(); -+ Consumer consumer = (ctx) -> { -+ level.setBlock(clickedPos, tillable.into().defaultBlockState(), 11); -+ tillable.drops().forEach((drop, chance) -> { -+ if (level.random.nextDouble() < chance) { -+ Block.popResourceFromFace(level, clickedPos, ctx.getClickedFace(), new ItemStack(drop)); -+ } -+ }); -+ }; -+ // Purpur end - Tool actionable options - if (predicate.test(context)) { - Player player = context.getPlayer(); -- level.playSound(player, clickedPos, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1.0F, 1.0F); -+ if (!TILLABLES.containsKey(clickedBlock)) level.playSound(null, clickedPos, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1.0F, 1.0F); // Purpur - Tool actionable options - force sound - if (!level.isClientSide()) { - consumer.accept(context); - if (player != null) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/MapItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/MapItem.java.patch deleted file mode 100644 index 15455757e..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/MapItem.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/MapItem.java b/net/minecraft/world/item/MapItem.java -index 8479f971afdcae0143bbec25ab258485e49722af..63c9805a2c2c8ac8fff4e322e1627880c3fabd83 100644 ---- a/net/minecraft/world/item/MapItem.java -+++ b/net/minecraft/world/item/MapItem.java -@@ -192,6 +192,7 @@ public class MapItem extends Item { - public static void renderBiomePreviewMap(ServerLevel level, ItemStack stack) { - MapItemSavedData savedData = getSavedData(stack, level); - if (savedData != null) { -+ savedData.isExplorerMap = true; // Purpur - Explorer Map API - if (level.dimension() == savedData.dimension) { - int i = 1 << savedData.scale; - int i1 = savedData.centerX; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch deleted file mode 100644 index ba14f60c5..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ProjectileWeaponItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/ProjectileWeaponItem.java b/net/minecraft/world/item/ProjectileWeaponItem.java -index ba93379b6e85bed3eedc4869b83b3d45aa770cce..8fb0eacdf739e5559fb725571fb3a65fb6b17e8a 100644 ---- a/net/minecraft/world/item/ProjectileWeaponItem.java -+++ b/net/minecraft/world/item/ProjectileWeaponItem.java -@@ -106,6 +106,8 @@ public abstract class ProjectileWeaponItem extends Item { - abstractArrow.setCritArrow(true); - } - -+ abstractArrow.setActualEnchantments(weapon.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting -+ - return abstractArrow; - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ShovelItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ShovelItem.java.patch deleted file mode 100644 index 63247abee..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ShovelItem.java.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/ShovelItem.java b/net/minecraft/world/item/ShovelItem.java -index ba0609f4d9166e66599f9d4430885ab03d53ef41..7910c96cc47985acc8b64ba376933c84c51022d4 100644 ---- a/net/minecraft/world/item/ShovelItem.java -+++ b/net/minecraft/world/item/ShovelItem.java -@@ -46,9 +46,12 @@ public class ShovelItem extends Item { - BlockState blockState1 = FLATTENABLES.get(blockState.getBlock()); - BlockState blockState2 = null; - Runnable afterAction = null; // Paper -+ org.purpurmc.purpur.tool.Flattenable flattenable = level.purpurConfig.shovelFlattenables.get(blockState.getBlock()); // Purpur - Tool actionable options - if (blockState1 != null && level.getBlockState(clickedPos.above()).isAir()) { -- afterAction = () -> level.playSound(player, clickedPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F); // Paper -- blockState2 = blockState1; -+ // Purpur start - Tool actionable options -+ afterAction = () -> {if (!FLATTENABLES.containsKey(blockState.getBlock())) level.playSound(player, clickedPos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);}; // Paper -+ blockState2 = flattenable.into().defaultBlockState(); -+ // Purpur end - Tool actionable options - } else if (blockState.getBlock() instanceof CampfireBlock && blockState.getValue(CampfireBlock.LIT)) { - afterAction = () -> { // Paper - if (!level.isClientSide()) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ThrowablePotionItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ThrowablePotionItem.java.patch deleted file mode 100644 index 348332f89..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/ThrowablePotionItem.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/ThrowablePotionItem.java b/net/minecraft/world/item/ThrowablePotionItem.java -index 2707c2e3c6e32bb7c497808dceb34690e27a567a..a9bce92803772c1d76e1c3eabe1147d4c5211440 100644 ---- a/net/minecraft/world/item/ThrowablePotionItem.java -+++ b/net/minecraft/world/item/ThrowablePotionItem.java -@@ -24,7 +24,7 @@ public abstract class ThrowablePotionItem extends PotionItem implements Projecti - ItemStack itemInHand = player.getItemInHand(hand); - if (level instanceof ServerLevel serverLevel) { - // Paper start - PlayerLaunchProjectileEvent -- final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(this::createPotion, serverLevel, itemInHand, player, -20.0F, PROJECTILE_SHOOT_POWER, 1.0F); -+ final Projectile.Delayed thrownPotion = Projectile.spawnProjectileFromRotationDelayed(this::createPotion, serverLevel, itemInHand, player, -20.0F, PROJECTILE_SHOOT_POWER, (float) serverLevel.purpurConfig.throwablePotionProjectileOffset); // Purpur - Projectile offset config - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemInHand), (org.bukkit.entity.Projectile) thrownPotion.projectile().getBukkitEntity()); - if (event.callEvent() && thrownPotion.attemptSpawn()) { - if (event.shouldConsume()) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/TridentItem.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/TridentItem.java.patch deleted file mode 100644 index 16246e058..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/TridentItem.java.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/TridentItem.java b/net/minecraft/world/item/TridentItem.java -index d029fda2e8bac95fb75f75666a55b0c3aa3bb12d..8330421fc79e63bbcec276c659cd76cad38e36eb 100644 ---- a/net/minecraft/world/item/TridentItem.java -+++ b/net/minecraft/world/item/TridentItem.java -@@ -83,7 +83,7 @@ public class TridentItem extends Item implements ProjectileItem { - if (tridentSpinAttackStrength == 0.0F) { - ItemStack itemStack = stack.copyWithCount(1); // Paper - Projectile.Delayed tridentDelayed = Projectile.spawnProjectileFromRotationDelayed( // Paper - PlayerLaunchProjectileEvent( -- ThrownTrident::new, serverLevel, itemStack, player, 0.0F, 2.5F, 1.0F -+ ThrownTrident::new, serverLevel, itemStack, player, 0.0F, 2.5F, (float) serverLevel.purpurConfig.tridentProjectileOffset // Purpur - Projectile offset config - ); - // Paper start - PlayerLaunchProjectileEvent - com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(stack), (org.bukkit.entity.Projectile) tridentDelayed.projectile().getBukkitEntity()); -@@ -93,6 +93,7 @@ public class TridentItem extends Item implements ProjectileItem { - return false; - } - ThrownTrident thrownTrident = tridentDelayed.projectile(); // Paper - PlayerLaunchProjectileEvent -+ thrownTrident.setActualEnchantments(stack.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting - if (event.shouldConsume()) { - itemStack.hurtWithoutBreaking(1, player); // Paper - PlayerLaunchProjectileEvent - use itemStack; pickup item damage - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch deleted file mode 100644 index 2b5403e18..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java b/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java -index 41e1e076a4567d3d3202cf8e426a1ebb391d85e8..2d710dd3f20cbea06c16f14a558b575b369c6ca2 100644 ---- a/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java -+++ b/net/minecraft/world/item/consume_effects/ClearAllStatusEffectsConsumeEffect.java -@@ -20,6 +20,12 @@ public record ClearAllStatusEffectsConsumeEffect() implements ConsumeEffect { - @Override - // CraftBukkit start - public boolean apply(Level level, ItemStack stack, LivingEntity entity, org.bukkit.event.entity.EntityPotionEffectEvent.Cause cause) { -+ // Purpur start - Option to toggle milk curing bad omen -+ net.minecraft.world.effect.MobEffectInstance badOmen = entity.getEffect(net.minecraft.world.effect.MobEffects.BAD_OMEN); -+ if (!level.purpurConfig.milkCuresBadOmen && stack.is(net.minecraft.world.item.Items.MILK_BUCKET) && badOmen != null) { -+ return entity.removeAllEffects(cause) && entity.addEffect(badOmen); -+ } -+ // Purpur end - Option to toggle milk curing bad omen - return entity.removeAllEffects(cause); - // CraftBukkit end - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/crafting/Ingredient.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/crafting/Ingredient.java.patch deleted file mode 100644 index 63a1394f0..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/item/crafting/Ingredient.java.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/item/crafting/Ingredient.java b/net/minecraft/world/item/crafting/Ingredient.java -index da95f40503f3696c8daa8fd0e947508fe43060ba..edeb3d74b0f240914b84da6dff3b057e89617a11 100644 ---- a/net/minecraft/world/item/crafting/Ingredient.java -+++ b/net/minecraft/world/item/crafting/Ingredient.java -@@ -36,6 +36,7 @@ public final class Ingredient implements StackedContents.IngredientInfo itemStacks; // Paper - Improve exact choice recipe ingredients -+ public Predicate predicate; // Purpur - Add predicate to recipe's ExactChoice ingredient - - public boolean isExact() { - return this.itemStacks != null; -@@ -88,6 +89,11 @@ public final class Ingredient implements StackedContents.IngredientInfo -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java -index ff9dd4aedc91d151f1955e2e9bed1c597341964c..93fa81eb9d4ad5f942f96ba0c0e69635a5fc408f 100644 ---- a/net/minecraft/world/level/BaseSpawner.java -+++ b/net/minecraft/world/level/BaseSpawner.java -@@ -60,6 +60,7 @@ public abstract class BaseSpawner { - } - - public boolean isNearPlayer(Level level, BlockPos pos) { -+ if (level.purpurConfig.spawnerDeactivateByRedstone && level.hasNeighborSignal(pos)) return false; // Purpur - Redstone deactivates spawners - return level.hasNearbyAlivePlayerThatAffectsSpawning(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, this.requiredPlayerRange); // Paper - Affects Spawning API - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/EntityGetter.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/EntityGetter.java.patch deleted file mode 100644 index cb70056d5..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/EntityGetter.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/EntityGetter.java b/net/minecraft/world/level/EntityGetter.java -index 6ae3698e8e2c84fb21c0a4facbbf1568dbd45405..1ad405fba4d7f8e7f4e8dc97b3a73692c16de104 100644 ---- a/net/minecraft/world/level/EntityGetter.java -+++ b/net/minecraft/world/level/EntityGetter.java -@@ -187,7 +187,7 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst - - default boolean hasNearbyAlivePlayer(double x, double y, double z, double distance) { - for (Player player : this.players()) { -- if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { -+ if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player) && EntitySelector.notAfk.test(player)) { // Purpur - AFK API - double d = player.distanceToSqr(x, y, z); - if (distance < 0.0 || d < distance * distance) { - return true; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/NaturalSpawner.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/NaturalSpawner.java.patch deleted file mode 100644 index 50403dd96..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/NaturalSpawner.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java -index 4e5078495037078922ab6350a500acdabe177ca5..14e21c5439cfdf870feeccf638d6494a0c003d64 100644 ---- a/net/minecraft/world/level/NaturalSpawner.java -+++ b/net/minecraft/world/level/NaturalSpawner.java -@@ -264,7 +264,7 @@ public final class NaturalSpawner { - mutableBlockPos.set(x, y, z); - double d = x + 0.5; - double d1 = z + 0.5; -- Player nearestPlayer = level.getNearestPlayer(d, y, d1, -1.0, false); -+ Player nearestPlayer = level.getNearestPlayer(d, y, d1, -1.0, level.purpurConfig.mobSpawningIgnoreCreativePlayers); // Purpur - mob spawning option to ignore creative players - if (nearestPlayer != null) { - double d2 = nearestPlayer.distanceToSqr(d, y, d1); - if (level.isLoadedAndInBounds(mutableBlockPos) && isRightDistanceToPlayerAndSpawnPoint(level, chunk, mutableBlockPos, d2)) { // Paper - don't load chunks for mob spawn diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch deleted file mode 100644 index 3894ffef3..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java -index e348412960da6623cf8d878ea37af05e6b606adc..f178c45c834aa276522c4ecd6995d9eaf63d3eb6 100644 ---- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java -+++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java -@@ -39,6 +39,7 @@ public abstract class BaseCoralPlantTypeBlock extends Block implements SimpleWat - } - - protected static boolean scanForWater(BlockState state, BlockGetter level, BlockPos pos) { -+ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die - if (state.getValue(WATERLOGGED)) { - return true; - } else { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseFireBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseFireBlock.java.patch deleted file mode 100644 index 6eff082e3..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BaseFireBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/BaseFireBlock.java b/net/minecraft/world/level/block/BaseFireBlock.java -index 1ff7387320928af6630b9e0cbc30199b4770737d..42e897dc4bee8e9c075415d494ce13c404f2042a 100644 ---- a/net/minecraft/world/level/block/BaseFireBlock.java -+++ b/net/minecraft/world/level/block/BaseFireBlock.java -@@ -208,7 +208,7 @@ public abstract class BaseFireBlock extends Block { - boolean flag = false; - - for (Direction direction1 : Direction.values()) { -- if (level.getBlockState(mutableBlockPos.set(pos).move(direction1)).is(Blocks.OBSIDIAN)) { -+ if (PortalShape.FRAME.test(level.getBlockState(mutableBlockPos.set(pos).move(direction1)), level, mutableBlockPos)) { // Purpur - Crying obsidian valid for portal frames - flag = true; - break; - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch deleted file mode 100644 index 0c67ed1bd..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BigDripleafBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/BigDripleafBlock.java b/net/minecraft/world/level/block/BigDripleafBlock.java -index c2ef71dd9ee070f80d32b8829b80240ff22f0f7f..9cbeba234dc96264a6bb134fc2af073e62925836 100644 ---- a/net/minecraft/world/level/block/BigDripleafBlock.java -+++ b/net/minecraft/world/level/block/BigDripleafBlock.java -@@ -251,7 +251,7 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone - playTiltSound(level, pos, sound); - } - -- int _int = DELAY_UNTIL_NEXT_TILT_STATE.getInt(tilt); -+ int _int = level.purpurConfig.bigDripleafTiltDelay.getOrDefault(tilt, -1); // Purpur - Big dripleaf tilt delay - if (_int != -1) { - level.scheduleTick(pos, this, _int); - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch deleted file mode 100644 index 505599a33..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/BubbleColumnBlock.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/BubbleColumnBlock.java b/net/minecraft/world/level/block/BubbleColumnBlock.java -index 596640c1473b8526b8bb57c5714a84ee55372d07..26f6a795a4d5be2b1c319a114c26c8f5f607d9cd 100644 ---- a/net/minecraft/world/level/block/BubbleColumnBlock.java -+++ b/net/minecraft/world/level/block/BubbleColumnBlock.java -@@ -99,9 +99,9 @@ public class BubbleColumnBlock extends Block implements BucketPickup { - if (state.is(Blocks.BUBBLE_COLUMN)) { - return state; - } else if (state.is(Blocks.SOUL_SAND)) { -- return Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, false); -+ return Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, org.purpurmc.purpur.PurpurConfig.soulSandBlockReverseBubbleColumnFlow); // Purpur - Config to reverse bubble column flow - } else { -- return state.is(Blocks.MAGMA_BLOCK) ? Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, true) : Blocks.WATER.defaultBlockState(); -+ return state.is(Blocks.MAGMA_BLOCK) ? Blocks.BUBBLE_COLUMN.defaultBlockState().setValue(DRAG_DOWN, !org.purpurmc.purpur.PurpurConfig.magmaBlockReverseBubbleColumnFlow) : Blocks.WATER.defaultBlockState(); // Purpur - Config to reverse bubble column flow - } - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CampfireBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CampfireBlock.java.patch deleted file mode 100644 index d43c6b7ac..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CampfireBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CampfireBlock.java b/net/minecraft/world/level/block/CampfireBlock.java -index b9e11a361e91cf3d5c929330fc0ba59cfe903198..2049ccee48c63fc0bfb5e5486c2603756fd20c7d 100644 ---- a/net/minecraft/world/level/block/CampfireBlock.java -+++ b/net/minecraft/world/level/block/CampfireBlock.java -@@ -123,7 +123,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB - return this.defaultBlockState() - .setValue(WATERLOGGED, flag) - .setValue(SIGNAL_FIRE, this.isSmokeSource(level.getBlockState(clickedPos.below()))) -- .setValue(LIT, !flag) -+ .setValue(LIT, level.getMinecraftWorld().purpurConfig.campFireLitWhenPlaced && !flag) // Purpur - Campfire option for lit when placed - .setValue(FACING, context.getHorizontalDirection()); - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch deleted file mode 100644 index 60b4647c2..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CarvedPumpkinBlock.java.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CarvedPumpkinBlock.java b/net/minecraft/world/level/block/CarvedPumpkinBlock.java -index b45e5f571e72028996f641157473039ba9dd3520..b192b384fa5b9b6ab5b72f6c6414c4fa4f36c75e 100644 ---- a/net/minecraft/world/level/block/CarvedPumpkinBlock.java -+++ b/net/minecraft/world/level/block/CarvedPumpkinBlock.java -@@ -67,7 +67,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { - if (blockPatternMatch != null) { - SnowGolem snowGolem = EntityType.SNOW_GOLEM.create(level, EntitySpawnReason.TRIGGERED); - if (snowGolem != null) { -- spawnGolemInWorld(level, blockPatternMatch, snowGolem, blockPatternMatch.getBlock(0, 2, 0).getPos()); -+ spawnGolemInWorld(level, blockPatternMatch, snowGolem, blockPatternMatch.getBlock(0, 2, 0).getPos(), this.placer); // Purpur - Summoner API - return; - } - } -@@ -77,7 +77,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { - IronGolem ironGolem = EntityType.IRON_GOLEM.create(level, EntitySpawnReason.TRIGGERED); - if (ironGolem != null) { - ironGolem.setPlayerCreated(true); -- spawnGolemInWorld(level, blockPatternMatch1, ironGolem, blockPatternMatch1.getBlock(1, 2, 0).getPos()); -+ spawnGolemInWorld(level, blockPatternMatch1, ironGolem, blockPatternMatch1.getBlock(1, 2, 0).getPos(), this.placer); // Purpur - Summoner API - return; - } - } -@@ -86,7 +86,7 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { - if (blockPatternMatch2 != null) { - CopperGolem copperGolem = EntityType.COPPER_GOLEM.create(level, EntitySpawnReason.TRIGGERED); - if (copperGolem != null) { -- spawnGolemInWorld(level, blockPatternMatch2, copperGolem, blockPatternMatch2.getBlock(0, 0, 0).getPos()); -+ spawnGolemInWorld(level, blockPatternMatch2, copperGolem, blockPatternMatch2.getBlock(0, 0, 0).getPos(), this.placer); // Purpur - Summoner API - if (!copperGolem.valid) return; // Paper - entityspawnevent - entity was not added to the world so prevent world mutation - this.replaceCopperBlockWithChest(level, blockPatternMatch2); - copperGolem.spawn(this.getWeatherStateFromPattern(blockPatternMatch2)); -@@ -105,7 +105,20 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { - .getAge(); - } - -+ @io.papermc.paper.annotation.DoNotUse - private static void spawnGolemInWorld(Level level, BlockPattern.BlockPatternMatch patternMatch, Entity golem, BlockPos pos) { -+ // Purpur start - Summoner API -+ spawnGolemInWorld(level, patternMatch, golem, pos, null); -+ } -+ private static void spawnGolemInWorld(Level level, BlockPattern.BlockPatternMatch patternMatch, Entity golem, BlockPos pos, net.minecraft.world.entity.LivingEntity placer) { -+ java.util.UUID summoner = placer == null ? null : placer.getUUID(); -+ switch (golem) { -+ case SnowGolem snowGolem -> snowGolem.setSummoner(summoner); -+ case IronGolem ironGolem -> ironGolem.setSummoner(summoner); -+ case CopperGolem copperGolem -> copperGolem.setSummoner(summoner); -+ default -> throw new IllegalStateException("Unexpected value: " + golem); -+ } -+ // Purpur end - Summoner API - // clearPatternBlocks(level, patternMatch); // Paper - moved down - golem.snapTo(pos.getX() + 0.5, pos.getY() + 0.05, pos.getZ() + 0.5, 0.0F, 0.0F); - // Paper start diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch deleted file mode 100644 index 167d58da1..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CaveVinesBlock.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CaveVinesBlock.java b/net/minecraft/world/level/block/CaveVinesBlock.java -index f4a4dc14012c110e58b1c9272d80d4b89394d090..da85ec2b88b200fd28d89d9ae35c7319d4b028b7 100644 ---- a/net/minecraft/world/level/block/CaveVinesBlock.java -+++ b/net/minecraft/world/level/block/CaveVinesBlock.java -@@ -92,4 +92,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements CaveVines { - public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) { - level.setBlock(pos, state.setValue(BERRIES, true), Block.UPDATE_CLIENTS); - } -+ -+ // Purpur start - cave vines configurable max growth age -+ @Override -+ public int getMaxGrowthAge() { -+ return org.purpurmc.purpur.PurpurConfig.caveVinesMaxGrowthAge; -+ } -+ // Purpur end - cave vines configurable max growth age - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch deleted file mode 100644 index f09b60208..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChangeOverTimeBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/ChangeOverTimeBlock.java b/net/minecraft/world/level/block/ChangeOverTimeBlock.java -index ea5a987b9925a7ff0cbc65a9cd98114770377442..d03e234fe20b33ebf7b6af6fb1b1738a6ff48a99 100644 ---- a/net/minecraft/world/level/block/ChangeOverTimeBlock.java -+++ b/net/minecraft/world/level/block/ChangeOverTimeBlock.java -@@ -51,7 +51,7 @@ public interface ChangeOverTimeBlock> { - } - - float f = (float)(i1 + 1) / (i1 + i + 1); -- float f1 = f * f * this.getChanceModifier(); -+ float f1 = level.purpurConfig.disableOxidationProximityPenalty ? this.getChanceModifier() :f * f * this.getChanceModifier();// Purpur - option to disable the copper oxidation proximity penalty - return random.nextFloat() < f1 ? this.getNext(state) : Optional.empty(); - } - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChestBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChestBlock.java.patch deleted file mode 100644 index aea974c33..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ChestBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/ChestBlock.java b/net/minecraft/world/level/block/ChestBlock.java -index fa2dce759419f62825000718361f47c6f208cdb2..6cd7150c23572b1ad627cabe406ebd9015a89c31 100644 ---- a/net/minecraft/world/level/block/ChestBlock.java -+++ b/net/minecraft/world/level/block/ChestBlock.java -@@ -370,6 +370,7 @@ public class ChestBlock extends AbstractChestBlock implements - } - - public static boolean isBlockedChestByBlock(BlockGetter level, BlockPos pos) { -+ if (level instanceof Level level1 && level1.purpurConfig.chestOpenWithBlockOnTop) return false; // Purpur - Option for chests to open even with a solid block on top - BlockPos blockPos = pos.above(); - return level.getBlockState(blockPos).isRedstoneConductor(level, blockPos); - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ComposterBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ComposterBlock.java.patch deleted file mode 100644 index c57f7d05c..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ComposterBlock.java.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java -index 429e833ffe7c89d7b0ca7515dbd82ffc1ce8d60d..f57feed60fdd99cc652be67ed2ada7d761167deb 100644 ---- a/net/minecraft/world/level/block/ComposterBlock.java -+++ b/net/minecraft/world/level/block/ComposterBlock.java -@@ -250,17 +250,27 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - ) { - int levelValue = state.getValue(LEVEL); - if (levelValue < 8 && COMPOSTABLES.containsKey(stack.getItem())) { -- if (levelValue < 7 && !level.isClientSide()) { -- BlockState blockState = addItem(player, state, level, pos, stack); -- // Paper start - handle cancelled events -- if (blockState == null) { -- return InteractionResult.PASS; -- } -- // Paper end -- level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0); -- player.awardStat(Stats.ITEM_USED.get(stack.getItem())); -- stack.consume(1, player); -+ // Purpur start - sneak to bulk process composter -+ BlockState newState = process(levelValue, player, state, level, pos, stack); -+ if (newState == null) { -+ return InteractionResult.PASS; - } -+ if (level.purpurConfig.composterBulkProcess && player.isShiftKeyDown() && newState != state) { -+ BlockState oldState; -+ int oldCount, newCount, oldLevel, newLevel; -+ do { -+ oldState = newState; -+ oldCount = stack.getCount(); -+ oldLevel = oldState.getValue(ComposterBlock.LEVEL); -+ newState = process(oldLevel, player, oldState, level, pos, stack); -+ if (newState == null) { -+ return InteractionResult.PASS; -+ } -+ newCount = stack.getCount(); -+ newLevel = newState.getValue(ComposterBlock.LEVEL); -+ } while (newCount > 0 && (newCount != oldCount || newLevel != oldLevel || newState != oldState)); -+ } -+ // Purpur end - Sneak to bulk process composter - - return InteractionResult.SUCCESS; - } else { -@@ -268,6 +278,25 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - } - } - -+ // Purpur start - sneak to bulk process composter -+ private static @Nullable BlockState process(int levelValue, Player player, BlockState state, Level level, BlockPos pos, ItemStack stack) { -+ if (levelValue < 7 && !level.isClientSide()) { -+ BlockState blockState = ComposterBlock.addItem(player, state, level, pos, stack); -+ // Paper start - handle cancelled events -+ if (blockState == null) { -+ return null; -+ } -+ // Paper end -+ -+ level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0); -+ player.awardStat(Stats.ITEM_USED.get(stack.getItem())); -+ stack.consume(1, player); -+ return blockState; -+ } -+ return state; -+ } -+ // Purpur end - Sneak to bulk process composter -+ - @Override - protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { - int levelValue = state.getValue(LEVEL); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CoralBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CoralBlock.java.patch deleted file mode 100644 index f2e14b899..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/CoralBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/CoralBlock.java b/net/minecraft/world/level/block/CoralBlock.java -index 1c86b4fce7392851b2e33914fb588775f90f766b..337985a30767aaac573fce6301b2690473f8305a 100644 ---- a/net/minecraft/world/level/block/CoralBlock.java -+++ b/net/minecraft/world/level/block/CoralBlock.java -@@ -65,6 +65,7 @@ public class CoralBlock extends Block { - } - - protected boolean scanForWater(BlockGetter level, BlockPos pos) { -+ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die - for (Direction direction : Direction.values()) { - FluidState fluidState = level.getFluidState(pos.relative(direction)); - if (fluidState.is(FluidTags.WATER)) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DragonEggBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DragonEggBlock.java.patch deleted file mode 100644 index d6ece93cf..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/DragonEggBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/DragonEggBlock.java b/net/minecraft/world/level/block/DragonEggBlock.java -index 52160294e39e3f0f471087a1fcb6e46763862954..c38fbff78f1acef9328c91d7b88d5db1971c9474 100644 ---- a/net/minecraft/world/level/block/DragonEggBlock.java -+++ b/net/minecraft/world/level/block/DragonEggBlock.java -@@ -46,6 +46,7 @@ public class DragonEggBlock extends FallingBlock { - } - - private void teleport(BlockState state, Level level, BlockPos pos) { -+ if (!level.purpurConfig.dragonEggTeleport) return; // Purpur - Option to disable dragon egg teleporting - WorldBorder worldBorder = level.getWorldBorder(); - - for (int i = 0; i < 1000; i++) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch deleted file mode 100644 index 259c85929..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/GrowingPlantHeadBlock.java.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -index bac7f990282fd7c676c2f8c40d7fd87badb1e284..c1b22036bd3da2dc0b59551cf8e5280d055c0951 100644 ---- a/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -+++ b/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -@@ -34,12 +34,12 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements - - @Override - public BlockState getStateForPlacement(RandomSource random) { -- return this.defaultBlockState().setValue(AGE, random.nextInt(25)); -+ return this.defaultBlockState().setValue(AGE, getMaxGrowthAge() == 0 ? 0 : random.nextInt(getMaxGrowthAge())); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } - - @Override - protected boolean isRandomlyTicking(BlockState state) { -- return state.getValue(AGE) < 25; -+ return state.getValue(AGE) < getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } - - @Override -@@ -55,7 +55,7 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements - } else if (this == Blocks.CAVE_VINES) { - modifier = level.spigotConfig.caveVinesModifier; - } -- if (state.getValue(AGE) < 25 && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution -+ if (state.getValue(AGE) < getMaxGrowthAge() && random.nextDouble() < ((modifier / 100.0D) * this.growPerTickProbability)) { // Spigot - SPIGOT-7159: Better modifier resolution // Purpur - kelp, cave, weeping, and twisting configurable max growth age - // Spigot end - BlockPos blockPos = pos.relative(this.growthDirection); - if (this.canGrowInto(level.getBlockState(blockPos))) { -@@ -75,11 +75,11 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements - } - - public BlockState getMaxAgeState(BlockState state) { -- return state.setValue(AGE, 25); -+ return state.setValue(AGE, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } - - public boolean isMaxAge(BlockState state) { -- return state.getValue(AGE) == 25; -+ return state.getValue(AGE) >= getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } - - protected BlockState updateBodyAfterConvertedFromHead(BlockState head, BlockState body) { -@@ -137,13 +137,13 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements - @Override - public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) { - BlockPos blockPos = pos.relative(this.growthDirection); -- int min = Math.min(state.getValue(AGE) + 1, 25); -+ int min = Math.min(state.getValue(AGE) + 1, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - int blocksToGrowWhenBonemealed = this.getBlocksToGrowWhenBonemealed(random); - - for (int i = 0; i < blocksToGrowWhenBonemealed && this.canGrowInto(level.getBlockState(blockPos)); i++) { - level.setBlockAndUpdate(blockPos, state.setValue(AGE, min)); - blockPos = blockPos.relative(this.growthDirection); -- min = Math.min(min + 1, 25); -+ min = Math.min(min + 1, getMaxGrowthAge()); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } - } - -@@ -155,4 +155,6 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements - protected GrowingPlantHeadBlock getHeadBlock() { - return this; - } -+ -+ public abstract int getMaxGrowthAge(); // Purpur - kelp, cave, weeping, and twisting configurable max growth age - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/HayBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/HayBlock.java.patch deleted file mode 100644 index 986d33e9b..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/HayBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/HayBlock.java b/net/minecraft/world/level/block/HayBlock.java -index cdde0a25e0a499d7575c00796143a033feb1f22f..999ecf16180b0a862cf8527ce532acf725ba869a 100644 ---- a/net/minecraft/world/level/block/HayBlock.java -+++ b/net/minecraft/world/level/block/HayBlock.java -@@ -23,6 +23,6 @@ public class HayBlock extends RotatedPillarBlock { - - @Override - public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance) { -- entity.causeFallDamage(fallDistance, 0.2F, level.damageSources().fall()); -+ super.fallOn(level, state, pos, entity, fallDistance); // Purpur - Configurable block fall damage modifiers - } - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/KelpBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/KelpBlock.java.patch deleted file mode 100644 index 1d8fcff87..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/KelpBlock.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/KelpBlock.java b/net/minecraft/world/level/block/KelpBlock.java -index bf040f13b9c76056ec8cbfe9e9c2481d68c9c772..0c9238df402d493f58066735406ee174bffad5b1 100644 ---- a/net/minecraft/world/level/block/KelpBlock.java -+++ b/net/minecraft/world/level/block/KelpBlock.java -@@ -71,4 +71,11 @@ public class KelpBlock extends GrowingPlantHeadBlock implements LiquidBlockConta - protected FluidState getFluidState(BlockState state) { - return Fluids.WATER.getSource(false); - } -+ -+ // Purpur start - kelp vines configurable max growth age -+ @Override -+ public int getMaxGrowthAge() { -+ return org.purpurmc.purpur.PurpurConfig.kelpMaxGrowthAge; -+ } -+ // Purpur end - kelp vines configurable max growth age - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/LiquidBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/LiquidBlock.java.patch deleted file mode 100644 index 4c39c6cad..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/LiquidBlock.java.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/LiquidBlock.java b/net/minecraft/world/level/block/LiquidBlock.java -index 1f62dcf2709d430e996790750a691b12938eb09a..77d1ecfd0f866f3fa5cd8fdf88eb4c147ba07d81 100644 ---- a/net/minecraft/world/level/block/LiquidBlock.java -+++ b/net/minecraft/world/level/block/LiquidBlock.java -@@ -138,7 +138,7 @@ public class LiquidBlock extends Block implements BucketPickup { - - @Override - protected void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { -- if (this.shouldSpreadLiquid(level, pos, state)) { -+ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config - level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava - } - } -@@ -175,7 +175,7 @@ public class LiquidBlock extends Block implements BucketPickup { - BlockState neighborState, - RandomSource random - ) { -- if (state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { -+ if ((level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.tickFluids) && state.getFluidState().isSource() || neighborState.getFluidState().isSource()) { // Purpur - Tick fluids config - scheduledTickAccess.scheduleTick(pos, state.getFluidState().getType(), this.fluid.getTickDelay(level)); - } - -@@ -184,7 +184,7 @@ public class LiquidBlock extends Block implements BucketPickup { - - @Override - protected void neighborChanged(BlockState state, Level level, BlockPos pos, Block neighborBlock, @Nullable Orientation orientation, boolean movedByPiston) { -- if (this.shouldSpreadLiquid(level, pos, state)) { -+ if (level.purpurConfig.tickFluids && this.shouldSpreadLiquid(level, pos, state)) { // Purpur - Tick fluids config - level.scheduleTick(pos, state.getFluidState().getType(), this.getFlowSpeed(level, pos)); // Paper - Configurable speed for water flowing over lava - } - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/MagmaBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/MagmaBlock.java.patch deleted file mode 100644 index fd1ee401d..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/MagmaBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/MagmaBlock.java b/net/minecraft/world/level/block/MagmaBlock.java -index 71344cb2580fb9a3cd523e25fb1a245711e275dd..bec06566342663479ee8342b7e5ceec61758c448 100644 ---- a/net/minecraft/world/level/block/MagmaBlock.java -+++ b/net/minecraft/world/level/block/MagmaBlock.java -@@ -28,7 +28,7 @@ public class MagmaBlock extends Block { - - @Override - public void stepOn(Level level, BlockPos pos, BlockState state, Entity entity) { -- if (!entity.isSteppingCarefully() && entity instanceof LivingEntity) { -+ if ((!entity.isSteppingCarefully() || level.purpurConfig.magmaBlockDamageWhenSneaking) && entity instanceof LivingEntity) { // Purpur - Configurable damage settings for magma blocks - entity.hurt(level.damageSources().hotFloor().eventBlockDamager(level, pos), 1.0F); // CraftBukkit - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NoteBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NoteBlock.java.patch deleted file mode 100644 index a13324c12..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/NoteBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/NoteBlock.java b/net/minecraft/world/level/block/NoteBlock.java -index 1335e4e9953444417325bbfd9655d5b9bb004ff8..95d608ae93f0a5881cb4b789f6463268e09843b4 100644 ---- a/net/minecraft/world/level/block/NoteBlock.java -+++ b/net/minecraft/world/level/block/NoteBlock.java -@@ -101,7 +101,7 @@ public class NoteBlock extends Block { - } - - private void playNote(@Nullable Entity entity, BlockState state, Level level, BlockPos pos) { -- if (state.getValue(INSTRUMENT).worksAboveNoteBlock() || level.getBlockState(pos.above()).isAir()) { -+ if (level.purpurConfig.noteBlockIgnoreAbove || state.getValue(INSTRUMENT).worksAboveNoteBlock() || level.getBlockState(pos.above()).isAir()) { // Purpur - Config to allow Note Block sounds when blocked - level.blockEvent(pos, this, 0, 0); - level.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos); - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ObserverBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ObserverBlock.java.patch deleted file mode 100644 index a0da370d6..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/ObserverBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/ObserverBlock.java b/net/minecraft/world/level/block/ObserverBlock.java -index 3c12d8e23f20b666b0005e597ba2e803c02d5d78..df0a900c249f0fd778287d055a5ad92787c7ceb5 100644 ---- a/net/minecraft/world/level/block/ObserverBlock.java -+++ b/net/minecraft/world/level/block/ObserverBlock.java -@@ -81,6 +81,7 @@ public class ObserverBlock extends DirectionalBlock { - RandomSource random - ) { - if (state.getValue(FACING) == direction && !state.getValue(POWERED)) { -+ if (!(level.getWorldBorder().world != null && level.getWorldBorder().world.purpurConfig.disableObserverClocks) || !(neighborState.getBlock() instanceof ObserverBlock) || neighborState.getValue(ObserverBlock.FACING).getOpposite() != direction) // Purpur - Add Option for disable observer clocks - this.startSignal(level, scheduledTickAccess, pos); - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch deleted file mode 100644 index ee06dd849..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PointedDripstoneBlock.java.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/PointedDripstoneBlock.java b/net/minecraft/world/level/block/PointedDripstoneBlock.java -index 1510827a9d402d78cf5a6ba0a973bb7b88668aac..e9ec6c5f2dd4e0b2e2bd8f5c3e40ddc7af22fdb8 100644 ---- a/net/minecraft/world/level/block/PointedDripstoneBlock.java -+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java -@@ -194,20 +194,20 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate - - @VisibleForTesting - public static void maybeTransferFluid(BlockState state, ServerLevel level, BlockPos pos, float randChance) { -- if (!(randChance > 0.17578125F) || !(randChance > 0.05859375F)) { -+ if (!(randChance > level.purpurConfig.cauldronDripstoneWaterFillChance) || !(randChance > level.purpurConfig.cauldronDripstoneLavaFillChance)) { // Purpur - Cauldron fill chances - if (isStalactiteStartPos(state, level, pos)) { - Optional fluidAboveStalactite = getFluidAboveStalactite(level, pos, state); - if (!fluidAboveStalactite.isEmpty()) { - Fluid fluid = fluidAboveStalactite.get().fluid; - float f; - if (fluid == Fluids.WATER) { -- f = 0.17578125F; -+ f = level.purpurConfig.cauldronDripstoneWaterFillChance; // Purpur - Cauldron fill chances - } else { - if (fluid != Fluids.LAVA) { - return; - } - -- f = 0.05859375F; -+ f = level.purpurConfig.cauldronDripstoneLavaFillChance; // Purpur - Cauldron fill chances - } - - if (!(randChance >= f)) { diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch deleted file mode 100644 index 9d0e7241b..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/PoweredRailBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/PoweredRailBlock.java b/net/minecraft/world/level/block/PoweredRailBlock.java -index 1d1a2e183624ebae22b966ab59a174e941f139c0..e5b1b5ef643e5bfacd79120f97f15ad8beb8c7ee 100644 ---- a/net/minecraft/world/level/block/PoweredRailBlock.java -+++ b/net/minecraft/world/level/block/PoweredRailBlock.java -@@ -28,7 +28,7 @@ public class PoweredRailBlock extends BaseRailBlock { - } - - protected boolean findPoweredRailSignal(Level level, BlockPos pos, BlockState state, boolean searchForward, int recursionCount) { -- if (recursionCount >= 8) { -+ if (recursionCount >= level.purpurConfig.railActivationRange) { // Purpur - Config for powered rail activation distance - return false; - } else { - int x = pos.getX(); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch deleted file mode 100644 index d16f08776..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/RespawnAnchorBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/RespawnAnchorBlock.java b/net/minecraft/world/level/block/RespawnAnchorBlock.java -index e90651ae6ab072c9fa9c179ae56329e0d816c77b..2b96781a2aaaef3837e617fa982c0d35862d4f39 100644 ---- a/net/minecraft/world/level/block/RespawnAnchorBlock.java -+++ b/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -166,7 +166,7 @@ public class RespawnAnchorBlock extends Block { - }; - Vec3 center = pos2.getCenter(); - level.explode( -- null, level.damageSources().badRespawnPointExplosion(center).causingBlockSnapshot(blockState), explosionDamageCalculator, center, 5.0F, true, Level.ExplosionInteraction.BLOCK // CraftBukkit - add state -+ null, level.damageSources().badRespawnPointExplosion(center).causingBlockSnapshot(blockState), explosionDamageCalculator, center, (float) level.purpurConfig.respawnAnchorExplosionPower, level.purpurConfig.respawnAnchorExplosionFire, level.purpurConfig.respawnAnchorExplosionEffect // CraftBukkit - add state // Purpur - Implement respawn anchor explosion options - ); - } - diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch deleted file mode 100644 index ba6376ac6..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SculkShriekerBlock.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SculkShriekerBlock.java b/net/minecraft/world/level/block/SculkShriekerBlock.java -index 2815fb48530de3a2f9ef0f472a0fd0a2c32140b6..39f5d04a2795d5e62a961c9fa5a23b79d9d81fa2 100644 ---- a/net/minecraft/world/level/block/SculkShriekerBlock.java -+++ b/net/minecraft/world/level/block/SculkShriekerBlock.java -@@ -116,7 +116,7 @@ public class SculkShriekerBlock extends BaseEntityBlock implements SimpleWaterlo - - @Override - public @Nullable BlockState getStateForPlacement(BlockPlaceContext context) { -- return this.defaultBlockState().setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER); -+ return this.defaultBlockState().setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER).setValue(SculkShriekerBlock.CAN_SUMMON, context.getLevel().purpurConfig.sculkShriekerCanSummonDefault); // Purpur - Config for sculk shrieker can_summon state - } - - @Override diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch deleted file mode 100644 index 4d8d83bca..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SnowLayerBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SnowLayerBlock.java b/net/minecraft/world/level/block/SnowLayerBlock.java -index de7e600ca1348b61990aaf4ffdd91c6c3ec13cf6..9967feffac868e824edf6be1b008fcd3530f3058 100644 ---- a/net/minecraft/world/level/block/SnowLayerBlock.java -+++ b/net/minecraft/world/level/block/SnowLayerBlock.java -@@ -76,6 +76,7 @@ public class SnowLayerBlock extends Block { - @Override - protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { - BlockState blockState = level.getBlockState(pos.below()); -+ if (blockState.is(Blocks.BLUE_ICE) && !(level.getWorldBorder().world == null || level.getWorldBorder().world.purpurConfig.snowOnBlueIce)) return false; // Purpur - Add config for snow on blue ice - return !blockState.is(BlockTags.SNOW_LAYER_CANNOT_SURVIVE_ON) - && ( - blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON) diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpongeBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpongeBlock.java.patch deleted file mode 100644 index 0005471dd..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/SpongeBlock.java.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/SpongeBlock.java b/net/minecraft/world/level/block/SpongeBlock.java -index 298e51da2da64fdaa860108cc34e59d214b5f9a7..0ce317ad5f3f7a08914d04ace2259f7fdb6f906e 100644 ---- a/net/minecraft/world/level/block/SpongeBlock.java -+++ b/net/minecraft/world/level/block/SpongeBlock.java -@@ -53,8 +53,8 @@ public class SpongeBlock extends Block { - org.bukkit.craftbukkit.util.BlockStateListPopulator blockList = new org.bukkit.craftbukkit.util.BlockStateListPopulator(level); // CraftBukkit - Use BlockStateListPopulator - BlockPos.breadthFirstTraversal( - pos, -- 6, -- 65, -+ level.purpurConfig.spongeAbsorptionRadius, // Purpur - Configurable sponge absorption -+ level.purpurConfig.spongeAbsorptionArea, // Purpur - Configurable sponge absorption - (validPos, queueAdder) -> { - for (Direction direction : ALL_DIRECTIONS) { - queueAdder.accept(validPos.relative(direction)); -@@ -68,7 +68,7 @@ public class SpongeBlock extends Block { - BlockState blockState = blockList.getBlockState(blockPos); - FluidState fluidState = blockList.getFluidState(blockPos); - // CraftBukkit end -- if (!fluidState.is(FluidTags.WATER)) { -+ if (!fluidState.is(FluidTags.WATER) && (!level.purpurConfig.spongeAbsorbsLava || !fluidState.is(FluidTags.LAVA)) && (!level.purpurConfig.spongeAbsorbsWaterFromMud || !blockState.is(Blocks.MUD))) { // Purpur - Option for sponges to work on lava and mud - return BlockPos.TraversalNodeStatus.SKIP; - } else if (blockState.getBlock() instanceof BucketPickup bucketPickup - && !bucketPickup.pickupBlock(null, blockList, blockPos, blockState).isEmpty()) { // CraftBukkit -@@ -76,6 +76,10 @@ public class SpongeBlock extends Block { - } else { - if (blockState.getBlock() instanceof LiquidBlock) { - blockList.setBlock(blockPos, Blocks.AIR.defaultBlockState(), Block.UPDATE_ALL); // CraftBukkit -+ // Purpur start - Option for sponges to work on lava and mud -+ } else if (blockState.is(Blocks.MUD)) { -+ blockList.setBlock(blockPos, Blocks.CLAY.defaultBlockState(), Block.UPDATE_ALL); -+ // Purpur end - Option for sponges to work on lava and mud - } else { - if (!blockState.is(Blocks.KELP) - && !blockState.is(Blocks.KELP_PLANT) diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch deleted file mode 100644 index efe10853b..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/TwistingVinesBlock.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/TwistingVinesBlock.java b/net/minecraft/world/level/block/TwistingVinesBlock.java -index afb77747ea6966c435aca4b667bfbbc909f52232..361aaca76ae0375782310af0e03241625f08f7bd 100644 ---- a/net/minecraft/world/level/block/TwistingVinesBlock.java -+++ b/net/minecraft/world/level/block/TwistingVinesBlock.java -@@ -34,4 +34,11 @@ public class TwistingVinesBlock extends GrowingPlantHeadBlock { - protected boolean canGrowInto(BlockState state) { - return NetherVines.isValidGrowthState(state); - } -+ -+ // Purpur start - twisting vines configurable max growth age -+ @Override -+ public int getMaxGrowthAge() { -+ return org.purpurmc.purpur.PurpurConfig.twistingVinesMaxGrowthAge; -+ } -+ // Purpur end - twisting vines configurable max growth age - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch deleted file mode 100644 index 9760066eb..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WeepingVinesBlock.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/WeepingVinesBlock.java b/net/minecraft/world/level/block/WeepingVinesBlock.java -index f4ff810cdd4206711312a4fffba18f4b30a5701f..96fb69aaf9ed020a328ff609d49f88ab29a69952 100644 ---- a/net/minecraft/world/level/block/WeepingVinesBlock.java -+++ b/net/minecraft/world/level/block/WeepingVinesBlock.java -@@ -34,4 +34,11 @@ public class WeepingVinesBlock extends GrowingPlantHeadBlock { - protected boolean canGrowInto(BlockState state) { - return NetherVines.isValidGrowthState(state); - } -+ -+ // Purpur start - weeping vines configurable max growth age -+ @Override -+ public int getMaxGrowthAge() { -+ return org.purpurmc.purpur.PurpurConfig.weepingVinesMaxGrowthAge; -+ } -+ // Purpur end - weeping vines configurable max growth age - } diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch deleted file mode 100644 index 1e6144bb1..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/block/WitherSkullBlock.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/block/WitherSkullBlock.java b/net/minecraft/world/level/block/WitherSkullBlock.java -index 24215493601ff724032660178c1261f3c40edd61..dd4d0c2fa77fc62ce2c3dfb2be902dcde3aa9cd7 100644 ---- a/net/minecraft/world/level/block/WitherSkullBlock.java -+++ b/net/minecraft/world/level/block/WitherSkullBlock.java -@@ -69,6 +69,7 @@ public class WitherSkullBlock extends SkullBlock { - ); - witherBoss.yBodyRot = blockPatternMatch.getForwards().getAxis() == Direction.Axis.X ? 0.0F : 90.0F; - witherBoss.makeInvulnerable(); -+ witherBoss.setSummoner(blockState.getBlock().placer == null ? null : blockState.getBlock().placer.getUUID()); // Purpur - Summoner API - // CraftBukkit start - if (!level.addFreshEntity(witherBoss, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_WITHER)) { - return; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch deleted file mode 100644 index aaf8ddfc9..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/chunk/storage/EntityStorage.java.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/chunk/storage/EntityStorage.java b/net/minecraft/world/level/chunk/storage/EntityStorage.java -index 2ce9caafffc86fee82abf0a33423a172a8158e37..65afe543c7b974b13e7da8d0c047db9fea6994f5 100644 ---- a/net/minecraft/world/level/chunk/storage/EntityStorage.java -+++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java -@@ -108,6 +108,7 @@ public class EntityStorage implements EntityPersistentStorage { - } - // Paper end - Entity load/save limit per chunk - TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector.forChild(entity.problemPath()), entity.registryAccess()); -+ if (!entity.canSaveToDisk()) return; // Purpur - Add canSaveToDisk to Entity - if (entity.save(tagValueOutput)) { - CompoundTag compoundTag1 = tagValueOutput.buildResult(); - listTag.add(compoundTag1); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/FlowingFluid.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/FlowingFluid.java.patch deleted file mode 100644 index 5abd1cab1..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/material/FlowingFluid.java.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java -index 85e9ec8061fc01d39977f6db314da14b1e7725e1..9685d02a9837c773094a5da5cff6fa6fcfeed86a 100644 ---- a/net/minecraft/world/level/material/FlowingFluid.java -+++ b/net/minecraft/world/level/material/FlowingFluid.java -@@ -233,7 +233,7 @@ public abstract class FlowingFluid extends Fluid { - } - } - -- if (i1 >= 2 && this.canConvertToSource(level)) { -+ if (i1 >= this.getRequiredSources(level) && this.canConvertToSource(level)) { // Purpur - Implement infinite liquids - BlockState blockState1 = level.getBlockState(mutableBlockPos.setWithOffset(pos, Direction.DOWN)); - FluidState fluidState1 = blockState1.getFluidState(); - if (blockState1.isSolid() || this.isSourceBlockOfThisType(fluidState1)) { -@@ -321,6 +321,12 @@ public abstract class FlowingFluid extends Fluid { - - protected abstract boolean canConvertToSource(ServerLevel level); - -+ // Purpur start - Implement infinite liquids -+ protected int getRequiredSources(Level level) { -+ return 2; -+ } -+ // Purpur end - Implement infinite liquids -+ - protected void spreadTo(LevelAccessor level, BlockPos pos, BlockState state, Direction direction, FluidState fluidState) { - if (state.getBlock() instanceof LiquidBlockContainer liquidBlockContainer) { - liquidBlockContainer.placeLiquid(level, pos, state, fluidState); diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch deleted file mode 100644 index 3535e24d5..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -index ca5448b2531d2f7126132723c4fa8d49835a4850..876aef8dab7187a69bcb380692d0f6a583fb38bd 100644 ---- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -+++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -@@ -239,7 +239,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { - if ((node == null || node.costMalus < 0.0F) - && verticalDeltaLimit > 0 - && (cachedPathType != PathType.FENCE || this.canWalkOverFences()) -- && cachedPathType != PathType.UNPASSABLE_RAIL -+ && (this.mob.level().purpurConfig.mobsIgnoreRails || cachedPathType != PathType.UNPASSABLE_RAIL) // Purpur - Config to allow mobs to pathfind over rails - && cachedPathType != PathType.TRAPDOOR - && cachedPathType != PathType.POWDER_SNOW) { - node = this.tryJumpOn(x, y, z, verticalDeltaLimit, nodeFloorLevel, direction, pathType, mutableBlockPos); -@@ -490,7 +490,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { - return PathType.TRAPDOOR; - } else if (blockState.is(Blocks.POWDER_SNOW)) { - return PathType.POWDER_SNOW; -- } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { -+ } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - Stonecutter damage - return PathType.DAMAGE_OTHER; - } else if (blockState.is(Blocks.HONEY_BLOCK)) { - return PathType.STICKY_HONEY; diff --git a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/portal/PortalShape.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/portal/PortalShape.java.patch deleted file mode 100644 index 47e41996f..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/portal/PortalShape.java.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/portal/PortalShape.java b/net/minecraft/world/level/portal/PortalShape.java -index 275e98ea476a790ff3cedf19689a9538b3b2ee53..c88339479dd59a399ff4b250208311a18eea950f 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/unapplied-sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch b/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch deleted file mode 100644 index 7a916ccae..000000000 --- a/purpur-server/minecraft-patches/unapplied-sources/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001 -From: File -Date: Sun, 20 Apr 1997 05:37:42 -0800 -Subject: [PATCH] purpur File Patches - - -diff --git a/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java b/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java -index c4f29da30d63deb3f9eabafcf62a946ff148b6b7..cdd2e1f1fc83cad782311ae5ba618fcf5fa9f37d 100644 ---- a/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java -+++ b/net/minecraft/world/level/storage/loot/functions/EnchantedCountIncreaseFunction.java -@@ -66,6 +66,11 @@ public class EnchantedCountIncreaseFunction extends LootItemConditionalFunction - Entity entity = context.getOptionalParameter(LootContextParams.ATTACKING_ENTITY); - if (entity instanceof LivingEntity livingEntity) { - int enchantmentLevel = EnchantmentHelper.getEnchantmentLevel(this.enchantment, livingEntity); -+ // Purpur start - Add an option to fix MC-3304 projectile looting -+ if (org.purpurmc.purpur.PurpurConfig.fixProjectileLootingTransfer && context.getOptionalParameter(LootContextParams.DIRECT_ATTACKING_ENTITY) instanceof net.minecraft.world.entity.projectile.arrow.AbstractArrow arrow) { -+ enchantmentLevel = arrow.actualEnchantments.getLevel(this.enchantment); -+ } -+ // Purpur end - Add an option to fix MC-3304 projectile looting - if (enchantmentLevel == 0) { - return stack; - }