mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
SPIGOT-927: Only schedule ticks for blocks in loaded chunks
This commit is contained in:
parent
a18bcfaf43
commit
83492e7bf2
@ -177,6 +177,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Helper method for scheduleTicks. If the hopper at blockposition is pointed
|
+ // Helper method for scheduleTicks. If the hopper at blockposition is pointed
|
||||||
+ // toward this tile, then make the hopper active
|
+ // toward this tile, then make the hopper active
|
||||||
+ private void scheduleTick(BlockPosition blockposition) {
|
+ private void scheduleTick(BlockPosition blockposition) {
|
||||||
|
+ if (!world.isLoaded(blockposition)) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
+ TileEntity tileEntity = this.world.getTileEntity(blockposition);
|
+ TileEntity tileEntity = this.world.getTileEntity(blockposition);
|
||||||
+ if (tileEntity instanceof TileEntityHopper) {
|
+ if (tileEntity instanceof TileEntityHopper) {
|
||||||
+ // i is the metadeta assoiated with the direction the hopper faces.
|
+ // i is the metadeta assoiated with the direction the hopper faces.
|
||||||
|
Loading…
Reference in New Issue
Block a user