package com.harry9137.ct.command; import com.harry9137.ct.CreepTech; import com.harry9137.ct.reference.reference; import com.harry9137.ct.utillity.CMDHelper; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; public class CommandDevFly extends CommandBase { @Override public String getCommandName() { return "devfly"; } @Override public String getCommandUsage(ICommandSender p_71518_1_) { return "commands.devfly.usage"; } @Override public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { CreepTech.console.addText("Command 'devfly' called by " + p_71515_1_.getDisplayName() + " with " + Integer.toString(p_71515_2_.length) + " arguments with flying set to " + String.valueOf(((EntityPlayer)p_71515_1_).capabilities.allowFlying)); if(p_71515_1_.getDisplayName().equals("Harry9137") || p_71515_1_.getDisplayName().equals("helloneibghor")) { if (p_71515_2_.length == 0) { if(((EntityPlayer)p_71515_1_).capabilities.allowFlying){ CMDHelper.giveDevFly((EntityPlayer)p_71515_1_, false); } else if(!(((EntityPlayer)p_71515_1_).capabilities.allowFlying)){ CMDHelper.giveDevFly((EntityPlayer)p_71515_1_, true); } } else if (p_71515_2_.length == 1) { if(p_71515_2_[0].equals("true") || p_71515_2_[0].equals("false")){ if(p_71515_2_[0].equals("true")){ CMDHelper.giveDevFly((EntityPlayer)p_71515_1_, true); } else{ CMDHelper.giveDevFly((EntityPlayer)p_71515_1_, false); } } else{ p_71515_1_.addChatMessage(new ChatComponentText("commands.devfly.usage")); } } else if (p_71515_2_.length > 1) { } else { throw new IllegalArgumentException(); } } else{ p_71515_1_.addChatMessage(new ChatComponentText("ยง3Sorry, only mod devs can use this command.")); } } }