Search in sources :

Example 36 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 37 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 38 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 39 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)

Example 40 with CraftWorld

use of org.bukkit.craftbukkit.v1_16_R3.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));
}
Also used : FakeBlock(com.denizenscript.denizen.utilities.blocks.FakeBlock) Block(net.minecraft.world.level.block.Block) BlockPos(net.minecraft.core.BlockPos) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Aggregations

ServerLevel (net.minecraft.server.level.ServerLevel)118 Location (org.bukkit.Location)92 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)90 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)71 BlockPos (net.minecraft.core.BlockPos)60 CraftWorld (org.bukkit.craftbukkit.v1_18_R2.CraftWorld)56 LivingEntity (org.bukkit.entity.LivingEntity)51 ItemStack (org.bukkit.inventory.ItemStack)46 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)40 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)39 CraftWorld (org.bukkit.craftbukkit.v1_8_R3.CraftWorld)37 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)35 CraftWorld (org.bukkit.craftbukkit.v1_11_R1.CraftWorld)33 Zombie (org.bukkit.entity.Zombie)32 ItemEntity (net.minecraft.world.entity.item.ItemEntity)29 FallingBlockEntity (net.minecraft.world.entity.item.FallingBlockEntity)26 GameProfile (com.mojang.authlib.GameProfile)25 HangingEntity (net.minecraft.world.entity.decoration.HangingEntity)25 FireworkRocketEntity (net.minecraft.world.entity.projectile.FireworkRocketEntity)25 Level (net.minecraft.world.level.Level)25