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 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; }
public BlockState getBlockState(Vector pos) { Vector vec = translate(pos); return delegate.getBlockState(world, vec.getBlockX(), vec.getBlockY(), vec.getBlockZ()); }