Yatopia/patches/server/0018-Item-stuck-sleep-config.patch
Ivan Pekov 41ffe92eeb
Per world entity (type) collisions & some cleanup (#76)
* Per world entity (type) collisions & some cleanup

* Unnuke RainforestConfig

* Forgot the API

* fix and remove code clean up for now

Co-authored-by: Bud Gidiere <sgidiere@gmail.com>
2020-08-11 10:38:17 -05:00

35 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 0eac1342ceba67ca51bed32e4b7c60afbce684d1..dd9206a70e85507fb538d2b59d97478db57df7b8 100644
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
@@ -211,4 +211,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);
+ }
}
\ 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 ca9c12151b193c05e42bbb99733f6e3ed2bae221..6869b688810cc72da01f164db1f0853d59752597 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 % dev.tr7zw.yatopia.YatopiaConfig.itemStuckSleepTicks == 0) { // Yatopia
this.noclip = !this.world.getCubes(this);
if (this.noclip) {
this.k(this.locX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0D, this.locZ());