21.02.2016, 16:31
I'm wondering about PlayerKeyStateChangeEvent... Why is there only getOldState() method? What about getNewState()?
player.applyAnimation("CRACK", "crackdeth2", 4f, 1, 0, 0, 0, 0, 0);
import net.gtaun.shoebill.common.command.Command;
import net.gtaun.shoebill.common.command.CommandHelp;
import net.gtaun.shoebill.common.command.PlayerCommandManager;
import net.gtaun.util.event.EventManager;
import net.gtaun.util.event.HandlerPriority;
/**
* Created by Erich on 05/03/2016.
*/
public class Jobs{
private EventManager events;
private PlayerCommandManager commandEvents;
public Jobs(EventManager events){
this.events= events;
commandEvents= new PlayerCommandManager(events);
commandEvents.installCommandHandler(HandlerPriority.NORMAL);
commandEvents.registerCommands(new JobCommands());
}
//I am now thinking about to add something like: enablePilotJob()
public class Pilot{
Pilot(){
//Do some stuff here
}
}
public class JobCommands{
@Command
public boolean job(){
return true;
}
public boolean leave(String option){
if(!option.contains("job")){
return true;
}
return true;
}
}
}
commandManager.registerChildGroup(vGroup, "v"); commandManager.registerCommand("v", new Class[]{String.class}, null, null, (short)-1000, false, V_HELP_HANDLER, null, null, null);
CommandGroup commandGroup = new CommandGroup(); commandGroup.registerCommands(new TestGroup()); commandGroup.setEmptyCommandHandler((player, commandGroup1) -> { player.sendMessage(Color.RED, "* This is my help message!"); return true; }); commandManager.registerChildGroup(commandGroup, "test");
commandManager = new PlayerCommandManager(getEventManager());
commandManager.registerCommands(new AdminCommands(), new Commands(getEventManager(), commandManager));
CommandGroup commandGroup = new CommandGroup();
commandGroup.registerCommands(new TestGroup());
commandGroup.setNotFoundHandler((player, commandGroup1, command) -> {
player.sendMessage(Color.RED, "* This is my message!");
return true;
});
commandGroup.setUsageMessageSupplier((player, prefix, command) -> {
return "Hello! This is not the default handler :)";
});
commandManager.registerChildGroup(commandGroup, "test");
commandManager.installCommandHandler(HandlerPriority.NORMAL);
@BeforeCheck public boolean checkPlayer(Player p) { System.out.println("Called"); if(!CPlayer.array[p.getId()].isAdmin(Player.Admin.DEVELOPER)){ p.sendMessage(Color.RED, "» Access denied"); return false; } return true; }
@BeforeCheck
public boolean checkPermission(Player p, String cmd, String params)
{
//Return true or false
}