Right now it is crashing at getModelForState(state) it gives me a null pointer exception. Had thought it was due to the BlockRendererDispatcher(null, new BlockColors()) having the null value. But, not sure how to give it the desired object of BlockModelShapes.
public boolean setSelected(ItemStack stack) {
if (stacks.contains(stack)) {
String display;
Block block = Block.getBlockFromItem(stack.getItem());
//ResourceLocation reg = block.getRegistryName();
//ResourceLocation location = new ResourceLocation(reg.toString());
BlockRendererDispatcher ren = new BlockRendererDispatcher(null, new BlockColors());
IBlockState state = block.getBlockState().getBaseState();
display = ren.getModelForState(state).toString();
//.getQuads(null, null, 0).get(0).getSprite()
//String asset = "assets/" + location.getResourceDomain() + "/" + "models/" + location.getResourcePath() + ".json"+"\n";
caption = display;
this.selected = stack;
raiseEvent(new GuiControlChangedEvent(this));
return true;
}
return false;
}