diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch index bf5eb8b9..9a39934f 100644 --- a/patches/server/0001-Build-changes.patch +++ b/patches/server/0001-Build-changes.patch @@ -96,7 +96,7 @@ index ca8b6a926dfff3fdd6b04228809a4480366120b2..f77f04f7312a528d3f898c6c4b8603ab @Override public String getBrand() { diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 4b002e8b75d117b726b0de274a76d3596fce015b..03373e5a37a5f90d31434aab921ec8c6b6efef70 100644 +index 4b002e8b75d117b726b0de274a76d3596fce015b..f6b362894bbd0f0f09f0f51a931529d708ca9b9e 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,8 @@ public class Metrics { @@ -122,7 +122,7 @@ index 4b002e8b75d117b726b0de274a76d3596fce015b..03373e5a37a5f90d31434aab921ec8c6 + return "unknown"; + })); + -+ if (org.leavesmc.leaves.LeavesConfig.bstatsPrivacyMode) { ++ if (org.leavesmc.leaves.LeavesConfig.mics.bstatsPrivacyMode) { + return; + } + @@ -197,7 +197,7 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a private static final String BUILD_DEV = "DEV"; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 64b56abf8900d0424100da460fc68ac964394793..7f0d05c242c649b3f0482334306898dedd1d5c43 100644 +index 64b56abf8900d0424100da460fc68ac964394793..9d5de69b85aff3d94f08c212eed76bd5ed0e39e9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1262,7 +1262,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop bot.sendFakeDataIfNeed(this, true)); // Leaves - render bot + } + // Leaves end - bot support @@ -270,7 +270,7 @@ index cffbd3300967e5d80b5973b35a76235bb2aa1b73..d9f3f70973b2df7c81124ddc614b55e2 PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); this.level().getCraftServer().getPluginManager().callEvent(changeEvent); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9b1645cf1fa47b8d7592c7eda4a4497ad9d6bbf8..9fef90a243f7da86a0de48091ef14b820ed8db90 100644 +index 9b1645cf1fa47b8d7592c7eda4a4497ad9d6bbf8..9b3fbc13779ded07c696e151772d834ff8d61a7d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -124,6 +124,8 @@ import org.bukkit.event.player.PlayerRespawnEvent.RespawnReason; @@ -287,7 +287,7 @@ index 9b1645cf1fa47b8d7592c7eda4a4497ad9d6bbf8..9fef90a243f7da86a0de48091ef14b82 org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol + // Leaves start - bot support -+ if (org.leavesmc.leaves.LeavesConfig.fakeplayerSupport) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.fakeplayer.enable) { + ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName()); + if (bot != null) { + this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false); @@ -307,7 +307,7 @@ index 9b1645cf1fa47b8d7592c7eda4a4497ad9d6bbf8..9fef90a243f7da86a0de48091ef14b82 // Paper end - Add PlayerPostRespawnEvent + // Leaves start - bot support -+ if (org.leavesmc.leaves.LeavesConfig.fakeplayerSupport) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.fakeplayer.enable) { + this.server.getBotList().bots.forEach(bot -> bot.sendFakeDataIfNeed(entityplayer1, true)); // Leaves - render bot + } + // Leaves end - bot support @@ -638,7 +638,7 @@ index deba03eb37012c638e08e20cd1c98e9db190c790..dd718bd472f3967c0b4e838468f4c454 return event; diff --git a/src/main/java/org/leavesmc/leaves/bot/BotCommand.java b/src/main/java/org/leavesmc/leaves/bot/BotCommand.java new file mode 100644 -index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5fbc27a190 +index 0000000000000000000000000000000000000000..4bf25cb267a8d01c2d04a2a9e34b9fc6a433cade --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/BotCommand.java @@ -0,0 +1,544 @@ @@ -703,13 +703,13 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + if (args.length <= 1) { + list.add("create"); + list.add("remove"); -+ if (LeavesConfig.fakeplayerUseAction) { ++ if (LeavesConfig.modify.fakeplayer.canUseAction) { + list.add("action"); + } -+ if (LeavesConfig.fakeplayerModifyConfig) { ++ if (LeavesConfig.modify.fakeplayer.canModifyConfig) { + list.add("config"); + } -+ if (LeavesConfig.fakeplayerManualSaveAndLoad) { ++ if (LeavesConfig.modify.fakeplayer.canManualSaveAndLoad) { + list.add("save"); + list.add("load"); + } @@ -779,7 +779,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + + @Override + public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) { -+ if (!testPermission(sender) || !LeavesConfig.fakeplayerSupport) return true; ++ if (!testPermission(sender) || !LeavesConfig.modify.fakeplayer.enable) return true; + + if (args.length == 0) { + sender.sendMessage(unknownMessage); @@ -851,12 +851,12 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + return false; + } + -+ if (org.leavesmc.leaves.LeavesConfig.unableFakeplayerNames.contains(name)) { ++ if (LeavesConfig.modify.fakeplayer.unableNames.contains(name)) { + sender.sendMessage(text("This name is not allowed", NamedTextColor.RED)); + return false; + } + -+ if (botList.bots.size() >= org.leavesmc.leaves.LeavesConfig.fakeplayerLimit) { ++ if (botList.bots.size() >= LeavesConfig.modify.fakeplayer.limit) { + sender.sendMessage(text("Fakeplayer limit is full", NamedTextColor.RED)); + return false; + } @@ -939,7 +939,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + } + + private void onAction(CommandSender sender, String @NotNull [] args) { -+ if (!LeavesConfig.fakeplayerUseAction) { ++ if (!LeavesConfig.modify.fakeplayer.canUseAction) { + return; + } + @@ -1051,7 +1051,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + private static final List acceptConfig = Configs.getConfigs().stream().map(config -> config.config.getName()).toList(); + + private void onConfig(CommandSender sender, String @NotNull [] args) { -+ if (!LeavesConfig.fakeplayerModifyConfig) { ++ if (!LeavesConfig.modify.fakeplayer.canModifyConfig) { + return; + } + @@ -1096,7 +1096,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + } + + private void onSave(CommandSender sender, String @NotNull [] args) { -+ if (!LeavesConfig.fakeplayerManualSaveAndLoad) { ++ if (!LeavesConfig.modify.fakeplayer.canManualSaveAndLoad) { + return; + } + @@ -1119,7 +1119,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + } + + private void onLoad(CommandSender sender, String @NotNull [] args) { -+ if (!LeavesConfig.fakeplayerManualSaveAndLoad) { ++ if (!LeavesConfig.modify.fakeplayer.canManualSaveAndLoad) { + return; + } + @@ -1153,7 +1153,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f + botMap.get(bukkitBot.getWorld()).add(bukkitBot.getName()); + } + -+ sender.sendMessage("Total number: (" + botList.bots.size() + "/" + org.leavesmc.leaves.LeavesConfig.fakeplayerLimit + ")"); ++ sender.sendMessage("Total number: (" + botList.bots.size() + "/" + LeavesConfig.modify.fakeplayer.limit + ")"); + for (World world : botMap.keySet()) { + sender.sendMessage(world.getName() + "(" + botMap.get(world).size() + "): " + formatPlayerNameList(botMap.get(world))); + } @@ -1188,7 +1188,7 @@ index 0000000000000000000000000000000000000000..527f01b206dcf0e677ac7ec8c27ebf5f +} diff --git a/src/main/java/org/leavesmc/leaves/bot/BotCreateState.java b/src/main/java/org/leavesmc/leaves/bot/BotCreateState.java new file mode 100644 -index 0000000000000000000000000000000000000000..ebb3aa94718382e8fac2a8fa617c796a9387709b +index 0000000000000000000000000000000000000000..bc09bb05fdccc7e6e51f441b0c23237145317e89 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/BotCreateState.java @@ -0,0 +1,120 @@ @@ -1242,7 +1242,7 @@ index 0000000000000000000000000000000000000000..ebb3aa94718382e8fac2a8fa617c796a + this.realName = realName; + this.location = location; + -+ this.name = LeavesConfig.fakeplayerPrefix + realName + LeavesConfig.fakeplayerSuffix; ++ this.name = LeavesConfig.modify.fakeplayer.prefix + realName + LeavesConfig.modify.fakeplayer.suffix; + this.skinName = this.realName; + this.skin = null; + this.createReason = BotCreateEvent.CreateReason.UNKNOWN; @@ -1638,7 +1638,7 @@ index 0000000000000000000000000000000000000000..4f5e6e5c1b9d8bd38c98e97fd31b3833 +} diff --git a/src/main/java/org/leavesmc/leaves/bot/BotList.java b/src/main/java/org/leavesmc/leaves/bot/BotList.java new file mode 100644 -index 0000000000000000000000000000000000000000..3eac675dccfa992d0aad4ebb84fcf6357761be2e +index 0000000000000000000000000000000000000000..3881aa5c5bd18a8859715ad31624dbd5e92e5721 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/BotList.java @@ -0,0 +1,297 @@ @@ -1874,13 +1874,13 @@ index 0000000000000000000000000000000000000000..3eac675dccfa992d0aad4ebb84fcf635 + + public void removeAll() { + for (ServerBot bot : this.bots) { -+ bot.resume = LeavesConfig.fakeplayerResident; -+ this.removeBot(bot, BotRemoveEvent.RemoveReason.INTERNAL, null, LeavesConfig.fakeplayerResident); ++ bot.resume = LeavesConfig.modify.fakeplayer.canResident; ++ this.removeBot(bot, BotRemoveEvent.RemoveReason.INTERNAL, null, LeavesConfig.modify.fakeplayer.canResident); + } + } + + public void loadResume() { -+ if (LeavesConfig.fakeplayerSupport && LeavesConfig.fakeplayerResident) { ++ if (LeavesConfig.modify.fakeplayer.enable && LeavesConfig.modify.fakeplayer.canResident) { + CompoundTag savedBotList = this.getSavedBotList().copy(); + for (String realName : savedBotList.getAllKeys()) { + CompoundTag nbt = savedBotList.getCompound(realName); @@ -1918,11 +1918,11 @@ index 0000000000000000000000000000000000000000..3eac675dccfa992d0aad4ebb84fcf635 + return false; + } + -+ if (LeavesConfig.unableFakeplayerNames.contains(name)) { ++ if (LeavesConfig.modify.fakeplayer.unableNames.contains(name)) { + return false; + } + -+ return this.bots.size() < LeavesConfig.fakeplayerLimit; ++ return this.bots.size() < LeavesConfig.modify.fakeplayer.limit; + } + + public static class CustomGameProfile extends GameProfile { @@ -2081,7 +2081,7 @@ index 0000000000000000000000000000000000000000..7ebe4d6c71e90be92387a585ea581c6b +} diff --git a/src/main/java/org/leavesmc/leaves/bot/MojangAPI.java b/src/main/java/org/leavesmc/leaves/bot/MojangAPI.java new file mode 100644 -index 0000000000000000000000000000000000000000..517e3321b866abe9d17a6fe9e919528b50bb130a +index 0000000000000000000000000000000000000000..4162df8802b1af73d9a0a76f846ab9ad953a1921 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/MojangAPI.java @@ -0,0 +1,39 @@ @@ -2102,7 +2102,7 @@ index 0000000000000000000000000000000000000000..517e3321b866abe9d17a6fe9e919528b + private static final Map CACHE = new HashMap<>(); + + public static String[] getSkin(String name) { -+ if (LeavesConfig.fakeplayerCacheSkin && CACHE.containsKey(name)) { ++ if (LeavesConfig.modify.fakeplayer.useSkinCache && CACHE.containsKey(name)) { + return CACHE.get(name); + } + @@ -2126,7 +2126,7 @@ index 0000000000000000000000000000000000000000..517e3321b866abe9d17a6fe9e919528b +} diff --git a/src/main/java/org/leavesmc/leaves/bot/ServerBot.java b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java new file mode 100644 -index 0000000000000000000000000000000000000000..5ade407ff2f3f770592ace5a0f7c82e0a2228ad3 +index 0000000000000000000000000000000000000000..40f46253389bd75afeebcc7954c1132ac7e97298 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java @@ -0,0 +1,561 @@ @@ -2240,7 +2240,7 @@ index 0000000000000000000000000000000000000000..5ade407ff2f3f770592ace5a0f7c82e0 + this.tracingRange = world.spigotConfig.playerTrackingRange * world.spigotConfig.playerTrackingRange; + + this.notSleepTicks = 0; -+ this.fauxSleeping = LeavesConfig.fakeplayerSkipSleep; ++ this.fauxSleeping = LeavesConfig.modify.fakeplayer.canSkipSleep; + } + + public void sendPlayerInfo(ServerPlayer player) { @@ -2349,10 +2349,10 @@ index 0000000000000000000000000000000000000000..5ade407ff2f3f770592ace5a0f7c82e0 + notSleepTicks++; + } + -+ if (LeavesConfig.fakeplayerRegenAmount > 0.0 && server.getTickCount() % 20 == 0) { ++ if (LeavesConfig.modify.fakeplayer.regenAmount > 0.0 && server.getTickCount() % 20 == 0) { + float health = getHealth(); + float maxHealth = getMaxHealth(); -+ float regenAmount = (float) (LeavesConfig.fakeplayerRegenAmount * 20); ++ float regenAmount = (float) (LeavesConfig.modify.fakeplayer.regenAmount * 20); + float amount; + + if (health < maxHealth - regenAmount) { @@ -2385,7 +2385,7 @@ index 0000000000000000000000000000000000000000..5ade407ff2f3f770592ace5a0f7c82e0 + + @Override + public @NotNull InteractionResult interact(@NotNull Player player, @NotNull InteractionHand hand) { -+ if (LeavesConfig.openFakeplayerInventory) { ++ if (LeavesConfig.modify.fakeplayer.canOpenInventory) { + if (player instanceof ServerPlayer player1 && player.getMainHandItem().isEmpty()) { + BotInventoryOpenEvent event = new BotInventoryOpenEvent(this.getBukkitEntity(), player1.getBukkitEntity()); + this.server.server.getPluginManager().callEvent(event); @@ -2647,14 +2647,14 @@ index 0000000000000000000000000000000000000000..5ade407ff2f3f770592ace5a0f7c82e0 + } + + private void runAction() { -+ if (LeavesConfig.fakeplayerUseAction) { ++ if (LeavesConfig.modify.fakeplayer.canUseAction) { + this.actions.forEach(action -> action.tryTick(this)); + this.actions.removeIf(BotAction::isCancelled); + } + } + + public boolean addBotAction(BotAction action, CommandSender sender) { -+ if (!LeavesConfig.fakeplayerUseAction) { ++ if (!LeavesConfig.modify.fakeplayer.canUseAction) { + return false; + } + @@ -4177,7 +4177,7 @@ index 0000000000000000000000000000000000000000..f8334858a7a0572d1c3dcf5f04696fbb +} diff --git a/src/main/java/org/leavesmc/leaves/bot/agent/configs/AlwaysSendDataConfig.java b/src/main/java/org/leavesmc/leaves/bot/agent/configs/AlwaysSendDataConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..9a584603edbbe4ccd8a88c90ef3e9125480635f1 +index 0000000000000000000000000000000000000000..31f68872652b3ac217d3b4f56e3bdd778314c27a --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/agent/configs/AlwaysSendDataConfig.java @@ -0,0 +1,45 @@ @@ -4200,7 +4200,7 @@ index 0000000000000000000000000000000000000000..9a584603edbbe4ccd8a88c90ef3e9125 + + public AlwaysSendDataConfig() { + super("always_send_data", CommandArgument.of(CommandArgumentType.BOOLEAN).setTabComplete(0, List.of("ture", "false")), AlwaysSendDataConfig::new); -+ this.value = LeavesConfig.alwaysSendFakeplayerData; ++ this.value = LeavesConfig.modify.fakeplayer.canSendDataAlways; + } + + @Override @@ -4329,7 +4329,7 @@ index 0000000000000000000000000000000000000000..0d934910cff745ea9a53d651e2007963 +} diff --git a/src/main/java/org/leavesmc/leaves/bot/agent/configs/SpawnPhantomConfig.java b/src/main/java/org/leavesmc/leaves/bot/agent/configs/SpawnPhantomConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..a3f978318a67c3c5e147a50eb2b6c01c3f549dc2 +index 0000000000000000000000000000000000000000..983b358a5cc03f07d36a3924d55275294b9a727e --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/agent/configs/SpawnPhantomConfig.java @@ -0,0 +1,51 @@ @@ -4351,7 +4351,7 @@ index 0000000000000000000000000000000000000000..a3f978318a67c3c5e147a50eb2b6c01c + + public SpawnPhantomConfig() { + super("spawn_phantom", CommandArgument.of(CommandArgumentType.BOOLEAN).setTabComplete(0, List.of("ture", "false")), SpawnPhantomConfig::new); -+ this.value = LeavesConfig.fakeplayerSpawnPhantom; ++ this.value = LeavesConfig.modify.fakeplayer.canSpawnPhantom; + } + + @Override diff --git a/patches/server/0011-Make-shears-in-dispenser-can-unlimited-use.patch b/patches/server/0011-Make-shears-in-dispenser-can-unlimited-use.patch index 49c14e62..e1ccecd8 100644 --- a/patches/server/0011-Make-shears-in-dispenser-can-unlimited-use.patch +++ b/patches/server/0011-Make-shears-in-dispenser-can-unlimited-use.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make shears in dispenser can unlimited use diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -index 65ed3d77a51b8299517e0c165403b0c5ac413475..9b582a4cbafba8469251341b4472a3b138ef01c8 100644 +index 65ed3d77a51b8299517e0c165403b0c5ac413475..4708560d4c749f3c1039beaa2779c0036fb3d42e 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java @@ -64,7 +64,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { @@ -13,7 +13,7 @@ index 65ed3d77a51b8299517e0c165403b0c5ac413475..9b582a4cbafba8469251341b4472a3b1 this.setSuccess(ShearsDispenseItemBehavior.tryShearBeehive(worldserver, blockposition) || ShearsDispenseItemBehavior.tryShearLivingEntity(worldserver, blockposition, stack, bukkitBlock, craftItem)); // CraftBukkit - if (this.isSuccess()) { -+ if (this.isSuccess() && !org.leavesmc.leaves.LeavesConfig.shearsInDispenserCanZeroAmount) { // Leaves - Make shears in dispenser can unlimited use ++ if (this.isSuccess() && !org.leavesmc.leaves.LeavesConfig.modify.oldMC.shearsInDispenserCanZeroAmount) { // Leaves - Make shears in dispenser can unlimited use stack.hurtAndBreak(1, worldserver, (ServerPlayer) null, (item) -> { }); } diff --git a/patches/server/0012-Redstone-Shears-Wrench.patch b/patches/server/0012-Redstone-Shears-Wrench.patch index d5dc5b8f..12845b3b 100644 --- a/patches/server/0012-Redstone-Shears-Wrench.patch +++ b/patches/server/0012-Redstone-Shears-Wrench.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Redstone Shears Wrench diff --git a/src/main/java/net/minecraft/world/item/ShearsItem.java b/src/main/java/net/minecraft/world/item/ShearsItem.java -index 374d51da03ce47ff744b64b8cfe98ad6d72ebdb4..273cb07c5cef7656a1a15bf7b530ed254e3a3f3d 100644 +index 374d51da03ce47ff744b64b8cfe98ad6d72ebdb4..5ae43ecff45239086ab8aad3b5c2e0774b999544 100644 --- a/src/main/java/net/minecraft/world/item/ShearsItem.java +++ b/src/main/java/net/minecraft/world/item/ShearsItem.java @@ -23,6 +23,23 @@ import net.minecraft.world.level.block.GrowingPlantHeadBlock; @@ -38,7 +38,7 @@ index 374d51da03ce47ff744b64b8cfe98ad6d72ebdb4..273cb07c5cef7656a1a15bf7b530ed25 + // Leaves start - shears wrench + Block block = blockState.getBlock(); -+ if (org.leavesmc.leaves.LeavesConfig.redstoneShearsWrench && block instanceof ObserverBlock || block instanceof DispenserBlock || ++ if (org.leavesmc.leaves.LeavesConfig.modify.redstoneShearsWrench && block instanceof ObserverBlock || block instanceof DispenserBlock || + block instanceof PistonBaseBlock || block instanceof HopperBlock || block instanceof RepeaterBlock || block instanceof ComparatorBlock || + block instanceof CrafterBlock || block instanceof LeverBlock || block instanceof CocoaBlock) { + StateDefinition blockstatelist = block.getStateDefinition(); diff --git a/patches/server/0014-Budding-Amethyst-can-push-by-piston.patch b/patches/server/0014-Budding-Amethyst-can-push-by-piston.patch index 1227ddf7..9d368d03 100644 --- a/patches/server/0014-Budding-Amethyst-can-push-by-piston.patch +++ b/patches/server/0014-Budding-Amethyst-can-push-by-piston.patch @@ -5,14 +5,15 @@ Subject: [PATCH] Budding Amethyst can push by piston diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..48ced9994219dc21d593a7deaa0a318f55dd00c7 100644 +index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..b3a3388ef62b0622906b2470056cb41f0deb0391 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -583,6 +583,12 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -583,6 +583,13 @@ public class Block extends BlockBehaviour implements ItemLike { } // Spigot end + // Leaves start - reset push reaction ++ @org.jetbrains.annotations.Nullable + public net.minecraft.world.level.material.PushReaction getResetPushReaction() { + return null; + } @@ -22,18 +23,19 @@ index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..48ced9994219dc21d593a7deaa0a318f public boolean equals(Object object) { diff --git a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java -index 8920855b07a31715327b8102c7faafc9f916825d..32d926a1b952b8069c5bf48c88e3c108b08b4ab1 100644 +index 8920855b07a31715327b8102c7faafc9f916825d..e6cc94e9c1b2388b8e42821e6bfaa2e22d44f9d3 100644 --- a/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BuddingAmethystBlock.java -@@ -60,4 +60,11 @@ public class BuddingAmethystBlock extends AmethystBlock { +@@ -60,4 +60,12 @@ public class BuddingAmethystBlock extends AmethystBlock { public static boolean canClusterGrowAtState(BlockState state) { return state.isAir() || state.is(Blocks.WATER) && state.getFluidState().getAmount() == 8; } + + // Leaves start - budding amethyst can push by piston ++ @org.jetbrains.annotations.Nullable + @Override + public net.minecraft.world.level.material.PushReaction getResetPushReaction() { -+ return org.leavesmc.leaves.LeavesConfig.buddingAmethystCanPushByPiston ? net.minecraft.world.level.material.PushReaction.PUSH_ONLY : null; ++ return org.leavesmc.leaves.LeavesConfig.modify.buddingAmethystCanPushByPiston ? net.minecraft.world.level.material.PushReaction.PUSH_ONLY : null; + } + // Leaves end - budding amethyst can push by piston } diff --git a/patches/server/0015-Spectator-dont-get-Advancement.patch b/patches/server/0015-Spectator-dont-get-Advancement.patch index 9386bd77..59b916e7 100644 --- a/patches/server/0015-Spectator-dont-get-Advancement.patch +++ b/patches/server/0015-Spectator-dont-get-Advancement.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spectator dont get Advancement diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index b5f18a0115b629930de84a9d086505adaa6087dd..ece0aa3bf18e864a261d4d4edf0a98a40e7f6bb3 100644 +index b9ed92cd8a12f648eeaa02427d95d75468534420..7f8eaf4590a29b147aa8c05cec919fd7744e74ba 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -221,6 +221,11 @@ public class PlayerAdvancements { @@ -13,7 +13,7 @@ index b5f18a0115b629930de84a9d086505adaa6087dd..ece0aa3bf18e864a261d4d4edf0a98a4 public boolean award(AdvancementHolder advancement, String criterionName) { + // Leaves start - spectator don't get advancement -+ if (org.leavesmc.leaves.LeavesConfig.spectatorDontGetAdvancement && player.gameMode.getGameModeForPlayer() == net.minecraft.world.level.GameType.SPECTATOR) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.spectatorDontGetAdvancement && player.gameMode.getGameModeForPlayer() == net.minecraft.world.level.GameType.SPECTATOR) { + return false; + } + // Leaves end - spectator don't get advancement diff --git a/patches/server/0016-Stick-can-change-ArmorStand-arm-status.patch b/patches/server/0016-Stick-can-change-ArmorStand-arm-status.patch index 86fad49b..817ed945 100644 --- a/patches/server/0016-Stick-can-change-ArmorStand-arm-status.patch +++ b/patches/server/0016-Stick-can-change-ArmorStand-arm-status.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Stick can change ArmorStand arm status diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 70b8023c3badc745f342d5b0ab54699e3923826a..dbaa552bed4d09e8b87475732dc911c95893ff89 100644 +index 70b8023c3badc745f342d5b0ab54699e3923826a..49e8a9d5df9b20bced385019f5e7fb622536213a 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -397,6 +397,12 @@ public class ArmorStand extends LivingEntity { @@ -13,8 +13,8 @@ index 70b8023c3badc745f342d5b0ab54699e3923826a..dbaa552bed4d09e8b87475732dc911c9 } } else { + // Leaves start - stick can change ArmorStand arm status -+ if (org.leavesmc.leaves.LeavesConfig.stickChangeArmorStandArmStatus && itemstack.is(Items.STICK) && player.isShiftKeyDown()) { -+ setShowArms(!isShowArms()); ++ if (org.leavesmc.leaves.LeavesConfig.modify.stickChangeArmorStandArmStatus && itemstack.is(Items.STICK) && player.isShiftKeyDown()) { ++ setShowArms(!showArms()); + } + // Leaves end - stick can change ArmorStand arm status + diff --git a/patches/server/0017-Configurable-MC-59471.patch b/patches/server/0017-Configurable-MC-59471.patch index cce70eed..2841fe07 100644 --- a/patches/server/0017-Configurable-MC-59471.patch +++ b/patches/server/0017-Configurable-MC-59471.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable MC-59471 diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java -index c2589f42c467ca672417c24076313da51bb2dcbb..88b8078cc416ec87331d284ebe37295406d6300d 100644 +index c2589f42c467ca672417c24076313da51bb2dcbb..99caf34456385565d8a985409690c656ab3d3c3d 100644 --- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java @@ -191,7 +191,7 @@ public class TripWireHookBlock extends Block { @@ -26,7 +26,7 @@ index c2589f42c467ca672417c24076313da51bb2dcbb..88b8078cc416ec87331d284ebe372954 - if (iblockdata5.is(Blocks.TRIPWIRE) || iblockdata5.is(Blocks.TRIPWIRE_HOOK)) { - world.setBlock(blockposition2, (BlockState) iblockdata4.trySetValue(TripWireHookBlock.ATTACHED, flag4), 3); + // Leaves start - MC-59471 -+ if (org.leavesmc.leaves.LeavesConfig.stringTripwireHookDuplicate) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.stringTripwireHookDuplicate) { + world.setBlock(blockposition2, iblockdata4.trySetValue(TripWireHookBlock.ATTACHED, flag4), 3); + world.getBlockState(blockposition2); + } else { diff --git a/patches/server/0018-No-chat-sign.patch b/patches/server/0018-No-chat-sign.patch index 41275798..d4c9ffa0 100644 --- a/patches/server/0018-No-chat-sign.patch +++ b/patches/server/0018-No-chat-sign.patch @@ -5,7 +5,7 @@ Subject: [PATCH] No chat sign diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java -index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..8fe9a0bf5a6c27d8a505afc2f51b3dccc905423b 100644 +index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..73d239536b373e292ee2883edac0049541b59ba0 100644 --- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java @@ -317,7 +317,7 @@ public final class ChatProcessor { @@ -13,12 +13,12 @@ index 14e412ebf75b0e06ab53a1c8f9dd1be6ad1e2680..8fe9a0bf5a6c27d8a505afc2f51b3dcc private void sendToServer(final ChatType.Bound chatType, final @Nullable Function msgFunction) { final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console)); - ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure"); -+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) || org.leavesmc.leaves.LeavesConfig.noChatSign ? null : "Not Secure"); // Leaves - No Not Secure ++ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) || org.leavesmc.leaves.LeavesConfig.mics.noChatSign ? null : "Not Secure"); // Leaves - No Not Secure } } diff --git a/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java b/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java -index 479e6e2aa88a22ef7f8fccb06add6806f5b71d9d..e6a6d09a64414ae6932e9bac338ce36043bd4b26 100644 +index 479e6e2aa88a22ef7f8fccb06add6806f5b71d9d..5a103b7c4d2566d93b18a2e8db32a3444ba44e36 100644 --- a/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java +++ b/src/main/java/net/minecraft/commands/arguments/ArgumentSignatures.java @@ -13,10 +13,17 @@ public record ArgumentSignatures(List entries) { @@ -33,7 +33,7 @@ index 479e6e2aa88a22ef7f8fccb06add6806f5b71d9d..e6a6d09a64414ae6932e9bac338ce360 + private static List readSign(FriendlyByteBuf buf) { + var entries = buf.readCollection(FriendlyByteBuf.limitValue(ArrayList::new, 8), Entry::new); -+ return org.leavesmc.leaves.LeavesConfig.noChatSign ? List.of() : entries; ++ return org.leavesmc.leaves.LeavesConfig.mics.noChatSign ? List.of() : entries; + } + // Leaves end - no chat sign + @@ -41,7 +41,7 @@ index 479e6e2aa88a22ef7f8fccb06add6806f5b71d9d..e6a6d09a64414ae6932e9bac338ce360 buf.writeCollection(this.entries, (buf2, entry) -> entry.write(buf2)); } diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index a523a83aec3a6ecbec4d60a187edc0c0167d15b4..1afa7dd77e80b233b9268bb119b0a9ee6000e40d 100644 +index a523a83aec3a6ecbec4d60a187edc0c0167d15b4..e4ac9fac52cec522d679a1ffe8b3263a204f5d7f 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -129,6 +129,16 @@ public class FriendlyByteBuf extends ByteBuf { @@ -51,7 +51,7 @@ index a523a83aec3a6ecbec4d60a187edc0c0167d15b4..1afa7dd77e80b233b9268bb119b0a9ee + // Leaves start - no chat sign + if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC) { + JsonElement element = dataresult.getOrThrow(string -> new EncoderException("Failed to encode: " + string + " " + value)); -+ element.getAsJsonObject().addProperty("preventsChatReports", org.leavesmc.leaves.LeavesConfig.noChatSign); ++ element.getAsJsonObject().addProperty("preventsChatReports", org.leavesmc.leaves.LeavesConfig.mics.noChatSign); + + this.writeUtf(GSON.toJson(element)); + return; @@ -62,7 +62,7 @@ index a523a83aec3a6ecbec4d60a187edc0c0167d15b4..1afa7dd77e80b233b9268bb119b0a9ee return new EncoderException("Failed to encode: " + s + " " + String.valueOf(value)); })), maxLength); // Paper - Adventure; add max length parameter diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java -index 07df3299f1d1aa5506e1f6f146347d53e0278d9c..fb441424c03d547cdf4dcfcde5e60d8e4d6a4f59 100644 +index 07df3299f1d1aa5506e1f6f146347d53e0278d9c..342f23250f22771d8b395cece087d277fd99eaae 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java @@ -15,8 +15,9 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt @@ -83,7 +83,7 @@ index 07df3299f1d1aa5506e1f6f146347d53e0278d9c..fb441424c03d547cdf4dcfcde5e60d8e + private static MessageSignature readSign(FriendlyByteBuf buf) { + byte[] bs = new byte[256]; + buf.readBytes(bs); -+ return org.leavesmc.leaves.LeavesConfig.noChatSign ? null : new MessageSignature(bs); ++ return org.leavesmc.leaves.LeavesConfig.mics.noChatSign ? null : new MessageSignature(bs); + } + // Leaves end - no chat sign + @@ -91,7 +91,7 @@ index 07df3299f1d1aa5506e1f6f146347d53e0278d9c..fb441424c03d547cdf4dcfcde5e60d8e public PacketType type() { return GamePacketTypes.SERVERBOUND_CHAT; diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java -index 5705cb920084b775cce4b361683b32c6b6e003ed..cbff868303d751d09b68f431c78bb13b4734f48f 100644 +index 5705cb920084b775cce4b361683b32c6b6e003ed..eb0caad2613e8fdd7dbcc2a295cc9201a225f3f2 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java @@ -26,6 +26,11 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess @@ -99,7 +99,7 @@ index 5705cb920084b775cce4b361683b32c6b6e003ed..cbff868303d751d09b68f431c78bb13b @Override public void handle(ServerGamePacketListener listener) { + // Leaves start - no chat report -+ if (org.leavesmc.leaves.LeavesConfig.noChatSign) { ++ if (org.leavesmc.leaves.LeavesConfig.mics.noChatSign) { + return; + } + // Leaves end - no chat report @@ -107,7 +107,7 @@ index 5705cb920084b775cce4b361683b32c6b6e003ed..cbff868303d751d09b68f431c78bb13b } } diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 9b1e6effb8bf852957dba92a54688932ddb0d565..264bef3fc05cf116e2a404a4fee7e30c90fdec2c 100644 +index 9b1e6effb8bf852957dba92a54688932ddb0d565..679a40aeedc7e259401a6c244ed54136d6c75a40 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -650,7 +650,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -115,12 +115,12 @@ index 9b1e6effb8bf852957dba92a54688932ddb0d565..264bef3fc05cf116e2a404a4fee7e30c return dedicatedserverproperties.enforceSecureProfile && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() - && this.services.canValidateProfileKeys(); -+ && this.services.canValidateProfileKeys() && !org.leavesmc.leaves.LeavesConfig.noChatSign; // Leaves - no chat sign ++ && this.services.canValidateProfileKeys() && !org.leavesmc.leaves.LeavesConfig.mics.noChatSign; // Leaves - no chat sign // Paper end - Add setting for proxy online mode status } diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 8344c7f953fc465ee9f43e1f81e2eb062fd3c432..ba8fd51e467ba35cd5f0a44d8b226ede2d2cc412 100644 +index 8344c7f953fc465ee9f43e1f81e2eb062fd3c432..93404b7e1aaf74d6acc7031116dc8f63fc70f964 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java @@ -304,10 +304,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -128,7 +128,7 @@ index 8344c7f953fc465ee9f43e1f81e2eb062fd3c432..ba8fd51e467ba35cd5f0a44d8b226ede public void send(Packet packet) { + // Leaves start - rebuild ClientboundPlayerChatPacket -+ if (org.leavesmc.leaves.LeavesConfig.noChatSign) { ++ if (org.leavesmc.leaves.LeavesConfig.mics.noChatSign) { + if (this instanceof ServerGamePacketListenerImpl && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat) { + packet = new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(chat.chatType().decorate(chat.unsignedContent() != null ? chat.unsignedContent() : Component.literal(chat.body().content())), false); + } @@ -139,7 +139,7 @@ index 8344c7f953fc465ee9f43e1f81e2eb062fd3c432..ba8fd51e467ba35cd5f0a44d8b226ede public void send(Packet packet, @Nullable PacketSendListener callbacks) { + // Leaves start - no ClientboundPlayerChatHeaderPacket and rebuild ClientboundPlayerChatPacket -+ if (org.leavesmc.leaves.LeavesConfig.noChatSign) { ++ if (org.leavesmc.leaves.LeavesConfig.mics.noChatSign) { + if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && callbacks != null) { + callbacks = null; + } @@ -149,7 +149,7 @@ index 8344c7f953fc465ee9f43e1f81e2eb062fd3c432..ba8fd51e467ba35cd5f0a44d8b226ede if (packet == null || this.processedDisconnect) { // Spigot return; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9fef90a243f7da86a0de48091ef14b820ed8db90..0e179ab666e936f59b9e2f42340871218b0439d3 100644 +index 9b3fbc13779ded07c696e151772d834ff8d61a7d..b83b903381ca6c426d2f26f9459e769083eb5876 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1423,7 +1423,7 @@ public abstract class PlayerList { @@ -157,7 +157,7 @@ index 9fef90a243f7da86a0de48091ef14b820ed8db90..0e179ab666e936f59b9e2f4234087121 public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public - return message.hasSignature() && !message.hasExpiredServer(Instant.now()); -+ return org.leavesmc.leaves.LeavesConfig.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Leaves - No Not Secure ++ return org.leavesmc.leaves.LeavesConfig.mics.noChatSign || (message.hasSignature() && !message.hasExpiredServer(Instant.now())); // Leaves - No Not Secure } // CraftBukkit start diff --git a/patches/server/0019-Dont-send-useless-entity-packets.patch b/patches/server/0019-Dont-send-useless-entity-packets.patch index 0e151ade..20873c6b 100644 --- a/patches/server/0019-Dont-send-useless-entity-packets.patch +++ b/patches/server/0019-Dont-send-useless-entity-packets.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Dont send useless entity packets This patch is Powered by Purpur(https://github.com/PurpurMC/Purpur) diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..0a315a87b9dcd39afd7dabeb9fcaf22de1951635 100644 +index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..1e1e5ade09d368f0fdc6533f26281bd7d6d31751 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java @@ -226,6 +226,11 @@ public class ServerEntity { @@ -14,7 +14,7 @@ index 90eb4927fa51ce3df86aa7b6c71f49150a03e337..0a315a87b9dcd39afd7dabeb9fcaf22d flag3 = true; flag4 = true; + // Leaves start - dont send useless entity packets -+ if (org.leavesmc.leaves.LeavesConfig.dontSendUselessEntityPackets && isUselessPacket(packet1)) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.dontSendUselessEntityPackets && isUselessPacket(packet1)) { + packet1 = null; + } + // Leaves end - dont send useless entity packets diff --git a/patches/server/0020-Optimize-suffocation.patch b/patches/server/0020-Optimize-suffocation.patch index eb20f1df..afe1f83d 100644 --- a/patches/server/0020-Optimize-suffocation.patch +++ b/patches/server/0020-Optimize-suffocation.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize suffocation This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 7610b2961d59af006440476f7c91038b9b1c5432..9caeda8672567ecd9687f5b1b0e5eb3dbf0b7769 100644 +index 7610b2961d59af006440476f7c91038b9b1c5432..8c34c7f74779774e8627c2eb9d5230ed1980df36 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -467,7 +467,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -14,7 +14,7 @@ index 7610b2961d59af006440476f7c91038b9b1c5432..9caeda8672567ecd9687f5b1b0e5eb3d if (world1 instanceof ServerLevel) { worldserver1 = (ServerLevel) world1; - if (this.isInWall()) { -+ if ((!org.leavesmc.leaves.LeavesConfig.enableSuffocationOptimization || this instanceof WitherBoss || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Leaves - optimize suffocation ++ if ((!org.leavesmc.leaves.LeavesConfig.performance.enableSuffocationOptimization || this instanceof WitherBoss || (tickCount % 10 == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) { // Leaves - optimize suffocation this.hurtServer(worldserver1, this.damageSources().inWall(), 1.0F); } else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) { double d1 = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone(); diff --git a/patches/server/0021-Only-check-for-spooky-season-once-an-hour.patch b/patches/server/0021-Only-check-for-spooky-season-once-an-hour.patch index 2a288402..6cd6a8eb 100644 --- a/patches/server/0021-Only-check-for-spooky-season-once-an-hour.patch +++ b/patches/server/0021-Only-check-for-spooky-season-once-an-hour.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Only check for spooky season once an hour This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 60c2868f255d372226e0c1389caaa5477bbef41e..69269ced145e5944980f63007c1b36778ecd543c 100644 +index 60c2868f255d372226e0c1389caaa5477bbef41e..d432e00ec084d1c7a23f10be6c457681ae66db37 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java @@ -242,13 +242,30 @@ public class Bat extends AmbientCreature { @@ -21,7 +21,7 @@ index 60c2868f255d372226e0c1389caaa5477bbef41e..69269ced145e5944980f63007c1b3677 - LocalDate localdate = LocalDate.now(); - int i = localdate.get(ChronoField.DAY_OF_MONTH); - int j = localdate.get(ChronoField.MONTH_OF_YEAR); -+ if (org.leavesmc.leaves.LeavesConfig.checkSpookySeasonOnceAnHour) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.checkSpookySeasonOnceAnHour) { + if (net.minecraft.server.MinecraftServer.currentTick - lastSpookyCheck > ONE_HOUR) { + LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); diff --git a/patches/server/0022-Config-to-disable-method-profiler.patch b/patches/server/0022-Config-to-disable-method-profiler.patch index e71a118f..6279b33c 100644 --- a/patches/server/0022-Config-to-disable-method-profiler.patch +++ b/patches/server/0022-Config-to-disable-method-profiler.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Config to disable method profiler This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 59d4bc687af52ffb2b8529ce91a5703492fce96f..601d12cc2e0f2e180882f6b8c878e24a0856d082 100644 +index 5c1c598044c872f1b198f32aca8eb7e67fa59e35..ee43310ce1cd051e45486c4587c5e2aa1d000338 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1320,7 +1320,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop attribute) { - return this.attributes.computeIfAbsent(attribute, attributex -> this.supplier.createInstance(this::onAttributeModified, attributex)); + // Leaves start - cache lambda, as for some reason java allocates it anyways -+ if (org.leavesmc.leaves.LeavesConfig.reduceEntityAllocations) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.reduceEntityAllocations) { + return this.attributes.computeIfAbsent(attribute, this.createInstance); + } else { + return this.attributes.computeIfAbsent(attribute, attributex -> this.supplier.createInstance(this::onAttributeModified, attributex)); diff --git a/patches/server/0025-Remove-lambda-from-ticking-guard.patch b/patches/server/0025-Remove-lambda-from-ticking-guard.patch index 3fa2ca28..1b98ad3a 100644 --- a/patches/server/0025-Remove-lambda-from-ticking-guard.patch +++ b/patches/server/0025-Remove-lambda-from-ticking-guard.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove lambda from ticking guard This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index abaa89fdb80da461a9720a31d2bfae8ee9ad3a8f..b73881ad6656a990ad0313b4ab94ba7302fae6b2 100644 +index abaa89fdb80da461a9720a31d2bfae8ee9ad3a8f..cc8af50b1ca021b837e4f16b61d7ee6b0f8f0c4c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -804,7 +804,23 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -15,7 +15,7 @@ index abaa89fdb80da461a9720a31d2bfae8ee9ad3a8f..b73881ad6656a990ad0313b4ab94ba73 gameprofilerfiller.push("tick"); - this.guardEntityTick(this::tickNonPassenger, entity); + // Leaves start - copied from this.guardEntityTick -+ if (org.leavesmc.leaves.LeavesConfig.removeTickGuardLambda) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.remove.tickGuardLambda) { + try { + this.tickNonPassenger(entity); // Leaves - changed + } catch (Throwable throwable) { diff --git a/patches/server/0026-Remove-iterators-from-inventory-contains.patch b/patches/server/0026-Remove-iterators-from-inventory-contains.patch index 6030b1fb..0a0ae8c1 100644 --- a/patches/server/0026-Remove-iterators-from-inventory-contains.patch +++ b/patches/server/0026-Remove-iterators-from-inventory-contains.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove iterators from inventory contains This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 0e214d502998e9eb959952b257844529992df0df..6d4d3eadb3408e5eb2f545551270071c9517eedb 100644 +index 0e214d502998e9eb959952b257844529992df0df..d2bd4c5b2a7a9689680f4b021368f25356c58ac7 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java @@ -649,17 +649,31 @@ public class Inventory implements Container, Nameable { @@ -15,7 +15,7 @@ index 0e214d502998e9eb959952b257844529992df0df..6d4d3eadb3408e5eb2f545551270071c public boolean contains(ItemStack stack) { - Iterator iterator = this.compartments.iterator(); + // Leaves start - don't allocate iterators -+ if (org.leavesmc.leaves.LeavesConfig.removeInventoryContainsIterators) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.remove.inventoryContainsIterators) { + for (int i = 0; i < this.compartments.size(); i++) { + List list = this.compartments.get(i); + for (int j = 0; j < list.size(); j++) { diff --git a/patches/server/0027-Cache-climbing-check-for-activation.patch b/patches/server/0027-Cache-climbing-check-for-activation.patch index 87f5f91e..d28ad222 100644 --- a/patches/server/0027-Cache-climbing-check-for-activation.patch +++ b/patches/server/0027-Cache-climbing-check-for-activation.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Cache climbing check for activation This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9caeda8672567ecd9687f5b1b0e5eb3dbf0b7769..5ddea4ca32bc2741ab449dc00a3d9ce4f8c57c70 100644 +index 8c34c7f74779774e8627c2eb9d5230ed1980df36..3002879d96916ce24400159792b48e5f9b8e2e3e 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -2123,6 +2123,22 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -18,7 +18,7 @@ index 9caeda8672567ecd9687f5b1b0e5eb3dbf0b7769..5ddea4ca32bc2741ab449dc00a3d9ce4 + private BlockPos lastClimbingPosition = null; + + public boolean onClimableCached() { -+ if (!org.leavesmc.leaves.LeavesConfig.cacheClimbCheck) { ++ if (!org.leavesmc.leaves.LeavesConfig.performance.cacheClimbCheck) { + return this.onClimbable(); + } + if (!this.blockPosition().equals(this.lastClimbingPosition)) { diff --git a/patches/server/0028-Reduce-chunk-loading-lookups.patch b/patches/server/0028-Reduce-chunk-loading-lookups.patch index 750ea6f0..b2bb3b40 100644 --- a/patches/server/0028-Reduce-chunk-loading-lookups.patch +++ b/patches/server/0028-Reduce-chunk-loading-lookups.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Reduce chunk loading & lookups This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish) diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..350ca2bf963b41227c69d0621330a0c1c024c09f 100644 +index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..2b8e1a8e233071821411eb1f95c705efb4a6e816 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java @@ -307,11 +307,28 @@ public class EnderMan extends Monster implements NeutralMob { @@ -17,7 +17,7 @@ index 48dcd2bc12ce1d08cc5195bff5460dc0dd9902d3..350ca2bf963b41227c69d0621330a0c1 - blockposition_mutableblockposition.move(Direction.DOWN); + // Leaves start - single chunk lookup + BlockState iblockdata; -+ if (org.leavesmc.leaves.LeavesConfig.reduceChuckLoadAndLookup) { ++ if (org.leavesmc.leaves.LeavesConfig.performance.reduceChuckLoadAndLookup) { + net.minecraft.world.level.chunk.LevelChunk chunk = this.level().getChunkIfLoaded(blockposition_mutableblockposition); + if (chunk == null) { + return false; diff --git a/patches/server/0029-InstantBlockUpdater-Reintroduced.patch b/patches/server/0029-InstantBlockUpdater-Reintroduced.patch index 537035f3..5eeceab9 100644 --- a/patches/server/0029-InstantBlockUpdater-Reintroduced.patch +++ b/patches/server/0029-InstantBlockUpdater-Reintroduced.patch @@ -6,7 +6,7 @@ Subject: [PATCH] InstantBlockUpdater Reintroduced This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition) diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 022de445bbbb869c38be4972c98dcf1c665539ec..fe8c9aae9da0b3a6980d5d8e3d78e58003aff25a 100644 +index 022de445bbbb869c38be4972c98dcf1c665539ec..1187453b7d961a0605af636cb6b5ed0c1f6b4be3 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -878,7 +878,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl @@ -15,7 +15,7 @@ index 022de445bbbb869c38be4972c98dcf1c665539ec..fe8c9aae9da0b3a6980d5d8e3d78e580 this.isDebug = flag1; - this.neighborUpdater = new CollectingNeighborUpdater(this, j); + // Leaves start - instantBlockUpdaterReintroduced -+ if (org.leavesmc.leaves.LeavesConfig.instantBlockUpdaterReintroduced) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.instantBlockUpdaterReintroduced) { + this.neighborUpdater = new net.minecraft.world.level.redstone.InstantNeighborUpdater(this); + } else { + this.neighborUpdater = new CollectingNeighborUpdater(this, j); diff --git a/patches/server/0030-Random-flatten-triangular-distribution.patch b/patches/server/0030-Random-flatten-triangular-distribution.patch index 0b65a66c..420ad4de 100644 --- a/patches/server/0030-Random-flatten-triangular-distribution.patch +++ b/patches/server/0030-Random-flatten-triangular-distribution.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Random flatten triangular distribution This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition) diff --git a/src/main/java/net/minecraft/util/RandomSource.java b/src/main/java/net/minecraft/util/RandomSource.java -index 252aef3ffe0fecd47ebea1ed7df48e14fa873eb9..3c71ef85b2444ea3858c12de48f4d7a2385e5b4f 100644 +index 252aef3ffe0fecd47ebea1ed7df48e14fa873eb9..bbfe68a7e860fff5c43feb2dc02c3c664a29bd09 100644 --- a/src/main/java/net/minecraft/util/RandomSource.java +++ b/src/main/java/net/minecraft/util/RandomSource.java @@ -53,7 +53,14 @@ public interface RandomSource { @@ -15,7 +15,7 @@ index 252aef3ffe0fecd47ebea1ed7df48e14fa873eb9..3c71ef85b2444ea3858c12de48f4d7a2 default double triangle(double mode, double deviation) { - return mode + deviation * (this.nextDouble() - this.nextDouble()); + // Leaves start - flattenTriangularDistribution -+ if (org.leavesmc.leaves.LeavesConfig.flattenTriangularDistribution) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.flattenTriangularDistribution) { + this.nextDouble(); + return mode + deviation * (-1 + this.nextDouble() * 2); + } else { diff --git a/patches/server/0031-BBOR-Protocol.patch b/patches/server/0031-BBOR-Protocol.patch index 8f1ee6f5..1e6b5974 100644 --- a/patches/server/0031-BBOR-Protocol.patch +++ b/patches/server/0031-BBOR-Protocol.patch @@ -5,7 +5,7 @@ Subject: [PATCH] BBOR Protocol diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 0e179ab666e936f59b9e2f42340871218b0439d3..8cc7815e0f996b7d5c4518a4a487b99480f48f97 100644 +index b83b903381ca6c426d2f26f9459e769083eb5876..7a741442ee2373f1a400214047bbf5844efecce6 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1566,6 +1566,7 @@ public abstract class PlayerList { @@ -34,7 +34,7 @@ index 4640baec5bed6c2d53cc0f8ca1d273cc115abe9b..2fea5a46bba27578366c36f594472c3e public Level getLevel() { diff --git a/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472aad5d4a3 +index 0000000000000000000000000000000000000000..c4ba09a998966fd8563f592920774cba2ea61c31 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/BBORProtocol.java @@ -0,0 +1,227 @@ @@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472 + + @ProtocolHandler.Ticker + public static void tick() { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + for (var playerEntry : players.entrySet()) { + sendBoundingToPlayer(playerEntry.getKey(), playerEntry.getValue()); + } @@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472 + + @ProtocolHandler.ReloadServer + public static void onServerReload() { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + initAllPlayer(); + } else { + loggedOutAllPlayer(); @@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472 + + @ProtocolHandler.PlayerJoin + public static void onPlayerLoggedIn(@NotNull ServerPlayer player) { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + ServerLevel overworld = MinecraftServer.getServer().overworld(); + ProtocolUtils.sendPayloadPacket(player, INITIALIZE_CLIENT, buf -> { + buf.writeLong(overworld.getSeed()); @@ -121,7 +121,7 @@ index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472 + + @ProtocolHandler.PlayerLeave + public static void onPlayerLoggedOut(@NotNull ServerPlayer player) { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + players.remove(player.getId()); + playerBoundingBoxesCache.remove(player.getId()); + } @@ -129,20 +129,20 @@ index 0000000000000000000000000000000000000000..7c48c0a5ac7e53e52ca06f72e6f58472 + + @ProtocolHandler.PayloadReceiver(payload = EmptyPayload.class, payloadId = "subscribe") + public static void onPlayerSubscribed(@NotNull ServerPlayer player, EmptyPayload payload) { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + players.put(player.getId(), player); + sendBoundingToPlayer(player.getId(), player); + } + } + + public static void onDataPackReload() { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + players.values().forEach(BBORProtocol::sendStructureList); + } + } + + public static void onChunkLoaded(@NotNull LevelChunk chunk) { -+ if (LeavesConfig.bborProtocol) { ++ if (LeavesConfig.protocol.bborProtocol) { + Map structures = new HashMap<>(); + final Registry structureFeatureRegistry = chunk.getLevel().registryAccess().lookupOrThrow(Registries.STRUCTURE); + for (var es : chunk.getAllStarts().entrySet()) { diff --git a/patches/server/0032-PCA-sync-protocol.patch b/patches/server/0032-PCA-sync-protocol.patch index 6fb32e40..192f5d21 100644 --- a/patches/server/0032-PCA-sync-protocol.patch +++ b/patches/server/0032-PCA-sync-protocol.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PCA sync protocol This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition) diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java -index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b03e771258a5a89549f5169951501b95a6e2f7bc 100644 +index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b2c83534446f95503b9fd8bd09be90575622c395 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java @@ -449,6 +449,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -14,7 +14,7 @@ index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b03e771258a5a89549f5169951501b95 @Override public void containerChanged(Container sender) { + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this); + } + // Leaves end - pca @@ -22,7 +22,7 @@ index 8aed30cdbbfdd42c20dcd4c8773c8a0ee21a980d..b03e771258a5a89549f5169951501b95 this.syncSaddleToClients(); diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java -index 5f656fc726a1dc5f42657095a2f2b7cf85b92d7c..c7f0a3e36959843b557615f55d32e6f1b3e9f456 100644 +index 5f656fc726a1dc5f42657095a2f2b7cf85b92d7c..6c0cece094d36ddb2ae8d67d3c847a2c8faa3da8 100644 --- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java @@ -69,6 +69,15 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa @@ -32,7 +32,7 @@ index 5f656fc726a1dc5f42657095a2f2b7cf85b92d7c..c7f0a3e36959843b557615f55d32e6f1 + // Leaves start - pca + if (!this.level().isClientSide()) { + this.inventory.addListener(inventory -> { -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this); + } + }); @@ -42,7 +42,7 @@ index 5f656fc726a1dc5f42657095a2f2b7cf85b92d7c..c7f0a3e36959843b557615f55d32e6f1 @Override diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -index d528e8e4aea266c495377365f01e314001eb1970..6d633cdcd9e28152936ec073cdac9a4462bd3fae 100644 +index d528e8e4aea266c495377365f01e314001eb1970..2472eb9f8f0b6872f7b98cb2da511c6a2527b8fc 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java @@ -122,7 +122,13 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @@ -52,7 +52,7 @@ index d528e8e4aea266c495377365f01e314001eb1970..6d633cdcd9e28152936ec073cdac9a44 - public void setChanged() {} + public void setChanged() { + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncEntityToClient(this); + } + // Leaves end - pca @@ -61,7 +61,7 @@ index d528e8e4aea266c495377365f01e314001eb1970..6d633cdcd9e28152936ec073cdac9a44 @Override public boolean stillValid(Player player) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 15e0861486a2bda3e2f4049b1b5a299c870acd31..57152b34559a5f98359c398d46a2fd1fb0298e50 100644 +index 15e0861486a2bda3e2f4049b1b5a299c870acd31..82e93a63ea64adbf648ea7b8a844a376bbe63597 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java @@ -440,6 +440,16 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -72,7 +72,7 @@ index 15e0861486a2bda3e2f4049b1b5a299c870acd31..57152b34559a5f98359c398d46a2fd1f + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -82,7 +82,7 @@ index 15e0861486a2bda3e2f4049b1b5a299c870acd31..57152b34559a5f98359c398d46a2fd1f public boolean canPlaceItem(int slot, ItemStack stack) { if (slot == 2) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java -index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..ef7764339d7594cd1cbdff8f9fb714c7d1441e4e 100644 +index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..c14e7805e849e56912d50b61d5f2f3d802ac9bde 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java @@ -132,6 +132,16 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity { @@ -93,7 +93,7 @@ index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..ef7764339d7594cd1cbdff8f9fb714c7 + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -103,7 +103,7 @@ index 618552afbdacc919c33b30a6bf4834fb71ab3d5b..ef7764339d7594cd1cbdff8f9fb714c7 protected Component getDefaultName() { return Component.translatable("container.barrel"); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e9884bb0dedc 100644 +index 83ad45aed0894e90825d22e078632352c3a06816..58319df10af098db7cb74f08651880dab64ae4e1 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java @@ -144,6 +144,11 @@ public class BeehiveBlockEntity extends BlockEntity { @@ -111,7 +111,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e988 } + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + // Leaves end - pca @@ -123,7 +123,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e988 } + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + // Leaves end - pca @@ -136,7 +136,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e988 flag = true; iterator.remove(); + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(Objects.requireNonNull(world.getBlockEntity(pos))); + } + // Leaves end - pca @@ -148,7 +148,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e988 } // CraftBukkit end + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + // Leaves end - pca @@ -156,7 +156,7 @@ index 83ad45aed0894e90825d22e078632352c3a06816..56a87f1c9a2423bb96f5622deb99e988 @Override diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -index 02fc9ce21c7d367055da350d21be4870d4242f3a..14c44a694215a549d91f7d19996292f9dcd4e394 100644 +index 02fc9ce21c7d367055da350d21be4870d4242f3a..974a7fbec9ec347ea16a07d7c857a27e3b25f76d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java @@ -345,6 +345,16 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements @@ -167,7 +167,7 @@ index 02fc9ce21c7d367055da350d21be4870d4242f3a..14c44a694215a549d91f7d19996292f9 + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -177,7 +177,7 @@ index 02fc9ce21c7d367055da350d21be4870d4242f3a..14c44a694215a549d91f7d19996292f9 public boolean canTakeItemThroughFace(int slot, ItemStack stack, Direction dir) { return slot == 3 ? stack.is(Items.GLASS_BOTTLE) : true; diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java -index 8847617f6a23e6d2fe9bf7444a2072dc53f741b8..470e5424a4e762e623542411065c86e6796a68dd 100644 +index 8847617f6a23e6d2fe9bf7444a2072dc53f741b8..ef91101fb9e44b5db58272e4c2fdada1fa9e1686 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java @@ -191,6 +191,16 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement @@ -188,7 +188,7 @@ index 8847617f6a23e6d2fe9bf7444a2072dc53f741b8..470e5424a4e762e623542411065c86e6 + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -198,7 +198,7 @@ index 8847617f6a23e6d2fe9bf7444a2072dc53f741b8..470e5424a4e762e623542411065c86e6 public float getOpenNess(float tickDelta) { return this.chestLidController.getOpenness(tickDelta); diff --git a/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java -index 9db5826420d693628ad74614f4cee79e1ebd88d9..18385e9861337228eebce324af2c2de2d4929e8b 100644 +index 9db5826420d693628ad74614f4cee79e1ebd88d9..0e14b15b262f1ca5e12e31d2f18bc90bb94baf79 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ComparatorBlockEntity.java @@ -24,6 +24,16 @@ public class ComparatorBlockEntity extends BlockEntity { @@ -209,7 +209,7 @@ index 9db5826420d693628ad74614f4cee79e1ebd88d9..18385e9861337228eebce324af2c2de2 + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -219,7 +219,7 @@ index 9db5826420d693628ad74614f4cee79e1ebd88d9..18385e9861337228eebce324af2c2de2 return this.output; } diff --git a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java -index c7f1937b0f171eee967388ab4699703dcdcfbd2b..30355dded672bb59ce9da53331e27bac641ad255 100644 +index c7f1937b0f171eee967388ab4699703dcdcfbd2b..c3d41360b2c5dab04f519459bd855045e8bec7c1 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/DispenserBlockEntity.java @@ -109,6 +109,16 @@ public class DispenserBlockEntity extends RandomizableContainerBlockEntity { @@ -230,7 +230,7 @@ index c7f1937b0f171eee967388ab4699703dcdcfbd2b..30355dded672bb59ce9da53331e27bac + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -240,7 +240,7 @@ index c7f1937b0f171eee967388ab4699703dcdcfbd2b..30355dded672bb59ce9da53331e27bac protected Component getDefaultName() { return Component.translatable("container.dispenser"); diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..817a795c3127a9d68f3889817dbc4a3829fa8be2 100644 +index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..02bda85189fd57bd3f6d18cfd573553b2e607300 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -134,6 +134,16 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -251,7 +251,7 @@ index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..817a795c3127a9d68f3889817dbc4a38 + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -265,7 +265,7 @@ index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..817a795c3127a9d68f3889817dbc4a38 blockEntity.setCooldown(world.spigotConfig.hopperTransfer); // Spigot setChanged(world, pos, state); + // Leaves start - pca -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(blockEntity); + } + // Leaves end - pca @@ -273,7 +273,7 @@ index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..817a795c3127a9d68f3889817dbc4a38 } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java -index 6291ebf3426bddb0e6d13159ce20936b6e9ba6bd..d90e17eaf852d04091cf69e7509f1d9ef59b88fe 100644 +index 6291ebf3426bddb0e6d13159ce20936b6e9ba6bd..3784e4c14bb59073f941b966f616ddac3f80a497 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ShulkerBoxBlockEntity.java @@ -270,6 +270,16 @@ public class ShulkerBoxBlockEntity extends RandomizableContainerBlockEntity impl @@ -284,7 +284,7 @@ index 6291ebf3426bddb0e6d13159ce20936b6e9ba6bd..d90e17eaf852d04091cf69e7509f1d9e + @Override + public void setChanged() { + super.setChanged(); -+ if (org.leavesmc.leaves.LeavesConfig.pcaSyncProtocol) { ++ if (org.leavesmc.leaves.LeavesConfig.protocol.pca.enable) { + org.leavesmc.leaves.protocol.PcaSyncProtocol.syncBlockEntityToClient(this); + } + } @@ -295,7 +295,7 @@ index 6291ebf3426bddb0e6d13159ce20936b6e9ba6bd..d90e17eaf852d04091cf69e7509f1d9e return ShulkerBoxBlockEntity.SLOTS; diff --git a/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae8955a66565c +index 0000000000000000000000000000000000000000..a38318506aeb1632ba7903671bcfad1e871c8fc7 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/PcaSyncProtocol.java @@ -0,0 +1,432 @@ @@ -363,14 +363,14 @@ index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae895 + + @ProtocolHandler.PlayerJoin + private static void onJoin(ServerPlayer player) { -+ if (LeavesConfig.pcaSyncProtocol) { ++ if (LeavesConfig.protocol.pca.enable) { + enablePcaSyncProtocol(player); + } + } + + @ProtocolHandler.PayloadReceiver(payload = EmptyPayload.class, payloadId = "cancel_sync_block_entity") + private static void cancelSyncBlockEntityHandler(ServerPlayer player, EmptyPayload payload) { -+ if (!LeavesConfig.pcaSyncProtocol) { ++ if (!LeavesConfig.protocol.pca.enable) { + return; + } + PcaSyncProtocol.clearPlayerWatchBlock(player); @@ -378,7 +378,7 @@ index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae895 + + @ProtocolHandler.PayloadReceiver(payload = EmptyPayload.class, payloadId = "cancel_sync_entity") + private static void cancelSyncEntityHandler(ServerPlayer player, EmptyPayload payload) { -+ if (!LeavesConfig.pcaSyncProtocol) { ++ if (!LeavesConfig.protocol.pca.enable) { + return; + } + PcaSyncProtocol.clearPlayerWatchEntity(player); @@ -386,7 +386,7 @@ index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae895 + + @ProtocolHandler.PayloadReceiver(payload = SyncBlockEntityPayload.class, payloadId = "sync_block_entity") + private static void syncBlockEntityHandler(ServerPlayer player, SyncBlockEntityPayload payload) { -+ if (!LeavesConfig.pcaSyncProtocol) { ++ if (!LeavesConfig.protocol.pca.enable) { + return; + } + @@ -430,7 +430,7 @@ index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae895 + + @ProtocolHandler.PayloadReceiver(payload = SyncEntityPayload.class, payloadId = "sync_entity") + private static void syncEntityHandler(ServerPlayer player, SyncEntityPayload payload) { -+ if (!LeavesConfig.pcaSyncProtocol) { ++ if (!LeavesConfig.protocol.pca.enable) { + return; + } + @@ -445,7 +445,7 @@ index 0000000000000000000000000000000000000000..7126ec4b6e0a1bfa16d97fd21d7ae895 + clearPlayerWatchData(player); + + if (entity instanceof Player) { -+ switch (LeavesConfig.pcaSyncPlayerEntity) { ++ switch (LeavesConfig.protocol.pca.syncPlayerEntity) { + case NOBODY -> { + return; + } diff --git a/patches/server/0033-Jade-Protocol.patch b/patches/server/0033-Jade-Protocol.patch index 236c0156..dad10a3b 100644 --- a/patches/server/0033-Jade-Protocol.patch +++ b/patches/server/0033-Jade-Protocol.patch @@ -124,7 +124,7 @@ index 30d0133a42ce990352f5c492fcf9beb105364848..1ab2eab686b3a89d406f127a6036c0e2 protected CompositeLootItemCondition(List terms, Predicate predicate) { diff --git a/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..c72d6eeb61cda12e49939deebb9791d5c7f36f0a +index 0000000000000000000000000000000000000000..ccce630f67cd6329033d65156231e749eaf0c448 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/jade/JadeProtocol.java @@ -0,0 +1,312 @@ @@ -301,7 +301,7 @@ index 0000000000000000000000000000000000000000..c72d6eeb61cda12e49939deebb9791d5 + + @ProtocolHandler.PlayerJoin + public static void onPlayerJoin(ServerPlayer player) { -+ if (!LeavesConfig.jadeProtocol) { ++ if (!LeavesConfig.protocol.jadeProtocol) { + return; + } + @@ -310,7 +310,7 @@ index 0000000000000000000000000000000000000000..c72d6eeb61cda12e49939deebb9791d5 + + @ProtocolHandler.PayloadReceiver(payload = RequestEntityPayload.class, payloadId = "request_entity") + public static void requestEntityData(ServerPlayer player, RequestEntityPayload payload) { -+ if (!LeavesConfig.jadeProtocol) { ++ if (!LeavesConfig.protocol.jadeProtocol) { + return; + } + @@ -362,7 +362,7 @@ index 0000000000000000000000000000000000000000..c72d6eeb61cda12e49939deebb9791d5 + + @ProtocolHandler.PayloadReceiver(payload = RequestBlockPayload.class, payloadId = "request_block") + public static void requestBlockData(ServerPlayer player, RequestBlockPayload payload) { -+ if (!LeavesConfig.jadeProtocol) { ++ if (!LeavesConfig.protocol.jadeProtocol) { + return; + } + @@ -425,7 +425,7 @@ index 0000000000000000000000000000000000000000..c72d6eeb61cda12e49939deebb9791d5 + + @ProtocolHandler.ReloadServer + public static void onServerReload() { -+ if (LeavesConfig.jadeProtocol) { ++ if (LeavesConfig.protocol.jadeProtocol) { + enableAllPlayer(); + } + } diff --git a/patches/server/0034-Alternative-block-placement-Protocol.patch b/patches/server/0034-Alternative-block-placement-Protocol.patch index 5f798511..f37dba8e 100644 --- a/patches/server/0034-Alternative-block-placement-Protocol.patch +++ b/patches/server/0034-Alternative-block-placement-Protocol.patch @@ -9,7 +9,7 @@ MasaGadget(https://github.com/plusls/MasaGadget) litematica(https://github.com/maruohon/litematica) diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index c816c935ecc74a811ffdffbe6ded73c06e92324a..5e852251cf81a606421f870780aafe511af2bae0 100644 +index c816c935ecc74a811ffdffbe6ded73c06e92324a..dba8ee20f9fed3adf26885471897ade154ec1d4d 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java @@ -157,6 +157,27 @@ public class BlockItem extends Item { @@ -17,7 +17,7 @@ index c816c935ecc74a811ffdffbe6ded73c06e92324a..5e852251cf81a606421f870780aafe51 protected BlockState getPlacementState(BlockPlaceContext context) { BlockState iblockdata = this.getBlock().getStateForPlacement(context); + // Leaves start - alternativeBlockPlacement -+ switch (org.leavesmc.leaves.LeavesConfig.alternativeBlockPlacement) { ++ switch (org.leavesmc.leaves.LeavesConfig.protocol.alternativeBlockPlacement) { + case CARPET -> { + BlockState tryState = org.leavesmc.leaves.protocol.CarpetAlternativeBlockPlacement.alternativeBlockPlacement(getBlock(), context); + if (tryState != null) { @@ -63,7 +63,7 @@ index 1451b25cedb7a8f01c046c8e1f8c6853aca42283..4390adf843b395db688017eb9034b56a if (iblockdata2 != null && this.canPlace(world, iblockdata2, blockposition)) { iblockdata1 = iblockdata2; diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 48ced9994219dc21d593a7deaa0a318f55dd00c7..c6e872633f6044e9c8e2a63bcef6332d24a6fff8 100644 +index b3a3388ef62b0622906b2470056cb41f0deb0391..1c9b9f27179f2bd3f24709a763ff264e97cb1dca 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java @@ -414,6 +414,33 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -74,7 +74,7 @@ index 48ced9994219dc21d593a7deaa0a318f55dd00c7..c6e872633f6044e9c8e2a63bcef6332d + @Nullable + public BlockState getRealStateForPlacement(BlockPlaceContext ctx) { + BlockState vanillaState = getStateForPlacement(ctx); -+ switch (org.leavesmc.leaves.LeavesConfig.alternativeBlockPlacement) { ++ switch (org.leavesmc.leaves.LeavesConfig.protocol.alternativeBlockPlacement) { + case CARPET -> { + BlockState tryState = org.leavesmc.leaves.protocol.CarpetAlternativeBlockPlacement.alternativeBlockPlacement(this, ctx); + if (tryState != null) { diff --git a/patches/server/0035-Player-operation-limiter.patch b/patches/server/0035-Player-operation-limiter.patch index 4a37a85d..3041c65d 100644 --- a/patches/server/0035-Player-operation-limiter.patch +++ b/patches/server/0035-Player-operation-limiter.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player operation limiter This patch is Powered by plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition) diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d9f3f70973b2df7c81124ddc614b55e25481eebb..62420e67452ec086002ad9f844c54450000af9a6 100644 +index ec61019771703a8366e893481c3368905bc7ee7f..407a7aaebb68f55c4a8951b00b4d79c138e35fe2 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -329,6 +329,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple @@ -62,7 +62,7 @@ index d9f3f70973b2df7c81124ddc614b55e25481eebb..62420e67452ec086002ad9f844c54450 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index a96f859a5d0c6ec692d4627a69f3c9ee49199dbc..7799f2b9482f5801b2fa911e4e40eeeb3b0a3606 100644 +index a96f859a5d0c6ec692d4627a69f3c9ee49199dbc..31ff81ca6a89fc3ce59c4b53a6a547eb4f2e812a 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -337,6 +337,19 @@ public class ServerPlayerGameMode { @@ -70,7 +70,7 @@ index a96f859a5d0c6ec692d4627a69f3c9ee49199dbc..7799f2b9482f5801b2fa911e4e40eeeb public void destroyAndAck(BlockPos pos, int sequence, String reason) { + // Leaves start - player operation limiter -+ if (org.leavesmc.leaves.LeavesConfig.playerOperationLimiter) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.playerOperationLimiter) { + if (reason.equals("insta mine")) { + player.addInstaBreakCountPerTick(); + if (!player.allowOperation()) { @@ -86,7 +86,7 @@ index a96f859a5d0c6ec692d4627a69f3c9ee49199dbc..7799f2b9482f5801b2fa911e4e40eeeb this.debugLogging(pos, true, sequence, reason); } else { diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index 5e852251cf81a606421f870780aafe511af2bae0..7341e9ab35886be0d62b6a30c99165fc852e5b9a 100644 +index dba8ee20f9fed3adf26885471897ade154ec1d4d..77309808abd4ab476e815d60015ad828102a1f6b 100644 --- a/src/main/java/net/minecraft/world/item/BlockItem.java +++ b/src/main/java/net/minecraft/world/item/BlockItem.java @@ -74,6 +74,20 @@ public class BlockItem extends Item { @@ -94,7 +94,7 @@ index 5e852251cf81a606421f870780aafe511af2bae0..7341e9ab35886be0d62b6a30c99165fc // CraftBukkit end + // Leaves start - player operation limiter -+ if (org.leavesmc.leaves.LeavesConfig.playerOperationLimiter && !context.getLevel().isClientSide()) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.playerOperationLimiter && !context.getLevel().isClientSide()) { + ServerPlayer player = (ServerPlayer) context.getPlayer(); + if (player != null && iblockdata != null) { + player.addPlaceBlockCountPerTick(); diff --git a/patches/server/0036-Renewable-Elytra.patch b/patches/server/0036-Renewable-Elytra.patch index ac9f33af..440ba374 100644 --- a/patches/server/0036-Renewable-Elytra.patch +++ b/patches/server/0036-Renewable-Elytra.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Renewable Elytra This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition) diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index 150fd890ac65097b5434fd88e8d2b24a89dca79a..25bbbfe8ccb8437880d6c27f9a859ed005f30faf 100644 +index 150fd890ac65097b5434fd88e8d2b24a89dca79a..e47de71f7c120cf7f1a7cdb5e49b1d89163e5722 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java @@ -233,6 +233,20 @@ public class Phantom extends FlyingMob implements Enemy { @@ -17,8 +17,8 @@ index 150fd890ac65097b5434fd88e8d2b24a89dca79a..25bbbfe8ccb8437880d6c27f9a859ed0 + @Override + protected void dropFromLootTable(ServerLevel level, DamageSource source, boolean causedByPlayer) { + super.dropFromLootTable(level, source, causedByPlayer); -+ if (org.leavesmc.leaves.LeavesConfig.renewableElytra > 0.0D) { -+ if (source.getEntity() instanceof Shulker && this.random.nextDouble() < org.leavesmc.leaves.LeavesConfig.renewableElytra) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.renewableElytra > 0.0D) { ++ if (source.getEntity() instanceof Shulker && this.random.nextDouble() < org.leavesmc.leaves.LeavesConfig.modify.renewableElytra) { + net.minecraft.world.item.ItemStack item = new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.ELYTRA); + item.setDamageValue(432); + this.spawnAtLocation(level, item); diff --git a/patches/server/0037-Stackable-ShulkerBoxes.patch b/patches/server/0037-Stackable-ShulkerBoxes.patch index c2f8ecf6..135ecf70 100644 --- a/patches/server/0037-Stackable-ShulkerBoxes.patch +++ b/patches/server/0037-Stackable-ShulkerBoxes.patch @@ -84,7 +84,7 @@ index 7ed52b887c4d766c23220a8809914d5d80f12ea4..8f8ae3f27be586de1413013db3ffca25 if (j > 0) { diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c7a50e09fd946b03ad5bc984607a807b4db1ece0 100644 +index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..8f2ca7211d4ebf494beae85caea5876fad4723eb 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -12,11 +12,13 @@ import net.minecraft.world.entity.Mob; @@ -120,7 +120,7 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c7a50e09fd946b03ad5bc984607a807b + // Leaves end - stackable shulker boxes + private boolean tryStackShulkerBoxes(ItemEntity other) { + ItemStack selfStack = this.getItem(); -+ if (org.leavesmc.leaves.LeavesConfig.shulkerBoxStackSize == 1 || !(selfStack.getItem() instanceof BlockItem bi) || !(bi.getBlock() instanceof ShulkerBoxBlock)) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize == 1 || !(selfStack.getItem() instanceof BlockItem bi) || !(bi.getBlock() instanceof ShulkerBoxBlock)) { + return false; + } + @@ -129,8 +129,8 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c7a50e09fd946b03ad5bc984607a807b + && org.leavesmc.leaves.util.ShulkerBoxUtils.shulkerBoxNoItem(selfStack) + && org.leavesmc.leaves.util.ShulkerBoxUtils.shulkerBoxNoItem(otherStack) + && Objects.equals(selfStack.getComponents(), otherStack.getComponents()) // empty block entity tags are cleaned up when spawning -+ && selfStack.getCount() != org.leavesmc.leaves.LeavesConfig.shulkerBoxStackSize) { -+ int amount = Math.min(otherStack.getCount(), org.leavesmc.leaves.LeavesConfig.shulkerBoxStackSize - selfStack.getCount()); ++ && selfStack.getCount() != org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize) { ++ int amount = Math.min(otherStack.getCount(), org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize - selfStack.getCount()); + + selfStack.grow(amount); + this.setItem(selfStack); @@ -161,7 +161,7 @@ index 0f086af57a5ff08c264dcbf89a8c3931ec73a609..c7a50e09fd946b03ad5bc984607a807b ItemStack itemstack1 = other.getItem(); diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java -index 6d4d3eadb3408e5eb2f545551270071c9517eedb..6cd9ed63431867df570839c3d8fff23b11450301 100644 +index d2bd4c5b2a7a9689680f4b021368f25356c58ac7..c07dae6cf6cd60a1f100415977dd9fe2ce639d72 100644 --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java @@ -110,7 +110,7 @@ public class Inventory implements Container, Nameable { @@ -334,7 +334,7 @@ index 33e7d2884195677c4d6340d8b84c1dd85c636ec1..f38487562422ebaf59a679f493f956b9 private Entity entityRepresentation; diff --git a/src/main/java/net/minecraft/world/level/block/AbstractCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/AbstractCauldronBlock.java -index e00ab1ed8088a1970249313ed63e09070fc6192d..6a3ba2fdcdedb248257003f7214b81e8651286e8 100644 +index e00ab1ed8088a1970249313ed63e09070fc6192d..89cfabda335d27d3657299c69837e29057617052 100644 --- a/src/main/java/net/minecraft/world/level/block/AbstractCauldronBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AbstractCauldronBlock.java @@ -56,9 +56,27 @@ public abstract class AbstractCauldronBlock extends Block { @@ -348,7 +348,7 @@ index e00ab1ed8088a1970249313ed63e09070fc6192d..6a3ba2fdcdedb248257003f7214b81e8 + // Leaves start - stackable shulker boxes + private InteractionResult wrapInteractor(CauldronInteraction cauldronBehavior, BlockState blockState, Level world, BlockPos blockPos, Player playerEntity, InteractionHand hand, ItemStack itemStack, net.minecraft.core.Direction hitDirection) { + int count = -1; -+ if (org.leavesmc.leaves.LeavesConfig.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof net.minecraft.world.item.BlockItem bi && ++ if (org.leavesmc.leaves.LeavesConfig.modify.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof net.minecraft.world.item.BlockItem bi && + bi.getBlock() instanceof ShulkerBoxBlock) { + count = itemStack.getCount(); + } @@ -367,7 +367,7 @@ index e00ab1ed8088a1970249313ed63e09070fc6192d..6a3ba2fdcdedb248257003f7214b81e8 protected VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { return SHAPE; diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 57152b34559a5f98359c398d46a2fd1fb0298e50..91a2619dc11eef5d9ac7450caa43330bac3bbaaa 100644 +index 82e93a63ea64adbf648ea7b8a844a376bbe63597..46bdb85f18077c77c445ce0bc3cfe32468c75306 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java @@ -426,7 +426,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -393,7 +393,7 @@ index 1f29b2419914ca9257db6553f01b7e7ec49bfc18..9d9a7c972119b224089f062d9c64c689 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 817a795c3127a9d68f3889817dbc4a3829fa8be2..478a15a8fc7f8d293752470395a122f0d9219746 100644 +index 02bda85189fd57bd3f6d18cfd573553b2e607300..ad5a971a4de217aa93601db8364f2cad1aab4c38 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -125,7 +125,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -419,7 +419,7 @@ index 817a795c3127a9d68f3889817dbc4a3829fa8be2..478a15a8fc7f8d293752470395a122f0 ignoreTileUpdates = true; // Paper - Perf: Optimize Hoppers diff --git a/src/main/java/org/leavesmc/leaves/util/ShulkerBoxUtils.java b/src/main/java/org/leavesmc/leaves/util/ShulkerBoxUtils.java new file mode 100644 -index 0000000000000000000000000000000000000000..64344eb9310690dd31e7fadcfb29ed8dda559716 +index 0000000000000000000000000000000000000000..07ed58fba9f8eb0f66c5aa6bd216fc02bbc5a5b3 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/util/ShulkerBoxUtils.java @@ -0,0 +1,39 @@ @@ -441,9 +441,9 @@ index 0000000000000000000000000000000000000000..64344eb9310690dd31e7fadcfb29ed8d + } + + public static int getItemStackMaxCount(ItemStack stack) { -+ if (LeavesConfig.shulkerBoxStackSize > 1 && stack.getItem() instanceof BlockItem bi && ++ if (LeavesConfig.modify.shulkerBoxStackSize > 1 && stack.getItem() instanceof BlockItem bi && + bi.getBlock() instanceof ShulkerBoxBlock && shulkerBoxNoItem(stack)) { -+ return LeavesConfig.shulkerBoxStackSize; ++ return LeavesConfig.modify.shulkerBoxStackSize; + } + return stack.getMaxStackSize(); + } diff --git a/patches/server/0038-MC-Technical-Survival-Mode.patch b/patches/server/0038-MC-Technical-Survival-Mode.patch index 94de4152..7145ff30 100644 --- a/patches/server/0038-MC-Technical-Survival-Mode.patch +++ b/patches/server/0038-MC-Technical-Survival-Mode.patch @@ -18,7 +18,7 @@ index 1029b6de6f36b08bf634b4056ef5701383f6f258..64bb056d409c19eca724caa8512e6a59 throw new RuntimeException("Could not reload paper configuration files", ex); } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 62420e67452ec086002ad9f844c54450000af9a6..1cd85d120ab386e409d6126e3166980eb795003c 100644 +index 407a7aaebb68f55c4a8951b00b4d79c138e35fe2..b0c1cc7196dae695b73eb766c5acbffeffd306b3 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1901,7 +1901,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple @@ -26,12 +26,12 @@ index 62420e67452ec086002ad9f844c54450000af9a6..1cd85d120ab386e409d6126e3166980e @Override public boolean isInvulnerableTo(ServerLevel world, DamageSource source) { - return super.isInvulnerableTo(world, source) || (this.isChangingDimension() && !source.is(DamageTypes.ENDER_PEARL)) || (!this.level().paperConfig().collisions.allowPlayerCrammingDamage && source.is(DamageTypes.CRAMMING)); // Paper - disable player cramming; -+ return super.isInvulnerableTo(world, source) || (this.isChangingDimension() && !source.is(DamageTypes.ENDER_PEARL)) || (!org.leavesmc.leaves.LeavesConfig.mcTechnicalMode && !this.level().paperConfig().collisions.allowPlayerCrammingDamage && source.is(DamageTypes.CRAMMING)); // Paper - disable player cramming; // Leaves - mc technical survival mode ++ return super.isInvulnerableTo(world, source) || (this.isChangingDimension() && !source.is(DamageTypes.ENDER_PEARL)) || (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && !this.level().paperConfig().collisions.allowPlayerCrammingDamage && source.is(DamageTypes.CRAMMING)); // Paper - disable player cramming; // Leaves - mc technical survival mode } @Override diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java -index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..576953959711e29d909f1bf6bcd3fe0359e62d8d 100644 +index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..f3350eb5a866f2890dbe0fb6e46cda090c6ab8f2 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java @@ -70,7 +70,7 @@ public class EndCrystal extends Entity { @@ -39,12 +39,12 @@ index 7cb3d69a69e0e3ef4b7f9f9c8b1eb67edb5d116d..576953959711e29d909f1bf6bcd3fe03 } // Paper start - Fix invulnerable end crystals - if (this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) { -+ if (!org.leavesmc.leaves.LeavesConfig.mcTechnicalMode && this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) { // Leaves - mc technical survival mode ++ if (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) { // Leaves - mc technical survival mode if (!java.util.Objects.equals(((ServerLevel) this.level()).uuid, this.getOriginWorld()) || ((ServerLevel) this.level()).getDragonFight() == null || ((ServerLevel) this.level()).getDragonFight().respawnStage == null diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index de87483600e55d88176fe25db621bbd3e464729f..19fd67a4f6a9eb34708848400e95414e8530837b 100644 +index de87483600e55d88176fe25db621bbd3e464729f..34b9384c0f852d28dc8b834a40785ede74b33cfd 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -101,7 +101,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -52,12 +52,12 @@ index de87483600e55d88176fe25db621bbd3e464729f..19fd67a4f6a9eb34708848400e95414e @Override public void tick() { - if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot -+ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > (org.leavesmc.leaves.LeavesConfig.mcTechnicalMode ? 2000 : this.level().spigotConfig.maxTntTicksPerTick)) { return; } // Spigot // Leaves - mc technical survival mode ++ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > (org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode ? 2000 : this.level().spigotConfig.maxTntTicksPerTick)) { return; } // Spigot // Leaves - mc technical survival mode this.handlePortal(); this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index 5297798c2be1ba85569c2b92ed221956bf75477a..4772d0b1c70213bb73aa22eca820ade21335b3a8 100644 +index 5297798c2be1ba85569c2b92ed221956bf75477a..b33c6c97b5f87162c647c135f6ae9eee0b1f0b8c 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java @@ -94,7 +94,7 @@ public final class NaturalSpawner { @@ -65,12 +65,12 @@ index 5297798c2be1ba85569c2b92ed221956bf75477a..4772d0b1c70213bb73aa22eca820ade2 if (enumcreaturetype != MobCategory.MISC) { // Paper start - Only count natural spawns - if (!entity.level().paperConfig().entities.spawning.countAllMobsForSpawning && -+ if (!org.leavesmc.leaves.LeavesConfig.mcTechnicalMode && !entity.level().paperConfig().entities.spawning.countAllMobsForSpawning && // Leaves - mc technical survival mode ++ if (!org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode && !entity.level().paperConfig().entities.spawning.countAllMobsForSpawning && // Leaves - mc technical survival mode !(entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL || entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { continue; diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 478a15a8fc7f8d293752470395a122f0d9219746..dd210401b63344bc7fa4f711da144efad669202f 100644 +index ad5a971a4de217aa93601db8364f2cad1aab4c38..7280d2216dcbe09278a2447eb994c4bd2aa98576 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -295,7 +295,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -78,7 +78,7 @@ index 478a15a8fc7f8d293752470395a122f0d9219746..dd210401b63344bc7fa4f711da144efa } } - if (foundItem && level.paperConfig().hopper.cooldownWhenFull) { // Inventory was full - cooldown -+ if (foundItem && level.paperConfig().hopper.cooldownWhenFull && !org.leavesmc.leaves.LeavesConfig.mcTechnicalMode) { // Inventory was full - cooldown // Leaves ++ if (foundItem && level.paperConfig().hopper.cooldownWhenFull && !org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode) { // Inventory was full - cooldown // Leaves hopper.setCooldown(level.spigotConfig.hopperTransfer); } return false; @@ -87,13 +87,13 @@ index 478a15a8fc7f8d293752470395a122f0d9219746..dd210401b63344bc7fa4f711da144efa origItemStack.setCount(originalItemCount); - if (level.paperConfig().hopper.cooldownWhenFull) { -+ if (level.paperConfig().hopper.cooldownWhenFull && !org.leavesmc.leaves.LeavesConfig.mcTechnicalMode) { // Leaves ++ if (level.paperConfig().hopper.cooldownWhenFull && !org.leavesmc.leaves.LeavesConfig.modify.mcTechnicalMode) { // Leaves cooldownHopper(hopper); } diff --git a/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java b/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java new file mode 100644 -index 0000000000000000000000000000000000000000..2fdcb75a1fb85ab2fc6759050b2e7ffa601dcfa0 +index 0000000000000000000000000000000000000000..0d8e5bf5f37357f2ed619e5574a8ce01589fe63e --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/util/McTechnicalModeHelper.java @@ -0,0 +1,27 @@ @@ -107,7 +107,7 @@ index 0000000000000000000000000000000000000000..2fdcb75a1fb85ab2fc6759050b2e7ffa +public class McTechnicalModeHelper { + + public static void doMcTechnicalModeIf() { -+ if (LeavesConfig.mcTechnicalMode) { ++ if (LeavesConfig.modify.mcTechnicalMode) { + doMcTechnicalMode(); + } + } diff --git a/patches/server/0039-Return-nether-portal-fix.patch b/patches/server/0039-Return-nether-portal-fix.patch index 788a51cb..7d123197 100644 --- a/patches/server/0039-Return-nether-portal-fix.patch +++ b/patches/server/0039-Return-nether-portal-fix.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Return nether portal fix This patch is powered by NetherPortalFix(https://github.com/TwelveIterationMods/NetherPortalFix) diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 1cd85d120ab386e409d6126e3166980eb795003c..e8f7298f2dce906d0aa6e1363da9664f3f9bc2eb 100644 +index b0c1cc7196dae695b73eb766c5acbffeffd306b3..f80911edce05c7440ead01a2332452e20ed734c1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1699,6 +1699,21 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple @@ -14,7 +14,7 @@ index 1cd85d120ab386e409d6126e3166980eb795003c..e8f7298f2dce906d0aa6e1363da9664f this.level().getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end + // Leaves start - nether portal fix -+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.netherPortalFix) { + final ResourceKey fromDim = worldserver1.dimension(); + final ResourceKey toDim = level().dimension(); + final ResourceKey OVERWORLD = Level.OVERWORLD; @@ -32,7 +32,7 @@ index 1cd85d120ab386e409d6126e3166980eb795003c..e8f7298f2dce906d0aa6e1363da9664f if (this.isBlocking()) { this.stopUsingItem(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8cc7815e0f996b7d5c4518a4a487b99480f48f97..df8e3c54b7fa22dd43041ee8ee8642b2322077a7 100644 +index 7a741442ee2373f1a400214047bbf5844efecce6..eb43b1fcda50326f086999a6e134c9807b837045 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -909,6 +909,24 @@ public abstract class PlayerList { @@ -40,7 +40,7 @@ index 8cc7815e0f996b7d5c4518a4a487b99480f48f97..df8e3c54b7fa22dd43041ee8ee8642b2 PlayerChangedWorldEvent event = new PlayerChangedWorldEvent(entityplayer.getBukkitEntity(), fromWorld.getWorld()); this.server.server.getPluginManager().callEvent(event); + // Leaves start - nether portal fix -+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.netherPortalFix) { + final ResourceKey fromDim = entityplayer.level().dimension(); + final ResourceKey toDim = entityplayer1.level().dimension(); + final ResourceKey OVERWORLD = Level.OVERWORLD; @@ -61,7 +61,7 @@ index 8cc7815e0f996b7d5c4518a4a487b99480f48f97..df8e3c54b7fa22dd43041ee8ee8642b2 // Save player file again if they were disconnected diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 5ddea4ca32bc2741ab449dc00a3d9ce4f8c57c70..a611be936c3ff43a083daa2504567eb1c342b485 100644 +index 3002879d96916ce24400159792b48e5f9b8e2e3e..bc0eeb8274a7248dca7f01ddd89c9a7e481da75b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -272,7 +272,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -74,7 +74,7 @@ index 5ddea4ca32bc2741ab449dc00a3d9ce4f8c57c70..a611be936c3ff43a083daa2504567eb1 @Nullable private DamageSource lastDamageSource; diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java -index 2b31bf586c1c0bd393d2aa8d0b6635dd9f22f21c..8778227d398bb2dacbefa87fce2260e4142b3055 100644 +index 2b31bf586c1c0bd393d2aa8d0b6635dd9f22f21c..0a9ce12e958ac25a4d789254e1fec9ec2c2a33ca 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java @@ -180,7 +180,18 @@ public class NetherPortalBlock extends Block implements Portal { @@ -84,7 +84,7 @@ index 2b31bf586c1c0bd393d2aa8d0b6635dd9f22f21c..8778227d398bb2dacbefa87fce2260e4 - Optional optional = worldserver.getPortalForcer().findClosestPortalPosition(blockposition1, worldborder, searchRadius); + // Leaves start - fix return portal + Optional optional = Optional.empty(); -+ if (org.leavesmc.leaves.LeavesConfig.netherPortalFix && entity instanceof net.minecraft.server.level.ServerPlayer player) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.netherPortalFix && entity instanceof net.minecraft.server.level.ServerPlayer player) { + org.leavesmc.leaves.util.ReturnPortalManager.ReturnPortal portal = org.leavesmc.leaves.util.ReturnPortalManager.findReturnPortal(player, entity.level().dimension(), entity.blockPosition()); + if (portal != null && worldserver.getBlockState(portal.pos()).is(Blocks.NETHER_PORTAL)) { + optional = Optional.of(portal.pos()); diff --git a/patches/server/0040-Appleskin-Protocol.patch b/patches/server/0040-Appleskin-Protocol.patch index 5d2545b1..b9f002ec 100644 --- a/patches/server/0040-Appleskin-Protocol.patch +++ b/patches/server/0040-Appleskin-Protocol.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Appleskin Protocol diff --git a/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..26aa98a402772a69d11d394537c5b21da702aefd +index 0000000000000000000000000000000000000000..dd8afa5a47e62829788c4d49d18e4436daa242dd --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/AppleSkinProtocol.java @@ -0,0 +1,127 @@ @@ -53,14 +53,14 @@ index 0000000000000000000000000000000000000000..26aa98a402772a69d11d394537c5b21d + + @ProtocolHandler.PlayerJoin + public static void onPlayerLoggedIn(@NotNull ServerPlayer player) { -+ if (LeavesConfig.appleskinProtocol) { ++ if (LeavesConfig.protocol.appleskin.enable) { + resetPlayerData(player); + } + } + + @ProtocolHandler.PlayerLeave + public static void onPlayerLoggedOut(@NotNull ServerPlayer player) { -+ if (LeavesConfig.appleskinProtocol) { ++ if (LeavesConfig.protocol.appleskin.enable) { + subscribedChannels.remove(player); + resetPlayerData(player); + } @@ -68,15 +68,15 @@ index 0000000000000000000000000000000000000000..26aa98a402772a69d11d394537c5b21d + + @ProtocolHandler.MinecraftRegister(ignoreId = true) + public static void onPlayerSubscribed(@NotNull ServerPlayer player, String channel) { -+ if (LeavesConfig.appleskinProtocol) { ++ if (LeavesConfig.protocol.appleskin.enable) { + subscribedChannels.computeIfAbsent(player, k -> new HashSet<>()).add(channel); + } + } + + @ProtocolHandler.Ticker + public static void tick() { -+ if (LeavesConfig.appleskinProtocol) { -+ if (MinecraftServer.getServer().getTickCount() % LeavesConfig.appleskinSyncTickInterval != 0) { ++ if (LeavesConfig.protocol.appleskin.enable) { ++ if (MinecraftServer.getServer().getTickCount() % LeavesConfig.protocol.appleskin.syncTickInterval != 0) { + return; + } + @@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..26aa98a402772a69d11d394537c5b21d + + @ProtocolHandler.ReloadServer + public static void onServerReload() { -+ if (!LeavesConfig.appleskinProtocol) { ++ if (!LeavesConfig.protocol.appleskin.enable) { + disableAllPlayer(); + } + } diff --git a/patches/server/0041-Xaero-Map-Protocol.patch b/patches/server/0041-Xaero-Map-Protocol.patch index 6cf2b363..64559bec 100644 --- a/patches/server/0041-Xaero-Map-Protocol.patch +++ b/patches/server/0041-Xaero-Map-Protocol.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Xaero Map Protocol diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index df8e3c54b7fa22dd43041ee8ee8642b2322077a7..b78a66a18c7527850de13688c52a3f7f70fe508a 100644 +index eb43b1fcda50326f086999a6e134c9807b837045..7a80d3e7d46a9c2a729ca50e2bd265fe5711a23f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1256,6 +1256,7 @@ public abstract class PlayerList { @@ -18,7 +18,7 @@ index df8e3c54b7fa22dd43041ee8ee8642b2322077a7..b78a66a18c7527850de13688c52a3f7f // entityplayer.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.START_RAINING, 0.0F)); diff --git a/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java b/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java new file mode 100644 -index 0000000000000000000000000000000000000000..14e66b8eb6f2d768e03439df7f4dedc9ba8624dd +index 0000000000000000000000000000000000000000..a94b5174282e0cb520c99a93cae7d3f439cd9cc8 --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/protocol/XaeroMapProtocol.java @@ -0,0 +1,42 @@ @@ -52,14 +52,14 @@ index 0000000000000000000000000000000000000000..14e66b8eb6f2d768e03439df7f4dedc9 + } + + public static void onSendWorldInfo(@NotNull ServerPlayer player) { -+ if (LeavesConfig.xaeroMapProtocol) { ++ if (LeavesConfig.protocol.xaeroMapProtocol) { + ProtocolUtils.sendPayloadPacket(player, MINIMAP_KEY, buf -> { + buf.writeByte(0); -+ buf.writeInt(LeavesConfig.xaeroMapServerID); ++ buf.writeInt(LeavesConfig.protocol.xaeroMapServerID); + }); + ProtocolUtils.sendPayloadPacket(player, WORLDMAP_KEY, buf -> { + buf.writeByte(0); -+ buf.writeInt(LeavesConfig.xaeroMapServerID); ++ buf.writeInt(LeavesConfig.protocol.xaeroMapServerID); + }); + } + } diff --git a/patches/server/0042-Leaves-Extra-Yggdrasil-Service.patch b/patches/server/0042-Leaves-Extra-Yggdrasil-Service.patch index 0c76c47c..81a44028 100644 --- a/patches/server/0042-Leaves-Extra-Yggdrasil-Service.patch +++ b/patches/server/0042-Leaves-Extra-Yggdrasil-Service.patch @@ -44,7 +44,7 @@ index 90ca25c4aaf92a5639839a7cdaee2ffcdb75efa7..f0c265a171590bafaed7c87c4f2e64e8 String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 601d12cc2e0f2e180882f6b8c878e24a0856d082..8913b80ff4c593369b01fe75b67a11335a852439 100644 +index ee43310ce1cd051e45486c4587c5e2aa1d000338..afe3cda698c415079d9f038b452cf594579b4eaf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -272,7 +272,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop arguments = new HashMap<>(); + arguments.put("username", profileName); + arguments.put("serverId", serverId); @@ -152,7 +152,7 @@ index 0000000000000000000000000000000000000000..b15ee80ac1aea751594cd3321928f26d + } + + GameProfile cache = null; -+ if (LeavesConfig.extraYggdrasilLoginProtect) { ++ if (LeavesConfig.mics.yggdrasil.loginProtect) { + cache = MinecraftServer.getServer().services.profileCache().getProfileIfCached(profileName); + } + @@ -161,7 +161,7 @@ index 0000000000000000000000000000000000000000..b15ee80ac1aea751594cd3321928f26d + try { + final HasJoinedMinecraftServerResponse response = client.get(url, HasJoinedMinecraftServerResponse.class); + if (response != null && response.id() != null) { -+ if (LeavesConfig.extraYggdrasilLoginProtect && cache != null) { ++ if (LeavesConfig.mics.yggdrasil.loginProtect && cache != null) { + if (response.id() != cache.getId()) { + continue; + } diff --git a/patches/server/0043-Use-vanilla-random-config.patch b/patches/server/0043-Use-vanilla-random-config.patch index 765c5a78..ec24eb1d 100644 --- a/patches/server/0043-Use-vanilla-random-config.patch +++ b/patches/server/0043-Use-vanilla-random-config.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use vanilla random config diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 8a00ae40e648523a01189e9da6c978a784d53cab..253089bd6b5897ce6022ce84b59abac42d57ab12 100644 +index 8a00ae40e648523a01189e9da6c978a784d53cab..a49f44762c5fbc8824dc0cfc1131391a71449c73 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -620,7 +620,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -13,12 +13,12 @@ index 8a00ae40e648523a01189e9da6c978a784d53cab..253089bd6b5897ce6022ce84b59abac4 this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; - this.random = SHARED_RANDOM; // Paper - Share random for entities to make them more random -+ this.random = org.leavesmc.leaves.LeavesConfig.useVanillaRandom ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Leaves - vanilla plz ++ this.random = org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom ? RandomSource.create() : SHARED_RANDOM; // Paper - Share random for entities to make them more random // Leaves - vanilla plz this.remainingFireTicks = -this.getFireImmuneTicks(); this.fluidHeight = new Object2DoubleArrayMap(2); this.fluidOnEyes = new HashSet(); diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..43e29db0e4daa8f219fbef406a035792bd7c4150 100644 +index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..c2f178d74e61c6d169ccea15ce8d3d0568dbcbe8 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -1088,7 +1088,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -26,12 +26,12 @@ index 42276acfeadec6e7aa9a91d3f446f4fedb04829d..43e29db0e4daa8f219fbef406a035792 BeeGoToHiveGoal() { super(); - this.travellingTicks = Bee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues -+ this.travellingTicks = org.leavesmc.leaves.LeavesConfig.useVanillaRandom ? Bee.this.level().random.nextInt(10) : Bee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues // Leaves - why no vanilla ++ this.travellingTicks = org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom ? Bee.this.level().random.nextInt(10) : Bee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues // Leaves - why no vanilla this.blacklistedTargets = Lists.newArrayList(); this.setFlags(EnumSet.of(Goal.Flag.MOVE)); } diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index f9fdc600dc680c55219fcbf9bc8f151a733a093c..c09483543a59b383bc9a939416506b94e48ec2bb 100644 +index f9fdc600dc680c55219fcbf9bc8f151a733a093c..ff9e8f501a537d005aba63737303177ca6882760 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java @@ -46,7 +46,7 @@ public class Squid extends AgeableWaterCreature { @@ -39,12 +39,12 @@ index f9fdc600dc680c55219fcbf9bc8f151a733a093c..c09483543a59b383bc9a939416506b94 public Squid(EntityType type, Level world) { super(type, world); - //this.random.setSeed((long)this.getId()); // Paper - Share random for entities to make them more random -+ if (org.leavesmc.leaves.LeavesConfig.useVanillaRandom) this.random.setSeed(this.getId()); // Paper - Share random for entities to make them more random // Leaves - vanilla plz ++ if (org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom) this.random.setSeed(this.getId()); // Paper - Share random for entities to make them more random // Leaves - vanilla plz this.tentacleSpeed = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index c7a50e09fd946b03ad5bc984607a807b4db1ece0..322b22577ae0269b0a4b641112130a8e96c4e344 100644 +index 8f2ca7211d4ebf494beae85caea5876fad4723eb..9e8a40f51337822ac55b5020778076c7466f5ef3 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -79,7 +79,13 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -53,7 +53,7 @@ index c7a50e09fd946b03ad5bc984607a807b4db1ece0..322b22577ae0269b0a4b641112130a8e this.setPos(x, y, z); - this.setDeltaMovement(this.random.nextDouble() * 0.2D - 0.1D, 0.2D, this.random.nextDouble() * 0.2D - 0.1D); + // Leaves start - vanilla yes, paper no -+ if (org.leavesmc.leaves.LeavesConfig.useVanillaRandom) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom) { + this.setDeltaMovement(world.random.nextDouble() * 0.2D - 0.1D, 0.2D, world.random.nextDouble() * 0.2D - 0.1D); + } else { + this.setDeltaMovement(this.random.nextDouble() * 0.2D - 0.1D, 0.2D, this.random.nextDouble() * 0.2D - 0.1D); @@ -63,7 +63,7 @@ index c7a50e09fd946b03ad5bc984607a807b4db1ece0..322b22577ae0269b0a4b641112130a8e // Paper end - Don't use level random in entity constructors } diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index 19fd67a4f6a9eb34708848400e95414e8530837b..2f9764436c3174a49818dedeff1184681c59e287 100644 +index 34b9384c0f852d28dc8b834a40785ede74b33cfd..aa4179781fc67e7e4194cfac795aa2a84abe616b 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -68,7 +68,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { @@ -71,7 +71,7 @@ index 19fd67a4f6a9eb34708848400e95414e8530837b..2f9764436c3174a49818dedeff118468 this(EntityType.TNT, world); this.setPos(x, y, z); - double d3 = this.random.nextDouble() * 6.2831854820251465D; // Paper - Don't use level random in entity constructors -+ double d3 = (org.leavesmc.leaves.LeavesConfig.useVanillaRandom ? world.random.nextDouble() : this.random.nextDouble()) * 6.2831854820251465D; // Paper - Don't use level random in entity constructors // Leaves - why? ++ double d3 = (org.leavesmc.leaves.LeavesConfig.modify.useVanillaRandom ? world.random.nextDouble() : this.random.nextDouble()) * 6.2831854820251465D; // Paper - Don't use level random in entity constructors // Leaves - why? this.setDeltaMovement(-Math.sin(d3) * 0.02D, 0.20000000298023224D, -Math.cos(d3) * 0.02D); this.setFuse(80); diff --git a/patches/server/0044-Fix-update-suppression-crash.patch b/patches/server/0044-Fix-update-suppression-crash.patch index 0c3afd33..1b1359d2 100644 --- a/patches/server/0044-Fix-update-suppression-crash.patch +++ b/patches/server/0044-Fix-update-suppression-crash.patch @@ -20,7 +20,7 @@ index 1f7f68aad97ee73763c042837f239bdc7167db55..1e8025ecb14acc7c24917793c97f5435 if (exception instanceof ReportedException) { ReportedException reportedexception = (ReportedException) exception; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8913b80ff4c593369b01fe75b67a11335a852439..3c2db9fa853ade7e429738f9896ad31e0550df65 100644 +index afe3cda698c415079d9f038b452cf594579b4eaf..875bbe2e5d247d3483a65d172a5f7a16f53c21d6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1872,7 +1872,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop