diff --git a/atdeprecated-server/minecraft-patches/features/0009-Purpur-Barrels-and-enderchests-6-rows.patch b/atdeprecated-server/minecraft-patches/features/0009-Purpur-Barrels-and-enderchests-6-rows.patch index 308d7fc..687fcdb 100644 --- a/atdeprecated-server/minecraft-patches/features/0009-Purpur-Barrels-and-enderchests-6-rows.patch +++ b/atdeprecated-server/minecraft-patches/features/0009-Purpur-Barrels-and-enderchests-6-rows.patch @@ -3,15 +3,14 @@ From: MidnightTale Date: Thu, 24 Jul 2025 08:46:30 +0700 Subject: [PATCH] Purpur: Barrels and enderchests 6 rows -Co-authored by: William Blake Galbreath As part of: Purpur (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/purpur-server/minecraft-patches/features/0003-Barrels-and-enderchests-6-rows.patch) Licensed under: MIT (https://github.com/PurpurMC/Purpur/blob/09f547de09fc5d886f18f6d99ff389289766ec9d/LICENSE) diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 5c21fc0c749973d17df690fe7e2eab597b198131..d89f91a08d38869296471a78d52fa84ff97be64a 100644 +index 5958732fe6ac391648df07cd76e73c0fb4c312b8..2f4ceb4f26a9861083de02e3d5aa6f10763c20f5 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -1086,6 +1086,9 @@ public abstract class PlayerList { +@@ -1087,6 +1087,9 @@ public abstract class PlayerList { player.getBukkitEntity().recalculatePermissions(); // CraftBukkit this.server.getCommands().sendCommands(player); } // Paper - Add sendOpLevel API @@ -34,7 +33,7 @@ index 7ff3562f4095a1e79a1299b56a080ee5a15cfa0d..aa1a5de33aef5718581bf50ee45b1d2b // CraftBukkit start public boolean fauxSleeping; diff --git a/net/minecraft/world/inventory/ChestMenu.java b/net/minecraft/world/inventory/ChestMenu.java -index 0fffa384f928ab84451331380968fb4650eafe26..8cf24c79535d1cf326079f0eacd5f1ac25e3f365 100644 +index 0fffa384f928ab84451331380968fb4650eafe26..57ac36b77f15966b0e2a6676bfc15b963ec1100a 100644 --- a/net/minecraft/world/inventory/ChestMenu.java +++ b/net/minecraft/world/inventory/ChestMenu.java @@ -70,6 +70,26 @@ public class ChestMenu extends AbstractContainerMenu { diff --git a/atdeprecated-server/minecraft-patches/features/0010-Add-config-for-death-loot.patch b/atdeprecated-server/minecraft-patches/features/0010-Add-config-for-death-loot.patch index e578dc3..ea97760 100644 --- a/atdeprecated-server/minecraft-patches/features/0010-Add-config-for-death-loot.patch +++ b/atdeprecated-server/minecraft-patches/features/0010-Add-config-for-death-loot.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add config for death loot diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 06e41bca6b964ca71ea7bca547b03cdb3610ba31..b39f2790fabeb7f2a977dcd1ec66db1fde373e51 100644 +index aa242f3f7589c8edafccccb52effaed7582aa6f4..44d8430361cadacff08b5f543a471982d453ff77 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -1249,7 +1249,33 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -1250,7 +1250,33 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc if (!keepInventory) { for (ItemStack item : this.getInventory().getContents()) { if (!item.isEmpty() && !EnchantmentHelper.has(item, net.minecraft.world.item.enchantment.EnchantmentEffectComponents.PREVENT_EQUIPMENT_DROP)) { @@ -17,23 +17,23 @@ index 06e41bca6b964ca71ea7bca547b03cdb3610ba31..b39f2790fabeb7f2a977dcd1ec66db1f + ItemEntity entity = this.drop(stack, true, false, false, null); + // atDeprecated start - death loot protection + if (entity != null) { -+ if (fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsOwnerPickupOnly) { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsOwnerPickupOnly) { + entity.setTarget(this.getUUID()); + entity.markAsDeathLoot(); + } -+ if (fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsGlow) { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsGlow) { + entity.setGlowingTag(true); + entity.markAsDeathLoot(); + } -+ if (fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsInvulnerable) { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsInvulnerable) { + entity.setInvulnerable(true); + entity.markAsDeathLoot(); + } -+ if (fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemDespawnTimeTicks > 0) { -+ entity.age = -fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemDespawnTimeTicks; ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemDespawnTimeTicks > 0) { ++ entity.age = -fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemDespawnTimeTicks; + entity.markAsDeathLoot(); + } -+ if (fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsMobCantPickup) { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsMobCantPickup) { + entity.canMobPickup = false; + entity.markAsDeathLoot(); + } @@ -44,7 +44,7 @@ index 06e41bca6b964ca71ea7bca547b03cdb3610ba31..b39f2790fabeb7f2a977dcd1ec66db1f } } diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index d55a6989fd68f0bcf7bd05e9420fda1115afa6c0..25b1db4170104c7b49ed5c62989f6d8c59699465 100644 +index d55a6989fd68f0bcf7bd05e9420fda1115afa6c0..08b29d1f7941bb81d9a715656d94d987e8247cc5 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -3970,9 +3970,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin @@ -56,7 +56,7 @@ index d55a6989fd68f0bcf7bd05e9420fda1115afa6c0..25b1db4170104c7b49ed5c62989f6d8c - itemEntity.setDeltaMovement(-Mth.sin(f1) * f, 0.2F, Mth.cos(f1) * f); + // atDeprecated start + if (this instanceof Player) { -+ float f = this.random.nextFloat() * (float) fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathLootSpread; ++ float f = this.random.nextFloat() * (float) fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathLootSpread; + float f1 = this.random.nextFloat() * (float) (Math.PI * 2); + itemEntity.setDeltaMovement(-Mth.sin(f1) * f, 0.2F, Mth.cos(f1) * f); + } else { @@ -69,7 +69,7 @@ index d55a6989fd68f0bcf7bd05e9420fda1115afa6c0..25b1db4170104c7b49ed5c62989f6d8c float f = 0.3F; float f1 = Mth.sin(this.getXRot() * (float) (Math.PI / 180.0)); diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java -index b745eb5d9c68547335247910ff2ae8d5fb36349c..bef0bf94a54ab85a86efcb5502ca721f28cf33be 100644 +index b745eb5d9c68547335247910ff2ae8d5fb36349c..a779bb24475e2ee5b6fab7da9b64a2c96b027242 100644 --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java @@ -56,6 +56,7 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -85,7 +85,7 @@ index b745eb5d9c68547335247910ff2ae8d5fb36349c..bef0bf94a54ab85a86efcb5502ca721f this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } + // atDeprecated start - glowing for death loot -+ if (this.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsGlow) { ++ if (this.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsGlow) { + this.setGlowingTag(true); + } + // atDeprecated end @@ -118,7 +118,7 @@ index b745eb5d9c68547335247910ff2ae8d5fb36349c..bef0bf94a54ab85a86efcb5502ca721f public void playerTouch(Player entity) { if (!this.level().isClientSide) { + // atDeprecated start - enforce owner-only pickup for death loot -+ if (this.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsOwnerPickupOnly) { ++ if (this.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsOwnerPickupOnly) { + if (this.target != null && !this.target.equals(entity.getUUID())) { + return; + } @@ -137,7 +137,7 @@ index b745eb5d9c68547335247910ff2ae8d5fb36349c..bef0bf94a54ab85a86efcb5502ca721f + // atDeprecated end } diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index aa1a5de33aef5718581bf50ee45b1d2b1c13a46c..b9b14cd9f0ff5556e076aab21f4c2b85d1e48ee5 100644 +index aa1a5de33aef5718581bf50ee45b1d2b1c13a46c..d5ba1bea926f0fd3ef38d101055d61eb548679a4 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java @@ -1840,7 +1840,16 @@ public abstract class Player extends LivingEntity { @@ -147,7 +147,7 @@ index aa1a5de33aef5718581bf50ee45b1d2b1c13a46c..b9b14cd9f0ff5556e076aab21f4c2b85 - return !level.getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) && !this.isSpectator() ? Math.min(this.experienceLevel * 7, 100) : 0; + // atDeprecated start - Use deathXpDropPercentage gamerule for XP drop (fixed XP calculation) + if (!level.getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY) && !this.isSpectator()) { -+ int percent = fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathXpDropPercentage; ++ int percent = fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathXpDropPercentage; + if (percent < 0) percent = 0; + if (percent > 100) percent = 100; + int xp = getTrueTotalExperience(); @@ -194,7 +194,7 @@ index aa1a5de33aef5718581bf50ee45b1d2b1c13a46c..b9b14cd9f0ff5556e076aab21f4c2b85 + // atDeprecated end } diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 5de769e7bd56bb3355c3c711d46ce5e103ea4409..e823741a915f14254933aebc515f4ad72b174bbc 100644 +index 5de769e7bd56bb3355c3c711d46ce5e103ea4409..646cb7159a3e38101c281bd9fac5d0be1d79c3e8 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -630,6 +630,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -202,7 +202,7 @@ index 5de769e7bd56bb3355c3c711d46ce5e103ea4409..e823741a915f14254933aebc515f4ad7 public static boolean addItem(Container container, ItemEntity item) { + // atDeprecated start - prevent hopper pickup of death loot -+ if (item.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.DEATH_LOOT_CONFIG.deathItemsHopperCantPickup) { ++ if (item.isDeathLoot && fun.mntale.atdeprecated.config.AtCoreConfig.INVENTORY_CONFIG.deathItemsHopperCantPickup) { + return false; + } + // atDeprecated end diff --git a/atdeprecated-server/minecraft-patches/features/0012-Lophine-Add-config-to-enable-Raytracing-tracker.patch b/atdeprecated-server/minecraft-patches/features/0012-Lophine-Add-config-to-enable-Raytracing-tracker.patch index 8819275..905e50a 100644 --- a/atdeprecated-server/minecraft-patches/features/0012-Lophine-Add-config-to-enable-Raytracing-tracker.patch +++ b/atdeprecated-server/minecraft-patches/features/0012-Lophine-Add-config-to-enable-Raytracing-tracker.patch @@ -3,7 +3,6 @@ From: MidnightTale Date: Thu, 24 Jul 2025 23:04:37 +0700 Subject: [PATCH] Lophine: Add config to enable Raytracing tracker -Co-authored by: MrHua269 As part of: Lophine (https://github.com/LuminolMC/Lophine/blob/904abaa56499a869259d3e6b3e586c1d33e34d28/lophine-server/minecraft-patches/features/0006-Add-config-to-enable-Raytracing-tracker.patch) Licensed under: MIT (https://github.com/LuminolMC/Lophine/blob/904abaa56499a869259d3e6b3e586c1d33e34d28/LICENSE.md) @@ -96,7 +95,7 @@ index 6f00ffa05d9597917574357e0069c9b056aa5ce2..af0a8b99188f25adb0a76e227d3debc1 public EntityType( EntityType.EntityFactory factory, diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index b9b14cd9f0ff5556e076aab21f4c2b85d1e48ee5..4480b491250f08350f479c27d17d51fe62bc60f6 100644 +index d5ba1bea926f0fd3ef38d101055d61eb548679a4..e95884b560b8986568dc84214649f640d84d199e 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java @@ -230,6 +230,25 @@ public abstract class Player extends LivingEntity { diff --git a/atdeprecated-server/minecraft-patches/features/0014-Leaf-Don-t-save-primed-tnt-entity.patch b/atdeprecated-server/minecraft-patches/features/0014-Leaf-Don-t-save-primed-tnt-entity.patch new file mode 100644 index 0000000..ec843ef --- /dev/null +++ b/atdeprecated-server/minecraft-patches/features/0014-Leaf-Don-t-save-primed-tnt-entity.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MidnightTale +Date: Fri, 25 Jul 2025 10:48:02 +0700 +Subject: [PATCH] Leaf: Don't save primed tnt entity + +As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/006fe7ce3a58e687183271f02e1331f23fc5bd99/leaf-server/minecraft-patches/features/0137-Don-t-save-primed-tnt-entity.patch) +Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/006fe7ce3a58e687183271f02e1331f23fc5bd99/LICENSE.md) + +diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java +index 732672aa7d915217eb4af44179b2f2ab1e796cca..19c34d9e453b98e633aa272dae7c35b01339532a 100644 +--- a/net/minecraft/world/entity/item/PrimedTnt.java ++++ b/net/minecraft/world/entity/item/PrimedTnt.java +@@ -246,4 +246,11 @@ public class PrimedTnt extends Entity implements TraceableEntity { + return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid(); + } + // Paper end - Option to prevent TNT from moving in water ++ ++ // Leaf start - PMC - Don't save primed tnt entity ++ @Override ++ public boolean shouldBeSaved() { ++ return !fun.mntale.atdeprecated.config.AtCoreConfig.ENTITY_CONFIG.dontSavePrimedTNT && super.shouldBeSaved(); ++ } ++ // Leaf - PMC - Don't save primed tnt entity + } diff --git a/atdeprecated-server/minecraft-patches/features/0015-Leaf-Don-t-save-falling-block-entity.patch b/atdeprecated-server/minecraft-patches/features/0015-Leaf-Don-t-save-falling-block-entity.patch new file mode 100644 index 0000000..ea91ded --- /dev/null +++ b/atdeprecated-server/minecraft-patches/features/0015-Leaf-Don-t-save-falling-block-entity.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MidnightTale +Date: Fri, 25 Jul 2025 10:50:28 +0700 +Subject: [PATCH] Leaf: Don't save falling block entity + +As part of: Leaf (https://github.com/Winds-Studio/Leaf/blob/006fe7ce3a58e687183271f02e1331f23fc5bd99/leaf-server/minecraft-patches/features/0138-Don-t-save-falling-block-entity.patch) +Licensed under: MIT (https://github.com/Winds-Studio/Leaf/blob/006fe7ce3a58e687183271f02e1331f23fc5bd99/LICENSE.md) + +diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java +index c444c4b7dc8454abd257030a8c59b9b22b9013d9..8fe609d6506edfe26067af196188a395f9ba966b 100644 +--- a/net/minecraft/world/entity/item/FallingBlockEntity.java ++++ b/net/minecraft/world/entity/item/FallingBlockEntity.java +@@ -390,4 +390,11 @@ public class FallingBlockEntity extends Entity { + this.forceTickAfterTeleportToDuplicate = entity != null && flag && (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation || me.earthme.luminol.config.modules.fixes.UnsafeTeleportationConfig.enabled); // Paper // Luminol - Unsafe teleportation + return entity; + } ++ ++ // Leaf start - PMC - Don't save falling block entity ++ @Override ++ public boolean shouldBeSaved() { ++ return !fun.mntale.atdeprecated.config.AtCoreConfig.ENTITY_CONFIG.dontSaveFallingBlock && super.shouldBeSaved(); ++ } ++ // Leaf end - PMC - Don't save falling block entity + } diff --git a/atdeprecated-server/minecraft-patches/features/0016-Purpur-Don-t-send-useless-entity-packets.patch b/atdeprecated-server/minecraft-patches/features/0016-Purpur-Don-t-send-useless-entity-packets.patch new file mode 100644 index 0000000..e847f70 --- /dev/null +++ b/atdeprecated-server/minecraft-patches/features/0016-Purpur-Don-t-send-useless-entity-packets.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MidnightTale +Date: Fri, 25 Jul 2025 11:16:28 +0700 +Subject: [PATCH] Purpur: Don't send useless entity packets + +Original license: MIT +Original project: https://github.com/PurpurMC/Purpur + +diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java +index 3a9293d5328ef0befa0b709169489b61a2266807..de476f97c42f6949f769aaf9cf5ce18470bd7cda 100644 +--- a/net/minecraft/server/level/ServerEntity.java ++++ b/net/minecraft/server/level/ServerEntity.java +@@ -231,6 +231,7 @@ public class ServerEntity { + } // SparklyPaper end + } + ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.ENTITY_CONFIG.reduceUselessEntityMovePackets && isUselessMoveEntityPacket(packet)) packet = null; // Purpur + if (packet != null) { + this.broadcast.accept(packet); + } +@@ -291,6 +292,21 @@ public class ServerEntity { + ); + } + ++ // Purpur start ++ private boolean isUselessMoveEntityPacket(@Nullable Packet packet) { ++ if (!(packet instanceof ClientboundMoveEntityPacket moveEntityPacket)) return false; ++ return switch (packet) { ++ case ClientboundMoveEntityPacket.Pos ignored -> ++ moveEntityPacket.getXa() == 0 && moveEntityPacket.getYa() == 0 && moveEntityPacket.getZa() == 0; ++ case ClientboundMoveEntityPacket.PosRot ignored -> ++ moveEntityPacket.getXa() == 0 && moveEntityPacket.getYa() == 0 && moveEntityPacket.getZa() == 0 && moveEntityPacket.getYRot() == 0 && moveEntityPacket.getXRot() == 0; ++ case ClientboundMoveEntityPacket.Rot ignored -> ++ moveEntityPacket.getYRot() == 0 && moveEntityPacket.getXRot() == 0; ++ default -> false; ++ }; ++ } ++ // Purpur end ++ + private void handleMinecartPosRot(NewMinecartBehavior behavior, byte yRot, byte xRot, boolean dirty) { + this.sendDirtyEntityData(); + if (behavior.lerpSteps.isEmpty()) { diff --git a/atdeprecated-server/minecraft-patches/features/0017-Grief-prevention.patch b/atdeprecated-server/minecraft-patches/features/0017-Grief-prevention.patch new file mode 100644 index 0000000..ab758a7 --- /dev/null +++ b/atdeprecated-server/minecraft-patches/features/0017-Grief-prevention.patch @@ -0,0 +1,65 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MidnightTale +Date: Fri, 25 Jul 2025 11:33:18 +0700 +Subject: [PATCH] Grief prevention + + +diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java +index 87377bba2ebdc0eba5b7b212d971994c35ca0b62..d356938e3f71cb394e0b5a5b49fb3cca00dab512 100644 +--- a/net/minecraft/server/level/ServerLevel.java ++++ b/net/minecraft/server/level/ServerLevel.java +@@ -2031,6 +2031,27 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe + @Nullable java.util.function.Consumer configurator + ) { + // CraftBukkit end ++ // atDeprecated start - Grief Prevention ++ if (source instanceof net.minecraft.world.entity.item.PrimedTnt && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventTntGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.monster.Creeper && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventCreeperGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.vehicle.MinecartTNT && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventTntMinecartGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.boss.enderdragon.EndCrystal && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventEndCrystalGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.projectile.WitherSkull && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventWitherSkullExplode) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.projectile.AbstractHurtingProjectile && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventFireballGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (source instanceof net.minecraft.world.entity.boss.wither.WitherBoss && fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventWitherBossExplode) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } else if (damageSource != null && damageSource.is(net.minecraft.world.damagesource.DamageTypes.BAD_RESPAWN_POINT)) { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventBedGrief || fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventRespawnAnchorGrief) { ++ explosionInteraction = Level.ExplosionInteraction.NONE; ++ } ++ } ++ // atDeprecated end - Grief Prevention + Explosion.BlockInteraction blockInteraction = switch (explosionInteraction) { + case NONE -> Explosion.BlockInteraction.KEEP; + case BLOCK -> this.getDestroyType(GameRules.RULE_BLOCK_EXPLOSION_DROP_DECAY); +diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java +index 787b74c5aa02afc4ba95fa1cdaf6cc21b6554b56..dffb05123e648f70683df2308d3e9493f8a08c02 100644 +--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java ++++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java +@@ -348,7 +348,7 @@ public class WitherBoss extends Monster implements RangedAttackMob { + + if (this.destroyBlocksTick > 0) { + this.destroyBlocksTick--; +- if (this.destroyBlocksTick == 0 && level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { ++ if (this.destroyBlocksTick == 0 && level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventWitherBossDestroyBlock) { + boolean flag = false; + int alternativeTarget = Mth.floor(this.getBbWidth() / 2.0F + 1.0F); + int floor = Mth.floor(this.getBbHeight()); +diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java +index c0e38131da55d8a85444ef4248224d37a7271089..e0155727e50060d4ee8f88913fe20fb265e9b66d 100644 +--- a/net/minecraft/world/entity/monster/EnderMan.java ++++ b/net/minecraft/world/entity/monster/EnderMan.java +@@ -631,6 +631,9 @@ public class EnderMan extends Monster implements NeutralMob { + + @Override + public boolean canUse() { ++ if (fun.mntale.atdeprecated.config.AtCoreConfig.GRIEF_PREVENTION_CONFIG.preventEndermanGrief) { ++ return false; ++ } + return this.enderman.getCarriedBlock() == null + && getServerLevel(this.enderman).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) + && this.enderman.getRandom().nextInt(reducedTickDelay(20)) == 0; diff --git a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/AtCoreConfig.java b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/AtCoreConfig.java index 7bdca63..d5a95f3 100644 --- a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/AtCoreConfig.java +++ b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/AtCoreConfig.java @@ -1,5 +1,6 @@ package fun.mntale.atdeprecated.config; +import fun.mntale.atdeprecated.config.modules.features.GriefPreventionConfig; import fun.mntale.atdeprecated.config.modules.features.*; import fun.mntale.atdeprecated.config.modules.fixes.*; import fun.mntale.atdeprecated.config.modules.experiment.*; @@ -13,11 +14,11 @@ public class AtCoreConfig { public static final AnvilConfig ANVIL_CONFIG = new AnvilConfig(); public static final BeaconConfig BEACON_CONFIG = new BeaconConfig(); public static final DispenserConfig DISPENSER_CONFIG = new DispenserConfig(); - public static final DeathLootConfig DEATH_LOOT_CONFIG = new DeathLootConfig(); public static final ElytraConfig ELYTRA_CONFIG = new ElytraConfig(); public static final PlayerConfig PLAYER_CONFIG = new PlayerConfig(); public static final InventoryConfig INVENTORY_CONFIG = new InventoryConfig(); public static final WaypointConfig WAYPOINT_CONFIG = new WaypointConfig(); + public static final GriefPreventionConfig GRIEF_PREVENTION_CONFIG = new GriefPreventionConfig(); public static final RemovedConfig REMOVED_CONFIG = new RemovedConfig(); public static final EntityConfig ENTITY_CONFIG = new EntityConfig(); public static final RayTrackingEntityTrackerConfig RAY_TRACKING_ENTITY_TRACKER_CONFIG = new RayTrackingEntityTrackerConfig(); @@ -35,11 +36,11 @@ private static void registerModules() { configManager.registerModule(ANVIL_CONFIG); configManager.registerModule(BEACON_CONFIG); configManager.registerModule(DISPENSER_CONFIG); - configManager.registerModule(DEATH_LOOT_CONFIG); configManager.registerModule(ELYTRA_CONFIG); configManager.registerModule(PLAYER_CONFIG); configManager.registerModule(INVENTORY_CONFIG); configManager.registerModule(WAYPOINT_CONFIG); + configManager.registerModule(GRIEF_PREVENTION_CONFIG); configManager.registerModule(REMOVED_CONFIG); configManager.registerModule(ENTITY_CONFIG); configManager.registerModule(RAY_TRACKING_ENTITY_TRACKER_CONFIG); diff --git a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/DeathLootConfig.java b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/DeathLootConfig.java deleted file mode 100644 index e18493d..0000000 --- a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/DeathLootConfig.java +++ /dev/null @@ -1,42 +0,0 @@ -package fun.mntale.atdeprecated.config.modules.features; - -import fun.mntale.atdeprecated.config.EnumConfigCategory; -import fun.mntale.atdeprecated.config.IConfigModule; -import fun.mntale.atdeprecated.config.annotations.ConfigInfo; - -public class DeathLootConfig implements IConfigModule { - - @ConfigInfo(name = "glow", comments = "Make items dropped on death glow.") - public boolean deathItemsGlow = true; - - @ConfigInfo(name = "invulnerable", comments = "Make items dropped on death invulnerable.") - public boolean deathItemsInvulnerable = true; - - @ConfigInfo(name = "despawn-time-ticks", comments = "The time in ticks before items dropped on death despawn. Set to -1 to disable despawning. (20 ticks = 1 second)") - public int deathItemDespawnTimeTicks = 1728000; - - @ConfigInfo(name = "owner-pickup-only", comments = "Only the owner can pick up items dropped on death.") - public boolean deathItemsOwnerPickupOnly = true; - - @ConfigInfo(name = "hopper-cant-pickup", comments = "Prevent hoppers from picking up items dropped on death.") - public boolean deathItemsHopperCantPickup = true; - - @ConfigInfo(name = "mob-cant-pickup", comments = "Prevent mobs from picking up items dropped on death.") - public boolean deathItemsMobCantPickup = true; - - @ConfigInfo(name = "xp-drop-percentage", comments = "The percentage of XP to drop on death. Valid values: 0-100.") - public int deathXpDropPercentage = 70; - - @ConfigInfo(name = "spread", comments = "The spread of items when a player dies.") - public double deathLootSpread = 0.5D; - - @Override - public EnumConfigCategory getCategory() { - return EnumConfigCategory.FEATURES; - } - - @Override - public String getBaseName() { - return "death-loot"; - } -} \ No newline at end of file diff --git a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/GriefPreventionConfig.java b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/GriefPreventionConfig.java new file mode 100644 index 0000000..612d1f1 --- /dev/null +++ b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/GriefPreventionConfig.java @@ -0,0 +1,51 @@ +package fun.mntale.atdeprecated.config.modules.features; + +import fun.mntale.atdeprecated.config.EnumConfigCategory; +import fun.mntale.atdeprecated.config.IConfigModule; +import fun.mntale.atdeprecated.config.annotations.ConfigInfo; + +public class GriefPreventionConfig implements IConfigModule { + + @ConfigInfo(name = "prevent-tnt-explode", comments = "Prevent TNT from destroying blocks") + public boolean preventTntGrief = false; + + @ConfigInfo(name = "prevent-creeper-explode", comments = "Prevent Creepers from destroying blocks") + public boolean preventCreeperGrief = true; + + @ConfigInfo(name = "prevent-tnt-minecart-explode", comments = "Prevent TNT Minecarts from destroying blocks") + public boolean preventTntMinecartGrief = true; + + @ConfigInfo(name = "prevent-bed-explode", comments = "Prevent Beds from destroying blocks in the nether/end") + public boolean preventBedGrief = true; + + @ConfigInfo(name = "prevent-respawn-anchor-explode", comments = "Prevent Respawn Anchors from destroying blocks") + public boolean preventRespawnAnchorGrief = true; + + @ConfigInfo(name = "prevent-end-crystal-explode", comments = "Prevent End Crystals from destroying blocks") + public boolean preventEndCrystalGrief = true; + + @ConfigInfo(name = "prevent-fireball-explode", comments = "Prevent fireballs (from ghasts, blazes, etc.) from destroying blocks") + public boolean preventFireballGrief = true; + + @ConfigInfo(name = "prevent-enderman-take-block", comments = "Prevent Endermen from picking up blocks") + public boolean preventEndermanGrief = true; + + @ConfigInfo(name = "prevent-wither-boss-explode", comments = "Prevent the main Wither boss explosion from destroying blocks") + public boolean preventWitherBossExplode = true; + + @ConfigInfo(name = "prevent-wither-skull-explode", comments = "Prevent Wither skulls from destroying blocks") + public boolean preventWitherSkullExplode = true; + + @ConfigInfo(name = "prevent-wither-boss-destroy-block", comments = "Prevent the Wither from breaking blocks by charging") + public boolean preventWitherBossDestroyBlock = false; + + @Override + public EnumConfigCategory getCategory() { + return EnumConfigCategory.FEATURES; + } + + @Override + public String getBaseName() { + return "grief-prevention"; + } +} \ No newline at end of file diff --git a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/InventoryConfig.java b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/InventoryConfig.java index 2b599e1..20d2731 100644 --- a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/InventoryConfig.java +++ b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/features/InventoryConfig.java @@ -12,6 +12,30 @@ public class InventoryConfig implements IConfigModule { @ConfigInfo(name = "enderchest-rows", comments = "Number of rows for ender chests. Valid values: 1-6.") public int enderChestRows = 6; + @ConfigInfo(name = "death-loot-glow", comments = "Make items dropped on death glow.") + public boolean deathItemsGlow = true; + + @ConfigInfo(name = "death-loot-invulnerable", comments = "Make items dropped on death invulnerable.") + public boolean deathItemsInvulnerable = true; + + @ConfigInfo(name = "death-loot-despawn-ticks", comments = "The time in ticks before items dropped on death despawn. Set to -1 to disable despawning. (20 ticks = 1 second)") + public int deathItemDespawnTimeTicks = 1728000; + + @ConfigInfo(name = "death-loot-owner-pickup-only", comments = "Only the owner can pick up items dropped on death.") + public boolean deathItemsOwnerPickupOnly = true; + + @ConfigInfo(name = "death-loot-hopper-cant-pickup", comments = "Prevent hoppers from picking up items dropped on death.") + public boolean deathItemsHopperCantPickup = true; + + @ConfigInfo(name = "death-loot-mob-cant-pickup", comments = "Prevent mobs from picking up items dropped on death.") + public boolean deathItemsMobCantPickup = true; + + @ConfigInfo(name = "death-loot-xp-drop-percentage", comments = "The percentage of XP to drop on death. Valid values: 0-100.") + public int deathXpDropPercentage = 70; + + @ConfigInfo(name = "spread", comments = "The spread of items when a player dies.") + public double deathLootSpread = 0.5D; + @Override public EnumConfigCategory getCategory() { return EnumConfigCategory.FEATURES; diff --git a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/optimizations/EntityConfig.java b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/optimizations/EntityConfig.java index 8c5ee75..860155e 100644 --- a/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/optimizations/EntityConfig.java +++ b/atdeprecated-server/src/main/java/fun/mntale/atdeprecated/config/modules/optimizations/EntityConfig.java @@ -18,6 +18,15 @@ public class EntityConfig implements IConfigModule { @ConfigInfo(name = "chicken-egg-lay-check-interval", comments = "The interval in ticks for how often the server checks if a chicken can lay an egg. Set to 0 to check every tick. Higher values are better for performance.") public int chickenEggLayCheckInterval = 3600; // 3 minutes + @ConfigInfo(name = "dont-save-primed-tnt", comments = "Don't save primed tnt entity") + public boolean dontSavePrimedTNT = true; + + @ConfigInfo(name = "dont-save-falling-block", comments = "Don't save falling block entity") + public boolean dontSaveFallingBlock = true; + + @ConfigInfo(name = "reduce-useless-entity-move-packets", comments = "Don't send entity packets if they contain no new information") + public boolean reduceUselessEntityMovePackets = true; + @Override public EnumConfigCategory getCategory() { return EnumConfigCategory.OPTIMIZATIONS;