use of net.minecraft.server.v1_10_R1.Block in project NoCheatPlus by NoCheatPlus.
the class BlockCacheSpigotCB1_10_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_10_R1.Block block = net.minecraft.server.v1_10_R1.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_10_R1.Block in project NoCheatPlus by NoCheatPlus.
the class BlockCacheCB2922 method fetchBounds.
@Override
public double[] fetchBounds(final int x, final int y, final int z) {
// TODO: change api for this / use nodes (!)
@SuppressWarnings("deprecation") final int id = getType(x, y, z).getId();
final net.minecraft.server.v1_7_R1.Block block = net.minecraft.server.v1_7_R1.Block.e(id);
if (block == null)
return null;
// data from cache.
block.updateShape(iBlockAccess, x, y, z);
// minX, minY, minZ, maxX, maxY, maxZ
return new double[] { block.x(), block.z(), block.B(), block.y(), block.A(), block.C() };
}
use of net.minecraft.server.v1_10_R1.Block in project askyblock by tastybento.
the class NMSHandler method setBlockSuperFast.
@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
net.minecraft.server.v1_10_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
net.minecraft.server.v1_10_R1.Chunk chunk = w.getChunkAt(b.getX() >> 4, b.getZ() >> 4);
BlockPosition bp = new BlockPosition(b.getX(), b.getY(), b.getZ());
int combined = blockId + (data << 12);
IBlockData ibd = net.minecraft.server.v1_10_R1.Block.getByCombinedId(combined);
if (applyPhysics) {
w.setTypeAndData(bp, ibd, 3);
} else {
w.setTypeAndData(bp, ibd, 2);
}
chunk.a(bp, ibd);
}
use of net.minecraft.server.v1_10_R1.Block in project Denizen-For-Bukkit by DenizenScript.
the class BlockHelperImpl method ringBell.
@Override
public void ringBell(Bell block) {
org.bukkit.block.data.type.Bell bellData = (org.bukkit.block.data.type.Bell) block.getBlockData();
Direction face = Direction.byName(bellData.getFacing().name());
Direction dir = Direction.NORTH;
switch(bellData.getAttachment()) {
case DOUBLE_WALL:
case SINGLE_WALL:
switch(face) {
case NORTH:
case SOUTH:
dir = Direction.EAST;
break;
}
break;
case FLOOR:
dir = face;
break;
}
CraftBlock craftBlock = (CraftBlock) block.getBlock();
((BellBlock) Blocks.BELL).attemptToRing(craftBlock.getCraftWorld().getHandle(), craftBlock.getPosition(), dir);
}
use of net.minecraft.server.v1_10_R1.Block in project Denizen-For-Bukkit by DenizenScript.
the class BlockData_v1_10_R1 method setBlock.
public void setBlock(Block block) {
block.setTypeIdAndData(material.getId(), (byte) data, false);
if (ctag != null) {
CompoundTagBuilder builder = ctag.createBuilder();
builder.putInt("x", block.getX());
builder.putInt("y", block.getY());
builder.putInt("z", block.getZ());
ctag = (CompoundTag_v1_10_R1) builder.build();
// TODO: make this work!
BlockPosition blockPos = new BlockPosition(block.getX(), block.getY(), block.getZ());
TileEntity te = ((CraftWorld) block.getWorld()).getHandle().getTileEntity(blockPos);
te.a(ctag.toNMSTag());
}
}
Aggregations