Non résolu [1.8.9] Commande n'executant pas quand on mets l'argument player(in game)
-
Re, title.exe
La classe commandepackage com.daichmff.modaichmod; import java.util.List; import com.google.common.collect.Lists; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.command.WrongUsageException; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; public class Command1 extends CommandBase implements ICommand { @Override public int compareTo(ICommand arg0) { // TODO Auto-generated method stub return 0; } @Override public String getCommandName() { // TODO Auto-generated method stub return "damage"; } @Override public String getCommandUsage(ICommandSender sender) { // TODO Auto-generated method stub return "setdamage.help"; } @Override public List<String> getCommandAliases() { // TODO Auto-generated method stub return Lists.newArrayList("sd"); } @Override public void processCommand(ICommandSender sender, String[] arguments) throws CommandException { if(arguments.length <= 0) throw new WrongUsageException(this.getCommandUsage(sender)); if(arguments[0].matches("fire")) { if(arguments.length == 2) { EntityPlayerMP playermp = this.getCommandSenderAsPlayer(sender); if(playermp != null) { playermp.setFire(this.parseInt(sender, arguments[1])); playermp.setFire(4); } else { } } if(arguments[0].matches("explode")) { } if(arguments[0].matches("magic")) { } if(arguments[0].matches("projectile")) { } else if(arguments[0].matches("fire")) { if(arguments.length == 2) { EntityPlayerMP playermp = this.getCommandSenderAsPlayer(sender); if(playermp != null) { playermp.setFire(this.parseInt(sender, arguments[1])); } else { } } else if(arguments.length == 3) { if(arguments[2].matches("help")) { } else { EntityPlayerMP playermp = MinecraftServer.getServer().getConfigurationManager().getPlayerByUsername(arguments[1]); if(playermp != null) { playermp.setFire(this.parseInt(sender, arguments[2])); } else { } } } else { } } if(arguments[0].matches("help")) { } } } private int parseInt(ICommandSender sender, String string) { // TODO Auto-generated method stub return 0; } @Override public boolean canCommandSenderUseCommand(ICommandSender sender) { return true; } @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { // TODO Auto-generated method stub return null; } @Override public boolean isUsernameIndex(String[] args, int index) { // TODO Auto-generated method stub return false; } }
Merci d’avance