From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Tue, 16 Jun 2020 17:29:20 +0200 Subject: [PATCH] Item stuck sleep config diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java index 716b2dea9b6e8d9d446e0e793b1c6f9ec16816ab..a158e9dc8b295f13c7ab73747cecd4c8dccce66f 100644 --- a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java +++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java @@ -216,4 +216,9 @@ public class YapfaConfig { pistonPushLimit = getInt("settings.pistonPushLimit", 12); } + public static int itemStuckSleepTicks = 1; + private static void itemStuckSleepTicks() { + itemStuckSleepTicks = getInt("settings.itemStuckSleepTicks", 1); + } + } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index a7860cb4ded3e9f949e6e1a7a2afacd738da756e..6c320dca0c11452f3c98c318bb1e5a635222f5ff 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -81,7 +81,7 @@ public class EntityItem extends Entity { if (this.world.isClientSide) { this.noclip = false; - } else { + } else if(!this.onGround || this.noclip || this.ticksLived % de.tr7zw.yapfa.YapfaConfig.itemStuckSleepTicks == 0) { // YAPFA this.noclip = !this.world.getCubes(this); if (this.noclip) { this.k(this.locX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0D, this.locZ());