mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 21:04:27 +00:00
Implement Profile Regions
This commit is contained in:
1 parent
db330d0038
commit
cf6e6dd655
14 files changed
+486
-283
No files matched your search
@@ -2,11 +2,11 @@ package kamkeel.npcs.command.profile;
|
||||
|
||||
import kamkeel.npcs.controllers.ProfileController;
|
||||
import kamkeel.npcs.controllers.data.ProfileOperation;
|
||||
import kamkeel.npcs.controllers.data.EnumProfileOperation;
|
||||
import net.minecraft.command.CommandException;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import static kamkeel.npcs.util.ColorUtil.sendError;
|
||||
import static kamkeel.npcs.util.ColorUtil.sendResult;
|
||||
import static kamkeel.npcs.util.ColorUtil.*;
|
||||
|
||||
public class CommandProfileRemove extends CommandProfileBase {
|
||||
|
||||
@@ -49,18 +49,14 @@ public class CommandProfileRemove extends CommandProfileBase {
|
||||
}
|
||||
EntityPlayer player = (EntityPlayer)sender;
|
||||
ProfileOperation result = ProfileController.removeSlot(player, slotId);
|
||||
switch(result) {
|
||||
case SUCCESS:
|
||||
sendResult(sender, "Successfully removed slot %d from your profile.", slotId);
|
||||
break;
|
||||
case LOCKED:
|
||||
sendError(sender, "Profile is locked. Please try again later.");
|
||||
break;
|
||||
case ERROR:
|
||||
sendError(sender, "Error removing slot. Ensure the slot exists and is not your active slot.");
|
||||
break;
|
||||
default:
|
||||
sendError(sender, "Operation could not be completed.");
|
||||
if(result.getResult() == EnumProfileOperation.SUCCESS) {
|
||||
sendResult(sender, "Successfully removed slot %d from your profile.", slotId);
|
||||
} else if(result.getResult() == EnumProfileOperation.LOCKED) {
|
||||
sendError(sender, "Profile is locked. Details: %s", result.getMessage());
|
||||
} else if(result.getResult() == EnumProfileOperation.ERROR) {
|
||||
sendError(sender, "Error removing slot: %s", result.getMessage());
|
||||
} else {
|
||||
sendError(sender, "Unexpected error: %s", result.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user