Java Code Examples for cn.nukkit.math.BlockFace.Plane#HORIZONTAL
The following examples show how to use
cn.nukkit.math.BlockFace.Plane#HORIZONTAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Level.java From Jupiter with GNU General Public License v3.0 | 6 votes |
public void updateComparatorOutputLevel(Vector3 v) { for (BlockFace face : Plane.HORIZONTAL) { Vector3 pos = v.getSide(face); if (this.isChunkLoaded((int) pos.x >> 4, (int) pos.z >> 4)) { Block block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } else if (block1.isNormalBlock()) { pos = pos.getSide(face); block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } } } } }
Example 2
Source File: Level.java From Nukkit with GNU General Public License v3.0 | 6 votes |
public void updateComparatorOutputLevel(Vector3 v) { for (BlockFace face : Plane.HORIZONTAL) { Vector3 pos = v.getSide(face); if (this.isChunkLoaded((int) pos.x >> 4, (int) pos.z >> 4)) { Block block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } else if (block1.isNormalBlock()) { pos = pos.getSide(face); block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } } } } }
Example 3
Source File: Level.java From Nukkit with GNU General Public License v3.0 | 6 votes |
public void updateComparatorOutputLevel(Vector3 v) { for (BlockFace face : Plane.HORIZONTAL) { Vector3 pos = v.getSide(face); if (this.isChunkLoaded((int) pos.x >> 4, (int) pos.z >> 4)) { Block block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } else if (block1.isNormalBlock()) { pos = pos.getSide(face); block1 = this.getBlock(pos); if (BlockRedstoneDiode.isDiode(block1)) { block1.onUpdate(BLOCK_UPDATE_REDSTONE); } } } } }
Example 4
Source File: BlockRedstoneWire.java From Jupiter with GNU General Public License v3.0 | 5 votes |
public int getWeakPower(BlockFace side) { if (!this.canProvidePower) { return 0; } else { int power = this.meta; if (power == 0) { return 0; } else if (side == BlockFace.UP) { return power; } else { EnumSet<BlockFace> enumset = EnumSet.noneOf(BlockFace.class); for (BlockFace face : Plane.HORIZONTAL) { if (this.isPowerSourceAt(face)) { enumset.add(face); } } if (side.getAxis().isHorizontal() && enumset.isEmpty()) { return power; } else if (enumset.contains(side) && !enumset.contains(side.rotateYCCW()) && !enumset.contains(side.rotateY())) { return power; } else { return 0; } } } }
Example 5
Source File: BlockRedstoneWire.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public int getWeakPower(BlockFace side) { if (!this.canProvidePower) { return 0; } else { int power = this.getDamage(); if (power == 0) { return 0; } else if (side == BlockFace.UP) { return power; } else { EnumSet<BlockFace> enumset = EnumSet.noneOf(BlockFace.class); for (BlockFace face : Plane.HORIZONTAL) { if (this.isPowerSourceAt(face)) { enumset.add(face); } } if (side.getAxis().isHorizontal() && enumset.isEmpty()) { return power; } else if (enumset.contains(side) && !enumset.contains(side.rotateYCCW()) && !enumset.contains(side.rotateY())) { return power; } else { return 0; } } } }
Example 6
Source File: BlockRedstoneWire.java From Nukkit with GNU General Public License v3.0 | 5 votes |
public int getWeakPower(BlockFace side) { if (!this.canProvidePower) { return 0; } else { int power = this.getDamage(); if (power == 0) { return 0; } else if (side == BlockFace.UP) { return power; } else { EnumSet<BlockFace> enumset = EnumSet.noneOf(BlockFace.class); for (BlockFace face : Plane.HORIZONTAL) { if (this.isPowerSourceAt(face)) { enumset.add(face); } } if (side.getAxis().isHorizontal() && enumset.isEmpty()) { return power; } else if (enumset.contains(side) && !enumset.contains(side.rotateYCCW()) && !enumset.contains(side.rotateY())) { return power; } else { return 0; } } } }