From 32e02629a9678d1126a957533d381e7d2571f3a1 Mon Sep 17 00:00:00 2001 From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> Date: Sat, 8 Apr 2023 23:46:00 +0300 Subject: [PATCH] Quickfix patching conventions UPSTREAM-CATEGORY-OPTION (for future automation purposes) Split configuration commits (tracking adding config options) Use per world config if possible --- ...op-contents-of-shulker-items-when-de.patch | 34 ------------------- .../0008-Kaiiju-Gameplay-Configuration.patch | 31 +++++++++++++++++ ...lay-ShulkerDropContentsWhenDestroyed.patch | 34 +++++++++++++++++++ 3 files changed, 65 insertions(+), 34 deletions(-) delete mode 100644 patches/server/0008-Add-option-to-drop-contents-of-shulker-items-when-de.patch create mode 100644 patches/server/0008-Kaiiju-Gameplay-Configuration.patch create mode 100644 patches/server/0009-Kaiiju-Gameplay-ShulkerDropContentsWhenDestroyed.patch diff --git a/patches/server/0008-Add-option-to-drop-contents-of-shulker-items-when-de.patch b/patches/server/0008-Add-option-to-drop-contents-of-shulker-items-when-de.patch deleted file mode 100644 index e7e44b4..0000000 --- a/patches/server/0008-Add-option-to-drop-contents-of-shulker-items-when-de.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Xymb -Date: Sat, 8 Apr 2023 18:10:14 +0200 -Subject: [PATCH] Add option to drop contents of shulker items when destroyed. - - -diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java -index edaeba20d871925ae05f7f1cabb3ac8eb71b4655..26442d7cac765f938a084aa69dd2aadb4a5dd8a3 100644 ---- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java -+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java -@@ -206,4 +206,10 @@ public class KaiijuConfig { - sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets); - alternateKeepAlive = getBoolean("network.alternate-keepalive", sendNullEntityPackets); - } -+ -+ public static boolean shulkerBoxDropContentsWhenDestroyed = true; -+ -+ private static void gameplaySettings() { -+ shulkerBoxDropContentsWhenDestroyed = getBoolean("gameplay.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed); -+ } - } -diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java -index b0204af850ee182773ad458208cccd946ad148d5..b09c8dc9de9baad7c0c18babc2c83ad1ca8f9b9c 100644 ---- a/src/main/java/net/minecraft/world/item/BlockItem.java -+++ b/src/main/java/net/minecraft/world/item/BlockItem.java -@@ -288,7 +288,7 @@ public class BlockItem extends Item { - - @Override - public void onDestroyed(ItemEntity entity) { -- if (this.block instanceof ShulkerBoxBlock) { -+ if (this.block instanceof ShulkerBoxBlock && dev.kaiijumc.kaiiju.KaiijuConfig.shulkerBoxDropContentsWhenDestroyed) { - ItemStack itemstack = entity.getItem(); - CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack); - diff --git a/patches/server/0008-Kaiiju-Gameplay-Configuration.patch b/patches/server/0008-Kaiiju-Gameplay-Configuration.patch new file mode 100644 index 0000000..b75e539 --- /dev/null +++ b/patches/server/0008-Kaiiju-Gameplay-Configuration.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> +Date: Sat, 8 Apr 2023 23:32:34 +0300 +Subject: [PATCH] Kaiiju Gameplay Configuration + + +diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java +index edaeba20d871925ae05f7f1cabb3ac8eb71b4655..e216139d08c52640396c07c19c5cfeff09031cdb 100644 +--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java ++++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java +@@ -206,4 +206,7 @@ public class KaiijuConfig { + sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets); + alternateKeepAlive = getBoolean("network.alternate-keepalive", sendNullEntityPackets); + } ++ ++ private static void gameplaySettings() { ++ } + } +diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +index b194f4dbebcbbf5bb4e026a0169e2d24806b46ec..73d79fe0077b28db2f9e7fa13a1ae6eff9abd6a9 100644 +--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java ++++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +@@ -143,4 +143,7 @@ public class KaiijuWorldConfig { + regionFormatLinearCompressionLevel = 1; + } + } ++ ++ private void gameplaySettings() { ++ } + } +\ No newline at end of file diff --git a/patches/server/0009-Kaiiju-Gameplay-ShulkerDropContentsWhenDestroyed.patch b/patches/server/0009-Kaiiju-Gameplay-ShulkerDropContentsWhenDestroyed.patch new file mode 100644 index 0000000..bbc12f4 --- /dev/null +++ b/patches/server/0009-Kaiiju-Gameplay-ShulkerDropContentsWhenDestroyed.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xymb +Date: Sat, 8 Apr 2023 23:38:13 +0300 +Subject: [PATCH] Kaiiju Gameplay ShulkerDropContentsWhenDestroyed + + +diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +index 73d79fe0077b28db2f9e7fa13a1ae6eff9abd6a9..1ebc47a266dd3202ac9654eebf1a6a74dead2e27 100644 +--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java ++++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +@@ -144,6 +144,9 @@ public class KaiijuWorldConfig { + } + } + ++ public boolean shulkerBoxDropContentsWhenDestroyed = true; ++ + private void gameplaySettings() { ++ shulkerBoxDropContentsWhenDestroyed = getBoolean("gameplay.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed ); + } + } +\ No newline at end of file +diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java +index b0204af850ee182773ad458208cccd946ad148d5..a4dff10cf787b187ffc716b2278c2dc6999ecb00 100644 +--- a/src/main/java/net/minecraft/world/item/BlockItem.java ++++ b/src/main/java/net/minecraft/world/item/BlockItem.java +@@ -288,7 +288,7 @@ public class BlockItem extends Item { + + @Override + public void onDestroyed(ItemEntity entity) { +- if (this.block instanceof ShulkerBoxBlock) { ++ if (this.block instanceof ShulkerBoxBlock && entity.getLevel().kaiijuConfig.shulkerBoxDropContentsWhenDestroyed) { + ItemStack itemstack = entity.getItem(); + CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack); +