private static ModelResourceLocation getTableLoc(BlockToolTable.TableTypes type) { return new ModelResourceLocation(LOCATION_ToolTable, String.format("%s=%s", BlockToolTable.TABLES.getName(), BlockToolTable.TABLES.getName(type))); }
@Override public IModel loadModel(ResourceLocation modelLocation) { // Load a dummy model for now, all actual blockModels added in process(). return new SpecialFlowerModel(new ModelResourceLocation("builtin/missing", "missing"), ImmutableMap.of(), ImmutableMap.of()); } }
@SideOnly(Side.CLIENT) @Override public void registerModels() { // Load and bake the 2D models ModelBakery.registerItemVariants(this, new ModelResourceLocation("botania:lexicon_default", "inventory"), new ModelResourceLocation("botania:lexicon_elven", "inventory")); ModelResourceLocation default3dPath = new ModelResourceLocation("botania:lexicon_3d_default", "inventory"); ModelResourceLocation elven3dPath = new ModelResourceLocation("botania:lexicon_3d_elven", "inventory"); // smart model will dispatch between 2d/3d appropriately, see LexiconModel ModelLoader.setCustomMeshDefinition(this, stack -> isElvenItem(stack) ? elven3dPath : default3dPath); }
@Override public IModel process(ImmutableMap<String, String> customData) { // Load the base variant from blockstate json, and also add all the model paths we received from external API ModelResourceLocation base = baseModel; if(customData.containsKey("base")) // Forge blockstate gives custom data in json form, have to drop the quotes base = new ModelResourceLocation(customData.get("base").substring(1, customData.get("base").length() - 1)); ImmutableMap<String, ModelResourceLocation> blockModels = ImmutableMap.copyOf(BotaniaAPIClient.getRegisteredSubtileBlockModels()); ImmutableMap<String, ModelResourceLocation> itemModels = ImmutableMap.copyOf(BotaniaAPIClient.getRegisteredSubtileItemModels()); return new SpecialFlowerModel(base, blockModels, itemModels); }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation("botania:vial", "inventory")); ModelLoader.setCustomModelResourceLocation(this, 1, new ModelResourceLocation("botania:flask", "inventory")); }
public static void registerCustomItemblock(Block b, int maxExclusive, IntFunction<String> metaToPath) { Item item = Item.getItemFromBlock(b); for (int i = 0; i < maxExclusive; i++) { ModelLoader.setCustomModelResourceLocation( item, i, new ModelResourceLocation(LibMisc.MOD_ID + ":itemblock/" + metaToPath.apply(i), "inventory") ); } }
/** * Determines which version of the energy cell model should be used depending on the fill factor * of the item stack. */ private ModelResourceLocation getItemModel( ItemStack is ) { double fillFactor = getFillFactor( is ); int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor ); return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel ); }
/** Registers the item-meta combo in the itemstack with the given location for the inventory-variant */ public static void registerItemModel(ItemStack itemStack, ResourceLocation name) { if(!itemStack.isEmpty() && name != null) { // tell the loader to load the model ModelLoader.registerItemVariants(itemStack.getItem(), name); // tell the game which model to use for this item-meta combination ModelLoader.setCustomModelResourceLocation(itemStack.getItem(), itemStack.getMetadata(), new ModelResourceLocation(name, VARIANT_INVENTORY)); } }
public FluidStateMapper(Fluid fluid) { this.fluid = fluid; // have each block hold its fluid per nbt? hm this.location = new ModelResourceLocation(Util.getResource("fluid_block"), fluid.getName()); }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@SideOnly( Side.CLIENT ) private static ModelResourceLocation modelFromBaseName( String baseName ) { return new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "part/" + baseName ), "inventory" ); }
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@Override @SideOnly( Side.CLIENT ) public void customize( IBlockRendering rendering, IItemRendering itemRendering ) { ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "facing=east,half=bottom,shape=straight" ); itemRendering.model( model ); } } )
@SideOnly(Side.CLIENT) @Override public void registerModels() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory")); } }
@Override @SideOnly( Side.CLIENT ) public void customize( IItemRendering rendering ) { rendering.builtInModel( "models/item/builtin/encoded_pattern", new ItemEncodedPatternModel() ); rendering.model( new ModelResourceLocation( MODEL, "inventory" ) ).variants( MODEL ); }