Java Code Examples for org.bukkit.block.BlockState#getX()
The following examples show how to use
org.bukkit.block.BlockState#getX() .
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: BlockStates.java From PGM with GNU Affero General Public License v3.0 | 5 votes |
static String format(BlockState state) { return "BlockState{pos=(" + state.getX() + ", " + state.getY() + ", " + state.getZ() + ") world=" + state.getMaterialData() + "}"; }
Example 2
Source File: StructureGrowDelegate.java From Kettle with GNU General Public License v3.0 | 5 votes |
public int getTypeId(int x, int y, int z) { for (BlockState state : blocks) { if (state.getX() == x && state.getY() == y && state.getZ() == z) { return state.getTypeId(); } } return world.getBlockTypeIdAt(x, y, z); }
Example 3
Source File: StructureGrowDelegate.java From Kettle with GNU General Public License v3.0 | 5 votes |
public boolean isEmpty(int x, int y, int z) { for (BlockState state : blocks) { if (state.getX() == x && state.getY() == y && state.getZ() == z) { return Block.getBlockById(state.getTypeId()) == Blocks.AIR; } } return world.getBlockAt(x, y, z).isEmpty(); }
Example 4
Source File: RedstoneModule.java From Modern-LWC with MIT License | 5 votes |
@Override public void onRedstone(LWCRedstoneEvent event) { if (event.isCancelled()) { return; } LWC lwc = event.getLWC(); Protection protection = event.getProtection(); // check for a player using it ProtectionFinder finder = protection.getProtectionFinder(); if (finder != null) { for (BlockState found : finder.getBlocks()) { if (DoorMatcher.PRESSURE_PLATES.contains(found.getType())) { // find a player that is using it int x = found.getX(); int y = found.getY(); int z = found.getZ(); Player player = lwc.findPlayer(x - 1, x + 1, y, y + 1, z - 1, z + 1); if (player != null) { if (!lwc.canAccessProtection(player, protection)) { event.setCancelled(true); } else { // bypass the denyRedstone/REDSTONE flag check return; } } } } } boolean hasFlag = protection.hasFlag(Flag.Type.REDSTONE); boolean denyRedstone = lwc.getConfiguration().getBoolean("protections.denyRedstone", false); if ((!hasFlag && denyRedstone) || (hasFlag && !denyRedstone)) { event.setCancelled(true); } }
Example 5
Source File: StructureGrowDelegate.java From Thermos with GNU General Public License v3.0 | 5 votes |
public int getTypeId(int x, int y, int z) { for (BlockState state : blocks) { if (state.getX() == x && state.getY() == y && state.getZ() == z) { return state.getTypeId(); } } return world.getBlockTypeIdAt(x, y, z); }
Example 6
Source File: StructureGrowDelegate.java From Thermos with GNU General Public License v3.0 | 5 votes |
public boolean isEmpty(int x, int y, int z) { for (BlockState state : blocks) { if (state.getX() == x && state.getY() == y && state.getZ() == z) { return net.minecraft.block.Block.getBlockById(state.getTypeId()) == net.minecraft.init.Blocks.air; } } return world.getBlockAt(x, y, z).isEmpty(); }
Example 7
Source File: BlockVectors.java From PGM with GNU Affero General Public License v3.0 | 4 votes |
static BlockVector position(BlockState block) { return new BlockVector(block.getX(), block.getY(), block.getZ()); }
Example 8
Source File: BlockQuery.java From PGM with GNU Affero General Public License v3.0 | 4 votes |
public BlockQuery(@Nullable Event event, BlockState block) { this(event, checkNotNull(block).getWorld(), block.getX(), block.getY(), block.getZ()); this.block = block; }
Example 9
Source File: BlockEventQuery.java From ProjectAres with GNU Affero General Public License v3.0 | 4 votes |
public BlockEventQuery(Event event, BlockState block) { this(event, block.getWorld(), block.getX(), block.getY(), block.getZ(), block); }
Example 10
Source File: BlockQuery.java From ProjectAres with GNU Affero General Public License v3.0 | 4 votes |
public BlockQuery(BlockState block) { this(block.getWorld(), block.getX(), block.getY(), block.getZ(), block); }
Example 11
Source File: BlockStateUtils.java From ProjectAres with GNU Affero General Public License v3.0 | 4 votes |
public static String format(BlockState state) { return "BlockState{pos=(" + state.getX() + ", " + state.getY() + ", " + state.getZ() + ") material=" + state.getMaterialData() + "}"; }
Example 12
Source File: BlockUtils.java From ProjectAres with GNU Affero General Public License v3.0 | 4 votes |
public static BlockVector position(BlockState block) { return new BlockVector(block.getX(), block.getY(), block.getZ()); }
Example 13
Source File: LWC.java From Modern-LWC with MIT License | 3 votes |
/** * Find a protection linked to the block at [x, y, z] * * @param block * @param block2 * @return */ @SuppressWarnings("deprecation") public boolean blockEquals(BlockState block, BlockState block2) { return block.getType() == block2.getType() && block.getX() == block2.getX() && block.getY() == block2.getY() && block.getZ() == block2.getZ() && block.getRawData() == block2.getRawData(); }