Search in sources :

Example 16 with Block

use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.

the class PlayerPathfinderNormal method a.

public PathType a(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3, PathType paramPathType) {
    BlockPosition.PooledBlockPosition localPooledBlockPosition = BlockPosition.PooledBlockPosition.s();
    if (paramPathType == PathType.WALKABLE) {
        for (int i = -1; i <= 1; i++) {
            for (int k = -1; k <= 1; k++) {
                if ((i != 0) || (k != 0)) {
                    Block localBlock = paramIBlockAccess.getType(localPooledBlockPosition.f(i + paramInt1, paramInt2, k + paramInt3)).getBlock();
                    if (localBlock == Blocks.CACTUS) {
                        paramPathType = PathType.DANGER_CACTUS;
                    } else if (localBlock == Blocks.FIRE) {
                        paramPathType = PathType.DANGER_FIRE;
                    }
                }
            }
        }
    }
    localPooledBlockPosition.t();
    return paramPathType;
}
Also used : MutableBlockPosition(net.minecraft.server.v1_12_R1.BlockPosition.MutableBlockPosition) BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) Block(net.minecraft.server.v1_12_R1.Block) PathPoint(net.minecraft.server.v1_12_R1.PathPoint)

Example 17 with Block

use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.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));
    // TODO: how to incorporate this - probably delete?
    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.getBlockData());
    return handle.getBukkitEntity();
}
Also used : EntityFallingBlock(net.minecraft.server.v1_13_R2.EntityFallingBlock) CraftFallingBlock(org.bukkit.craftbukkit.v1_13_R2.entity.CraftFallingBlock) Block(net.minecraft.server.v1_13_R2.Block) FallingBlock(org.bukkit.entity.FallingBlock) WorldServer(net.minecraft.server.v1_13_R2.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_13_R2.CraftWorld)

Example 18 with Block

use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.

the class NMSImpl method getCollisionBox.

@Override
public BoundingBox getCollisionBox(org.bukkit.block.Block block) {
    WorldServer world = ((CraftWorld) block.getWorld()).getHandle();
    Block type = CraftMagicNumbers.getBlock(block);
    BlockPosition pos = new BlockPosition(block.getX(), block.getY(), block.getZ());
    AxisAlignedBB aabb = type.a(world, pos, world.getType(pos));
    return aabb == null ? BoundingBox.EMPTY : new BoundingBox(aabb.a, aabb.b, aabb.c, aabb.d, aabb.e, aabb.f);
}
Also used : AxisAlignedBB(net.minecraft.server.v1_8_R3.AxisAlignedBB) BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) BoundingBox(net.citizensnpcs.api.util.BoundingBox) CraftBlock(org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock) Block(net.minecraft.server.v1_8_R3.Block) WorldServer(net.minecraft.server.v1_8_R3.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

Example 19 with Block

use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.

the class PlayerNavigation method p.

private int p() {
    if ((!this.b.V()) || (!h())) {
        return (int) (this.b.getBoundingBox().b + 0.5D);
    }
    int i = (int) this.b.getBoundingBox().b;
    Block localBlock = this.c.getType(new BlockPosition(MathHelper.floor(this.b.locX), i, MathHelper.floor(this.b.locZ))).getBlock();
    int j = 0;
    while ((localBlock == Blocks.FLOWING_WATER) || (localBlock == Blocks.WATER)) {
        i++;
        localBlock = this.c.getType(new BlockPosition(MathHelper.floor(this.b.locX), i, MathHelper.floor(this.b.locZ))).getBlock();
        j++;
        if (j > 16) {
            return (int) this.b.getBoundingBox().b;
        }
    }
    return i;
}
Also used : BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) Block(net.minecraft.server.v1_8_R3.Block) PathPoint(net.minecraft.server.v1_8_R3.PathPoint)

Example 20 with Block

use of com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block in project Citizens2 by CitizensDev.

the class PlayerNavigation method b.

private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
    for (BlockPosition localBlockPosition : BlockPosition.a(new BlockPosition(paramInt1, paramInt2, paramInt3), new BlockPosition(paramInt1 + paramInt4 - 1, paramInt2 + paramInt5 - 1, paramInt3 + paramInt6 - 1))) {
        double d1 = localBlockPosition.getX() + 0.5D - paramVec3D.a;
        double d2 = localBlockPosition.getZ() + 0.5D - paramVec3D.c;
        if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
            Block localBlock = this.c.getType(localBlockPosition).getBlock();
            if (!localBlock.b(this.c, localBlockPosition)) {
                return false;
            }
        }
    }
    return true;
}
Also used : BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) Block(net.minecraft.server.v1_8_R3.Block)

Aggregations

Block (net.minecraft.server.v1_12_R1.Block)9 Block (org.apache.tapestry5.Block)9 ByteString (com.google.protobuf.ByteString)8 ArrayList (java.util.ArrayList)8 Block (net.minecraft.server.v1_10_R1.Block)8 Block (net.minecraft.server.v1_11_R1.Block)8 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)8 Block (net.minecraft.server.v1_8_R3.Block)8 FallingBlock (org.bukkit.entity.FallingBlock)8 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)7 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)7 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)6 Block (com.google.cloud.vision.v1.Block)6 Feature (com.google.cloud.vision.v1.Feature)6 ImageAnnotatorClient (com.google.cloud.vision.v1.ImageAnnotatorClient)6 Page (com.google.cloud.vision.v1.Page)6 Paragraph (com.google.cloud.vision.v1.Paragraph)6 Symbol (com.google.cloud.vision.v1.Symbol)6 Word (com.google.cloud.vision.v1.Word)6 Block (net.minecraft.server.v1_15_R1.Block)5