當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelResourceLocation類代碼示例

本文整理匯總了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));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:27,代碼來源:StateMap.java

示例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_);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:17,代碼來源:CustomItems.java

示例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;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:CustomItemProperties.java

示例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"));
		
	}
}
 
開發者ID:Glitch-Byte,項目名稱:AuraMod,代碼行數:18,代碼來源:AuraMod.java

示例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);
}
 
開發者ID:XFactHD,項目名稱:RFUtilities,代碼行數:26,代碼來源:ClientEventHandler.java

示例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));
        }
    }
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:20,代碼來源:FactorizationClientProxy.java

示例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);
	}
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:23,代碼來源:MBlockLog.java

示例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);
	}
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:24,代碼來源:BlockVirtianSoil.java

示例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"));
}
 
開發者ID:ItsAMysterious,項目名稱:Real-Life-Mod-1.8,代碼行數:21,代碼來源:ClientProxy.java

示例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"));
		}
	}
}
 
開發者ID:mattparizeau,項目名稱:Natural-Rocks,代碼行數:18,代碼來源:NRBlocks.java

示例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);
	}
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:22,代碼來源:BlockMSand.java

示例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();
            }
        }
    }
 
開發者ID:McJty,項目名稱:GearSwapper1.8,代碼行數:18,代碼來源:ModBlocks.java

示例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), });

	}
}
 
開發者ID:sokratis12GR,項目名稱:MoreDimensions,代碼行數:20,代碼來源:CoalDimension.java

示例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);
	}
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:25,代碼來源:BlockCarvedPumpkin.java

示例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;
}
 
開發者ID:GenDeathrow,項目名稱:Skills,代碼行數:21,代碼來源:SK_FishingRod.java


注:本文中的net.minecraft.client.resources.model.ModelResourceLocation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。