use of org.bukkit.craftbukkit.v1_17_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class CustomEntityHelperImpl method spawnItemProjectile.
@Override
public ItemProjectile spawnItemProjectile(Location location, ItemStack itemStack) {
CraftWorld world = (CraftWorld) location.getWorld();
EntityItemProjectileImpl entity = new EntityItemProjectileImpl(world.getHandle(), location, CraftItemStack.asNMSCopy(itemStack));
world.getHandle().addFreshEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM);
return entity.getBukkitEntity();
}
use of org.bukkit.craftbukkit.v1_17_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class CustomEntityHelperImpl method spawnFakeArrow.
@Override
public FakeArrow spawnFakeArrow(Location location) {
CraftWorld world = (CraftWorld) location.getWorld();
EntityFakeArrowImpl arrow = new EntityFakeArrowImpl(world, location);
return arrow.getBukkitEntity();
}
use of org.bukkit.craftbukkit.v1_17_R1.CraftWorld in project Denizen-For-Bukkit by DenizenScript.
the class WorldHelperImpl method setStatic.
@Override
public void setStatic(World world, boolean isStatic) {
ServerLevel worldServer = ((CraftWorld) world).getHandle();
ReflectionHelper.setFieldValue(net.minecraft.world.level.Level.class, ReflectionMappingsInfo.Level_isClientSide, worldServer, isStatic);
}
use of org.bukkit.craftbukkit.v1_17_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_17_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();
}
Aggregations