diff options
Diffstat (limited to 'features/nether/index.js')
-rw-r--r-- | features/nether/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/features/nether/index.js b/features/nether/index.js index 4eb6fab..a7db6bb 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -71,7 +71,9 @@ class Nether extends Feature { let blockState = this.getBlockIdFromState(packet[m.getBlockState.S23PacketBlockChange]()) let oldBlockState = this.getBlockIdFromState(World.getBlockStateAt(position)) if (oldBlockState === 20515 && blockState === 16419) { - this.blocks.push({ loc: position, time: Date.now() + 3000 }) + if (Math.abs(Player.getX() - position.getX()) <= 20 && Math.abs(Player.getY() - position.getY()) <= 20 && Math.abs(Player.getZ() - position.getZ()) <= 20) { + this.blocks.push({ loc: position, time: Date.now() + 3000 }) + } } if (blockState === 57379) { this.blocks = this.blocks.filter(b => { @@ -98,7 +100,9 @@ class Nether extends Feature { this.lastBlock = [position.getX(), position.getY(), position.getZ()] } if (oldBlockState === 20515 && blockState === 16419) { - this.blocks.push({ loc: position, time: Date.now() + 3000 }) + if (Math.abs(Player.getX() - position.getX()) <= 20 && Math.abs(Player.getY() - position.getY()) <= 20 && Math.abs(Player.getZ() - position.getZ()) <= 20) { + this.blocks.push({ loc: position, time: Date.now() + 3000 }) + } } if (blockState === 57379) { this.blocks = this.blocks.filter(b => { |