Search in sources :

Example 31 with Block

use of net.minecraft.server.v1_7_R1.Block in project Citizens2 by CitizensDev.

the class FallingBlockController method createEntity.

@Override
protected Entity createEntity(Location at, NPC npc) {
    WorldServer ws = ((CraftWorld) at.getWorld()).getHandle();
    Block id = Blocks.STONE;
    int data = npc.data().get(NPC.ITEM_DATA_METADATA, npc.data().get("falling-block-data", 0));
    if (npc.data().has("falling-block-id") || npc.data().has(NPC.ITEM_ID_METADATA)) {
        id = CraftMagicNumbers.getBlock(Material.getMaterial(npc.data().<String>get(NPC.ITEM_ID_METADATA, npc.data().<String>get("falling-block-id"))));
    }
    final EntityFallingBlockNPC handle = new EntityFallingBlockNPC(ws, npc, at.getX(), at.getY(), at.getZ(), id.fromLegacyData(data));
    return handle.getBukkitEntity();
}
Also used : Block(net.minecraft.server.v1_12_R1.Block) EntityFallingBlock(net.minecraft.server.v1_12_R1.EntityFallingBlock) FallingBlock(org.bukkit.entity.FallingBlock) CraftFallingBlock(org.bukkit.craftbukkit.v1_12_R1.entity.CraftFallingBlock) WorldServer(net.minecraft.server.v1_12_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 32 with Block

use of net.minecraft.server.v1_7_R1.Block in project NoCheatPlus by NoCheatPlus.

the class BlockCacheCB3026 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_R2.Block block = net.minecraft.server.v1_7_R2.Block.e(id);
    if (block == null)
        return null;
    // getData 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() };
}
Also used : Block(net.minecraft.server.v1_7_R2.Block)

Example 33 with Block

use of net.minecraft.server.v1_7_R1.Block in project NoCheatPlus by NoCheatPlus.

the class BlockCacheCB3043 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_R3.Block block = net.minecraft.server.v1_7_R3.Block.e(id);
    if (block == null)
        return null;
    // getData 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() };
}
Also used : Block(net.minecraft.server.v1_7_R3.Block)

Aggregations

Block (net.minecraft.server.v1_10_R1.Block)7 Block (net.minecraft.server.v1_11_R1.Block)7 Block (net.minecraft.server.v1_12_R1.Block)7 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)6 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)6 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)6 Block (net.minecraft.server.v1_8_R3.Block)6 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)5 PathPoint (net.minecraft.server.v1_10_R1.PathPoint)4 PathPoint (net.minecraft.server.v1_11_R1.PathPoint)4 MutableBlockPosition (net.minecraft.server.v1_12_R1.BlockPosition.MutableBlockPosition)4 PathPoint (net.minecraft.server.v1_8_R3.PathPoint)4 MutableBlockPosition (net.minecraft.server.v1_10_R1.BlockPosition.MutableBlockPosition)3 PathType (net.minecraft.server.v1_10_R1.PathType)3 MutableBlockPosition (net.minecraft.server.v1_11_R1.BlockPosition.MutableBlockPosition)3 PathPoint (net.minecraft.server.v1_12_R1.PathPoint)3 FallingBlock (org.bukkit.entity.FallingBlock)3 AnnotateImageRequest (com.google.cloud.vision.v1.AnnotateImageRequest)2 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)2 BatchAnnotateImagesResponse (com.google.cloud.vision.v1.BatchAnnotateImagesResponse)2