Yatopia/patches/server/0018-Item-stuck-sleep-config.patch
Ivan Pekov c75ada51ef
Port even more patches
Ported some patches from EMC and Origami
2020-08-15 19:18:36 +03:00

34 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
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());