Don't tick chests v2

This commit is contained in:
Iceee 2014-07-08 22:51:47 -05:00 committed by Zach Brown
parent 66dd81d53a
commit b848676e2f
6 changed files with 89 additions and 38 deletions

View File

@ -1,11 +1,11 @@
From 9950f9c12273919665410851fcc1fc03fff79a75 Mon Sep 17 00:00:00 2001
From ac6e927fe693f9aad65e4f891acb012d3c2c851a Mon Sep 17 00:00:00 2001
From: Dmck2b <itallhappenedverysuddenly@gmail.com>
Date: Tue, 8 Jul 2014 23:55:29 +0100
Subject: [PATCH] Allow disabling of spawn chunks always being loaded
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9b10da7..1d949e7 100644
index 9741e94..2dc61fc 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -285,6 +285,8 @@ public abstract class World implements IBlockAccess {

View File

@ -1,33 +0,0 @@
From 722471328e7515099b512065c208785a1f0443da Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Mon, 7 Jul 2014 16:28:46 -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 4f45dba..07c368d 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -252,9 +252,10 @@ public class TileEntityChest extends TileEntity implements IInventory {
super.h();
if (this.world == null) return; // CraftBukkit
this.i();
- ++this.ticks;
+ //++this.ticks; // PaperSpigot - Don't tick chests
float f;
+ /* PaperSpigot start - Don't tick chests
if (!this.world.isStatic && this.o != 0 && (this.ticks + this.x + this.y + this.z) % 200 == 0) {
this.o = 0;
f = 5.0F;
@@ -273,6 +274,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
}
}
}
+ PaperSpigot end */
this.n = this.m;
f = 0.1F;
--
1.9.1

View File

@ -1,4 +1,4 @@
From d60dc3eab52d9205ce594691e2fac0b340290129 Mon Sep 17 00:00:00 2001
From d0c766d5ab0038550cf9abc3603538fbb33773f4 Mon Sep 17 00:00:00 2001
From: "Evan A. Haskell" <eah2119@gmail.com>
Date: Thu, 26 Jun 2014 18:37:29 -0400
Subject: [PATCH] Fix Null Tile Entity Worlds

View File

@ -1,4 +1,4 @@
From fff7efbaf9c3df799386163152ee335d1ff84b24 Mon Sep 17 00:00:00 2001
From d4704f5db1d3d651344b8c385b211722c54eae02 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 8 Jul 2014 21:49:42 -0500
Subject: [PATCH] Revert Bukkit Damage API Behavior

View File

@ -1,4 +1,4 @@
From d95189e8abe6482067e5f3f36b5ce19c5424f2bd Mon Sep 17 00:00:00 2001
From b72b08303cfcc8424fdf55f54ac41f1978341802 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 8 Jul 2014 22:39:41 -0500
Subject: [PATCH] Better EULA handling

View File

@ -0,0 +1,84 @@
From 18801c8a166e2218b454c809a2e7f6570ba5f0c6 Mon Sep 17 00:00:00 2001
From: Iceee <andrew@opticgaming.tv>
Date: Tue, 8 Jul 2014 22:51:47 -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..dfa2ce2 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -252,7 +252,8 @@ public class TileEntityChest extends TileEntity implements IInventory {
super.h();
if (this.world == null) return; // CraftBukkit
this.i();
- ++this.ticks;
+ // PaperSpigot start - Don't tick chests
+ /* ++this.ticks;
float f;
if (!this.world.isStatic && this.o != 0 && (this.ticks + this.x + this.y + this.z) % 200 == 0) {
@@ -326,7 +327,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
if (this.m < 0.0F) {
this.m = 0.0F;
}
- }
+ } */
}
public boolean c(int i, int j) {
@@ -349,6 +350,25 @@ 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 - Sound handling here now that we're not ticking chests
+ float f = 0.1F;
+ 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 +391,25 @@ 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 - Sound handling here now that we're not ticking chests
+ 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