I tried to fix item rendering issues, but failed.
This commit is contained in:
parent
e0edff6891
commit
c0fc388a01
2 changed files with 6 additions and 1 deletions
|
@ -35,6 +35,7 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.blocks.generator.solarpanel.EnumPanelType;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
|
@ -175,6 +176,10 @@ public class RegisterItemJsons {
|
|||
registerBlockstateMultiItem(Item.getItemFromBlock(ModBlocks.CABLE), cableType.ordinal(), cableType.getName().toLowerCase(), "cable_inv");
|
||||
}
|
||||
|
||||
for (EnumPanelType panelType : EnumPanelType.values()) {
|
||||
registerBlockstate(Item.getItemFromBlock(ModBlocks.CABLE), panelType.ordinal(), panelType.getName().toLowerCase() + ",active=false", "blocks/generators/");
|
||||
}
|
||||
|
||||
ModelLoader.setCustomStateMapper(ModBlocks.CABLE, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
|
|
|
@ -128,13 +128,13 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
|
|||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
if(tag.hasKey("panelType")){
|
||||
panel = EnumPanelType.values()[tag.getInteger("panelType")];
|
||||
} else {
|
||||
Core.logHelper.warn("A solar panel has failed to load from NBT, it will not work correctly. Please break and replace it to fix the issue. BlockPos:" + pos.toString());
|
||||
panel = EnumPanelType.Basic;
|
||||
}
|
||||
super.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue