Search in sources :

Example 86 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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();
}
Also used : EntityItemProjectileImpl(com.denizenscript.denizen.nms.v1_18.impl.entities.EntityItemProjectileImpl) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld)

Example 87 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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();
}
Also used : EntityFakeArrowImpl(com.denizenscript.denizen.nms.v1_18.impl.entities.EntityFakeArrowImpl) CraftWorld(org.bukkit.craftbukkit.v1_18_R1.CraftWorld)

Example 88 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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);
}
Also used : ServerLevel(net.minecraft.server.level.ServerLevel) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Example 89 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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);
    }
}
Also used : ChunkMap(net.minecraft.server.level.ChunkMap) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Example 90 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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();
}
Also used : ServerLevel(net.minecraft.server.level.ServerLevel) FishHook(org.bukkit.entity.FishHook) CraftFishHook(org.bukkit.craftbukkit.v1_17_R1.entity.CraftFishHook) FishingHook(net.minecraft.world.entity.projectile.FishingHook) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Aggregations

Location (org.bukkit.Location)55 Zombie (org.bukkit.entity.Zombie)32 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)28 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)28 ItemStack (org.bukkit.inventory.ItemStack)27 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)23 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)22 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)20 ServerLevel (net.minecraft.server.level.ServerLevel)18 CraftWorld (org.bukkit.craftbukkit.v1_9_R1.CraftWorld)17 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)16 GameProfile (com.mojang.authlib.GameProfile)11 UUID (java.util.UUID)11 Scoreboard (org.bukkit.scoreboard.Scoreboard)11 Team (org.bukkit.scoreboard.Team)11 CraftWorld (org.bukkit.craftbukkit.v1_9_R2.CraftWorld)8 BabyZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.BabyZombie)8 FastZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.FastZombie)8 HardZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.HardZombie)8 TankerZombie (pl.plajer.villagedefense3.creatures.v1_9_R1.TankerZombie)8