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


Java Utils.setBiomeAt方法代码示例

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


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

示例1: taintplosion

import thaumcraft.common.lib.utils.Utils; //导入方法依赖的package包/类
public static void taintplosion(World world, int x, int y, int z, boolean taintBiome, int chanceToTaint, float str, int size, int blocksAffected) {
    if(chanceToTaint < 1) chanceToTaint = 1;
    world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, str, false);
    for (int a = 0; a < blocksAffected; a++) {
        int xx = x + world.rand.nextInt(size) - world.rand.nextInt(size);
        int yy = y + world.rand.nextInt(size) - world.rand.nextInt(size);
        int zz = z + world.rand.nextInt(size) - world.rand.nextInt(size);
        if (world.isAirBlock(xx, yy, zz)) {
            if (yy < y) {
                world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGoo, 8, 3);
            } else {
                world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGas, 8, 3);
            }
        }
        if(!Config.genTaint) continue;

        if(taintBiome && world.rand.nextInt(chanceToTaint) == 0) {
            Utils.setBiomeAt(world, xx, zz, ThaumcraftWorldGenerator.biomeTaint);
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:22,代码来源:ExplosionHelper.java

示例2: cleanseBiomeAroundTile

import thaumcraft.common.lib.utils.Utils; //导入方法依赖的package包/类
public static void cleanseBiomeAroundTile(TileEntity tile) {
    if (!tile.getWorldObj().isRemote && tile.getWorldObj().rand.nextInt(35) == 0) {
        int x = tile.getWorldObj().rand.nextInt(5) - 2;
        int z = tile.getWorldObj().rand.nextInt(5) - 2;

        int tileBiome = tile.getWorldObj().getBiomeGenForCoords(x + tile.xCoord, z + tile.zCoord).biomeID;
        if (tileBiome == Config.biomeTaintID || tileBiome == Config.biomeEerieID || tileBiome == Config.biomeMagicalForestID) {
            BiomeGenBase[] biomesForGeneration = null;
            biomesForGeneration = tile.getWorldObj().getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x + tile.xCoord, z + tile.zCoord, 1, 1);
            if (biomesForGeneration != null && biomesForGeneration.length > 0 && biomesForGeneration[0] != null) {
                BiomeGenBase biome = biomesForGeneration[0];
                Utils.setBiomeAt(tile.getWorldObj(), x + tile.xCoord, z + tile.zCoord, biome);
            }
        }
    }
}
 
开发者ID:CannibalVox,项目名称:NewRadicalBotany,代码行数:17,代码来源:BiomeCleanseSupport.java

示例3: doBlockEffect

import thaumcraft.common.lib.utils.Utils; //导入方法依赖的package包/类
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
    if(!Config.genTaint) return;
    int x = selectedBlock.posX;
    int y = selectedBlock.posY;
    int z = selectedBlock.posZ;
    BlockTaintFibres.spreadFibres(world, x, y, z);
    if(world.rand.nextInt(12) == 0) {
        Utils.setBiomeAt(world, x, z, ThaumcraftWorldGenerator.biomeTaint);
        world.addBlockEvent(x, y, z, world.getBlock(x, y, z), 1, 0);
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:13,代码来源:AuraEffects.java

示例4: onImpact

import thaumcraft.common.lib.utils.Utils; //导入方法依赖的package包/类
@Override
protected void onImpact(MovingObjectPosition movingObjectPosition)
{
    if (!worldObj.isRemote)
    {

        List entities = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(5.0D, 5.0D, 5.0D));
        if (entities.size() > 0)
        {
            Iterator iterator = entities.iterator();

            while (iterator.hasNext())
            {
                Object y = iterator.next();
                EntityLivingBase entity = (EntityLivingBase) y;
                if (entity instanceof ITaintedMob && !entity.isEntityUndead())
                    entity.addPotionEffect(new PotionEffect(CommonProxy.ethereal.getId(), 1200, 0, false));
            }
        }

        int entityPosX = (int) this.posX;
        int entityPosY = (int) this.posY;
        int entityPosZ = (int) this.posZ;

        for (int i = 0; i < 10; ++i)
        {
            int x = (int) ((this.rand.nextFloat() - this.rand.nextFloat()) * 5.0F);
            int z = (int) ((this.rand.nextFloat() - this.rand.nextFloat()) * 5.0F);
            if ((this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeTaintID || this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeEerieID || this.worldObj.getBiomeGenForCoords(x + entityPosX, z + entityPosZ).biomeID == Config.biomeMagicalForestID))
            {
                BiomeGenBase[] biomesForGeneration = null;
                biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x + entityPosX, z + entityPosZ, 1, 1);
                if (biomesForGeneration != null && biomesForGeneration[0] != null)
                {
                    BiomeGenBase biome = biomesForGeneration[0];
                    if (biome.biomeID == ThaumcraftWorldGenerator.biomeTaint.biomeID)
                    {
                        biome = BiomeGenBase.plains;
                    }

                    Utils.setBiomeAt(this.worldObj, x + entityPosX, z + entityPosZ, biome);
                    worldObj.markBlockRangeForRenderUpdate(x + entityPosX, entityPosY - 1, z + entityPosZ, x + entityPosX + 16, entityPosY, z + entityPosZ + 16);
                }
            }
        }
        this.setDead();
    } else
    {
        ThaumicThings.proxy.onBottleBreak(ThaumicThings.proxy.bottleEthereal, worldObj, posX, posY, posZ);
    }
}
 
开发者ID:Thog,项目名称:ThaumicThings,代码行数:52,代码来源:EntityBottleEthereal.java

示例5: onEntityUpdate

import thaumcraft.common.lib.utils.Utils; //导入方法依赖的package包/类
@Override
public void onEntityUpdate() {
    //Spread taint just like tainted nodes, but twice as fast
    //TODO add a config option for speed, and a toggle?
    tickCounter++;
    if (this.dimension == 0 && tickCounter % 25 == 0) {
        int y = 0;
        int x = MathHelper.floor_double(this.posX - .5D) + worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
        int z = MathHelper.floor_double(this.posZ) + worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
        BiomeGenBase bg = worldObj.getBiomeGenForCoords(x, z);
        if (bg.biomeID != ThaumcraftWorldGenerator.biomeTaint.biomeID) {
            Utils.setBiomeAt(worldObj, x, z, ThaumcraftWorldGenerator.biomeTaint);
        }
        if ((Config.hardNode) && (worldObj.rand.nextBoolean())) {
            x = MathHelper.floor_double(this.posX - .5D) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
            y = MathHelper.floor_double(this.posY) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
            z = MathHelper.floor_double(this.posZ) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
            BlockTaintFibres.spreadFibres(worldObj, x, y, z);
        }
    }
    
    //Spawn a random aberration
    int spawnChance = 4000; //nether portals spawn chance is 2000, though entities seem to update more often than blocks
    if (!worldObj.isRemote && worldObj.provider.isSurfaceWorld() &&
        worldObj.getGameRules().getGameRuleBooleanValue("doMobSpawning") &&
        worldObj.rand.nextInt(spawnChance) < worldObj.difficultySetting.getDifficultyId()) {

        //TODO change getTrackingRange to getModEntityId when the issue is fixed
        int entityId = EntityRegistry.instance().lookupModSpawn(
                FMLCommonHandler.instance().findContainerFor(Xthuoth.instance),
                worldObj.rand.nextInt(ModEntities.maxAberrationId)).getTrackingRange();

        Block blockBelow = worldObj.getBlock(MathHelper.floor_double(this.posX - .5D),
            MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ));
        if (posY > 0 && blockBelow.isNormalCube()) {
            Entity entity = ItemSpawnEgg.spawnCreature(worldObj, entityId, posX + 0.5D, posY + .5D, posZ + 0.5D);
            if (entity != null) {
                entity.timeUntilPortal = entity.getPortalCooldown();
            }
        }
    }
}
 
开发者ID:Aurilux,项目名称:Xth-uoth,代码行数:43,代码来源:EntityRift.java


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