Search in sources :

Example 31 with Block

use of com.google.cloud.vision.v1p3beta1.Block in project Citizens2 by CitizensDev.

the class PlayerPathfinderNormal method getPathTypeBase.

public PathType getPathTypeBase(IBlockAccess paramIBlockAccess, int paramInt1, int paramInt2, int paramInt3) {
    BlockPosition localBlockPosition = new BlockPosition(paramInt1, paramInt2, paramInt3);
    IBlockData localIBlockData = paramIBlockAccess.getType(localBlockPosition);
    Block localBlock1 = localIBlockData.getBlock();
    Material localMaterial = localIBlockData.getMaterial();
    PathType localPathType1 = PathType.BLOCKED;
    if ((localBlock1 == Blocks.TRAPDOOR) || (localBlock1 == Blocks.IRON_TRAPDOOR) || (localBlock1 == Blocks.WATERLILY)) {
        return PathType.TRAPDOOR;
    }
    if (localBlock1 == Blocks.FIRE) {
        return PathType.DAMAGE_FIRE;
    }
    if (localBlock1 == Blocks.CACTUS) {
        return PathType.DAMAGE_CACTUS;
    }
    if (((localBlock1 instanceof BlockDoor)) && (localMaterial == Material.WOOD) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_WOOD_CLOSED;
    }
    if (((localBlock1 instanceof BlockDoor)) && (localMaterial == Material.ORE) && (!localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_IRON_CLOSED;
    }
    if (((localBlock1 instanceof BlockDoor)) && (localIBlockData.get(BlockDoor.OPEN).booleanValue())) {
        return PathType.DOOR_OPEN;
    }
    if ((localBlock1 instanceof BlockMinecartTrackAbstract)) {
        return PathType.RAIL;
    }
    if (((localBlock1 instanceof BlockFence)) || ((localBlock1 instanceof BlockCobbleWall)) || (((localBlock1 instanceof BlockFenceGate)) && (!localIBlockData.get(BlockFenceGate.OPEN).booleanValue()))) {
        return PathType.FENCE;
    }
    if (localMaterial == Material.AIR) {
        localPathType1 = PathType.OPEN;
    } else {
        if (localMaterial == Material.WATER) {
            return PathType.WATER;
        }
        if (localMaterial == Material.LAVA) {
            return PathType.LAVA;
        }
    }
    if ((localBlock1.b(paramIBlockAccess, localBlockPosition)) && (localPathType1 == PathType.BLOCKED)) {
        localPathType1 = PathType.OPEN;
    }
    return localPathType1;
}
Also used : BlockDoor(net.minecraft.server.v1_10_R1.BlockDoor) PathType(net.minecraft.server.v1_10_R1.PathType) IBlockData(net.minecraft.server.v1_10_R1.IBlockData) BlockFenceGate(net.minecraft.server.v1_10_R1.BlockFenceGate) BlockCobbleWall(net.minecraft.server.v1_10_R1.BlockCobbleWall) MutableBlockPosition(net.minecraft.server.v1_10_R1.BlockPosition.MutableBlockPosition) BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition) Block(net.minecraft.server.v1_10_R1.Block) Material(net.minecraft.server.v1_10_R1.Material) BlockMinecartTrackAbstract(net.minecraft.server.v1_10_R1.BlockMinecartTrackAbstract) BlockFence(net.minecraft.server.v1_10_R1.BlockFence)

Example 32 with Block

use of com.google.cloud.vision.v1p3beta1.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 : EntityFallingBlock(net.minecraft.server.v1_10_R1.EntityFallingBlock) Block(net.minecraft.server.v1_10_R1.Block) FallingBlock(org.bukkit.entity.FallingBlock) WorldServer(net.minecraft.server.v1_10_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_10_R1.CraftWorld)

Example 33 with Block

use of com.google.cloud.vision.v1p3beta1.Block in project Citizens2 by CitizensDev.

the class PlayerNavigation method u.

private int u() {
    if (!this.a.isInWater() || !r())
        return MathHelper.floor(this.a.locY() + 0.5D);
    int var0 = MathHelper.floor(this.a.locY());
    Block var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
    int var2 = 0;
    while (var1 == Blocks.WATER) {
        var0++;
        var1 = this.b.getType(new BlockPosition(this.a.locX(), var0, this.a.locZ())).getBlock();
        if (++var2 > 16)
            return MathHelper.floor(this.a.locY());
    }
    return var0;
}
Also used : BlockPosition(net.minecraft.server.v1_16_R3.BlockPosition) BaseBlockPosition(net.minecraft.server.v1_16_R3.BaseBlockPosition) Block(net.minecraft.server.v1_16_R3.Block) PathPoint(net.minecraft.server.v1_16_R3.PathPoint)

Example 34 with Block

use of com.google.cloud.vision.v1p3beta1.Block in project Citizens2 by CitizensDev.

the class PlayerPathfinderNormal method b.

protected static PathType b(IBlockAccess var0, BlockPosition var1) {
    IBlockData var2 = var0.getType(var1);
    Block var3 = var2.getBlock();
    Material var4 = var2.getMaterial();
    if (var2.isAir())
        return PathType.OPEN;
    if (var2.a(TagsBlock.TRAPDOORS) || var2.a(Blocks.LILY_PAD))
        return PathType.TRAPDOOR;
    if (var2.a(Blocks.CACTUS))
        return PathType.DAMAGE_CACTUS;
    if (var2.a(Blocks.SWEET_BERRY_BUSH))
        return PathType.DAMAGE_OTHER;
    if (var2.a(Blocks.HONEY_BLOCK))
        return PathType.STICKY_HONEY;
    if (var2.a(Blocks.COCOA))
        return PathType.COCOA;
    Fluid var5 = var0.getFluid(var1);
    if (var5.a(TagsFluid.WATER))
        return PathType.WATER;
    if (var5.a(TagsFluid.LAVA))
        return PathType.LAVA;
    if (a(var2))
        return PathType.DAMAGE_FIRE;
    if (BlockDoor.l(var2) && !var2.get(BlockDoor.OPEN).booleanValue())
        return PathType.DOOR_WOOD_CLOSED;
    if (var3 instanceof BlockDoor && var4 == Material.ORE && !var2.get(BlockDoor.OPEN).booleanValue())
        return PathType.DOOR_IRON_CLOSED;
    if (var3 instanceof BlockDoor && var2.get(BlockDoor.OPEN).booleanValue())
        return PathType.DOOR_OPEN;
    if (var3 instanceof BlockMinecartTrackAbstract)
        return PathType.RAIL;
    if (var3 instanceof BlockLeaves)
        return PathType.LEAVES;
    if (var3.a(TagsBlock.FENCES) || var3.a(TagsBlock.WALLS) || (var3 instanceof BlockFenceGate && !var2.get(BlockFenceGate.OPEN).booleanValue()))
        return PathType.FENCE;
    if (!var2.a(var0, var1, PathMode.LAND))
        return PathType.BLOCKED;
    return PathType.OPEN;
}
Also used : BlockDoor(net.minecraft.server.v1_16_R3.BlockDoor) IBlockData(net.minecraft.server.v1_16_R3.IBlockData) BlockLeaves(net.minecraft.server.v1_16_R3.BlockLeaves) BlockFenceGate(net.minecraft.server.v1_16_R3.BlockFenceGate) Fluid(net.minecraft.server.v1_16_R3.Fluid) TagsFluid(net.minecraft.server.v1_16_R3.TagsFluid) Block(net.minecraft.server.v1_16_R3.Block) TagsBlock(net.minecraft.server.v1_16_R3.TagsBlock) Material(net.minecraft.server.v1_16_R3.Material) BlockMinecartTrackAbstract(net.minecraft.server.v1_16_R3.BlockMinecartTrackAbstract)

Example 35 with Block

use of com.google.cloud.vision.v1p3beta1.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 : Block(net.minecraft.server.v1_16_R3.Block) CraftFallingBlock(org.bukkit.craftbukkit.v1_16_R3.entity.CraftFallingBlock) EntityFallingBlock(net.minecraft.server.v1_16_R3.EntityFallingBlock) FallingBlock(org.bukkit.entity.FallingBlock) WorldServer(net.minecraft.server.v1_16_R3.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_16_R3.CraftWorld)

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