-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: see portal info with /portal info (name)
- Loading branch information
Showing
18 changed files
with
120 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ava/com/sekwah/advancedportals/core/commands/subcommands/portal/InfoPortalSubCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.sekwah.advancedportals.core.commands.subcommands.portal; | ||
|
||
import com.google.inject.Inject; | ||
import com.sekwah.advancedportals.core.commands.SubCommand; | ||
import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; | ||
import com.sekwah.advancedportals.core.services.PortalServices; | ||
import com.sekwah.advancedportals.core.util.Lang; | ||
import com.sekwah.advancedportals.core.util.TagReader; | ||
|
||
import java.util.List; | ||
|
||
public class InfoPortalSubCommand implements SubCommand { | ||
@Inject | ||
PortalServices portalServices; | ||
|
||
@Override | ||
public void onCommand(CommandSenderContainer sender, String[] args) { | ||
if (args.length > 1) { | ||
var portalName = args[1]; | ||
var portal = portalServices.getPortal(portalName); | ||
if(portal == null) { | ||
sender.sendMessage(Lang.translate("messageprefix.negative") | ||
+ Lang.translateInsertVariables("command.portal.info.notfound", portalName)); | ||
return; | ||
} | ||
sender.sendMessage(Lang.translate("messageprefix.positive") | ||
+ Lang.translateInsertVariables("command.portal.info.complete", portalName)); | ||
TagReader.printArgs(sender, portal.getArgs()); | ||
} else { | ||
sender.sendMessage(Lang.translate("command.portal.info.noname")); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean hasPermission(CommandSenderContainer sender) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public List<String> onTabComplete(CommandSenderContainer sender, | ||
String[] args) { | ||
return portalServices.getPortalNames(); | ||
} | ||
|
||
@Override | ||
public String getBasicHelpText() { | ||
return Lang.translate("command.portal.list.help"); | ||
} | ||
|
||
@Override | ||
public String getDetailedHelpText() { | ||
return Lang.translate("command.portal.list.help"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
core/src/main/java/com/sekwah/advancedportals/core/connector/containers/GameMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.sekwah.advancedportals.core.connector.containers; | ||
|
||
public enum GameMode { | ||
SURVIVAL, | ||
CREATIVE, | ||
ADVENTURE, | ||
SPECTATOR | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters