本文整理匯總了Java中net.gtaun.shoebill.event.player.PlayerUpdateEvent類的典型用法代碼示例。如果您正苦於以下問題:Java PlayerUpdateEvent類的具體用法?Java PlayerUpdateEvent怎麽用?Java PlayerUpdateEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PlayerUpdateEvent類屬於net.gtaun.shoebill.event.player包,在下文中一共展示了PlayerUpdateEvent類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInit
import net.gtaun.shoebill.event.player.PlayerUpdateEvent; //導入依賴的package包/類
@Override
protected void onInit() {
lastTick = System.currentTimeMillis();
streamer.updatePlayer(player);
eventManagerNode.registerHandler(PlayerUpdateEvent.class, (e) -> {
if(System.currentTimeMillis() - lastTick >= 100) {
streamer.updatePlayer(player);
lastTick = System.currentTimeMillis();
}
});
}
示例2: onInit
import net.gtaun.shoebill.event.player.PlayerUpdateEvent; //導入依賴的package包/類
@Override
protected void onInit()
{
eventManagerNode.registerHandler(PlayerUpdateEvent.class, HandlerPriority.NORMAL, Attentions.create().object(player), (e) ->
{
if (player.getUpdateCount() % 40 == 0) updateMapIcons();
});
final LocalizedStringSet stringSet = raceService.getLocalizedStringSet();
player.sendMessage(Color.LIGHTBLUE, stringSet.format(player, "TrackEditor.StartEditingTrackMessage", track.getName()));
}
示例3: PlayerManager
import net.gtaun.shoebill.event.player.PlayerUpdateEvent; //導入依賴的package包/類
public PlayerManager() throws IOException
{
eventManager = EventSystem.getInstance().getEventManagerInstance();
commandManager = new PlayerCommandManager(eventManager);
commandManager.registerCommands(new Commands());
commandManager.installCommandHandler(HandlerPriority.NORMAL);
CommandGroup playerCommands = new CommandGroup();
playerCommands.registerCommands(new Commands());
commandManager.registerChildGroup(playerCommands, "player");
commandManager.setUsageMessageSupplier((player, prefix, command) -> {
String message;
if(command.getHelpMessage() == null)
{
message = prefix + command;
for (CommandParameter param : command.getParameters()) {
message += " [" + param + "]";
}
}
else {
message = command.getHelpMessage();
}
return message;
});
//--
eventManager.registerHandler(PlayerUpdateEvent.class, (e) -> {
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(e.getPlayer(), PlayerData.class);
playerLifecycle.setPlayerState(PlayerState.UPDATING);
playerLifecycle.setLastUpdate(System.currentTimeMillis());
if(!e.getPlayer().isNpc())
EventBase.checkEvent(e.getPlayer());
});
eventManager.registerHandler(PlayerWeaponShotEvent.class, EventBase::onPlayerWeaponShot);
eventManager.registerHandler(PlayerTakeDamageEvent.class, EventBase::onPlayerTakeDamage);
eventManager.registerHandler(PlayerConnectEvent.class, (e) -> {
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(e.getPlayer(), PlayerData.class);
playerLifecycle.setPlayerState(PlayerState.CONNECTED);
});
eventManager.registerHandler(PlayerDisconnectEvent.class, (e) -> {
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(e.getPlayer(), PlayerData.class);
playerLifecycle.setPlayerState(PlayerState.NONE);
EventBase.leaveEvent(e.getPlayer());
});
eventManager.registerHandler(PlayerDeathEvent.class, (e) -> {
e.getPlayer().clearAnimations(0);
e.getPlayer().setHealth(1.0f);
EventBase.onPlayerDeath(e.getPlayer());
});
eventManager.registerHandler(PlayerKeyStateChangeEvent.class, EventBase::onPlayerKeyStateChange);
eventManager.registerHandler(PlayerSpawnEvent.class, (e) -> {
e.getPlayer().setHealth(100);
EventBase.onPlayerSpawn(e.getPlayer());
});
/*
eventManager.registerHandler(PlayerChangeLanguageEvent.class, e -> {
// EventSystem.getInstance().setPlayerLanguage(e.getPlayer(), e.getLanguage().getAbbr());
});
*/
}
示例4: onInit
import net.gtaun.shoebill.event.player.PlayerUpdateEvent; //導入依賴的package包/類
@Override
protected void onInit()
{
scriptExecutor = ScriptExecutorFactory.createCheckpointScriptExecutor(player);
hudWidget = new RacingHudWidget(rootEventManager, raceService, player, this);
hudWidget.init();
addDestroyable(hudWidget);
if (player.isInAnyVehicle()) lastVehicleModel = player.getVehicle().getModelId();
eventManagerNode.registerHandler(PlayerUpdateEvent.class, HandlerPriority.NORMAL, Attentions.create().object(player), (e) ->
{
if (player.getUpdateCount() % 40 != 0) return;
updateMapIcons();
});
eventManagerNode.registerHandler(PlayerDeathEvent.class, HandlerPriority.NORMAL, Attentions.create().object(player), (e) ->
{
if (racing.getSetting().getDeathRule() == DeathRule.KNOCKOUT) racing.leave(player);
});
eventManagerNode.registerHandler(PlayerSpawnEvent.class, HandlerPriority.BOTTOM, Attentions.create().object(player), (e) ->
{
if (lastVehicleModel != 0)
{
createTempVehicle(lastVehicleModel);
tempVehicle.setLocation(lastPassLocation);
tempVehicle.setVelocity(lastPassVelocity);
}
else
{
player.setLocation(lastPassLocation);
}
});
eventManagerNode.registerHandler(PlayerStateChangeEvent.class, HandlerPriority.NORMAL, Attentions.create().object(player), (e) ->
{
if (player.isInAnyVehicle()) lastVehicleModel = player.getVehicle().getModelId();
});
}