Search in sources :

Example 11 with IBlockData

use of net.minecraft.world.level.block.state.IBlockData in project dynmap by webbukkit.

the class BukkitVersionHelperSpigot118_2 method getBlockNames.

/**
 * Get block short name list
 */
@Override
public String[] getBlockNames() {
    RegistryBlockID<IBlockData> bsids = Block.o;
    Block baseb = null;
    Iterator<IBlockData> iter = bsids.iterator();
    ArrayList<String> names = new ArrayList<String>();
    while (iter.hasNext()) {
        IBlockData bs = iter.next();
        Block b = bs.b();
        // If this is new block vs last, it's the base block state
        if (b != baseb) {
            baseb = b;
            continue;
        }
        MinecraftKey id = RegistryBlocks.U.b(b);
        String bn = id.toString();
        if (bn != null) {
            names.add(bn);
            Log.info("block=" + bn);
        }
    }
    return names.toArray(new String[0]);
}
Also used : IBlockData(net.minecraft.world.level.block.state.IBlockData) ArrayList(java.util.ArrayList) Block(net.minecraft.world.level.block.Block) NBTTagString(net.minecraft.nbt.NBTTagString) MinecraftKey(net.minecraft.resources.MinecraftKey)

Aggregations

IBlockData (net.minecraft.world.level.block.state.IBlockData)11 Block (net.minecraft.world.level.block.Block)7 NBTTagString (net.minecraft.nbt.NBTTagString)6 BlockPosition (net.minecraft.core.BlockPosition)5 ArrayList (java.util.ArrayList)4 MinecraftKey (net.minecraft.resources.MinecraftKey)4 GsonBuilder (com.google.gson.GsonBuilder)3 HashMap (java.util.HashMap)3 IdentityHashMap (java.util.IdentityHashMap)3 WorldServer (net.minecraft.server.level.WorldServer)3 BlockFluids (net.minecraft.world.level.block.BlockFluids)3 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)3 DynmapBlockState (org.dynmap.renderer.DynmapBlockState)3 ComplexCollisionBox (cc.funkemunky.api.utils.world.types.ComplexCollisionBox)2 SimpleCollisionBox (cc.funkemunky.api.utils.world.types.SimpleCollisionBox)2 EntityPlayer (net.minecraft.server.level.EntityPlayer)2 ItemStack (net.minecraft.world.item.ItemStack)2 World (net.minecraft.world.level.World)2 AxisAlignedBB (net.minecraft.world.phys.AxisAlignedBB)2 VoxelShape (net.minecraft.world.phys.shapes.VoxelShape)2