Fix calls to deprecated model registry methods

This commit is contained in:
Nick 2016-01-10 14:34:01 -08:00
parent ebdc069563
commit 5e1a38b271
3 changed files with 14 additions and 17 deletions

View file

@ -6,6 +6,7 @@ import lombok.Getter;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -31,11 +32,11 @@ public class OrbRegistry
}
@SideOnly(Side.CLIENT)
public static void registerOrbTexture(BloodOrb orb, String resourceLocation)
public static void registerOrbTexture(BloodOrb orb, ResourceLocation resourceLocation)
{
int meta = getIndexOf(orb);
ModelBakery.addVariantName(BloodMagicAPI.getItem(BloodMagicAPI.ORB), resourceLocation);
ModelBakery.registerItemVariants(BloodMagicAPI.getItem(BloodMagicAPI.ORB), resourceLocation);
ModelLoader.setCustomModelResourceLocation(BloodMagicAPI.getItem(BloodMagicAPI.ORB), meta, new ModelResourceLocation(resourceLocation, "inventory"));
}

View file

@ -1,6 +1,7 @@
package WayofTime.bloodmagic.registry;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import WayofTime.bloodmagic.BloodMagic;
@ -221,12 +222,12 @@ public class ModItems
InventoryRenderHelper renderHelper = BloodMagic.proxy.getRenderHelper();
renderHelper.itemRenderAll(bloodOrb);
OrbRegistry.registerOrbTexture(orbWeak, Constants.Mod.DOMAIN + "ItemBloodOrbWeak");
OrbRegistry.registerOrbTexture(orbApprentice, Constants.Mod.DOMAIN + "ItemBloodOrbApprentice");
OrbRegistry.registerOrbTexture(orbMagician, Constants.Mod.DOMAIN + "ItemBloodOrbMagician");
OrbRegistry.registerOrbTexture(orbMaster, Constants.Mod.DOMAIN + "ItemBloodOrbMaster");
OrbRegistry.registerOrbTexture(orbArchmage, Constants.Mod.DOMAIN + "ItemBloodOrbArchmage");
OrbRegistry.registerOrbTexture(orbTranscendent, Constants.Mod.DOMAIN + "ItemBloodOrbTranscendent");
OrbRegistry.registerOrbTexture(orbWeak, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbWeak"));
OrbRegistry.registerOrbTexture(orbApprentice, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbApprentice"));
OrbRegistry.registerOrbTexture(orbMagician, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbMagician"));
OrbRegistry.registerOrbTexture(orbMaster, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbMaster"));
OrbRegistry.registerOrbTexture(orbArchmage, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbArchmage"));
OrbRegistry.registerOrbTexture(orbTranscendent, new ResourceLocation(Constants.Mod.DOMAIN + "ItemBloodOrbTranscendent"));
renderHelper.itemRender(bucketEssence);

View file

@ -10,6 +10,7 @@ import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
/**
@ -49,9 +50,9 @@ public class InventoryRenderHelper
*/
public void itemRender(Item item, int meta, String name)
{
String resName = domain + name;
ResourceLocation resName = new ResourceLocation(domain + name);
ModelBakery.addVariantName(item, resName);
ModelBakery.registerItemVariants(item, resName);
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(resName, "inventory"));
}
@ -105,18 +106,12 @@ public class InventoryRenderHelper
});
}
public void itemRenderToggle(Item item, String name)
{
itemRender(item, 0, name + "_deactivated");
itemRender(item, 1, name + "_activated");
}
public void fluidRender(Block block)
{
final Block toRender = block;
ModelBakery.addVariantName(InventoryRenderHelper.getItemFromBlock(block));
ModelBakery.registerItemVariants(InventoryRenderHelper.getItemFromBlock(block));
ModelLoader.setCustomMeshDefinition(InventoryRenderHelper.getItemFromBlock(block), new ItemMeshDefinition()
{
@Override