本文整理汇总了Java中net.minecraft.client.resources.model.ModelResourceLocation类的典型用法代码示例。如果您正苦于以下问题:Java ModelResourceLocation类的具体用法?Java ModelResourceLocation怎么用?Java ModelResourceLocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModelResourceLocation类属于net.minecraft.client.resources.model包,在下文中一共展示了ModelResourceLocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModelResourceLocation
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
{
Map<IProperty, Comparable> map = Maps.<IProperty, Comparable>newLinkedHashMap(state.getProperties());
String s;
if (this.name == null)
{
s = ((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock())).toString();
}
else
{
s = ((IProperty)this.name).getName((Comparable)map.remove(this.name));
}
if (this.suffix != null)
{
s = s + this.suffix;
}
for (IProperty<?> iproperty : this.ignored)
{
map.remove(iproperty);
}
return new ModelResourceLocation(s, this.getPropertyString(map));
}
示例2: getCustomItemModel
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static IBakedModel getCustomItemModel(ItemStack p_getCustomItemModel_0_, IBakedModel p_getCustomItemModel_1_, ModelResourceLocation p_getCustomItemModel_2_)
{
if (p_getCustomItemModel_1_.isGui3d())
{
return p_getCustomItemModel_1_;
}
else if (itemProperties == null)
{
return p_getCustomItemModel_1_;
}
else
{
CustomItemProperties customitemproperties = getCustomItemProperties(p_getCustomItemModel_0_, 1);
return customitemproperties == null ? p_getCustomItemModel_1_ : customitemproperties.getModel(p_getCustomItemModel_2_);
}
}
示例3: getModel
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public IBakedModel getModel(ModelResourceLocation p_getModel_1_)
{
if (p_getModel_1_ != null && this.mapTextures != null)
{
String s = p_getModel_1_.getResourcePath();
if (this.mapModels != null)
{
IBakedModel ibakedmodel = (IBakedModel)this.mapModels.get(s);
if (ibakedmodel != null)
{
return ibakedmodel;
}
}
}
return this.model;
}
示例4: postInit
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
if (event.getSide() == Side.CLIENT)
{
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
BlockAuraStone.BlockType.registerRenders();
renderItem.getItemModelMesher().register(orb, 0, new ModelResourceLocation(MODID + ":" + ((ItemAuraOrb) orb).getNameFromDamage(0), "inventory"));
renderItem.getItemModelMesher().register(orb, 1, new ModelResourceLocation(MODID + ":" + ((ItemAuraOrb) orb).getNameFromDamage(1), "inventory"));
renderItem.getItemModelMesher().register(Item.getItemFromBlock(auramPlant), 0 , new ModelResourceLocation(MODID + ":" + (((BlockAuramPlant) auramPlant).getName()), "inventory"));
}
}
示例5: modelBake
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
@SuppressWarnings("unused")
@SubscribeEvent
public void modelBake(ModelBakeEvent event)
{
List<IBakedModel> capacitors = new ArrayList<IBakedModel>();
IBakedModel teBasic = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=1"));
IBakedModel teHardened = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=2"));
IBakedModel teReinforced = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=3"));
IBakedModel teResonant = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=4"));
IBakedModel eioBasic = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=5"));
IBakedModel eioDouble = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=6"));
IBakedModel eioVibrant = event.modelRegistry.getObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "facing=north,type=7"));
capacitors.add(teBasic);
capacitors.add(teHardened);
capacitors.add(teReinforced);
capacitors.add(teResonant);
capacitors.add(eioBasic);
capacitors.add(eioDouble);
capacitors.add(eioVibrant);
SmartModelCapacitor capacitorModel = new SmartModelCapacitor(capacitors);
event.modelRegistry.putObject(new ModelResourceLocation(Reference.MOD_ID + ":blockCapacitor", "inventory"), capacitorModel);
}
示例6: registerISensitiveMeshes
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
@Override
public void registerISensitiveMeshes(Collection<Item> items) {
for (Item it : items) {
if (!(it instanceof ISensitiveMesh)) {
continue;
}
final ISensitiveMesh ism = (ISensitiveMesh) it;
ModelLoader.setCustomMeshDefinition(it, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
String meshName = ism.getMeshName(stack);
return new ModelResourceLocation("factorization:" + meshName + "#inventory");
}
});
for (ItemStack is : ism.getMeshSamples()) {
ModelLoader.addVariantName(it, "factorization:" + ism.getMeshName(is));
}
}
}
示例7: inventoryRender
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static void inventoryRender()
{
Item itemBlockBrickVariants = GameRegistry.findItem(MReference.MODID, "ministrapp_log");
ModelBakery.addVariantName(itemBlockBrickVariants, "ministrapp:redwood_log");
ModelBakery.addVariantName(itemBlockBrickVariants, "ministrapp:frozen_oak_log");
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "ministrapp_log");
MWoodType[] aenumtype = MWoodType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j)
{
MWoodType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":"
+ enumtype
.getUnlocalizedName()
+ "_log", "inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}
示例8: inventoryRender
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static void inventoryRender()
{
Item item = GameRegistry.findItem(MReference.MODID, "virtian_soil");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_dirt");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_coarse_dirt");
ModelBakery.addVariantName(item, "ministrapp:virtian_soil_podzol");
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "virtian_soil");
DirtType[] aenumtype = BlockDirt.DirtType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j)
{
BlockDirt.DirtType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":"
+ "virtian_soil_" + enumtype
.getName(),
"inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}
示例9: registerItemModels
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
/**
* -------------------------------------------------------------------------
*/
@Override
public void registerItemModels() {
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
for (Item item : RealLifeMod_Items.itemList) {
renderItem.getItemModelMesher().register(item, 0, new ModelResourceLocation(
Reference.ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
for (Block b : RealLifeMod_Blocks.blockList) {
renderItem.getItemModelMesher().register(Item.getItemFromBlock(b), 0,
new ModelResourceLocation(Reference.ID + ":" + b.getUnlocalizedName().substring(5), "inventory"));
}
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RealLifeMod_Blocks.transformer), 0,
new ModelResourceLocation(Reference.ID + ":blockTransformer", "inventory"));
}
示例10: initBlocks
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static final void initBlocks(FMLInitializationEvent event)
{
blocks = new ArrayList<CustomBlock>();
marble = (CustomBlock)new CustomBlock("marble", Material.rock).setHardness(1.5f).setResistance(10.0f).setStepSound(Block.soundTypePiston);
marbleBricks = (CustomBlock)new CustomBlock("marbleBricks", Material.rock).setHardness(1.5f).setResistance(10.0f).setStepSound(Block.soundTypePiston);
if (event.getSide() == Side.CLIENT)
{
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
for (CustomBlock block : blocks)
{
renderItem.getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(NaturalRocks.prefix + block.getName(), "inventory"));
}
}
}
示例11: inventoryRender
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static void inventoryRender()
{
Item item = GameRegistry.findItem(MReference.MODID, "cold_sand");
ModelBakery.addVariantName(item, "ministrapp:cold_sand");
ModelBakery.addVariantName(item, "ministrapp:cold_red_sand");
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "cold_sand");
EnumType[] aenumtype = BlockSand.EnumType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j)
{
BlockSand.EnumType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":" + "cold_"
+ enumtype.getName(),
"inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}
示例12: initModels
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void initModels() {
woodenGearSwapperBlock.initModel();
ironGearSwapperBlock.initModel();
lapisGearSwapperBlock.initModel();
stoneGearSwapperBlock.initModel();
glassGearSwapperBlock.initModel();
if (!Config.customBlockName.isEmpty()) {
Block b = Block.blockRegistry.getObject(new ResourceLocation(Config.customBlockName));
if (b != null) {
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
mesher.register(Item.getItemFromBlock(moddedGearSwapperBlock), 0, new ModelResourceLocation(b.getRegistryName(), "inventory"));
// moddedGearSwapperBlock.initModel();
}
}
}
示例13: load
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public void load(FMLInitializationEvent event)
{
if (ConfigHandler.enableCoalDimension)
{
GameRegistry.registerBlock(portal, "coalDimension_portal");
GameRegistry.registerItem(block, "coalDimension_trigger");
DimensionManager.registerProviderType(DIMID, CoalDimension.WorldProviderMod.class, false);
DimensionManager.registerDimension(DIMID, DIMID);
if (event.getSide() == Side.CLIENT)
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(block, 0,
new ModelResourceLocation("moredimensions:coalDimension_trigger", "inventory"));
GameRegistry.addRecipe(new ItemStack(block, 1), new Object[]
{ "XXX", "XXX", "X78", Character.valueOf('7'), new ItemStack(Blocks.coal_block, 1), Character.valueOf('8'),
new ItemStack(Items.flint, 1), });
}
}
示例14: inventoryRender
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
public static void inventoryRender(String type)
{
Item itemBlockpVariants = GameRegistry.findItem(MReference.MODID, "pumpkin_minestrapp_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:simple_carved_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:average_carved_" + type);
ModelBakery.addVariantName(itemBlockpVariants, "ministrapp:complex_carved_" + type);
Item itemBlockVariants = GameRegistry.findItem(MReference.MODID, "pumpkin_minestrapp_" + type);
MPumpkinType[] aenumtype = MPumpkinType.values();
int i = aenumtype.length;
for (int j = 0; j < i; ++j)
{
MPumpkinType enumtype = aenumtype[j];
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(MReference.MODID + ":"
+ enumtype
.getUnlocalizedName()
+ "_carved_" + type,
"inventory");
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(itemBlockVariants, enumtype.getMetadata(), itemModelResourceLocation);
}
}
示例15: getModel
import net.minecraft.client.resources.model.ModelResourceLocation; //导入依赖的package包/类
@Override
public ModelResourceLocation getModel(ItemStack itemstack, EntityPlayer playerIn, int useRemaining)
{
if(playerIn instanceof EntityPlayer)
{
SkillTrackerData tracker = SkillTrackerData.get(playerIn);
if(tracker != null)
{
//System.out.println("tracker not null");
if(tracker.fishingEntity != null)
{
//System.out.println("Cast Model");
return new ModelResourceLocation(Skillz.MODID+ ":sk_fishing_rod_cast", "inventory");
}
}
}
return null;
}