本文整理汇总了Java中net.gtaun.shoebill.object.Player类的典型用法代码示例。如果您正苦于以下问题:Java Player类的具体用法?Java Player怎么用?Java Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于net.gtaun.shoebill.object包,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onPlayerWeaponShot
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* onPlayerWeaponShot()
* @param e the PlayerWeaponShotEvent
*/
public static void onPlayerWeaponShot(PlayerWeaponShotEvent e) {
Player player = e.getPlayer();
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerPlayerData.getCurrentEvent();
/*
if(e.getHitPlayer() != null) {
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(e.getHitPlayer(), PlayerData.class);
if(playerPlayerData.isAFK()) playerPlayerData.setDamage(playerPlayerData.getDamage()+weaponDamage); //TODO
}
*/
if(eventData != null) {
try {
((Event) eventData.getClz().newInstance()).onPlayerWeaponShot(e);
} catch (InstantiationException | IllegalAccessException err) {
System.out.println(err);
err.printStackTrace();
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:24,代码来源:EventBase.java
示例2: resetEventData
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* reset EventData
* @param eventData the event
* @param completely if true, the eventData will reset completely (without the memberList, eventClass, eventId, eventName, eventOwner)
*/
private static void resetEventData(EventData eventData, boolean completely) {
ArrayList<Player> playerList = new ArrayList<>(eventData.getPlayerList());
if(!completely) {
boolean joinable = eventData.isJoinable();
Location spawnLocation = eventData.getLocation();
eventData.reset();
eventData.setJoinable(joinable);
eventData.setLocation(spawnLocation);
}
else eventData.reset();
eventData.setPlayerList(playerList);
}
开发者ID:Alf21,项目名称:event-system,代码行数:22,代码来源:EventBase.java
示例3: joinEvent
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* let player join event
* @param player the player
* @param eventData the event
*/
private static void joinEvent(Player player, EventData eventData) {
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
playerPlayerData.setCurrentEvent(eventData);
eventData.getPlayerList().add(player);
if(eventData.getMap() != null) {
if(eventData.getZone() != null)
eventData.getZone().show(player, new Color(255,255,255,102));
}
eventData.getOwner().sendMessage(Color.YELLOW, localizedStringSet.format(eventData.getOwner(), "Event.Join.Joined", player.getName()));
for(Player player2 : eventData.getPlayerList()) {
player2.sendMessage(Color.YELLOW, localizedStringSet.format(player2, "Event.Join.Joined", player.getName()));
}
try {
((Event) eventData.getClz().newInstance()).onPlayerJoin(player, eventData);
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:28,代码来源:EventBase.java
示例4: onPlayerSpawn
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* onPlayerSpawn()
* @param player the player
*/
public static void onPlayerSpawn(Player player) {
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerPlayerData.getCurrentEvent();
if(eventData != null) {
if(eventData.getMap() != null && eventData.getMap().getLocation() != null) {
if(eventData.getState() == EventState.RUNNING)
spawnPlayer(player, eventData);
}
else {
if(eventData.getState() == EventState.RUNNING) {
player.setWorld(eventData.getId()+1);
player.setInterior(0);
}
}
try {
((Event) eventData.getClz().newInstance()).onPlayerSpawn(player);
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:27,代码来源:EventBase.java
示例5: arrayToString
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* transform a player array into a readable string with their names
* @param players the array / list of players
* @return String
*/
public static String arrayToString(ArrayList<Player> players) {
String string = "";
if(!players.isEmpty()) {
if(players.size() == 1) string = players.get(0).getName();
else {
int i = 1;
for(Player player : players) {
if(i != 1) {
if(i == players.size()) string += " & ";
else string += ", ";
}
string += player.getName();
i++;
}
}
}
return string;
}
开发者ID:Alf21,项目名称:event-system,代码行数:24,代码来源:EventFunctions.java
示例6: finish
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Override
public void finish(EventData eventData) {
destroyAllEventTextdraws(eventData);
if(eventData.getScoreTimer() != null) {
if(eventData.getScoreTimer().isRunning())
eventData.getScoreTimer().stop();
eventData.getScoreTimer().destroy();
eventData.setScoreTimer(null);
}
for(Player all : EventFunctions.getAllPlayers(eventData)) {
Shoebill.get().runOnSampThread(() -> {
if(all != null && all.isOnline()) {
PlayerData playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(all, PlayerData.class);
playerPlayerData.setGameTextTD(new GameTextTD(all, localizedStringSet.get(all, "Event.Finish.Gametext"), 7000, true, 1000));
}
});
}
eventData.setDataPlayerArray(new ArrayList<>());
eventData.setDataPlayerArray2(new ArrayList<>());
}
开发者ID:Alf21,项目名称:event-system,代码行数:22,代码来源:Catching.java
示例7: updateBoxColors
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* update the boxcolors from the event textdraws
* @param eventData the event
*/
private static void updateBoxColors(Player player, EventData eventData) {
if(!eventData.getEventTextdraws().isEmpty()) {
Shoebill.get().runOnSampThread(() -> {
for(Player runner : eventData.getDataPlayerArray()) {
Color color = getBoxColor(runner, getNearestHunter(runner, eventData), eventData);
EventTextdraw eventTextdraw = EventFunctions.getEventTextdraw(eventData, runner.getName());
if (eventTextdraw != null) {
eventTextdraw.setColor(color);
for(Player all : EventFunctions.getAllPlayers(eventData)) {
eventTextdraw.hide(all);
eventTextdraw.show(all);
}
}
}
});
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:22,代码来源:Catching.java
示例8: onPlayerDeath
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Override
public void onPlayerDeath(Player player) {
playerLifecycle = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerLifecycle.getCurrentEvent();
if(eventData.getState() == EventState.RUNNING) {
player.sendMessage(Color.YELLOW, "[" + localizedStringSet.get(player, "Event.Class.TTT.Abbr") + "] " + Color.WHITE.toEmbeddingString() + localizedStringSet.get(player, "Event.Class.TTT.Death.Disqualified"));
if(eventData.getDataPlayerArray().contains(player)) {
eventData.getDataPlayerArray().remove(player);
tDInnocent.hide(player);
}
else if(eventData.getDataPlayerArray2().contains(player)){
eventData.getDataPlayerArray2().remove(player);
tDTraitor.hide(player);
}
TTTDeadBody deadBody = new TTTDeadBody(eventData, player);
eventData.getDeadBodies().add(deadBody);
eventData.getSpectators().add(player);
checkFinish(eventData);
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:23,代码来源:TTT.java
示例9: start
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Override
public void start(EventData eventData) {
eventData.setDataPlayerArray(new ArrayList<>());
eventData.setDataPlayerArray2(new ArrayList<>());
prepare(eventData);
startCountdown(eventData, 30);
Timer timer = Timer.create(32000, 1, (factualInterval) -> {
for(Player player : EventFunctions.getAllPlayers(eventData)) {
eventData.getDataPlayerArray().add(player);
}
for(int i = 0; i < eventData.getDataInt(); i++) {
Random random = new Random();
int rand = random.nextInt(eventData.getDataPlayerArray().size()-1);
setTraitor(eventData.getDataPlayerArray().get(rand));
}
eventData.getDataPlayerArray().forEach(TTT::setInnocent);
eventData.setState(EventState.RUNNING);
startTraitorCountdown(eventData);
});
timer.start();
eventData.setGameTimer(timer);
}
开发者ID:Alf21,项目名称:event-system,代码行数:23,代码来源:TTT.java
示例10: loadMission
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* load a mission
* @param eventData the event
* @param clz the class of mission
*/
private static void loadMission(EventData eventData, Class<?> clz) {
try {
unloadMission(eventData);
eventData.setMission(clz);
((Mission) clz.newInstance()).create(eventData);
MissionDescription missionDescription = MissionFunctions.getDescriptionForMission(clz);
if (missionDescription != null) {
for (Player player : EventFunctions.getAllPlayers(eventData)) {
player.sendMessage(localizedStringSet.format(player, "Event.Class.Missions.Create.CreatedMessage", MissionFunctions.getName(player, missionDescription.name())));
}
}
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:22,代码来源:MissionBase.java
示例11: PlayerData
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
public PlayerData(EventManager manager, Player p) {
super(manager, p);
player = p;
vehicleHealth = -1;
eventPoints = 0;
eventScore = 0;
playerWeapons = new ArrayList<>();
color = new Color(0,0,0,0);
lastUpdate = 0;
damage = 0;
aFK = false;
health = 100f;
armour = 0f;
traitorShop = new HashMap<>();
rangeLabels = new ArrayList<>();
}
开发者ID:Alf21,项目名称:event-system,代码行数:17,代码来源:PlayerData.java
示例12: getNearbyPlayers
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* Created by marvin on 10.01.15 in project roleplay.
* Copyright (c) 2015 Marvin Haschker. All rights reserved.
* get nearest players of a location depends on a maximal distance between players and location
* @param location the main / origin location
* @param maxDistance the maximal distance / range
* @return ArrayList of Player
*/
public static ArrayList<Player> getNearbyPlayers(Location location, float maxDistance) {
ArrayList<Player> players = new ArrayList<>();
for (Player player : Player.getHumans()) {
float distance = player.getLocation().distance(location);
if (distance <= maxDistance) {
players.add(player);
}
}
return players;
}
开发者ID:Alf21,项目名称:event-system,代码行数:19,代码来源:EventFunctions.java
示例13: getEventClass
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* get the event class from description
* @param player the player to get language file of
* @param string the description
* @return Class
*/
private static Class<?> getEventClass(Player player, String string) {
for(Class<?> eventClz : EventExtensibleDependencies.getAvailableEventTypes()) {
String name = EventFunctions.getName(player, EventFunctions.getDescriptionForEvent(eventClz).name());
if(name.equals(string))
return eventClz;
}
return null;
}
开发者ID:Alf21,项目名称:event-system,代码行数:15,代码来源:EventBase.java
示例14: gttdh
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Command
@CommandHelp("/gttdh")
public boolean gttdh(Player player) {
player.sendMessage("/gttd - create, /gttdhfalse - hide, /gttdhtrue - hide, /gttds - show");
player.sendMessage("/gttdh - help, /gttdstop - stop /gttdresume - resume, /gttdt - transitions");
return true;
}
开发者ID:Alf21,项目名称:event-system,代码行数:8,代码来源:Commands.java
示例15: FCNPCTakeDamageEvent
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
public FCNPCTakeDamageEvent(FCNPC npc, Player damager, WeaponModel weapon, int bodyPart, float amount) {
super(npc);
this.damager = damager;
this.weapon = weapon;
this.bodyPart = bodyPart;
this.amount = amount;
}
开发者ID:Shoebill,项目名称:fcnpc-wrapper,代码行数:8,代码来源:FCNPCTakeDamageEvent.java
示例16: onPlayerAFK
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* onPlayerAFKEvent
* @param player the player
* @param eventData the event
*/
public static void onPlayerAFK(Player player, EventData eventData) {
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
if(!playerPlayerData.isAFK()) { //TODO
playerPlayerData.setAFK(true);
}
try {
((Event) eventData.getClz().newInstance()).onPlayerAFK(player, eventData);
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:18,代码来源:EventBase.java
示例17: onPlayerExit
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
/**
* onPlayerExitEvent
* @param player the player
* @param eventData the event
*/
public static void onPlayerExit(Player player, EventData eventData) {
playerPlayerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
try {
((Event) eventData.getClz().newInstance()).onPlayerExit(player, eventData);
} catch (InstantiationException | IllegalAccessException e) {
System.out.println(e);
e.printStackTrace();
}
if(eventData.getMap() != null) {
if(eventData.getZone() != null) {
eventData.getZone().hide(player);
}
}
resetData(player);
if(isEventMember(player)) {
eventData.getWaitingForPlayers().remove(player);
eventData.getPlayerList().remove(player);
playerPlayerData.setCurrentEvent(null);
if(eventData.getPlayerList().isEmpty() && (eventData.getState() == EventState.PREPARE || eventData.getState() == EventState.WAITING))
unprepareStart(eventData);
else if(eventData.getState() == EventState.WAITING && eventData.getWaitingForPlayers().isEmpty())
startEvent(eventData);
}
else if(isEventOwner(player)){
destroyEvent(eventData);
//TODO: if owner make other member owner
//TODO: else destroy eventData
}
}
开发者ID:Alf21,项目名称:event-system,代码行数:37,代码来源:EventBase.java
示例18: eventsdb
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Command
@CommandHelp("/eventsdb")
public boolean eventsdb(Player player) {
PlayerData playerData = EventSystem.getInstance().getPlayerLifecycleHolder().getObject(player, PlayerData.class);
EventData eventData = playerData.getCurrentEvent();
if(eventData != null) {
new TTTDeadBody(eventData, player);
}
return true;
}
开发者ID:Alf21,项目名称:event-system,代码行数:11,代码来源:Commands.java
示例19: tachohelp
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
@Command
@CommandHelp("Show help message")
public boolean tachohelp(Player player)
{
player.sendMessage(Color.YELLOW, "/tacho [id]");
return true;
}
开发者ID:Alf21,项目名称:vehicle-system,代码行数:8,代码来源:Commands.java
示例20: PlayerData
import net.gtaun.shoebill.object.Player; //导入依赖的package包/类
public PlayerData(EventManager manager, Player p) {
super(manager, p);
player = p;
count = 0L;
timer = Timer.create(UPDATE_DELAY, (factualInterval) -> {
VehicleFunctions.onTimer(this, VehicleSystem.getVehicleData(p));
count++;
});
}
开发者ID:Alf21,项目名称:vehicle-system,代码行数:10,代码来源:PlayerData.java
注:本文中的net.gtaun.shoebill.object.Player类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论