use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project ForestryMC by ForestryMC.
the class ItemBackpack method registerModel.
@SideOnly(Side.CLIENT)
@Override
public void registerModel(Item item, IModelManager manager) {
EnumBackpackType t = type == EnumBackpackType.NATURALIST ? EnumBackpackType.NORMAL : type;
String typeTag = "backpacks/" + t.toString().toLowerCase(Locale.ENGLISH);
models = new ModelResourceLocation[4];
models[0] = new ModelResourceLocation("forestry:" + typeTag + "_neutral", "inventory");
models[1] = new ModelResourceLocation("forestry:" + typeTag + "_locked", "inventory");
models[2] = new ModelResourceLocation("forestry:" + typeTag + "_receive", "inventory");
models[3] = new ModelResourceLocation("forestry:" + typeTag + "_resupply", "inventory");
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_neutral"));
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_locked"));
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_receive"));
ModelBakery.registerItemVariants(item, new ResourceLocation("forestry:" + typeTag + "_resupply"));
manager.registerItemModel(item, new BackpackMeshDefinition());
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project ForestryMC by ForestryMC.
the class ItemCrated method registerModel.
@SideOnly(Side.CLIENT)
@Override
public void registerModel(Item item, IModelManager manager) {
if (contained.isEmpty()) {
manager.registerItemModel(item, 0);
manager.registerItemModel(item, 1, "crate-filled");
} else {
ModelResourceLocation modelLocation = new ModelResourceLocation("forestry:crate-filled", "crate-filled");
ModelLoader.setCustomModelResourceLocation(item, 0, modelLocation);
ModelBakery.registerItemVariants(item, modelLocation);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project ForestryMC by ForestryMC.
the class ProxyRenderClient method registerFluidStateMapper.
@Override
public void registerFluidStateMapper(Block block, Fluids fluid) {
final ModelResourceLocation fluidLocation = new ModelResourceLocation("forestry:blockforestryfluid", fluid.getTag());
StateMapperBase ignoreState = new FluidStateMapper(fluidLocation);
ModelLoader.setCustomStateMapper(block, ignoreState);
ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(block), new FluidItemMeshDefinition(fluidLocation));
ModelBakery.registerItemVariants(Item.getItemFromBlock(block), fluidLocation);
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project TechReborn by TechReborn.
the class RegisterItemJsons method registerBlockstateMultiItem.
private static void registerBlockstateMultiItem(Item item, String variantName, String path) {
ResourceLocation loc = new ResourceLocation("techreborn", path);
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(loc, "type=" + variantName));
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project TechReborn by TechReborn.
the class FluidBlockModelHandler method registerFluidBlockModel.
private static void registerFluidBlockModel(BlockFluidTechReborn block) {
String name = block.getUnlocalizedName().substring(5).toLowerCase();
Item item = Item.getItemFromBlock(block);
ModelResourceLocation location = new ModelResourceLocation(new ResourceLocation(ModInfo.MOD_ID.toLowerCase(), "fluids"), name);
ModelLoader.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return location;
}
});
ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return location;
}
});
}
Aggregations