Paper/Spigot-Server-Patches/0026-Don-t-tick-chests.patch
Zach Brown 4aef5602d5 Update from upstream SpigotMC
Remove defensive copy in EAR SpigotMC/Spigot@f1ba1f6c07
Make "moved wrongly limit" configurable SpigotMC/Spigot@f7ab380e16
Fix null Tile Entity Worlds (we already had this) SpigotMC/Spigot@b271cdbfa0
Fix slow tab complete for some commands SpigotMC/Spigot@f3b7952c73
Only suggest ops to deop and remove whitelist add case entirely SpigotMC/Spigot@0e1fcfbe70
Allow tab complete for /whitelist add SpigotMC/Spigot@27f8aa22bd
2014-07-22 15:25:09 -05:00

85 Zeilen
3.0 KiB
Diff

From 9d0c463f0d044f4f7f291ee25f8755a2eccf7aba Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Fri, 11 Jul 2014 01:31:43 -0500
Subject: [PATCH] Don't tick chests
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index c900caf..ce612ad 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -249,6 +249,8 @@ public class TileEntityChest extends TileEntity implements IInventory {
}
public void h() {
+ // PaperSpigot start - Don't tick chests at all, period
+ /*
super.h();
if (this.world == null) return; // CraftBukkit
this.i();
@@ -327,6 +329,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
this.m = 0.0F;
}
}
+ */
}
public boolean c(int i, int j) {
@@ -349,6 +352,26 @@ public class TileEntityChest extends TileEntity implements IInventory {
if (this.world == null) return; // CraftBukkit
this.world.playBlockAction(this.x, this.y, this.z, this.q(), 1, this.o);
+ // PaperSpigot start - Move chest open sound handling down here
+ this.i();
+ double d0;
+
+ if (this.o > 0 && this.m == 0.0F && this.i == null && this.k == null) {
+ double d1 = (double) this.x + 0.5D;
+
+ d0 = (double) this.z + 0.5D;
+ if (this.l != null) {
+ d0 += 0.5D;
+ }
+
+ if (this.j != null) {
+ d1 += 0.5D;
+ }
+
+ this.world.makeSound(d1, (double) this.y + 0.5D, d0, "random.chestopen", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ }
+ // PaperSpigot end
+
// CraftBukkit start - Call redstone event
if (this.q() == Blocks.TRAPPED_CHEST) {
int newPower = Math.max(0, Math.min(15, this.o));
@@ -371,6 +394,26 @@ public class TileEntityChest extends TileEntity implements IInventory {
if (this.world == null) return; // CraftBukkit
this.world.playBlockAction(this.x, this.y, this.z, this.q(), 1, this.o);
+ // PaperSpigot start - Move chest close sound handling down here
+ this.i();
+ double d0;
+
+ if (this.o == 0 && this.i == null && this.k == null) {
+ d0 = (double) this.x + 0.5D;
+ double d2 = (double) this.z + 0.5D;
+
+ if (this.l != null) {
+ d2 += 0.5D;
+ }
+
+ if (this.j != null) {
+ d0 += 0.5D;
+ }
+
+ this.world.makeSound(d0, (double) this.y + 0.5D, d2, "random.chestclosed", 0.5F, this.world.random.nextFloat() * 0.1F + 0.9F);
+ }
+ // PaperSpigot end
+
// CraftBukkit start - Call redstone event
if (this.q() == Blocks.TRAPPED_CHEST) {
int newPower = Math.max(0, Math.min(15, this.o));
--
1.9.1