Search in sources :

Example 1 with ItemJsonRenderer

use of com.builtbroken.mc.client.json.render.item.ItemJsonRenderer in project Engine by VoltzEngine-Project.

the class ClientProxy method postInit.

@Override
public void postInit() {
    super.postInit();
    //Item that uses a model for all states
    registerItemJsonRenders(new ItemJsonRenderer(), "VE-Item", "item", "tile", "block");
    List<IJsonGenObject> objects = JsonContentLoader.INSTANCE.generatedObjects.get(JsonBlockProcessor.KEY);
    if (objects != null && !objects.isEmpty()) {
        for (IJsonGenObject object : objects) {
            if (object instanceof BlockBase) {
                List<ITileEventListener> listeners = ((BlockBase) object).listeners.get("placement");
                if (listeners != null && !listeners.isEmpty()) {
                    for (ITileEventListener listener : listeners) {
                        if (listener instanceof RotatableListener) {
                            ((BlockBase) object).addListener(new RotatableIconListener((BlockBase) object));
                            break;
                        }
                    }
                }
            }
        }
    }
}
Also used : RotatableListener(com.builtbroken.mc.prefab.tile.listeners.RotatableListener) BlockBase(com.builtbroken.mc.framework.block.BlockBase) RotatableIconListener(com.builtbroken.mc.client.listeners.blocks.RotatableIconListener) IJsonGenObject(com.builtbroken.mc.lib.json.imp.IJsonGenObject) ITileEventListener(com.builtbroken.mc.api.tile.listeners.ITileEventListener) ItemJsonRenderer(com.builtbroken.mc.client.json.render.item.ItemJsonRenderer)

Aggregations

ITileEventListener (com.builtbroken.mc.api.tile.listeners.ITileEventListener)1 ItemJsonRenderer (com.builtbroken.mc.client.json.render.item.ItemJsonRenderer)1 RotatableIconListener (com.builtbroken.mc.client.listeners.blocks.RotatableIconListener)1 BlockBase (com.builtbroken.mc.framework.block.BlockBase)1 IJsonGenObject (com.builtbroken.mc.lib.json.imp.IJsonGenObject)1 RotatableListener (com.builtbroken.mc.prefab.tile.listeners.RotatableListener)1