Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
move config
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Aug 7, 2024
1 parent f9666a1 commit bebbbea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions patches/server/0003-LevelBukkit-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ index 0000000000000000000000000000000000000000..5ca0b7470839835e526e9681b2396a70
\ No newline at end of file
diff --git a/src/main/kotlin/one/tranic/bukkit/config/LevelBukkitConfig.kt b/src/main/kotlin/one/tranic/bukkit/config/LevelBukkitConfig.kt
new file mode 100644
index 0000000000000000000000000000000000000000..94344ae28f5fbc96c1e14035881c0662288f88a0
index 0000000000000000000000000000000000000000..755cdc692b1f51ad6092c68dcaf1bce1fbc61481
--- /dev/null
+++ b/src/main/kotlin/one/tranic/bukkit/config/LevelBukkitConfig.kt
@@ -0,0 +1,276 @@
@@ -0,0 +1,272 @@
+package one.tranic.bukkit.config
+
+import gg.pufferfish.pufferfish.simd.SIMDDetection
Expand Down Expand Up @@ -147,9 +147,8 @@ index 0000000000000000000000000000000000000000..94344ae28f5fbc96c1e14035881c0662
+ )
+ )
+ addDefault("feature.farmland-gets-moist-from-below", true)
+
+ addDefault(
+ "vanilla.hopper", false,
+ "feature.vanilla-hopper", false,
+ "Reverted Hopper behavior to vanilla, this doesn't fix all issues."
+ )
+
Expand Down Expand Up @@ -212,8 +211,7 @@ index 0000000000000000000000000000000000000000..94344ae28f5fbc96c1e14035881c0662
+ Feature.secureSeed = getBoolean("feature.secure-seed")
+ Feature.farmlandGetsMoistFromBelow =
+ configuration.getBoolean("feature.farmland-gets-moist-from-below")
+
+ Vanilla.hopper = getBoolean("vanilla.hopper")
+ Feature.vanillaHopper = getBoolean("feature.vanilla-hopper")
+
+ Optimize.flattenTriangularDistribution = getBoolean("optimize.flatten-triangular-distribution")
+ Optimize.cacheWorldGeneratorSeaLevel = getBoolean("optimize.cache-world-generator-sea-level")
Expand Down Expand Up @@ -306,11 +304,9 @@ index 0000000000000000000000000000000000000000..94344ae28f5fbc96c1e14035881c0662
+
+ @JvmField
+ var farmlandGetsMoistFromBelow: Boolean = true
+ }
+
+ object Vanilla {
+ @JvmField
+ var hopper: Boolean = false
+ var vanillaHopper = false
+ }
+
+ object Optimize {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0023-Leaves-Vanilla-hopper.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Leaves: Vanilla hopper
This is a temporary solution designed to attempt to restore the vanilla behavior of the funnel while preserving optimizations as much as possible. It should ultimately be replaced by the optimization solution provided by lithium.

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 957c217653a664bab26db476724d288b18d87102..1b6318a87df4fd2c2af36b6ad32d7b6de5e47ec7 100644
index 957c217653a664bab26db476724d288b18d87102..2e2f36baff6f84893f8290619797640b64cbd78d 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
@@ -29,6 +29,7 @@ import net.minecraft.world.level.block.ChestBlock;
Expand Down Expand Up @@ -40,7 +40,7 @@ index 957c217653a664bab26db476724d288b18d87102..1b6318a87df4fd2c2af36b6ad32d7b6d
- // No plugin could of relied on the behavior of false as the other call
- // site for IMIE did not exhibit the same behavior
+ // Leaves start - fix vanilla
+ if (LevelBukkitConfig.Vanilla.hopper && movedItem.getCount() <= movedItemCount) {
+ if (LevelBukkitConfig.Feature.vanillaHopper && movedItem.getCount() <= movedItemCount) {
+ movedItem = origItemStack.copy();
+ final ItemStack remainingItem = addItem(container, hopper, container.removeItem(i, movedItemCount), null);
+ if (remainingItem.isEmpty()) {
Expand Down

0 comments on commit bebbbea

Please sign in to comment.