That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -1,16 +1,9 @@
package electroblob.wizardry.command;
import java.util.List;
import electroblob.wizardry.WizardData;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.data.WizardData;
import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.NumberInvalidException;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.command.WrongUsageException;
import net.minecraft.command.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
@@ -18,6 +11,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import java.util.List;
public class CommandSetAlly extends CommandBase {
@Override
@@ -85,10 +80,12 @@ public class CommandSetAlly extends CommandBase {
if(allyOf != sender && sender instanceof EntityPlayer
&& !WizardryUtilities.isPlayerOp((EntityPlayer)sender, server)){
// Displays a chat message if a non-op tries to modify another player's allies.
TextComponentTranslation TextComponentTranslation2 = new TextComponentTranslation(
"commands." + Wizardry.MODID + ":ally.permission");
TextComponentTranslation2.getStyle().setColor(TextFormatting.RED);
allyOf.sendMessage(TextComponentTranslation2);
if(server.sendCommandFeedback()){
TextComponentTranslation TextComponentTranslation2 = new TextComponentTranslation(
"commands." + Wizardry.MODID + ":ally.permission");
TextComponentTranslation2.getStyle().setColor(TextFormatting.RED);
allyOf.sendMessage(TextComponentTranslation2);
}
return;
}
@@ -102,15 +99,17 @@ public class CommandSetAlly extends CommandBase {
if(allyOf == ally) throw new NumberInvalidException("commands." + Wizardry.MODID + ":ally.self");
if(WizardData.get(allyOf) != null){
String string = WizardData.get(allyOf).toggleAlly(ally) ? "add" : "remove";
if(executeAsOtherPlayer){
sender.sendMessage(new TextComponentTranslation("commands." + Wizardry.MODID + ":ally." + string + "ally",
ally.getName(), allyOf.getName()));
// In this case, the player whose allies have been modified is also notified.
allyOf.sendMessage(new TextComponentTranslation("item.wand." + string + "ally", ally.getName()));
}else{
sender.sendMessage(new TextComponentTranslation("item.wand." + string + "ally", ally.getName()));
if(server.sendCommandFeedback()){
if(WizardData.get(allyOf) != null){
String string = WizardData.get(allyOf).toggleAlly(ally) ? "add" : "remove";
if(executeAsOtherPlayer){
sender.sendMessage(new TextComponentTranslation("commands." + Wizardry.MODID + ":ally." + string + "ally",
ally.getName(), allyOf.getName()));
// In this case, the player whose allies have been modified is also notified.
allyOf.sendMessage(new TextComponentTranslation("item.wand." + string + "ally", ally.getName()));
}else{
sender.sendMessage(new TextComponentTranslation("item.wand." + string + "ally", ally.getName()));
}
}
}