use of net.minecraft.server.v1_9_R2.BlockPosition in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_8_R2 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_8_R2.Block block = net.minecraft.server.v1_8_R2.Block.getById(id);
if (block == null) {
// TODO: Convention for null bounds -> full ?
return null;
}
block.updateShape(world, new BlockPosition(x, y, z));
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { block.B(), block.D(), block.F(), block.C(), block.E(), block.G() };
}
use of net.minecraft.server.v1_9_R2.BlockPosition in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_8_R3 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_8_R3.Block block = net.minecraft.server.v1_8_R3.Block.getById(id);
if (block == null) {
// TODO: Convention for null bounds -> full ?
return null;
}
block.updateShape(world, new BlockPosition(x, y, z));
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { block.B(), block.D(), block.F(), block.C(), block.E(), block.G() };
}
use of net.minecraft.server.v1_9_R2.BlockPosition in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_9_R1 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_9_R1.Block block = net.minecraft.server.v1_9_R1.Block.getById(id);
if (block == null) {
// TODO: Convention for null blocks -> full ?
return null;
}
final BlockPosition pos = new BlockPosition(x, y, z);
final AxisAlignedBB bb = block.a(world.getType(pos), world, pos);
if (bb == null) {
// Special case.
return new double[] { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 };
// return null;
}
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { bb.a, bb.b, bb.c, bb.d, bb.e, bb.f };
}
use of net.minecraft.server.v1_9_R2.BlockPosition in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_9_R2 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_9_R2.Block block = net.minecraft.server.v1_9_R2.Block.getById(id);
if (block == null) {
// TODO: Convention for null blocks -> full ?
return null;
}
final BlockPosition pos = new BlockPosition(x, y, z);
// TODO: Deprecation warning below (reason / substitute?).
@SuppressWarnings("deprecation") final AxisAlignedBB bb = block.a(world.getType(pos), world, pos);
if (bb == null) {
// Special case.
return new double[] { 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 };
// return null;
}
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { bb.a, bb.b, bb.c, bb.d, bb.e, bb.f };
}
use of net.minecraft.server.v1_9_R2.BlockPosition in project acidisland by tastybento.
the class NMSHandler method setFlowerPotBlock.
/* (non-Javadoc)
* @see com.wasteofplastic.askyblock.nms.NMSAbstraction#setBlock(org.bukkit.block.Block, org.bukkit.inventory.ItemStack)
*/
@Override
public void setFlowerPotBlock(final Block block, final ItemStack itemStack) {
if (block.getType().equals(Material.FLOWER_POT)) {
Location loc = block.getLocation();
CraftWorld cw = (CraftWorld) block.getWorld();
BlockPosition bp = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
TileEntityFlowerPot te = (TileEntityFlowerPot) cw.getHandle().getTileEntity(bp);
// Bukkit.getLogger().info("Debug: flowerpot materialdata = " + (new ItemStack(potItem, 1,(short) potItemData).toString()));
net.minecraft.server.v1_11_R1.ItemStack cis = CraftItemStack.asNMSCopy(itemStack);
te.setContents(cis);
te.update();
}
}
Aggregations