@Override public String toString() { return super.toString() + " facing " + getFacing() + (isActivated()?" Activated":"") + (isConnected()?" Connected":""); } }
public TripwireHook(BlockFace dir) { this(); setFacingDirection(dir); }
/** * Test if tripwire is connected * * @return true if connected, false if not */ public boolean isConnected() { return (getData() & 0x4) != 0; }
builder.fill(new Vector(8, 2, 3), new Vector(8, 3, 3), vine.getItemType(), vine); builder.fill(new Vector(2, 1, 8), new Vector(3, 1, 8), Material.TRIPWIRE); TripwireHook hookE = new TripwireHook(getRelativeFacing(BlockFace.WEST)); hookE.setConnected(true); builder.setBlock(new Vector(4, 1, 8), hookE.getItemType(), hookE); TripwireHook hookW = new TripwireHook(getRelativeFacing(BlockFace.EAST)); hookW.setConnected(true); builder.setBlock(new Vector(1, 1, 8), hookW.getItemType(), hookW); builder.fill(new Vector(5, 1, 1), new Vector(5, 1, 7), Material.REDSTONE_WIRE); builder.setBlock(new Vector(4, 1, 1), Material.REDSTONE_WIRE); builder.fill(new Vector(7, 1, 2), new Vector(7, 1, 4), Material.TRIPWIRE); TripwireHook hookN = new TripwireHook(getRelativeFacing(BlockFace.SOUTH)); hookN.setConnected(true); builder.setBlock(new Vector(7, 1, 1), hookN.getItemType(), hookN); TripwireHook hookS = new TripwireHook(getRelativeFacing(BlockFace.NORTH)); hookS.setConnected(true); builder.setBlock(new Vector(7, 1, 5), hookS.getItemType(), hookS); builder.fill(new Vector(8, 1, 6), new Vector(9, 1, 6), Material.REDSTONE_WIRE); builder.setBlock(new Vector(9, 1, 5), Material.REDSTONE_WIRE);
public boolean isPowered() { return isActivated(); }
/** * Test if hook is currently activated * * @return true if activated, false if not */ public boolean isActivated() { return (getData() & 0x8) != 0; }
public boolean isPowered() { return isActivated(); }
@Override public String toString() { return super.toString() + " facing " + getFacing() + (isActivated()?" Activated":"") + (isConnected()?" Connected":""); } }
public BlockFace getAttachedFace() { switch (getData() & 0x3) { case 0: return BlockFace.NORTH; case 1: return BlockFace.EAST; case 2: return BlockFace.SOUTH; case 3: return BlockFace.WEST; } return null; }
public TripwireHook(BlockFace dir) { this(); setFacingDirection(dir); }
/** * Test if hook is currently activated * * @return true if activated, false if not */ public boolean isActivated() { return (getData() & 0x8) != 0; }
/** * Test if tripwire is connected * * @return true if connected, false if not */ public boolean isConnected() { return (getData() & 0x4) != 0; }
public BlockFace getAttachedFace() { switch (getData() & 0x3) { case 0: return BlockFace.NORTH; case 1: return BlockFace.EAST; case 2: return BlockFace.SOUTH; case 3: return BlockFace.WEST; } return null; }