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


Java ThaumcraftWorldGenerator类代码示例

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


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

示例1: taintplosion

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的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: onItemUse

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的package包/类
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    if (!world.isRemote) {
        int xMod = 0, yMod = 0, zMod = 0;
        switch(side) {
            case 0: yMod = -2; break; //since the rift is 2 blocks tall, we move it down 2 blocks if we click the bottom side of the block
            case 1: yMod = 1; break;
            case 2: zMod = -1; break;
            case 3: zMod = 1; break;
            case 4: xMod = -1; break;
            case 5: xMod = 1; break;
            default: yMod = 1;
        }
        ThaumcraftWorldGenerator.createNodeAt(world, x + xMod, y + yMod, z + zMod, NodeType.TAINTED, null, new AspectList().add(Aspect.TAINT, 10));
        return true;
    }
    return false;
}
 
开发者ID:Aurilux,项目名称:Xth-uoth,代码行数:18,代码来源:ItemTaintedNode.java

示例3: doBlockEffect

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的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: placeRandomNode

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的package包/类
private boolean placeRandomNode(World world, int x, int y, int z) {
    if(world.getBlock(x, y, z) == Blocks.air) {
        ThaumcraftWorldGenerator.createRandomNodeAt(world, x, y, z, world.rand, false, false, false);
        return world.getBlock(x, y, z) == ConfigBlocks.blockAiry;
    }
    return false;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:8,代码来源:ItemCreativeNode.java

示例5: onImpact

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的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

示例6: registerWorldChunkManager

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的package包/类
public void registerWorldChunkManager() {
    this.worldChunkMgr = new WorldChunkManagerHell(ThaumcraftWorldGenerator.biomeEldritchLands, 0.0F);
    this.dimensionId = ModConfig.dimOuterId;
    this.hasNoSky = true;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:6,代码来源:WorldProviderTCEldrich.java

示例7: onEntityUpdate

import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; //导入依赖的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.world.ThaumcraftWorldGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。