本文整理匯總了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());
}
示例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());
}
示例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");
}
});
}
示例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);
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
}
示例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);
}
}
示例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;
}
});
}
示例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;
}
});
}
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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);
}