• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BiomeEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraftforge.event.terraingen.BiomeEvent的典型用法代码示例。如果您正苦于以下问题:Java BiomeEvent类的具体用法?Java BiomeEvent怎么用?Java BiomeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BiomeEvent类属于net.minecraftforge.event.terraingen包,在下文中一共展示了BiomeEvent类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onGrassColor

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public void onGrassColor(BiomeEvent.GetGrassColor event) {

	switch (CurrentSeason.getSeason()) {
	case SPRING :
		event.newColor = applyColor(event.newColor, springGrassColor, springGrassMultiplier);
		break;
	case SUMMER :
		event.newColor = applyColor(event.newColor, summerGrassColor, summerGrassMultiplier);
		break;
	case FALL :
		event.newColor = applyColor(event.newColor, fallGrassColor, fallGrassMultiplier);
		break;
	case WINTER :
		event.newColor = applyColor(event.newColor, winterGrassColor, winterGrassMultiplier);
		break;
	default:
		// no change
		break;
	}
}
 
开发者ID:Benimatic,项目名称:SimpleSeasons,代码行数:22,代码来源:BiomeColorHandler.java


示例2: onFoliageColor

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public void onFoliageColor(BiomeEvent.GetFoliageColor event) {
	switch (CurrentSeason.getSeason()) {
	case SPRING :
		event.newColor = applyColor(event.newColor, springFoliageColor, springFoliageMultiplier);
		break;
	case SUMMER :
		event.newColor = applyColor(event.newColor, summerFoliageColor, summerFoliageMultiplier);
		break;
	case FALL :
		event.newColor = applyColor(event.newColor, fallFoliageColor, fallFoliageMultiplier);
		break;
	case WINTER :
		event.newColor = applyColor(event.newColor, winterFoliageColor, winterFoliageMultiplier);
		break;
	default:
		// no change
		break;
	}
}
 
开发者ID:Benimatic,项目名称:SimpleSeasons,代码行数:21,代码来源:BiomeColorHandler.java


示例3: func_151557_c

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
protected int func_151557_c(Block p_151557_1_, int p_151557_2_)
{
    BiomeEvent.GetVillageBlockMeta event = new BiomeEvent.GetVillageBlockMeta(startPiece == null ? null : startPiece.biome, p_151557_1_, p_151557_2_);
    MinecraftForge.TERRAIN_GEN_BUS.post(event);
    if (event.getResult() == Result.DENY) return event.replacement;
    if (this.field_143014_b)
    {
        if (p_151557_1_ == Blocks.log || p_151557_1_ == Blocks.log2)
        {
            return 0;
        }

        if (p_151557_1_ == Blocks.cobblestone)
        {
            return 0;
        }

        if (p_151557_1_ == Blocks.planks)
        {
            return 2;
        }
    }

    return p_151557_2_;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:26,代码来源:StructureVillagePieces.java


示例4: onVillageBlocks

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public void onVillageBlocks(BiomeEvent.GetVillageBlockID event) {
    IBlockState original = event.getOriginal();

    if (event.getBiome() == ATGBiomes.TUNDRA) {
        if (original.getBlock() == Blocks.LOG || original.getBlock() == Blocks.LOG2) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE).withProperty(BlockLog.LOG_AXIS, original.getValue(BlockLog.LOG_AXIS)));
        } else if (original.getBlock() == Blocks.PLANKS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.SPRUCE));
        } else if (original.getBlock() == Blocks.OAK_STAIRS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.SPRUCE_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, original.getValue(BlockStairs.FACING)));
        } else if (original.getBlock() == Blocks.OAK_FENCE) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.SPRUCE_FENCE.getDefaultState());
        }
    }
    else if (event.getBiome() == ATGBiomes.SCRUBLAND) {
        if (original.getBlock() == Blocks.LOG || original.getBlock() == Blocks.LOG2) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.LOG2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.ACACIA).withProperty(BlockLog.LOG_AXIS, original.getValue(BlockLog.LOG_AXIS)));
        } else if (original.getBlock() == Blocks.PLANKS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.PLANKS.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.ACACIA));
        } else if (original.getBlock() == Blocks.OAK_STAIRS) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.ACACIA_STAIRS.getDefaultState().withProperty(BlockStairs.FACING, original.getValue(BlockStairs.FACING)));
        } else if (original.getBlock() == Blocks.OAK_FENCE) {
            event.setResult(Event.Result.DENY);
            event.setReplacement(Blocks.ACACIA_FENCE.getDefaultState());
        }
    }
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:36,代码来源:VillageBlocks.java


示例5: func_151558_b

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
protected Block func_151558_b(Block p_151558_1_, int p_151558_2_)
{
    BiomeEvent.GetVillageBlockID event = new BiomeEvent.GetVillageBlockID(startPiece == null ? null : startPiece.biome, p_151558_1_, p_151558_2_);
    MinecraftForge.TERRAIN_GEN_BUS.post(event);
    if (event.getResult() == Result.DENY) return event.replacement;
    if (this.field_143014_b)
    {
        if (p_151558_1_ == Blocks.log || p_151558_1_ == Blocks.log2)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.cobblestone)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.planks)
        {
            return Blocks.sandstone;
        }

        if (p_151558_1_ == Blocks.oak_stairs)
        {
            return Blocks.sandstone_stairs;
        }

        if (p_151558_1_ == Blocks.stone_stairs)
        {
            return Blocks.sandstone_stairs;
        }

        if (p_151558_1_ == Blocks.gravel)
        {
            return Blocks.sandstone;
        }
    }

    return p_151558_1_;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:41,代码来源:StructureVillagePieces.java


示例6: findReplacement

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
/**
 * Invokes the Forge events to figure out any block replacements due to
 * themes.
 */
public static IBlockState findReplacement(final BiomeGenBase biome, final IBlockState state) {
	// Ask subscribers if they want to replace
	final BiomeEvent.GetVillageBlockID event1 = new BiomeEvent.GetVillageBlockID(biome, state);
	MinecraftForge.TERRAIN_GEN_BUS.post(event1);
	if (event1.getResult() == Result.DENY)
		return event1.replacement;
	return state;
}
 
开发者ID:OreCruncher,项目名称:Restructured,代码行数:13,代码来源:BlockThemes.java


示例7: blockReplaceEvent

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOW)
public void blockReplaceEvent(final BiomeEvent.GetVillageBlockID event) {
	if (event.getResult() == Result.DENY)
		return;
	final Map<Block, ThemeBlock> replacements = themes.get(event.biome);
	if (replacements == null)
		return;

	// Crack the block portion
	final IBlockState original = event.original;
	final ThemeBlock theme = replacements.get(original.getBlock());
	if (theme == null)
		return;

	final Block newBlock = theme.getBlock();

	// Handle the meta
	int newMeta = theme.getMeta();
	if (newMeta != KEEP_META) {
		// Preserve slab orientation
		if (theme.isSlab())
			newMeta |= (theme.getMeta() & 8);
		// Preserve log orientation
		else if (theme.isLog())
			newMeta |= (theme.getMeta() & 12);
	} else {
		newMeta = original.getBlock().getMetaFromState(original);
	}

	event.replacement = newBlock.getStateFromMeta(newMeta);
	event.setResult(Result.DENY);
}
 
开发者ID:OreCruncher,项目名称:Restructured,代码行数:33,代码来源:BlockThemes.java


示例8: onGetFoliageColor

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onGetFoliageColor(BiomeEvent.GetFoliageColor event)
{
    event.setNewColor(getColor(ColorType.FOLIAGE, event.getBiome(), event.getOriginalColor()));
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:6,代码来源:JEDEventHandlerClient.java


示例9: onGetGrassColor

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onGetGrassColor(BiomeEvent.GetGrassColor event)
{
    event.setNewColor(getColor(ColorType.GRASS, event.getBiome(), event.getOriginalColor()));
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:6,代码来源:JEDEventHandlerClient.java


示例10: onGetWaterColor

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public static void onGetWaterColor(BiomeEvent.GetWaterColor event)
{
    event.setNewColor(getColor(ColorType.WATER, event.getBiome(), event.getOriginalColor()));
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:6,代码来源:JEDEventHandlerClient.java


示例11: darklandsVillages

import net.minecraftforge.event.terraingen.BiomeEvent; //导入依赖的package包/类
@SubscribeEvent
public void darklandsVillages(BiomeEvent.GetVillageBlockID event){
	if(event.getBiome() instanceof IDarklandsBiome){
		if(event.getOriginal().getBlock() == Blocks.LOG || event.getOriginal().getBlock() == Blocks.LOG2){
			event.setReplacement(ACBlocks.darklands_oak_wood.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.COBBLESTONE){
			event.setReplacement(ACBlocks.cobblestone.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.PLANKS){
			event.setReplacement(ACBlocks.darklands_oak_planks.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.OAK_STAIRS){
			event.setReplacement(ACBlocks.darklands_oak_stairs.getDefaultState().withProperty(BlockStairs.FACING, event.getOriginal().getValue(BlockStairs.FACING)));
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.STONE_STAIRS){
			event.setReplacement(ACBlocks.darkstone_cobblestone_stairs.getDefaultState().withProperty(BlockStairs.FACING, event.getOriginal().getValue(BlockStairs.FACING)));;
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.OAK_FENCE){
			event.setReplacement(ACBlocks.darklands_oak_fence.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.STONE_SLAB){
			event.setReplacement(ACBlocks.darkstone_slab.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.DOUBLE_STONE_SLAB){
			event.setReplacement(BlockHandler.Darkstoneslab2.getDefaultState());
			event.setResult(Result.DENY);
		}
		if(event.getOriginal().getBlock() == Blocks.WOODEN_PRESSURE_PLATE){
			event.setReplacement(ACBlocks.darklands_oak_pressure_plate.getDefaultState());
			event.setResult(Result.DENY);
		}
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:42,代码来源:AbyssalCraftEventHooks.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KeyControl类代码示例发布时间:2022-05-23
下一篇:
Java MenuScene类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap