use of org.bukkit.craftbukkit.v1_18_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelperImpl method setTrackingRange.
@Override
public void setTrackingRange(Entity entity, int range) {
try {
ChunkMap map = ((CraftWorld) entity.getWorld()).getHandle().getChunkProvider().chunkMap;
ChunkMap.TrackedEntity entry = map.G.get(entity.getEntityId());
TRACKING_RANGE_SETTER.invoke(entry, range);
} catch (Throwable ex) {
Debug.echoError(ex);
}
}
use of org.bukkit.craftbukkit.v1_18_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class FishingHelperImpl method spawnHook.
@Override
public FishHook spawnHook(Location location, Player player) {
ServerLevel nmsWorld = ((CraftWorld) location.getWorld()).getHandle();
FishingHook hook = new FishingHook(((CraftPlayer) player).getHandle(), nmsWorld, 0, 0);
nmsWorld.addEntity(hook, CreatureSpawnEvent.SpawnReason.CUSTOM);
return (FishHook) hook.getBukkitEntity();
}
use of org.bukkit.craftbukkit.v1_18_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelperImpl method showBlockAction.
@Override
public void showBlockAction(Player player, Location location, int action, int state) {
BlockPos position = new BlockPos(location.getX(), location.getY(), location.getZ());
Block block = ((CraftWorld) location.getWorld()).getHandle().getBlockState(position).getBlock();
send(player, new ClientboundBlockEventPacket(position, block, action, state));
}
use of org.bukkit.craftbukkit.v1_18_R1.CraftWorld 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.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class EntityHelperImpl method getMobSpawnerDisplayEntity.
@Override
public EntityTag getMobSpawnerDisplayEntity(CreatureSpawner spawner) {
SpawnerBlockEntity nmsSpawner = BlockHelperImpl.getTE((CraftCreatureSpawner) spawner);
net.minecraft.world.entity.Entity nmsEntity = nmsSpawner.getSpawner().getOrCreateDisplayEntity(((CraftWorld) spawner.getWorld()).getHandle());
return new EntityTag(nmsEntity.getBukkitEntity());
}
Aggregations