Search in sources :

Example 1 with TakumiWorldGenTrees

use of com.tntmodders.takumi.world.gen.TakumiWorldGenTrees in project takumicraft by TNTModders.

the class EntityTreeCreeper method takumiExplode.

@Override
public void takumiExplode() {
    if (!this.world.isRemote) {
        this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.getPowered() ? 6 : 3, false);
        WorldGenAbstractTree tree = this.getPowered() ? new TakumiWorldGenBigTree(true, TakumiBlockCore.CREEPER_LOG.getDefaultState(), TakumiBlockCore.CREEPER_LEAVES.getDefaultState()) : new TakumiWorldGenTrees(true, false, TakumiBlockCore.CREEPER_LOG.getDefaultState(), TakumiBlockCore.CREEPER_LEAVES.getDefaultState());
        tree.generate(this.world, this.rand, new BlockPos(this));
        Calendar calendar = this.world.getCurrentDate();
        int month = calendar.get(Calendar.MONTH) + 1;
        int date = calendar.get(Calendar.DATE);
        if (month == 12 && (date == 24 || date == 25)) {
            for (int i = 0; i < 45; i++) {
                BlockPos pos = this.getPosition().add(this.rand.nextInt(40) - 20, 0, this.rand.nextInt(40) - 20);
                pos = pos.up(this.world.getHeight(pos).getY() - pos.getY());
                EntityFireworksCreeper.createTree(this, pos);
            }
        }
    }
}
Also used : Calendar(java.util.Calendar) TakumiWorldGenTrees(com.tntmodders.takumi.world.gen.TakumiWorldGenTrees) WorldGenAbstractTree(net.minecraft.world.gen.feature.WorldGenAbstractTree) TakumiWorldGenBigTree(com.tntmodders.takumi.world.gen.TakumiWorldGenBigTree) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with TakumiWorldGenTrees

use of com.tntmodders.takumi.world.gen.TakumiWorldGenTrees in project takumicraft by TNTModders.

the class EntityNaturalCreeper method takumiExplode.

@Override
public void takumiExplode() {
    if (!this.world.isRemote) {
        this.world.createExplosion(this, this.posX, this.posY, this.posZ, this.getPowered() ? 6 : 3, false);
        WorldGenAbstractTree tree = this.getPowered() ? new TakumiWorldGenBigTree(true, TakumiBlockCore.GUNORE.getDefaultState(), TakumiBlockCore.CREEPER_BOMB.getDefaultState()) : new TakumiWorldGenTrees(true, false, TakumiBlockCore.GUNORE.getDefaultState(), TakumiBlockCore.CREEPER_BOMB.getDefaultState());
        tree.generate(this.world, this.rand, new BlockPos(this));
    }
}
Also used : TakumiWorldGenTrees(com.tntmodders.takumi.world.gen.TakumiWorldGenTrees) WorldGenAbstractTree(net.minecraft.world.gen.feature.WorldGenAbstractTree) TakumiWorldGenBigTree(com.tntmodders.takumi.world.gen.TakumiWorldGenBigTree) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

TakumiWorldGenBigTree (com.tntmodders.takumi.world.gen.TakumiWorldGenBigTree)2 TakumiWorldGenTrees (com.tntmodders.takumi.world.gen.TakumiWorldGenTrees)2 BlockPos (net.minecraft.util.math.BlockPos)2 WorldGenAbstractTree (net.minecraft.world.gen.feature.WorldGenAbstractTree)2 Calendar (java.util.Calendar)1