Skip to content

Commit

Permalink
Quickfix patching conventions
Browse files Browse the repository at this point in the history
UPSTREAM-CATEGORY-OPTION (for future automation purposes)
Split configuration commits (tracking adding config options)
Use per world config if possible
  • Loading branch information
sofianedjerbi committed Apr 8, 2023
1 parent ef8af2f commit 32e0262
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 34 deletions.

This file was deleted.

31 changes: 31 additions & 0 deletions patches/server/0008-Kaiiju-Gameplay-Configuration.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <[email protected]>
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <[email protected]>
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);

0 comments on commit 32e0262

Please sign in to comment.