diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/general')
| -rw-r--r-- | src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java index ea4d8f5a1b..fc92d5d82c 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemAreaClear.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.item.general; import java.util.List; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.CoreItem; import gtPlusPlus.core.lib.CORE; @@ -107,35 +108,40 @@ public class ItemAreaClear extends CoreItem { int y1 = pos.yPos; int z1 = pos.zPos; - int x2 = (x1-12); - int y2 = (y1-5); - int z2 = (z1-12); + int x2 = (x1-24); + int y2 = (y1-10); + int z2 = (z1-24); removeBlockColumn(world, new BlockPos(x2, y2, z2)); return true; } public boolean removeBlockColumn(World world, BlockPos pos){ - for (int i=0; i<25; i++){ + for (int i=0; i<50; i++){ + removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos-10, pos.zPos+i)); removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i)); + removeBlockRow(world, new BlockPos(pos.xPos, pos.yPos+10, pos.zPos+i)); } return true; } public boolean removeBlockRow(World world, BlockPos pos){ - for (int j=0; j<10; j++){ - for (int i=0; i<25; i++){ - if (!world.isAirBlock(pos.xPos+i, pos.yPos+j, pos.zPos) && - world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){ - int chance = MathUtils.randInt(0, 100); - if (chance <= 0){ - if (pos.yPos+j <= 50){ - world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.glowstone); + for (int j=0; j<20; j++){ + for (int i=0; i<50; i++){ + + if (!(world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) instanceof BlockBaseOre)){ + if (!world.isAirBlock(pos.xPos+i, pos.yPos+j, pos.zPos) && + world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){ + int chance = MathUtils.randInt(0, 100); + if (chance <= 0){ + if (pos.yPos+j <= 50){ + world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.glowstone); + } } - } - else { - if ((world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) == Blocks.glowstone && ((pos.yPos+j) > 50)) || world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.glowstone){ - world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.air); + else { + if ((world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) == Blocks.glowstone && ((pos.yPos+j) > 50)) || world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.glowstone){ + world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.air); + } } } } @@ -168,7 +174,7 @@ public class ItemAreaClear extends CoreItem { for (int j=0; j<2; j++){ for (int i=0; i<21; i++){ if (world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){ - world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.grass); + world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.grass); } } } |
