Fix required permissions level for the regen energy values command

Change up the sync energy values command to be "push to all players" rather than "request a sync for the person running the command"
This commit is contained in:
Pahimar 2016-05-24 23:17:26 -04:00
parent 30c0eb46b7
commit 568196aa9e
2 changed files with 3 additions and 4 deletions

View file

@ -28,7 +28,7 @@ public class CommandRegenEnergyValues extends CommandBase {
@Override @Override
public int getRequiredPermissionLevel() { public int getRequiredPermissionLevel() {
return 4; return 2;
} }
@Override @Override

View file

@ -11,7 +11,6 @@ import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException; import net.minecraft.command.WrongUsageException;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatComponentTranslation;
import java.util.HashMap; import java.util.HashMap;
@ -62,8 +61,8 @@ public class CommandSyncEnergyValues extends CommandBase
} }
if (shouldSync) { if (shouldSync) {
LogHelper.info(EnergyValueRegistry.ENERGY_VALUE_MARKER, "Syncing energy values with player '{}' at their request", commandSender.getCommandSenderName()); LogHelper.info(EnergyValueRegistry.ENERGY_VALUE_MARKER, "Syncing energy values with all players at {}'s request", commandSender.getCommandSenderName());
PacketHandler.INSTANCE.sendTo(new MessageSyncEnergyValues(), (EntityPlayerMP) commandSender); PacketHandler.INSTANCE.sendToAll(new MessageSyncEnergyValues());
commandSender.addChatMessage(new ChatComponentTranslation(Messages.Commands.SYNC_ENERGY_VALUES_SUCCESS)); commandSender.addChatMessage(new ChatComponentTranslation(Messages.Commands.SYNC_ENERGY_VALUES_SUCCESS));
} }
else { else {