Search in sources :

Example 61 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));
    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 62 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));
    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_11_R1.EntityFallingBlock) CraftFallingBlock(org.bukkit.craftbukkit.v1_11_R1.entity.CraftFallingBlock) FallingBlock(org.bukkit.entity.FallingBlock) Block(net.minecraft.server.v1_11_R1.Block) WorldServer(net.minecraft.server.v1_11_R1.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld)

Example 63 with Block

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

the class PlayerNavigation method a.

private boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
    int i = paramInt1 - paramInt4 / 2;
    int j = paramInt3 - paramInt6 / 2;
    if (!b(i, paramInt2, j, paramInt4, paramInt5, paramInt6, paramVec3D, paramDouble1, paramDouble2)) {
        return false;
    }
    for (int k = i; k < i + paramInt4; k++) {
        for (int m = j; m < j + paramInt6; m++) {
            double d1 = k + 0.5D - paramVec3D.a;
            double d2 = m + 0.5D - paramVec3D.c;
            if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
                Block localBlock = this.c.getType(new BlockPosition(k, paramInt2 - 1, m)).getBlock();
                Material localMaterial = localBlock.getMaterial();
                if (localMaterial == Material.AIR) {
                    return false;
                }
                if ((localMaterial == Material.WATER) && (!this.b.V())) {
                    return false;
                }
                if (localMaterial == Material.LAVA) {
                    return false;
                }
            }
        }
    }
    return true;
}
Also used : BlockPosition(net.minecraft.server.v1_8_R3.BlockPosition) Block(net.minecraft.server.v1_8_R3.Block) Material(net.minecraft.server.v1_8_R3.Material) PathPoint(net.minecraft.server.v1_8_R3.PathPoint)

Example 64 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));
    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_8_R3.EntityFallingBlock) Block(net.minecraft.server.v1_8_R3.Block) FallingBlock(org.bukkit.entity.FallingBlock) WorldServer(net.minecraft.server.v1_8_R3.WorldServer) CraftWorld(org.bukkit.craftbukkit.v1_8_R3.CraftWorld)

Example 65 with Block

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

the class Upgrade0_11_0_1 method doTask.

@Override
protected void doTask() {
    Environments.iterator(GlobalState.BUFFER_DIRECTORY, GlobalState.DATABASE_DIRECTORY).forEachRemaining(environment -> {
        logInfoMessage("Upgrading Storage Format v2 data files to Storage Format v3 in environment {}", environment);
        Path directory = Paths.get(GlobalState.DATABASE_DIRECTORY).resolve(environment);
        Database db = new Database(directory);
        db.start();
        try {
            Path cpb = directory.resolve("cpb");
            Iterable<Block<Identifier, Text, Value>> blocks = StorageFormatV2.load(cpb, TableRevision.class);
            for (Block<Identifier, Text, Value> block : blocks) {
                for (Revision<Identifier, Text, Value> revision : block) {
                    Write write = Reflection.newInstance(Write.class, revision.getType(), revision.getKey(), revision.getValue(), revision.getLocator(), // (authorized)
                    revision.getVersion());
                    db.accept(write);
                }
                db.sync();
                logInfoMessage("Finished transferring v2 data Block {} to v3 Segment format", block.getId());
            }
        } finally {
            db.stop();
        }
    });
}
Also used : Path(java.nio.file.Path) Write(com.cinchapi.concourse.server.storage.temp.Write) Identifier(com.cinchapi.concourse.server.model.Identifier) Database(com.cinchapi.concourse.server.storage.db.Database) Value(com.cinchapi.concourse.server.model.Value) Block(com.cinchapi.concourse.server.storage.format.StorageFormatV2.Block) Text(com.cinchapi.concourse.server.model.Text)

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