From 62fb79a6b0305df6d23157b2e7148093c88493f9 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 11 Mar 2016 11:01:51 +0000 Subject: [PATCH] Added world clear command to test ores --- .../command/TechRebornDevCommand.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/techreborn/command/TechRebornDevCommand.java b/src/main/java/techreborn/command/TechRebornDevCommand.java index 7b69818ff..c0300dac4 100644 --- a/src/main/java/techreborn/command/TechRebornDevCommand.java +++ b/src/main/java/techreborn/command/TechRebornDevCommand.java @@ -3,6 +3,9 @@ package techreborn.command; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraftforge.fluids.Fluid; import reborncore.api.fuel.FluidPowerManager; @@ -43,11 +46,18 @@ public class TechRebornDevCommand extends CommandBase { sender.addChatMessage(new ChatComponentText("Found invalid fluid entry")); } } -// } else if ("parts".equals(args[0])) { //TODO 1.8 -// for (IModPart part : ModPartRegistry.parts) { -// sender.addChatMessage(new ChatComponentText(part.getName())); -// } -// } + } else if ("clear".equals(args[0])) { + EntityPlayerMP playerMP = (EntityPlayerMP) sender; + for (int x = 0; x < 25; x++) { + for (int z = 0; z < 25; z++) { + for (int y = 0; y < playerMP.posY; y++) { + BlockPos pos = new BlockPos(playerMP.posX + x, y, playerMP.posZ + z); + if (playerMP.worldObj.getBlockState(pos).getBlock() == Blocks.stone || playerMP.worldObj.getBlockState(pos).getBlock() == Blocks.dirt) { + playerMP.worldObj.setBlockState(pos, Blocks.air.getDefaultState(), 2); + } + } + } + } } } }