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


Java StateMapperBase類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.block.statemap.StateMapperBase的典型用法代碼示例。如果您正苦於以下問題:Java StateMapperBase類的具體用法?Java StateMapperBase怎麽用?Java StateMapperBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StateMapperBase類屬於net.minecraft.client.renderer.block.statemap包,在下文中一共展示了StateMapperBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerModels

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
public void registerModels()
{
    ItemModels.register();
    //BlockModels.register();

    ModelLoader.setCustomStateMapper(ModBlocks.thorns,new StateMap.Builder().ignore(BlockThorns.FACING).build());
    ModelLoader.setCustomStateMapper(ModBlocks.brine, new BrineStateMapper());
    ModelLoader.setCustomStateMapper(ModBlocks.aqueductWater, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return aqueductWaterLocation;
        }
    });

    RenderingRegistry.registerEntityRenderingHandler(EntityGreatarrow.class, RenderGreatarrow.GREATARROW_RENDER);
    RenderingRegistry.registerEntityRenderingHandler(EntityYa.class, RenderYa.YA_RENDER);
    RenderingRegistry.registerEntityRenderingHandler(EntitySpirit.class, manager -> new RenderSpirit(manager));
    RenderingRegistry.registerEntityRenderingHandler(EntityAncestryBottle.class, manager -> new RenderSnowball<>(manager,ModItems.ancestryBottle,Minecraft.getMinecraft().getRenderItem()));
    RenderingRegistry.registerEntityRenderingHandler(EntityArtifactFrame.class, RenderArtifactFrame.ARTIFACEFRAME_RENDER);
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAlchDragon.class, new RenderAlchDragon());
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:22,代碼來源:ClientProxy.java

示例2: initModel

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
	StateMapperBase ignoreState = new StateMapperBase() {
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState iBlockState) {
			return ModelPipeBaked.BAKED_MODEL;
		}
	};
	ModelLoader.setCustomStateMapper(this, ignoreState);
	ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation(getRegistryName(), "inventory");
	//for(PipeType type : PipeType.values())
	// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(this), type.getMeta(), itemModelResourceLocation);
	for(PipeType type : PipeType.values())
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), type.getMeta(), itemModelResourceLocation);
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new TileEntityPipeRenderer());
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:18,代碼來源:BlockPipe.java

示例3: registerBlockWithStateMapper

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
public static void registerBlockWithStateMapper(Block block)
{
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getBlockModelShapes().registerBlockWithStateMapper(block, new StateMapperBase() 
	{
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state)
		{
			return new ModelResourceLocation(state.getBlock().getRegistryName(), "normal");
		}
		
	});

	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), new ItemMeshDefinition() 
	{
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) 
		{
			return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
		}
	});
}
 
開發者ID:Modding-Legacy,項目名稱:Aether-Legacy,代碼行數:22,代碼來源:BlockRendering.java

示例4: registerFluidsClient

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
public static final void registerFluidsClient()
{
    final ModelResourceLocation fluidSteamLocation = new ModelResourceLocation(QBarConstants.MODID + ":" +
            "blockfluidsteam",
            "steam");
    ModelLoader.setCustomStateMapper(QBarFluids.blockFluidSteam, new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(final IBlockState state)
        {
            return fluidSteamLocation;
        }
    });

    ModelBakery.registerItemVariants(Item.getItemFromBlock(QBarFluids.blockFluidSteam), fluidSteamLocation);
    ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(QBarFluids.blockFluidSteam),
            stack -> fluidSteamLocation);
}
 
開發者ID:OPMCorp,項目名稱:Qbar,代碼行數:19,代碼來源:ClientProxy.java

示例5: registerRenderer

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void registerRenderer() {
    IFluidBlock block = BlocksRegistry.liquidXpBlock;
    Item item = Item.getItemFromBlock((Block)block);
    assert (item == Items.AIR);

    ModelBakery.registerItemVariants(item);

    ModelResourceLocation modelResourceLocation = new ModelResourceLocation(MekfarmMod.MODID + ":fluids", this.getName());

    ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) {
            return modelResourceLocation;
        }
    });

    ModelLoader.setCustomStateMapper((Block) block, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return modelResourceLocation;
        }
    });
}
 
開發者ID:faceofcat,項目名稱:Mekfarm,代碼行數:25,代碼來源:LiquidXPFluid.java

示例6: registerRenderer

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void registerRenderer() {
    IFluidBlock block = BlocksRegistry.sewageBlock;
    Item item = Item.getItemFromBlock((Block)block);
    assert (item == Items.AIR);

    ModelBakery.registerItemVariants(item);

    ModelResourceLocation modelResourceLocation = new ModelResourceLocation(MekfarmMod.MODID + ":fluids", this.getName());

    ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
        @Override
        public ModelResourceLocation getModelLocation(ItemStack stack) {
            return modelResourceLocation;
        }
    });

    ModelLoader.setCustomStateMapper((Block) block, new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return modelResourceLocation;
        }
    });
}
 
開發者ID:faceofcat,項目名稱:Mekfarm,代碼行數:25,代碼來源:SewageFluid.java

示例7: registerFluidModel

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
public void registerFluidModel(Block  block) {
	Item item = Item.getItemFromBlock(block);

	ModelBakery.registerItemVariants(item);

	final ModelResourceLocation loc = new ModelResourceLocation(Reference.MODID + ":fluid", "liquidmalgra");

	ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) {
			return loc;
		}
	});

	ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
			return loc;
		}
	});
}
 
開發者ID:Ohrm,項目名稱:Malgra,代碼行數:22,代碼來源:ClientProxy.java

示例8: preInit

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@Override
public void preInit(FMLPreInitializationEvent event) {
	super.preInit(event);
	for (final String name : Fluids.getFluidBlockRegistry().keySet()) {
		final Block block = Fluids.getFluidBlockByName(name);
		final Item item = Item.getItemFromBlock(block);
		if (!item.getRegistryName().getResourceDomain().equals(BaseGems.MODID))
			continue;
		final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(item.getRegistryName().getResourceDomain() + ":" + name, "fluid");
		ModelBakery.registerItemVariants(item);
		ModelLoader.setCustomMeshDefinition(item, stack -> fluidModelLocation);
		ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
			@Override
			protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
				return fluidModelLocation;
			}
		});
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:BaseGems,代碼行數:20,代碼來源:ClientProxy.java

示例9: registerCustomBlockRenderer

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public void registerCustomBlockRenderer(ICustomRenderedBlock customRenderedBlock) {
    if (customRenderedBlock == null || !(customRenderedBlock instanceof BlockBase)) {
        return;
    }
    //set custom state mapper
    StateMapperBase stateMapper = new StateMapperBase() {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
            return customRenderedBlock.getBlockModelResourceLocation();
        }
    };
    ModelLoader.setCustomStateMapper((BlockBase) customRenderedBlock, stateMapper);
    //register renderers
    if (customRenderedBlock instanceof ICustomRenderedBlockWithTile) {
        registerTileRenderer((ICustomRenderedBlockWithTile) customRenderedBlock);
    } else {
        registerBlockRenderer(customRenderedBlock);
    }
}
 
開發者ID:InfinityRaider,項目名稱:InfinityLib,代碼行數:21,代碼來源:BlockRendererRegistry.java

示例10: buildRenderFor

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public static void buildRenderFor(Block block, String name)
{
	final ModelResourceLocation fluidLocation = new ModelResourceLocation(MReference.MODID + ":" + name, "fluid");
	Item fluid = Item.getItemFromBlock(block);
	ModelBakery.addVariantName(fluid);
	ModelLoader.setCustomMeshDefinition(fluid, new ItemMeshDefinition()
	{
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack)
		{
			return fluidLocation;
		}
	});
	ModelLoader.setCustomStateMapper(block, new StateMapperBase()
	{
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state)
		{
			return fluidLocation;
		}
	});
}
 
開發者ID:MinestrapTeam,項目名稱:Minestrappolation-4,代碼行數:24,代碼來源:MFluid.java

示例11: bakeModels

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
public static void bakeModels(String modID){
	for(Fluid fluid : fluidBlocks.keySet()){
		BlockFluidBase block = fluidBlocks.get(fluid);
		Item item = Item.getItemFromBlock(block);
		final ModelResourceLocation fluidModelLocation = new ModelResourceLocation(
				modID.toLowerCase() + ":" + fluidBlockNames.get(block), "fluid");
           ModelBakery.registerItemVariants(item);
		ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition()
		{
			public ModelResourceLocation getModelLocation(ItemStack stack)
			{
				return fluidModelLocation;
			}
		});
		ModelLoader.setCustomStateMapper(block, new StateMapperBase()
		{
			protected ModelResourceLocation getModelResourceLocation(IBlockState state)
			{
				return fluidModelLocation;
			}
		});
	}
}
 
開發者ID:cyanobacterium,項目名稱:BaseMetals,代碼行數:25,代碼來源:Fluids.java

示例12: registerFluidModel

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
private void registerFluidModel(Block fluidBlock, String name) {
	Item item = Item.getItemFromBlock(fluidBlock);

	ModelBakery.registerItemVariants(item);

	final ModelResourceLocation modelResourceLocation = new ModelResourceLocation("abyssalcraft:fluid", name);

	ModelLoader.setCustomMeshDefinition(item, stack -> modelResourceLocation);

	ModelLoader.setCustomStateMapper(fluidBlock, new StateMapperBase() {
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) {
			return modelResourceLocation;
		}
	});
}
 
開發者ID:Shinoow,項目名稱:AbyssalCraft,代碼行數:17,代碼來源:AbyssalCraftClientEventHooks.java

示例13: registerFluidBlockRendering

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@Override
public void registerFluidBlockRendering(Block block, String name) 
{    	
    final ModelResourceLocation fluidLocation = new ModelResourceLocation(HarshenCastle.MODID.toLowerCase() + ":fluids", name);

    ModelLoader.setCustomStateMapper(block, new StateMapperBase()
    {
        @Override
        protected ModelResourceLocation getModelResourceLocation(IBlockState state)
        {

            return fluidLocation;
        }
    });
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:16,代碼來源:ClientProxy.java

示例14: initModels

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的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

示例15: registerModels

import net.minecraft.client.renderer.block.statemap.StateMapperBase; //導入依賴的package包/類
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event){
	StateMapperBase mapper=new StateMapperBase() {
		
		@Override
		protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
			return new ModelResourceLocation(new ResourceLocation(Constants.MODID, "creosote"), "creosote");
		}
	};
	if(FluidsRegistry.BlockCreosote!=null)
		ModelLoader.setCustomStateMapper(FluidsRegistry.BlockCreosote, mapper);
}
 
開發者ID:EnderiumSmith,項目名稱:CharcoalPit,代碼行數:13,代碼來源:BlocksRegistry.java


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