Files
MiraiMC/patches/server/0067-Set-item-stuck-sleep-to-15-ticks.patch
2022-08-23 10:36:35 +02:00

22 lines
1.2 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] Set item stuck sleep to 15 ticks
Original code by YatopiaMC, licensed under MIT
You can find the original code on https://github.com/YatopiaMC/Yatopia
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 16a55f94bda9f959548772c8916b4dc3eb045d47..3fbcd5e5d83b4451d2bf169971aa23ae5402184b 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -141,7 +141,7 @@ public class ItemEntity extends Entity {
if (this.level.isClientSide) {
this.noPhysics = false;
- } else {
+ } else if (!this.onGround || this.noPhysics || this.tickCount % 15 == 0) { // Mirai
this.noPhysics = !this.level.noCollision(this, this.getBoundingBox().deflate(1.0E-7D));
if (this.noPhysics) {
this.moveTowardsClosestSpace(this.getX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0D, this.getZ());