本文整理匯總了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;
}