SPIGOT-927: Only schedule ticks for blocks in loaded chunks

This commit is contained in:
Thinkofdeath 2015-05-26 14:44:43 +01:00
parent a18bcfaf43
commit 83492e7bf2

View File

@ -177,6 +177,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // 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.