public void setBlock(Vector pos, Material type, int data) { Vector vec = translate(pos); if (boundingBox.isVectorInside(vec)) { delegate.setTypeAndRawData( world, vec.getBlockX(), vec.getBlockY(), vec.getBlockZ(), type, data); } }
public boolean spawnMob(Vector pos, EntityType entityType) { Vector vec = translate(pos); return boundingBox.isVectorInside(vec) && world.spawnEntity( new Location(world, vec.getBlockX(), vec.getBlockY(), vec.getBlockZ()), entityType) != null; }
public void setBlockDownward(Vector pos, Material type, MaterialData data) { Vector vec = translate(pos); if (boundingBox.isVectorInside(vec)) { int y = vec.getBlockY(); while (!world.getBlockAt(vec.getBlockX(), y, vec.getBlockZ()).getType().isSolid() && y > 1) { delegate.setTypeAndData(world, vec.getBlockX(), y, vec.getBlockZ(), type, data); y--; } } }
public void createMobSpawner(Vector pos, EntityType entityType) { Vector vec = translate(pos); if (boundingBox.isVectorInside(vec)) { BlockState state = world.getBlockAt(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ()).getState(); delegate.backupBlockState(state.getBlock()); state.setType(Material.MOB_SPAWNER); state.update(true); state = world.getBlockAt(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ()).getState(); if (state instanceof CreatureSpawner) { ((CreatureSpawner) state).setSpawnedType(entityType); } } }
public boolean createRandomItemsContainer( Vector pos, Random random, RandomItemsContent content, DirectionalContainer container, int maxStacks) { Vector vec = translate(pos); if (boundingBox.isVectorInside(vec)) { BlockState state = world.getBlockAt(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ()).getState(); delegate.backupBlockState(state.getBlock()); state.setType(container.getItemType()); state.setData(container); state.update(true); return content.fillContainer(random, container, state, maxStacks); } return false; }