use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.
the class BlockFluid method registerModel.
@Override
@SideOnly(Side.CLIENT)
public void registerModel() {
final Item item = Item.getItemFromBlock(this);
assert item != null;
ModelBakery.registerItemVariants(item);
final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(LibMod.MOD_ID + ":fluid", getFluid().getName());
ModelLoader.setCustomMeshDefinition(item, stack -> modelResourceLocation);
ModelLoader.setCustomStateMapper(this, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) {
return modelResourceLocation;
}
});
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Fracture by HellFirePvP.
the class ClientProxy method registerDisplayInformationInit.
public void registerDisplayInformationInit() {
for (RenderInfoItem modelEntry : itemRegister) {
if (modelEntry.variant) {
registerVariantName(modelEntry.item, modelEntry.name);
}
Item item = modelEntry.item;
ModelResourceLocation def = new ModelResourceLocation(Fracture.MODID + ":" + modelEntry.name, "inventory");
ModelLoader.setCustomModelResourceLocation(item, modelEntry.metadata, def);
}
for (RenderInfoBlock modelEntry : blockRegister) {
Item item = Item.getItemFromBlock(modelEntry.block);
ModelResourceLocation def = new ModelResourceLocation(Fracture.MODID + ":" + modelEntry.name, "inventory");
ModelLoader.setCustomModelResourceLocation(item, modelEntry.metadata, def);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project YABBA by LatvianModder.
the class YabbaItems method registerModels.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public static void registerModels(ModelRegistryEvent event) {
ModelLoaderRegistry.registerLoader(BarrelModelLoader.INSTANCE);
ModelLoader.setCustomModelResourceLocation(ITEM_BARREL_ITEM, 0, BarrelModelLoader.MODEL_LOCATION);
ModelLoader.setCustomStateMapper(ITEM_BARREL, BarrelModelLoader.INSTANCE);
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(ITEM_BARREL_CONNECTOR), 0, new ModelResourceLocation(ITEM_BARREL_CONNECTOR.getRegistryName(), "normal"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(ANTIBARREL), 0, new ModelResourceLocation(ANTIBARREL.getRegistryName(), "normal"));
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(COMPOUND_ITEM_BARREL), 0, new ModelResourceLocation(COMPOUND_ITEM_BARREL.getRegistryName(), "normal"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_BLANK, 0, new ModelResourceLocation(UPGRADE_BLANK.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_STONE_TIER, 0, new ModelResourceLocation(UPGRADE_STONE_TIER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_IRON_TIER, 0, new ModelResourceLocation(UPGRADE_IRON_TIER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_GOLD_TIER, 0, new ModelResourceLocation(UPGRADE_GOLD_TIER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_DIAMOND_TIER, 0, new ModelResourceLocation(UPGRADE_DIAMOND_TIER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_STAR_TIER, 0, new ModelResourceLocation(UPGRADE_STAR_TIER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_CREATIVE, 0, new ModelResourceLocation(UPGRADE_CREATIVE.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_OBSIDIAN_SHELL, 0, new ModelResourceLocation(UPGRADE_OBSIDIAN_SHELL.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_REDSTONE_OUT, 0, new ModelResourceLocation(UPGRADE_REDSTONE_OUT.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_HOPPER, 0, new ModelResourceLocation(UPGRADE_HOPPER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_VOID, 0, new ModelResourceLocation(UPGRADE_VOID.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(UPGRADE_PICKUP, 0, new ModelResourceLocation(UPGRADE_PICKUP.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(HAMMER, 0, new ModelResourceLocation(HAMMER.getRegistryName(), "inventory"));
ModelLoader.setCustomModelResourceLocation(PAINTER, 0, new ModelResourceLocation(PAINTER.getRegistryName(), "inventory"));
ClientRegistry.bindTileEntitySpecialRenderer(TileItemBarrel.class, new RenderItemBarrel());
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Cavern2 by kegare.
the class CaveItems method registerModels.
@SideOnly(Side.CLIENT)
public static void registerModels(@Nullable String prefix, Item item, String... modelNames) {
List<ModelResourceLocation> models = Lists.newArrayList();
for (String model : modelNames) {
models.add(new ModelResourceLocation(CaveUtils.getKey(ObjectUtils.defaultIfNull(prefix, "") + model), "inventory"));
}
ModelBakery.registerItemVariants(item, models.toArray(new ResourceLocation[models.size()]));
for (int i = 0; i < models.size(); ++i) {
ModelLoader.setCustomModelResourceLocation(item, i, models.get(i));
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project BetterQuesting by Funwayguy.
the class ClientProxy method registerBlockModel.
@SideOnly(Side.CLIENT)
public static void registerBlockModel(Block block, int meta, String name) {
Item item = Item.getItemFromBlock(block);
ModelResourceLocation model = new ModelResourceLocation(name, "inventory");
if (!name.equals(item.getRegistryName())) {
ModelBakery.registerItemVariants(item, model);
}
ModelLoader.setCustomModelResourceLocation(item, meta, model);
// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, model);
}
Aggregations