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


Java Biomes.HELL属性代码示例

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


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

示例1: createBiomeProvider

/**
 * creates a new world chunk manager for WorldProvider
 */
public void createBiomeProvider()
{
    this.biomeProvider = new BiomeProviderSingle(Biomes.HELL);
    this.isHellWorld = true;
    this.hasNoSky = true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:WorldProviderHell.java

示例2: findBiome

public Biome findBiome(String p_findBiome_1_)
{
    p_findBiome_1_ = p_findBiome_1_.toLowerCase();

    if (p_findBiome_1_.equals("nether"))
    {
        return Biomes.HELL;
    }
    else
    {
        for (ResourceLocation resourcelocation : Biome.REGISTRY.getKeys())
        {
            Biome biome = (Biome)Biome.REGISTRY.getObject(resourcelocation);

            if (biome != null)
            {
                String s = biome.getBiomeName().replace(" ", "").toLowerCase();

                if (s.equals(p_findBiome_1_))
                {
                    return biome;
                }
            }
        }

        return null;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:ConnectedParser.java

示例3: updateMobSpawning

public static void updateMobSpawning() {
	ArrayList<Biome> biomesList = new ArrayList<Biome>();
	for (Biome biome : GameRegistry.findRegistry(Biome.class)){
		if(biome!=Biomes.HELL && biome!=Biomes.SKY)
		biomesList.add(biome);
	}
	if (!TF2ConfigVars.disableSpawn) {
		Biome[] biomes = biomesList.toArray(new Biome[biomesList.size()]);
		for(Entry<Class<? extends EntityLiving>, Integer> entry:TF2ConfigVars.spawnRate.entrySet()) {
			EntityRegistry.addSpawn(entry.getKey(), entry.getValue().intValue(), 1, 3, EnumCreatureType.MONSTER, biomes);
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:13,代码来源:TF2weapons.java

示例4: init

@Override
public void init()
{
    this.biomeProvider = new BiomeProviderSingle(Biomes.HELL);
    this.doesWaterVaporize = true;
    this.nether = true;
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:7,代码来源:WorldProviderHellJED.java

示例5: onBlockActivated

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiome(pos) != Biomes.HELL)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]), true);
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.SleepResult entityplayer$sleepresult = playerIn.trySleep(pos);

            if (entityplayer$sleepresult == EntityPlayer.SleepResult.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]), true);
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]), true);
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.TOO_FAR_AWAY)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.tooFarAway", new Object[0]), true);
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:76,代码来源:BlockBed.java

示例6: onBlockActivated

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiome(pos) != Biomes.HELL)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]));
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.SleepResult entityplayer$sleepresult = playerIn.trySleep(pos);

            if (entityplayer$sleepresult == EntityPlayer.SleepResult.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]));
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]));
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:72,代码来源:BlockBed.java

示例7: onBlockActivated

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return true;
    }
    else
    {
        if (state.getValue(PART) != BlockBed.EnumPartType.HEAD)
        {
            pos = pos.offset((EnumFacing)state.getValue(FACING));
            state = worldIn.getBlockState(pos);

            if (state.getBlock() != this)
            {
                return true;
            }
        }

        if (worldIn.provider.canRespawnHere() && worldIn.getBiomeGenForCoords(pos) != Biomes.HELL)
        {
            if (((Boolean)state.getValue(OCCUPIED)).booleanValue())
            {
                EntityPlayer entityplayer = this.getPlayerInBed(worldIn, pos);

                if (entityplayer != null)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.occupied", new Object[0]));
                    return true;
                }

                state = state.withProperty(OCCUPIED, Boolean.valueOf(false));
                worldIn.setBlockState(pos, state, 4);
            }

            EntityPlayer.SleepResult entityplayer$sleepresult = playerIn.trySleep(pos);

            if (entityplayer$sleepresult == EntityPlayer.SleepResult.OK)
            {
                state = state.withProperty(OCCUPIED, Boolean.valueOf(true));
                worldIn.setBlockState(pos, state, 4);
                return true;
            }
            else
            {
                if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_POSSIBLE_NOW)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.noSleep", new Object[0]));
                }
                else if (entityplayer$sleepresult == EntityPlayer.SleepResult.NOT_SAFE)
                {
                    playerIn.addChatComponentMessage(new TextComponentTranslation("tile.bed.notSafe", new Object[0]));
                }

                return true;
            }
        }
        else
        {
            worldIn.setBlockToAir(pos);
            BlockPos blockpos = pos.offset(((EnumFacing)state.getValue(FACING)).getOpposite());

            if (worldIn.getBlockState(blockpos).getBlock() == this)
            {
                worldIn.setBlockToAir(blockpos);
            }

            worldIn.newExplosion((Entity)null, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 5.0F, true, true);
            return true;
        }
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:72,代码来源:BlockBed.java


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