diff --git a/patches/unapplied/server/minecraft-patches/sources/io/papermc/paper/command/subcommands/FixLightCommand.java.patch b/divinemc-server/minecraft-patches/sources/io/papermc/paper/command/subcommands/FixLightCommand.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/io/papermc/paper/command/subcommands/FixLightCommand.java.patch rename to divinemc-server/minecraft-patches/sources/io/papermc/paper/command/subcommands/FixLightCommand.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch similarity index 98% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch index 05a9f23..5281b0f 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/MinecraftServer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -994,6 +_,13 @@ +@@ -986,6 +_,13 @@ if (this.hasStopped) return; this.hasStopped = true; } diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/PlayerAdvancements.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch similarity index 96% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index f79e55a..0e54f81 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -2266,6 +_,7 @@ +@@ -2190,6 +_,7 @@ this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, gameMode.getId())); if (gameMode == GameType.SPECTATOR) { this.removeEntitiesOnShoulder(); diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch similarity index 98% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index 91384eb..dd4fe4b 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -733,8 +_,14 @@ +@@ -725,8 +_,14 @@ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/network/ServerStatusPacketListenerImpl.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch similarity index 64% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch index f7172a5..1c94562 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/server/players/PlayerList.java.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -716,7 +_,6 @@ - return this.respawn(player, keepInventory, reason, eventReason, null); +@@ -715,7 +_,6 @@ } - public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, org.bukkit.Location location) { + + public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, @Nullable org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, @Nullable org.bukkit.Location location) { - player.stopRiding(); // CraftBukkit this.players.remove(player); this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/rcon/RconConsoleSource.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/server/rcon/RconConsoleSource.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/server/rcon/RconConsoleSource.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/server/rcon/RconConsoleSource.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch similarity index 96% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch index deb2c27..0762114 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/stats/ServerStatsCounter.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/stats/ServerStatsCounter.java +++ b/net/minecraft/stats/ServerStatsCounter.java -@@ -81,12 +_,6 @@ +@@ -100,12 +_,6 @@ this.dirty.add(stat); } @@ -13,7 +13,7 @@ public void parseLocal(DataFixer fixerUpper, String json) { try { try (JsonReader jsonReader = new JsonReader(new StringReader(json))) { -@@ -190,9 +_,11 @@ +@@ -144,9 +_,11 @@ public void sendStats(ServerPlayer player) { Object2IntMap> map = new Object2IntOpenHashMap<>(); diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/util/thread/BlockableEventLoop.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/util/thread/BlockableEventLoop.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/util/thread/BlockableEventLoop.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/util/thread/BlockableEventLoop.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch similarity index 95% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch index c1c1c83..e6bea2a 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -1385,7 +_,7 @@ +@@ -1393,7 +_,7 @@ player.setRealHealth(health); } @@ -9,7 +9,7 @@ return; } // CraftBukkit end -@@ -2673,6 +_,7 @@ +@@ -2730,6 +_,7 @@ } protected void updateSwingTime() { @@ -17,7 +17,7 @@ int currentSwingDuration = this.getCurrentSwingDuration(); if (this.swinging) { this.swingTime++; -@@ -3157,7 +_,13 @@ +@@ -3212,7 +_,13 @@ } protected float getFlyingSpeed() { @@ -32,7 +32,7 @@ } public float getSpeed() { -@@ -3642,6 +_,7 @@ +@@ -3657,6 +_,7 @@ protected void updateFallFlying() { this.checkSlowFallDistance(); if (!this.level().isClientSide) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch similarity index 81% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch index 494bacd..e825eb7 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java.patch @@ -5,6 +5,6 @@ protected void alertOther(Mob mob, LivingEntity target) { + if (mob == target) return; // DivineMC - Fix MC-110386 - mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit - reason + mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY); // CraftBukkit - reason } } diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch similarity index 89% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch index f300a3f..a742b8a 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java.patch @@ -12,4 +12,4 @@ + // DivineMC end - skip useless secondary poi sensor // Purpur start - Option for Villager Clerics to farm Nether Wart - make sure clerics don't wander to soul sand when the option is off Brain brain = entity.getBrain(); - if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().getProfession() == net.minecraft.world.entity.npc.VillagerProfession.CLERIC) { + if (!level.purpurConfig.villagerClericsFarmWarts && entity.getVillagerData().profession().is(net.minecraft.world.entity.npc.VillagerProfession.CLERIC)) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch similarity index 87% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch index 8cc12f5..1b00990 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/monster/ZombieVillager.java.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/net/minecraft/world/entity/monster/ZombieVillager.java -@@ -319,6 +_,12 @@ +@@ -293,6 +_,12 @@ if (!this.isSilent()) { - serverLevel.levelEvent(null, 1027, this.blockPosition(), 0); + level.levelEvent(null, 1027, this.blockPosition(), 0); } + + // DivineMC start - Fix MC-200418 diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch similarity index 96% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index b431131..7968f8e 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -1879,6 +_,11 @@ +@@ -1806,6 +_,11 @@ } public void causeFoodExhaustion(float exhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason reason) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch similarity index 92% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch index 7058426..c653df7 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/BaseCommandBlock.java.patch @@ -1,15 +1,15 @@ --- a/net/minecraft/world/level/BaseCommandBlock.java +++ b/net/minecraft/world/level/BaseCommandBlock.java -@@ -21,7 +_,7 @@ +@@ -25,7 +_,7 @@ import net.minecraft.world.phys.Vec3; public abstract class BaseCommandBlock implements CommandSource { - private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm:ss"); + private static final ThreadLocal TIME_FORMAT = ThreadLocal.withInitial(() -> new SimpleDateFormat("HH:mm:ss")); // DivineMC - Make it thread safe private static final Component DEFAULT_NAME = Component.literal("@"); + private static final int NO_LAST_EXECUTION = -1; private long lastExecution = -1L; - private boolean updateLastExecution = true; -@@ -168,7 +_,7 @@ +@@ -156,7 +_,7 @@ public void sendSystemMessage(Component component) { if (this.trackOutput) { org.spigotmc.AsyncCatcher.catchOp("sendSystemMessage to a command block"); // Paper - Don't broadcast messages to command blocks diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch similarity index 95% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch index 4cd6154..765d174 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/Blocks.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/Blocks.java +++ b/net/minecraft/world/level/block/Blocks.java -@@ -6632,6 +_,7 @@ +@@ -6744,6 +_,7 @@ .mapColor(MapColor.COLOR_ORANGE) .instrument(NoteBlockInstrument.BASEDRUM) .requiresCorrectToolForDrops() diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch similarity index 98% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch index f9306ac..6bfd496 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/LeavesBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/LeavesBlock.java +++ b/net/minecraft/world/level/block/LeavesBlock.java -@@ -77,12 +_,29 @@ +@@ -70,12 +_,29 @@ } protected boolean decaying(BlockState state) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/SlimeBlock.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/SlimeBlock.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/block/SlimeBlock.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/block/SlimeBlock.java.patch diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch similarity index 93% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch index 42d13f8..2d97cab 100644 --- a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch +++ b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/chunk/LevelChunk.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -267,11 +_,18 @@ +@@ -270,11 +_,18 @@ public BlockState getBlockStateFinal(final int x, final int y, final int z) { // Copied and modified from below final int sectionIndex = this.getSectionIndex(y); @@ -22,5 +22,5 @@ + return section.states.get((y & 15) << 8 | (z & 15) << 4 | (x & 15)); + // DivineMC end - optimize block state lookup } + @Override - public BlockState getBlockState(BlockPos pos) { diff --git a/patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch b/divinemc-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch similarity index 100% rename from patches/unapplied/server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch rename to divinemc-server/minecraft-patches/sources/net/minecraft/world/level/levelgen/SurfaceRules.java.patch