use of org.bukkit.craftbukkit.v1_18_R1.block in project NoCheatPlus by NoCheatPlus.
the class BlockCacheCB2922 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_R1.Block block = net.minecraft.server.v1_7_R1.Block.e(id);
if (block == null)
return null;
// data 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() };
}
use of org.bukkit.craftbukkit.v1_18_R1.block in project Denizen-For-Bukkit by DenizenScript.
the class BlockHelperImpl method ringBell.
@Override
public void ringBell(Bell block) {
org.bukkit.block.data.type.Bell bellData = (org.bukkit.block.data.type.Bell) block.getBlockData();
Direction face = Direction.byName(bellData.getFacing().name());
Direction dir = Direction.NORTH;
switch(bellData.getAttachment()) {
case DOUBLE_WALL:
case SINGLE_WALL:
switch(face) {
case NORTH:
case SOUTH:
dir = Direction.EAST;
break;
}
break;
case FLOOR:
dir = face;
break;
}
CraftBlock craftBlock = (CraftBlock) block.getBlock();
((BellBlock) Blocks.BELL).attemptToRing(craftBlock.getCraftWorld().getHandle(), craftBlock.getPosition(), dir);
}
use of org.bukkit.craftbukkit.v1_18_R1.block in project Denizen-For-Bukkit by DenizenScript.
the class Handler method getBiomeAt.
@Override
public BiomeNMS getBiomeAt(Block block) {
// Based on CraftWorld source
ServerLevel level = ((CraftWorld) block.getWorld()).getHandle();
Biome biome = level.getNoiseBiome(block.getX() >> 2, block.getY() >> 2, block.getZ() >> 2);
ResourceLocation key = level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getKey(biome);
String keyText = key.getNamespace().equals("minecraft") ? key.getPath() : key.toString();
return new BiomeNMSImpl(level, keyText);
}
use of org.bukkit.craftbukkit.v1_18_R1.block in project MyPet by xXKeyleXx.
the class EntityConverterService method convertEnderman.
public void convertEnderman(Enderman enderman, TagCompound properties) {
if (enderman.getCarriedBlock() != null) {
ItemStack block = enderman.getCarriedMaterial().toItemStack(1);
properties.getCompoundData().put("Block", MyPetApi.getPlatformHelper().itemStackToCompund(block));
}
}
use of org.bukkit.craftbukkit.v1_18_R1.block in project Citizens2 by CitizensDev.
the class PlayerNavigation method r.
private int r() {
if ((!this.a.isInWater()) || (!g())) {
return (int) (this.a.getBoundingBox().b + 0.5D);
}
int i = (int) this.a.getBoundingBox().b;
Block localBlock = this.b.getType(new BlockPosition(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ))).getBlock();
int j = 0;
while ((localBlock == Blocks.FLOWING_WATER) || (localBlock == Blocks.WATER)) {
i++;
localBlock = this.b.getType(new BlockPosition(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ))).getBlock();
j++;
if (j > 16) {
return (int) this.a.getBoundingBox().b;
}
}
return i;
}
Aggregations