当前位置: 首页>>代码示例>>Java>>正文


Java ModelLoader.setCustomMeshDefinition方法代码示例

本文整理汇总了Java中net.minecraftforge.client.model.ModelLoader.setCustomMeshDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java ModelLoader.setCustomMeshDefinition方法的具体用法?Java ModelLoader.setCustomMeshDefinition怎么用?Java ModelLoader.setCustomMeshDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.client.model.ModelLoader的用法示例。


在下文中一共展示了ModelLoader.setCustomMeshDefinition方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
public static void register(IFCustomFluidBlock base) {
    Item fluid = Item.getItemFromBlock(base);

    ModelBakery.registerItemVariants(fluid);
    FluidStateMapper mapper = new FluidStateMapper(base.getName());
    ModelLoader.setCustomMeshDefinition(fluid, mapper);
    ModelLoader.setCustomStateMapper(base, mapper);
}
 
开发者ID:Buuz135,项目名称:Industrial-Foregoing,代码行数:9,代码来源:FluidsRenderRegistry.java

示例2: registerModels

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
private void registerModels() {

        ModelRegistryHelper.registerItemRenderer(ModItems.itemWireless, new RenderItemWireless());

        ModItems.itemMaterial.registerModels();
        ModelResourceLocation location = new ModelResourceLocation("wrcbe:material", "type=rep");
        ModelLoader.setCustomModelResourceLocation(ModItems.itemRep, 0, location);

        ModelLoader.setCustomMeshDefinition(ModItems.itemRemote, stack -> new ModelResourceLocation("wrcbe:device", "type=wireless_remote"));
        ModelLoader.registerItemVariants(ModItems.itemRemote, new ModelResourceLocation("wrcbe:device", "type=wireless_remote"));
        ModelBakery.registerItemKeyGenerator(ModItems.itemRemote, stack -> stack.getItem().getRegistryName().toString() + "|" + stack.getMetadata() + "," + ItemWirelessRemote.getTransmitting(stack));

        ModelLoader.setCustomMeshDefinition(ModItems.itemTriangulator, stack -> new ModelResourceLocation("wrcbe:device", "type=wireless_triangulator"));
        ModelLoader.registerItemVariants(ModItems.itemTriangulator, new ModelResourceLocation("wrcbe:device", "type=wireless_triangulator"));
        ModelBakery.registerItemKeyGenerator(ModItems.itemTriangulator, stack -> {
            int damage = stack.getItemDamage();
            if (damage < 0 || damage > RedstoneEther.numfreqs) {
                damage = 0;
            }
            //I know, random call to a thing, used to update textures.
            TriangTexManager.getIconIndexFromDamage(damage);
            return ModelBakery.defaultItemKeyGenerator.generateKey(stack);
        });
        ModelLoader.setCustomModelResourceLocation(ModItems.itemSniffer, 0, new ModelResourceLocation("wrcbe:device", "type=sniffer"));
        ModelLoader.setCustomModelResourceLocation(ModItems.itemPrivateSniffer, 0, new ModelResourceLocation("wrcbe:device", "type=private_sniffer"));

        ModelRegistryHelper.registerItemRenderer(ModItems.itemTracker, new RenderItemTracker());
        ModelLoader.setCustomModelResourceLocation(ModItems.itemEmptyWirelessMap, 0, new ModelResourceLocation("wrcbe:device", "type=empty_wireless_map"));
        ModelLoader.registerItemVariants(ModItems.itemWirelessMap, new ModelResourceLocation("wrcbe:device", "type=wireless_map"));
        ModelLoader.setCustomMeshDefinition(ModItems.itemWirelessMap, stack -> new ModelResourceLocation("wrcbe:device", "type=wireless_map"));
    }
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:32,代码来源:ProxyClient.java

示例3: initModels

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void initModels()
{
	Item item = Item.getItemFromBlock(ModBlocks.liquid_butter);

	ModelBakery.registerItemVariants(item);
	ModelResourceLocation location = new ModelResourceLocation("btweagles:fluid", "liquid_butter");
	ModelLoader.setCustomMeshDefinition(item, stack -> location);
	ModelLoader.setCustomStateMapper(ModBlocks.liquid_butter, new StateMapperBase() {
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
			return location;
		}
	});
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:16,代码来源:ModFluids.java

示例4: initModel

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public void initModel(){
	ModelBakery.registerItemVariants(this, new ModelResourceLocation(Melodium.MODID+":composition_paper"), new ModelResourceLocation(Melodium.MODID+":song_paper"));
	ModelLoader.setCustomMeshDefinition(this, new ItemMeshDefinition(){
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) {
			if (isLearned(stack)){
				return new ModelResourceLocation(Melodium.MODID+":song_paper");
			}
			return new ModelResourceLocation(Melodium.MODID+":composition_paper");
		}
	});
}
 
开发者ID:TeamMelodium,项目名称:Melodium,代码行数:15,代码来源:ItemCompositionPaper.java

示例5: registerFluidRender

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
protected void registerFluidRender(BlockFluidBase blockFluid, String blockStateName) {
    final String location = FoodCraftReloaded.MODID + ":" + blockStateName;
    final Item itemFluid = Item.getItemFromBlock(blockFluid);
    ModelLoader.setCustomMeshDefinition(itemFluid, stack -> new ModelResourceLocation(location, "fluid"));
    ModelLoader.setCustomStateMapper(blockFluid, new StateMapperBase() {
        @Nonnull
        @Override
        protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state) {
            return new ModelResourceLocation(location, "fluid");
        }
    });
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:14,代码来源:EnumLoader.java

示例6: onModelRegistry

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SubscribeEvent
public static void onModelRegistry(ModelRegistryEvent event) {
    //Registries for mooncakes
    ModelResourceLocation[] modelLocationArray = new ModelResourceLocation[MooncakeFillingType.VALUES.length];
    for (int i = 0; i < MooncakeFillingType.VALUES.length; i++) {
        modelLocationArray[i] = new ModelResourceLocation("mooncakecraft:mooncake_" + MooncakeFillingType.getByOrdinal(i).getLocalizationKey(), "inventory");
    }
    ModelBakery.registerItemVariants(MooncakeConstants.MOONCAKE_ITEM, modelLocationArray);
    ModelLoader.setCustomMeshDefinition(MooncakeConstants.MOONCAKE_ITEM, itemStack -> new ModelResourceLocation("mooncakecraft:mooncake_" + MooncakeFillingType.getByOrdinal(itemStack.getMetadata()).getLocalizationKey(), "inventory"));

    //Registries for mooncake fillings
    ModelResourceLocation[] modelLocationArray1 = new ModelResourceLocation[MooncakeFillingType.VALUES.length];
    for (int i = 0; i < MooncakeFillingType.VALUES.length; i++) {
        modelLocationArray1[i] = new ModelResourceLocation("mooncakecraft:mooncake_filling_" + MooncakeFillingType.getByOrdinal(i).getLocalizationKey(), "inventory");
    }
    ModelBakery.registerItemVariants(MooncakeConstants.MOONCAKE_FILLING, modelLocationArray1);
    ModelLoader.setCustomMeshDefinition(MooncakeConstants.MOONCAKE_FILLING, itemStack -> new ModelResourceLocation("mooncakecraft:mooncake_filling_" + MooncakeFillingType.getByOrdinal(itemStack.getMetadata()).getLocalizationKey(), "inventory"));

    //Registries for raw mooncakes
    ModelResourceLocation[] modelLocationArray2 = new ModelResourceLocation[MooncakeFillingType.VALUES.length];
    for (int i = 0; i < MooncakeFillingType.VALUES.length; i++) {
        modelLocationArray2[i] = new ModelResourceLocation("mooncakecraft:mooncake_raw_" + MooncakeFillingType.getByOrdinal(i).getLocalizationKey(), "inventory");
    }
    ModelBakery.registerItemVariants(MooncakeConstants.RAW_MOONCAKE_ITEM, modelLocationArray2);
    ModelLoader.setCustomMeshDefinition(MooncakeConstants.RAW_MOONCAKE_ITEM, itemStack -> new ModelResourceLocation("mooncakecraft:mooncake_raw_" + MooncakeFillingType.getByOrdinal(itemStack.getMetadata()).getLocalizationKey(), "inventory"));

    //Registries for unshaped mooncakes
    ModelResourceLocation[] modelLocationArray3 = new ModelResourceLocation[MooncakeFillingType.VALUES.length];
    for (int i = 0; i < MooncakeFillingType.VALUES.length; i++) {
        modelLocationArray3[i] = new ModelResourceLocation("mooncakecraft:mooncake_unshaped_" + MooncakeFillingType.getByOrdinal(i).getLocalizationKey(), "inventory");
    }
    ModelBakery.registerItemVariants(MooncakeConstants.UNSHAPED_MOONCAKE_ITEM, modelLocationArray3);
    ModelLoader.setCustomMeshDefinition(MooncakeConstants.UNSHAPED_MOONCAKE_ITEM, itemStack -> new ModelResourceLocation("mooncakecraft:mooncake_unshaped_" + MooncakeFillingType.getByOrdinal(itemStack.getMetadata()).getLocalizationKey(), "inventory"));

    //Registries for other things
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.WHEAT_FLOUR, 0, new ModelResourceLocation("mooncakecraft:wheat_flour", "inventory"));
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.SESAME_SEED, 0, new ModelResourceLocation("mooncakecraft:sesame_seeds", "inventory"));
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.PEANUT_SEED, 0, new ModelResourceLocation("mooncakecraft:peanut_seeds", "inventory"));
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.LOTUS_SEED, 0, new ModelResourceLocation("mooncakecraft:lotus_seeds", "inventory"));
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.JUJUBE, 0, new ModelResourceLocation("mooncakecraft:jujube", "inventory"));

    //Registries for mooncake mold
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.MOONCAKE_MOLD, 0, new ModelResourceLocation("mooncakecraft:mooncake_mold_empty", "inventory"));
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.MOONCAKE_MOLD, 1, new ModelResourceLocation("mooncakecraft:mooncake_mold_full", "inventory"));

    //ICON
    ModelLoader.setCustomModelResourceLocation(MooncakeConstants.ICON, 0, new ModelResourceLocation("mooncakecraft:icon", "inventory"));
}
 
开发者ID:TeamCovertDragon,项目名称:MooncakeCraft,代码行数:49,代码来源:MooncakeRegistriesClient.java

示例7: registerRender

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@Override
public void registerRender() {
	models = new HashMap<String, ModelResourceLocation>();
	String[] modelPaths = new String[] { "rafradek_blocklauncher:block_cannon",
			"rafradek_blocklauncher:block_rifle", "rafradek_blocklauncher:block_shotgun",
			"rafradek_blocklauncher:block_thrower", "rafradek_blocklauncher:tnt_launcher",
			"rafradek_blocklauncher:tnt_launcher_2", "rafradek_blocklauncher:block_chaingun",
			"rafradek_blocklauncher:block_sniper", "rafradek_blocklauncher:tnt_mines" };

	for (String string : modelPaths) {
		ModelResourceLocation model = new ModelResourceLocation(string, "inventory");
		models.put(string, model);
		ModelBakery.registerItemVariants(BlockLauncher.cannon, model);
	}

	ModelLoader.setCustomMeshDefinition(BlockLauncher.cannon, new ItemMeshDefinition() {

		@Override
		public ModelResourceLocation getModelLocation(ItemStack p_178113_1_) {

			int type = BlockLauncher.cannon.getType(p_178113_1_);
			if (type == 0)
				return models.get("rafradek_blocklauncher:block_rifle");
			else if (type == 1)
				return models.get("rafradek_blocklauncher:block_cannon");
			else if (type == 2)
				return models.get("rafradek_blocklauncher:block_shotgun");
			else if (type == 3)
				return models.get("rafradek_blocklauncher:block_thrower");
			else if (type == 4)
				return models.get("rafradek_blocklauncher:block_chaingun");
			else if (type == 5)
				return models.get("rafradek_blocklauncher:block_sniper");
			else if (type == 16)
				return models.get("rafradek_blocklauncher:tnt_launcher");
			else if (type == 17)
				// if(stack.getTagCompound().getInteger("wait")<=0)
				return models.get("rafradek_blocklauncher:tnt_launcher_2");
			// else
			// return this.tntlauncherEmptyIcon;
			else if (type == 18)
				// if(stack.getTagCompound().getInteger("wait")<=0)
				return models.get("rafradek_blocklauncher:tnt_mines");
			// else
			// return this.tntlauncherEmptyIcon;
			return models.get("rafradek_blocklauncher:block_cannon");
		}

	});
	// ModelBakery.addVariantName(BlockLauncher.launchpart,
	// "rafradek_blocklauncher:launchpart","rafradek_blocklauncher:launchpart_better");
	ModelLoader.setCustomModelResourceLocation(BlockLauncher.launchpart, 0,
			new ModelResourceLocation("rafradek_blocklauncher:launchpart", "inventory"));
	ModelLoader.setCustomModelResourceLocation(BlockLauncher.launchpartBetter, 0,
			new ModelResourceLocation("rafradek_blocklauncher:launchpart_better", "inventory"));
	RenderingRegistry.registerEntityRenderingHandler(EntityFallingEnchantedBlock.class,
			new IRenderFactory<EntityFallingEnchantedBlock>() {

				@Override
				public RenderFallingBlock createRenderFor(RenderManager manager) {
					// TODO Auto-generated method stub
					return new RenderFallingBlock(manager);
				}

			});
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:67,代码来源:BLClientProxy.java

示例8: setModelLocation

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private static void setModelLocation(Item item, String variantSettings) {
    ModelLoader.setCustomMeshDefinition(item, stack -> new ModelResourceLocation(item.getRegistryName().toString(), variantSettings));
}
 
开发者ID:primetoxinz,项目名称:Meltery,代码行数:5,代码来源:ClientProxy.java

示例9: registerRender

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
protected void registerRender(Item item, int meta, ModelResourceLocation location) {
    ModelBakery.registerItemVariants(item, location);
    ModelLoader.setCustomModelResourceLocation(item, meta, location);
    ModelLoader.setCustomMeshDefinition(item, stack -> location);
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:7,代码来源:EnumLoader.java

示例10: registerRender

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void registerRender() {
    ModelLoader.setCustomMeshDefinition(this, (stack) -> new ModelResourceLocation(FoodCraftReloaded.MODID + ":" + getUnlocalizedName(stack), "inventory"));
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:5,代码来源:ItemMetadataFood.java

示例11: registerStaticModel

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
public static void registerStaticModel(Item item, ModelResourceLocation staticLocation)
{
    ModelLoader.setCustomMeshDefinition(item, i -> staticLocation);
    ModelBakery.registerItemVariants(item, staticLocation);
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:6,代码来源:ClientRegistry.java

示例12: preInit

import net.minecraftforge.client.model.ModelLoader; //导入方法依赖的package包/类
@Override
public void preInit() {
	ModelLoader.setCustomMeshDefinition(PonySocks.sock, stack -> modelTypes[stack.getMetadata() % modelTypes.length]);
	ModelBakery.registerItemVariants(PonySocks.sock, modelTypes);
}
 
开发者ID:asiekierka,项目名称:PonySocks2,代码行数:6,代码来源:ClientProxy.java


注:本文中的net.minecraftforge.client.model.ModelLoader.setCustomMeshDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。