Skip to content

Commit

Permalink
3.7.44
Browse files Browse the repository at this point in the history
  • Loading branch information
ZombieStriker authored Mar 3, 2018
1 parent f0c079e commit 99d56cb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.7.44
Added /lobbyapi changeWorldSlot

3.7.43
Fixed Github updater

3.7.42
Added chatcolor support to display names

Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
main: me.zombie_striker.lobbyapi.Main
version: 3.7.42
version: 3.7.44
name: LobbyAPI
commands:
Lobby:
Expand Down
26 changes: 24 additions & 2 deletions src/me/zombie_striker/lobbyapi/LobbyCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public List<String> onTabComplete(CommandSender sender, Command command,
} else if (args.length > 1) {
if (b(args[0], "ChangeSpawn", "addJoiningCommand","setDisplayName",
"ListJoiningCommands", "setDescription", "RemoveWorld",
"SetMainLobby", "AddDefaultItem", "RemoveDefaultItem",
"SetMainLobby", "AddDefaultItem","changeWorldSlot", "RemoveDefaultItem",
"ListDefaultItems")) {
if (args.length == 2) {
bLW(tab, args[1]);
Expand Down Expand Up @@ -271,6 +271,29 @@ public boolean onCommand(CommandSender sender, Command cmd,
sender.sendMessage(prefix
+ " [world] = '~' for the world you are in or the world's name (it is Case Sensitive)");
}
} else if (args[0].equalsIgnoreCase("changeWorldSlot")) {
if (args.length >= 3) {
LobbyWorld lw = gLW(sender, args[1]);
if (lw == null)
return false;
int index = 0;
try {
index = Integer.parseInt(args[2]);
} catch (Exception e) {
sender.sendMessage(prefix
+ " The index must be a number");
return true;
}
lw.setSlot(index);
sender.sendMessage(prefix + "The slot for the world has been changed to "+index);
}else {
sender.sendMessage(prefix + " Usage:" + ChatColor.BOLD
+ " /LobbyAPI changeWorldSlot [world] [slot]");
sender.sendMessage(prefix
+ " [world] = '~' for the world you are in or the world's name (it is Case Sensitive)");
sender.sendMessage(prefix
+ " [slot] = the new slot for the world");
}

} else if (args[0].equalsIgnoreCase("removeDefaultItem")) {
if (args.length >= 3) {
Expand Down Expand Up @@ -300,7 +323,6 @@ public boolean onCommand(CommandSender sender, Command cmd,
lw.setSpawnItems(items);
ConfigHandler.setWorldVariable(lw,
ConfigKeys.DefaultItems.s, items);

} else {
sender.sendMessage(prefix + " Usage:" + ChatColor.BOLD
+ " /LobbyAPI addDefaultItem [world]");
Expand Down
5 changes: 5 additions & 0 deletions src/me/zombie_striker/lobbyapi/LobbyWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ public String getWorldName() {
public int getSlot() {
return ID;
}

public void setSlot(int slot) {
this.ID = slot;
}


public int getSlotAmount() {
return amount;
Expand Down

0 comments on commit 99d56cb

Please sign in to comment.