use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.
the class ToolPartGem method getModel.
@Override
public ModelResourceLocation getModel(ItemStack tool, ToolPartPosition pos, int frame) {
String name = ((IRegistryObject) tool.getItem()).getName();
name = SilentGems.RESOURCE_PREFIX + name + "/" + name;
String gemNum = tool.getItem() instanceof ItemGemBow ? "" : "" + gem.ordinal();
String frameNum = frame == 3 ? "_3" : "";
switch(pos) {
case HEAD:
name += gemNum + frameNum;
break;
case ROD_DECO:
name += "_deco";
break;
default:
return null;
}
if (modelMap.containsKey(name)) {
return modelMap.get(name);
}
name = name.toLowerCase();
ModelResourceLocation model = new ModelResourceLocation(name, "inventory");
modelMap.put(name, model);
return model;
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.
the class ToolPartRodGems method getModel.
@Override
public ModelResourceLocation getModel(ItemStack tool, ToolPartPosition pos, int frame) {
String name = ((IRegistryObject) tool.getItem()).getName();
name = SilentGems.RESOURCE_PREFIX + name.toLowerCase() + "/" + name + "_" + rodName;
if (modelMap.containsKey(name)) {
return modelMap.get(name);
}
name = name.toLowerCase();
ModelResourceLocation model = new ModelResourceLocation(name, "inventory");
modelMap.put(name, model);
return model;
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.
the class BlockGemSubtypes method getModels.
@Override
public void getModels(Map<Integer, ModelResourceLocation> models) {
for (int i = 0; i < 16; ++i) {
EnumGem gem = EnumGem.values()[i];
models.put(i, new ModelResourceLocation(getFullName().toLowerCase(), "gem=" + gem.getName()));
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.
the class ModBlockRenderers method register.
private static void register(Item item, int meta, String name, String variantData) {
ResourceLocation resName = new ResourceLocation(SilentGems.RESOURCE_PREFIX + name);
ModelBakery.registerItemVariants(item, resName);
ModelResourceLocation model = new ModelResourceLocation(resName, variantData);
ModelLoader.setCustomModelResourceLocation(item, meta, model);
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.
the class ItemEnchantmentToken method getModels.
@Override
public void getModels(Map<Integer, ModelResourceLocation> models) {
String fullName = getFullName().toLowerCase();
models.put(0, new ModelResourceLocation(fullName, "inventory"));
int i = 1;
for (String type : MODEL_TYPES) {
String name = fullName + "_" + type.toLowerCase();
models.put(i++, new ModelResourceLocation(name, "inventory"));
}
}
Aggregations