use of net.minecraft.client.renderer.block.statemap.StateMapperBase in project NetherEx by LogicTechCorp.
the class NetherExModels method registerModel.
private static void registerModel(IFluidBlock block) {
Item item = Item.getItemFromBlock((Block) block);
ModelBakery.registerItemVariants(item);
ModelResourceLocation modelLocation = new ModelResourceLocation(NetherEx.MOD_ID + ":fluid", block.getFluid().getName());
ModelLoader.setCustomMeshDefinition(item, MeshDefinitionFix.create(stack -> modelLocation));
ModelLoader.setCustomStateMapper((Block) block, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return modelLocation;
}
});
}
use of net.minecraft.client.renderer.block.statemap.StateMapperBase in project SecurityCraft by Geforce132.
the class ClientProxy method registerTextureFiles.
/**
* Register the texture files used by blocks with metadata/variants with the ModelBakery.
*/
@Override
@SideOnly(Side.CLIENT)
public void registerTextureFiles() {
Item reinforcedWoodPlanks = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedPlanks");
ModelBakery.registerItemVariants(reinforcedWoodPlanks, new ResourceLocation("securitycraft:reinforcedPlanks_Oak"), new ResourceLocation("securitycraft:reinforcedPlanks_Spruce"), new ResourceLocation("securitycraft:reinforcedPlanks_Birch"), new ResourceLocation("securitycraft:reinforcedPlanks_Jungle"), new ResourceLocation("securitycraft:reinforcedPlanks_Acacia"), new ResourceLocation("securitycraft:reinforcedPlanks_DarkOak"));
Item reinforcedStainedGlass = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStainedGlass");
ModelBakery.registerItemVariants(reinforcedStainedGlass, new ResourceLocation("securitycraft:reinforcedStainedGlass_white"), new ResourceLocation("securitycraft:reinforcedStainedGlass_orange"), new ResourceLocation("securitycraft:reinforcedStainedGlass_magenta"), new ResourceLocation("securitycraft:reinforcedStainedGlass_light_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlass_yellow"), new ResourceLocation("securitycraft:reinforcedStainedGlass_lime"), new ResourceLocation("securitycraft:reinforcedStainedGlass_pink"), new ResourceLocation("securitycraft:reinforcedStainedGlass_gray"), new ResourceLocation("securitycraft:reinforcedStainedGlass_silver"), new ResourceLocation("securitycraft:reinforcedStainedGlass_cyan"), new ResourceLocation("securitycraft:reinforcedStainedGlass_purple"), new ResourceLocation("securitycraft:reinforcedStainedGlass_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlass_brown"), new ResourceLocation("securitycraft:reinforcedStainedGlass_green"), new ResourceLocation("securitycraft:reinforcedStainedGlass_red"), new ResourceLocation("securitycraft:reinforcedStainedGlass_black"));
Item reinforcedStainedGlassPanes = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStainedGlassPanes");
ModelBakery.registerItemVariants(reinforcedStainedGlassPanes, new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_white"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_orange"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_magenta"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_light_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_yellow"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_lime"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_pink"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_gray"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_silver"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_cyan"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_purple"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_blue"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_brown"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_green"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_red"), new ResourceLocation("securitycraft:reinforcedStainedGlassPanes_black"));
Item reinforcedSandstone = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedSandstone");
ModelBakery.registerItemVariants(reinforcedSandstone, new ResourceLocation("securitycraft:reinforcedSandstone_normal"), new ResourceLocation("securitycraft:reinforcedSandstone_chiseled"), new ResourceLocation("securitycraft:reinforcedSandstone_smooth"));
Item reinforcedWoodSlabs = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedWoodSlabs");
ModelBakery.registerItemVariants(reinforcedWoodSlabs, new ResourceLocation("securitycraft:reinforcedWoodSlabs_oak"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_spruce"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_birch"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_jungle"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_acacia"), new ResourceLocation("securitycraft:reinforcedWoodSlabs_darkoak"));
Item reinforcedStoneSlabs = GameRegistry.findItem(mod_SecurityCraft.MODID, "reinforcedStoneSlabs");
ModelBakery.registerItemVariants(reinforcedStoneSlabs, new ResourceLocation("securitycraft:reinforcedStoneSlabs_stone"), new ResourceLocation("securitycraft:reinforcedStoneSlabs_cobblestone"), new ResourceLocation("securitycraft:reinforcedStoneSlabs_sandstone"), new ResourceLocation("securitycraft:reinforcedDirtSlab"));
Item fakeWater = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusWater");
ModelBakery.registerItemVariants(fakeWater);
ModelLoader.setCustomMeshDefinition(fakeWater, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusWater, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water");
}
});
Item fakeWaterFlowing = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusWaterFlowing");
ModelBakery.registerItemVariants(fakeWaterFlowing);
ModelLoader.setCustomMeshDefinition(fakeWaterFlowing, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water_flowing");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusWaterFlowing, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "water_flowing");
}
});
Item fakeLava = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusLava");
ModelBakery.registerItemVariants(fakeLava);
ModelLoader.setCustomMeshDefinition(fakeLava, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusLava, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava");
}
});
Item fakeLavaFlowing = GameRegistry.findItem(mod_SecurityCraft.MODID, "bogusLavaFlowing");
ModelBakery.registerItemVariants(fakeLavaFlowing);
ModelLoader.setCustomMeshDefinition(fakeLavaFlowing, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava_flowing");
}
});
ModelLoader.setCustomStateMapper(mod_SecurityCraft.bogusLavaFlowing, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
return new ModelResourceLocation("securitycraft:fakeLiquids", "lava_flowing");
}
});
}
Aggregations