From 060c7ee7c048c50bb50c5fa8b583e1554954a327 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Tue, 26 May 2015 14:44:43 +0100 Subject: [PATCH] SPIGOT-927: Only schedule ticks for blocks in loaded chunks --- CraftBukkit-Patches/0157-Schedule-Hopper-Ticks.patch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0157-Schedule-Hopper-Ticks.patch b/CraftBukkit-Patches/0157-Schedule-Hopper-Ticks.patch index 94b55c1280..34cadbd3b1 100644 --- a/CraftBukkit-Patches/0157-Schedule-Hopper-Ticks.patch +++ b/CraftBukkit-Patches/0157-Schedule-Hopper-Ticks.patch @@ -1,4 +1,4 @@ -From 1c13de44e824b19644554a6b0f73272651c9b22f Mon Sep 17 00:00:00 2001 +From b4ba16f862dc2d42971780eb3e1cc45d6b2eb821 Mon Sep 17 00:00:00 2001 From: "Evan A. Haskell" Date: Sat, 19 Apr 2014 16:58:26 -0400 Subject: [PATCH] Schedule Hopper Ticks @@ -166,10 +166,10 @@ index edcb307..4b3ea37 100644 if (this.getControllerMove().a()) { double d0 = this.getControllerMove().b(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index c268a40..578f79d 100644 +index c268a40..c4cc269 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -21,6 +21,64 @@ public abstract class TileEntity { +@@ -21,6 +21,67 @@ public abstract class TileEntity { private int h; protected Block e; @@ -177,6 +177,9 @@ index c268a40..578f79d 100644 + // Helper method for scheduleTicks. If the hopper at blockposition is pointed + // toward this tile, then make the hopper active + private void scheduleTick(BlockPosition blockposition) { ++ if (!world.isLoaded(blockposition)) { ++ return; ++ } + TileEntity tileEntity = this.world.getTileEntity(blockposition); + if (tileEntity instanceof TileEntityHopper) { + // i is the metadeta assoiated with the direction the hopper faces. @@ -234,7 +237,7 @@ index c268a40..578f79d 100644 public TileEntity() { this.position = BlockPosition.ZERO; this.h = -1; -@@ -105,6 +163,10 @@ public abstract class TileEntity { +@@ -105,6 +166,10 @@ public abstract class TileEntity { if (this.w() != Blocks.AIR) { this.world.updateAdjacentComparators(this.position, this.w()); }