Instant NBT Tags for items/blocks

Published by Hidan on
Issue description

I want to suggest Instant NBT Maker for Items and Blocks, the idea is to allow item to have Predefined NBT Tags during creation process than by making the procedure that will make NBT Tag for the current item, this will allow us to make default properties such as our own EMC system for items and blocks or energy storage

How this will gonna work?
While making an item, there will be a list box "Similar to the one that Biome setting window has for mobs"
their user will be able to Create/Edit/Delete NBT Tag along with adding default values to it
in practice it should look like this

"Energy" = 0
"MaxEnergy" = 200
"IsOn" = false

Issue comments

You define NBT tags when setting them in the procedures, there is no need to set them again there. For default item values, you could use on item crafted to set default NBT.

Yep but If I want to have like 200 items, each with different NBT values than it might cause lag due to checking and filtering them
also it might not work when I take it directly from Creative Inventory or command 

I will check what can be done, but I am not sure if there even is a way to set default tag values before using them.

Is this not the thing?

//This reads default storage Tags "NOTE: Tags need's to gave this exact names to work properly!"
    public void readFromNBT(NBTTagCompound compound)
    {
    	this.energy = compound.getInteger("Energy");
    	this.capacity = compound.getInteger("Capacity");
    	this.maxReceive = compound.getInteger("MaxReceive");
    	this.maxExtract = compound.getInteger("MaxExtract");
    }
    
    //This saves default storage Tags "NOTE: Tags need's to gave this exact names to work properly!"
    public void writeToNBT(NBTTagCompound compound)
    {
    	compound.setInteger("Energy", this.energy);
    	compound.setInteger("Capacity", this.capacity);
    	compound.setInteger("MaxReceive", this.maxReceive);
    	compound.setInteger("MaxExtract", this.maxExtract);
    }

 

Yes, but this does not set default values, it only handles loading and storing values. I will do some research and see what can be done.

FE system supports this, so I think this is the way to go.