From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Fri, 31 Jul 2020 21:48:14 -0500 Subject: [PATCH] Item stuck sleep config diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java index f23c13d14649e92e747b45d93a06bd5726bab00b..4d718370eb544fb4eb6a1d051512f63414df8c7e 100644 --- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java +++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java @@ -216,4 +216,9 @@ public class YatopiaConfig { private static void pistonPushLimit() { pistonPushLimit = getInt("settings.pistonPushLimit", 12); } + + public static int itemStuckSleepTicks = 1; + private static void itemStuckSleepTicks() { + itemStuckSleepTicks = getInt("settings.itemStuckSleepTicks", 1); + } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index 732f09319a309b92d74e6536e29d30be917be455..4ba28ab7f96dd83edc552a9c81d79b3c0061dc2c 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -82,7 +82,7 @@ public class EntityItem extends Entity { if (this.world.isClientSide) { this.noclip = false; - } else { + } else if (!this.onGround || this.noclip || this.ticksLived % dev.tr7zw.yatopia.YatopiaConfig.itemStuckSleepTicks == 0) { // Yatopia this.noclip = !this.world.getCubes(this); if (this.noclip) { this.l(this.locX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0D, this.locZ());