Fixes subitem rendering

This commit is contained in:
modmuss50 2016-03-14 13:28:33 +00:00
parent 72b16c2306
commit 54c7827bb2
16 changed files with 119 additions and 8 deletions

View file

@ -2,9 +2,15 @@ package techreborn.itemblocks;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.lib.ModInfo;
/**
* Created by modmuss50 on 20/02/2016.
@ -27,4 +33,10 @@ public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem {
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -12,7 +12,7 @@ import reborncore.RebornCore;
import techreborn.api.ScrapboxList;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemScrapBox extends ItemTR implements ITexturedItem{
public class ItemScrapBox extends ItemTextureBase implements ITexturedItem{
public ItemScrapBox() {
setUnlocalizedName("techreborn.scrapbox");

View file

@ -1,11 +1,15 @@
package techreborn.items;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.lib.ModInfo;
public abstract class ItemTextureBase extends ItemTR implements ITexturedItem {
// @Override
// public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
// return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
// }
@Override
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,7 +3,7 @@ package techreborn.items;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemUUmatter extends ItemTR implements ITexturedItem {
public class ItemUUmatter extends ItemTextureBase implements ITexturedItem {
public ItemUUmatter() {
setCreativeTab(TechRebornCreativeTabMisc.instance);

View file

@ -2,8 +2,10 @@ package techreborn.items.armor;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
@ -15,6 +17,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo;
import java.util.List;
@ -98,4 +101,10 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, ITex
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -1,8 +1,10 @@
package techreborn.items.armor;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
@ -14,6 +16,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo;
import java.util.List;
@ -98,4 +101,10 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, IT
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,6 +3,7 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -24,6 +25,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.utils.OreDictUtils;
import java.util.List;
@ -148,4 +150,10 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,6 +3,7 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -24,6 +25,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import java.util.List;
import java.util.Random;
@ -142,4 +144,10 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -1,13 +1,17 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.items.ItemTR;
import techreborn.lib.ModInfo;
public class ItemHammer extends ItemTR implements ITexturedItem {
private String iconName;
@ -54,5 +58,9 @@ public class ItemHammer extends ItemTR implements ITexturedItem {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,6 +3,7 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -23,6 +24,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.utils.OreDictUtils;
import java.util.List;
@ -149,4 +151,10 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -1,6 +1,7 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -18,6 +19,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.ItemNBTHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import java.util.List;
@ -157,4 +159,10 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur
public int getMaxMeta() {
return 2;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,6 +3,7 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -24,6 +25,7 @@ import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.TorchHelper;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo;
import java.util.List;
@ -156,4 +158,10 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, ITextu
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -3,6 +3,7 @@ package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
@ -19,6 +20,7 @@ import reborncore.common.powerSystem.PoweredItem;
import reborncore.common.util.Color;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo;
import java.util.List;
@ -146,4 +148,10 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITex
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -11,8 +11,9 @@ import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.client.TechRebornCreativeTab;
import techreborn.items.ItemTR;
import techreborn.items.ItemTextureBase;
public class ItemTechManual extends ItemTR implements ITexturedItem {
public class ItemTechManual extends ItemTextureBase implements ITexturedItem {
public ItemTechManual() {
setCreativeTab(TechRebornCreativeTab.instance);

View file

@ -1,12 +1,16 @@
package techreborn.items.tools;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class ItemTreeTap extends Item implements ITexturedItem {
@ -35,4 +39,10 @@ public class ItemTreeTap extends Item implements ITexturedItem {
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}

View file

@ -4,6 +4,7 @@ import ic2.api.tile.IWrenchable;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.block.BlockDynamicLiquid;
import net.minecraft.block.BlockStaticLiquid;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -18,8 +19,11 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.items.ItemTR;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.List;
@ -116,4 +120,10 @@ public class ItemWrench extends ItemTR implements ITexturedItem {
public int getMaxMeta() {
return 1;
}
@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory");
}
}