Search in sources :

Example 61 with CraftWorld

use of org.bukkit.craftbukkit.v1_7_R3.CraftWorld in project acidisland by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_8_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_8_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_8_R1.Block.getByCombinedId(combined);
    chunk.a(bp, ibd);
    if (applyPhysics) {
        net.minecraft.server.v1_8_R1.Block block = chunk.getType(bp);
        w.update(bp, block);
    }
}
Also used : IBlockData(net.minecraft.server.v1_8_R1.IBlockData) BlockPosition(net.minecraft.server.v1_8_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_8_R1.CraftWorld)

Example 62 with CraftWorld

use of org.bukkit.craftbukkit.v1_7_R3.CraftWorld in project acidisland by tastybento.

the class NMSHandler method setBlockSuperFast.

@Override
public void setBlockSuperFast(Block b, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_9_R1.World w = ((CraftWorld) b.getWorld()).getHandle();
    net.minecraft.server.v1_9_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_9_R1.Block.getByCombinedId(combined);
    if (applyPhysics) {
        w.setTypeAndData(bp, ibd, 3);
    } else {
        w.setTypeAndData(bp, ibd, 2);
    }
    chunk.a(bp, ibd);
}
Also used : IBlockData(net.minecraft.server.v1_9_R1.IBlockData) BlockPosition(net.minecraft.server.v1_9_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_9_R1.CraftWorld)

Aggregations

Location (org.bukkit.Location)13 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)10 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)9 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)9 CraftWorld (org.bukkit.craftbukkit.v1_9_R2.CraftWorld)9 CraftWorld (org.bukkit.craftbukkit.v1_7_R4.CraftWorld)5 CraftWorld (org.bukkit.craftbukkit.v1_8_R1.CraftWorld)5 CraftWorld (org.bukkit.craftbukkit.v1_8_R2.CraftWorld)5 GameProfile (com.mojang.authlib.GameProfile)4 Property (com.mojang.authlib.properties.Property)4 BigInteger (java.math.BigInteger)4 MessageDigest (java.security.MessageDigest)4 UUID (java.util.UUID)4 PlayerProfile (net.aufdemrand.denizen.nms.util.PlayerProfile)4 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)4 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)3 Scoreboard (org.bukkit.scoreboard.Scoreboard)3 Team (org.bukkit.scoreboard.Team)3 Field (java.lang.reflect.Field)2 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)2