mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
add notify + reject now throws
This commit is contained in:
parent
7f91f7c410
commit
4ffa4301ec
3 changed files with 17 additions and 7 deletions
|
|
@ -1,16 +1,16 @@
|
||||||
package core.game.interaction.player;
|
package core.game.interaction.player;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import core.game.content.activity.ActivityManager;
|
import core.game.content.activity.ActivityManager;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
import core.game.system.SystemManager;
|
import core.game.system.SystemManager;
|
||||||
import rs09.game.world.GameWorld;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.plugin.PluginManifest;
|
import core.plugin.PluginManifest;
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.PluginType;
|
import core.plugin.PluginType;
|
||||||
|
import rs09.game.world.GameWorld;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a player login.
|
* Validates a player login.
|
||||||
|
|
@ -59,7 +59,6 @@ public final class LoginValidationPlugin implements Plugin<Player> {
|
||||||
if (player.getAttribute("falconry", false)) {
|
if (player.getAttribute("falconry", false)) {
|
||||||
ActivityManager.start(player, "falconry", true);
|
ActivityManager.start(player, "falconry", true);
|
||||||
}
|
}
|
||||||
player.getConfigManager().set(678, 5);// RFD
|
|
||||||
if (player.getSavedData().getQuestData().getDragonSlayerAttribute("repaired")) {
|
if (player.getSavedData().getQuestData().getDragonSlayerAttribute("repaired")) {
|
||||||
player.getConfigManager().set(177, 1967876);
|
player.getConfigManager().set(177, 1967876);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ class CommandSystem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
command.attemptHandling(player,arguments)
|
try {
|
||||||
|
command.attemptHandling(player, arguments)
|
||||||
|
} catch (e: IllegalStateException){return true}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,19 @@ abstract class CommandSet(val defaultPrivilege: Command.Privilege) : Plugin<Any?
|
||||||
/**
|
/**
|
||||||
* Glorified player.sendMessage with red text coloring. Please use this
|
* Glorified player.sendMessage with red text coloring. Please use this
|
||||||
* rather than just player.sendMessage for anything that involves informing the player
|
* rather than just player.sendMessage for anything that involves informing the player
|
||||||
* of proper usage or invalid syntax.
|
* of proper usage or invalid syntax. Throws an IllegalStateException and ends command execution immediately.
|
||||||
*/
|
*/
|
||||||
fun reject(player: Player, message: String){
|
fun reject(player: Player, message: String){
|
||||||
player.sendMessage(colorize("%R$message"))
|
player.sendMessage(colorize("%R$message"))
|
||||||
|
throw IllegalStateException()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Glorified player.sendMessage with green text coloring and an arrow. Use this when you need to
|
||||||
|
* notify/inform a player of some information from within the command without ending execution.
|
||||||
|
*/
|
||||||
|
fun notify(player: Player, message: String){
|
||||||
|
player.sendMessage(colorize("%G-->$message"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue