Search in sources :

Example 6 with CraftChunk

use of org.bukkit.craftbukkit.v1_7_R4.CraftChunk in project InteractionVisualizer by LOOHP.

the class V1_13 method getTileEntities.

@Override
public NMSTileEntitySet<?, ?> getTileEntities(ChunkPosition chunk, boolean load) {
    if (!chunk.isLoaded() && !load) {
        return null;
    }
    World world = chunk.getWorld();
    return new NMSTileEntitySet<net.minecraft.server.v1_13_R1.BlockPosition, net.minecraft.server.v1_13_R1.TileEntity>(((CraftChunk) chunk.getChunk()).getHandle().tileEntities, entry -> {
        net.minecraft.server.v1_13_R1.BlockPosition pos = entry.getKey();
        Material type = CraftMagicNumbers.getMaterial(entry.getValue().getBlock().getBlock());
        TileEntityType tileEntityType = TileEntity.getTileEntityType(type);
        if (tileEntityType != null) {
            return new TileEntity(world, pos.getX(), pos.getY(), pos.getZ(), tileEntityType);
        } else {
            return null;
        }
    });
}
Also used : TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) Material(org.bukkit.Material) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) CraftWorld(org.bukkit.craftbukkit.v1_13_R1.CraftWorld) World(org.bukkit.World) CraftChunk(org.bukkit.craftbukkit.v1_13_R1.CraftChunk)

Example 7 with CraftChunk

use of org.bukkit.craftbukkit.v1_7_R4.CraftChunk in project InteractionVisualizer by LOOHP.

the class V1_14 method getTileEntities.

@Override
public NMSTileEntitySet<?, ?> getTileEntities(ChunkPosition chunk, boolean load) {
    if (!chunk.isLoaded() && !load) {
        return null;
    }
    World world = chunk.getWorld();
    return new NMSTileEntitySet<net.minecraft.server.v1_14_R1.BlockPosition, net.minecraft.server.v1_14_R1.TileEntity>(((CraftChunk) chunk.getChunk()).getHandle().tileEntities, entry -> {
        net.minecraft.server.v1_14_R1.BlockPosition pos = entry.getKey();
        Material type = CraftMagicNumbers.getMaterial(entry.getValue().getBlock().getBlock());
        TileEntityType tileEntityType = TileEntity.getTileEntityType(type);
        if (tileEntityType != null) {
            return new TileEntity(world, pos.getX(), pos.getY(), pos.getZ(), tileEntityType);
        } else {
            return null;
        }
    });
}
Also used : TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) Material(org.bukkit.Material) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) CraftWorld(org.bukkit.craftbukkit.v1_14_R1.CraftWorld) World(org.bukkit.World) CraftChunk(org.bukkit.craftbukkit.v1_14_R1.CraftChunk)

Example 8 with CraftChunk

use of org.bukkit.craftbukkit.v1_7_R4.CraftChunk in project InteractionVisualizer by LOOHP.

the class V1_15 method getTileEntities.

@Override
public NMSTileEntitySet<?, ?> getTileEntities(ChunkPosition chunk, boolean load) {
    if (!chunk.isLoaded() && !load) {
        return null;
    }
    World world = chunk.getWorld();
    return new NMSTileEntitySet<net.minecraft.server.v1_15_R1.BlockPosition, net.minecraft.server.v1_15_R1.TileEntity>(((CraftChunk) chunk.getChunk()).getHandle().tileEntities, entry -> {
        net.minecraft.server.v1_15_R1.BlockPosition pos = entry.getKey();
        Material type = CraftMagicNumbers.getMaterial(entry.getValue().getBlock().getBlock());
        TileEntityType tileEntityType = TileEntity.getTileEntityType(type);
        if (tileEntityType != null) {
            return new TileEntity(world, pos.getX(), pos.getY(), pos.getZ(), tileEntityType);
        } else {
            return null;
        }
    });
}
Also used : TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) Material(org.bukkit.Material) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) World(org.bukkit.World) CraftWorld(org.bukkit.craftbukkit.v1_15_R1.CraftWorld) CraftChunk(org.bukkit.craftbukkit.v1_15_R1.CraftChunk)

Example 9 with CraftChunk

use of org.bukkit.craftbukkit.v1_7_R4.CraftChunk in project InteractionVisualizer by LOOHP.

the class V1_16 method getTileEntities.

@Override
public NMSTileEntitySet<?, ?> getTileEntities(ChunkPosition chunk, boolean load) {
    if (!chunk.isLoaded() && !load) {
        return null;
    }
    World world = chunk.getWorld();
    return new NMSTileEntitySet<net.minecraft.server.v1_16_R1.BlockPosition, net.minecraft.server.v1_16_R1.TileEntity>(((CraftChunk) chunk.getChunk()).getHandle().tileEntities, entry -> {
        net.minecraft.server.v1_16_R1.BlockPosition pos = entry.getKey();
        Material type = CraftMagicNumbers.getMaterial(entry.getValue().getBlock().getBlock());
        TileEntityType tileEntityType = TileEntity.getTileEntityType(type);
        if (tileEntityType != null) {
            return new TileEntity(world, pos.getX(), pos.getY(), pos.getZ(), tileEntityType);
        } else {
            return null;
        }
    });
}
Also used : TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) Material(org.bukkit.Material) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) CraftWorld(org.bukkit.craftbukkit.v1_16_R1.CraftWorld) World(org.bukkit.World) CraftChunk(org.bukkit.craftbukkit.v1_16_R1.CraftChunk)

Example 10 with CraftChunk

use of org.bukkit.craftbukkit.v1_7_R4.CraftChunk in project InteractionVisualizer by LOOHP.

the class V1_16_2 method getTileEntities.

@Override
public NMSTileEntitySet<?, ?> getTileEntities(ChunkPosition chunk, boolean load) {
    if (!chunk.isLoaded() && !load) {
        return null;
    }
    World world = chunk.getWorld();
    return new NMSTileEntitySet<net.minecraft.server.v1_16_R2.BlockPosition, net.minecraft.server.v1_16_R2.TileEntity>(((CraftChunk) chunk.getChunk()).getHandle().tileEntities, entry -> {
        net.minecraft.server.v1_16_R2.BlockPosition pos = entry.getKey();
        Material type = CraftMagicNumbers.getMaterial(entry.getValue().getBlock().getBlock());
        TileEntityType tileEntityType = TileEntity.getTileEntityType(type);
        if (tileEntityType != null) {
            return new TileEntity(world, pos.getX(), pos.getY(), pos.getZ(), tileEntityType);
        } else {
            return null;
        }
    });
}
Also used : TileEntity(com.loohp.interactionvisualizer.objectholders.TileEntity) TileEntityType(com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType) Material(org.bukkit.Material) NMSTileEntitySet(com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet) World(org.bukkit.World) CraftWorld(org.bukkit.craftbukkit.v1_16_R2.CraftWorld) CraftChunk(org.bukkit.craftbukkit.v1_16_R2.CraftChunk)

Aggregations

LevelChunk (net.minecraft.world.level.chunk.LevelChunk)15 Material (org.bukkit.Material)14 World (org.bukkit.World)12 NMSTileEntitySet (com.loohp.interactionvisualizer.objectholders.NMSTileEntitySet)11 TileEntity (com.loohp.interactionvisualizer.objectholders.TileEntity)11 TileEntityType (com.loohp.interactionvisualizer.objectholders.TileEntity.TileEntityType)11 Location (org.bukkit.Location)11 BlockPos (net.minecraft.core.BlockPos)10 ArrayList (java.util.ArrayList)9 List (java.util.List)9 CraftChunk (org.bukkit.craftbukkit.v1_17_R1.CraftChunk)9 CraftChunk (org.bukkit.craftbukkit.v1_18_R2.CraftChunk)9 WildLoadersPlugin (com.bgsoftware.wildloaders.WildLoadersPlugin)8 Hologram (com.bgsoftware.wildloaders.api.holograms.Hologram)8 ChunkLoader (com.bgsoftware.wildloaders.api.loaders.ChunkLoader)8 ChunkLoaderNPC (com.bgsoftware.wildloaders.api.npc.ChunkLoaderNPC)8 ITileEntityChunkLoader (com.bgsoftware.wildloaders.loaders.ITileEntityChunkLoader)8 WChunkLoader (com.bgsoftware.wildloaders.loaders.WChunkLoader)8 Collection (java.util.Collection)8 Collections (java.util.Collections)8