use of com.denizenscript.denizen.objects.PlayerTag in project Denizen-For-Bukkit by DenizenScript.
the class PlayerEquipsArmorScriptEvent method armorChangeEvent.
@EventHandler
public void armorChangeEvent(PlayerArmorChangeEvent event) {
if (EntityTag.isCitizensNPC(event.getPlayer())) {
return;
}
if (simpleComparisonString(event.getOldItem()).equals(simpleComparisonString(event.getNewItem()))) {
return;
}
newItem = new ItemTag(event.getNewItem());
oldItem = new ItemTag(event.getOldItem());
slot = event.getSlotType();
player = new PlayerTag(event.getPlayer());
fire(event);
}
use of com.denizenscript.denizen.objects.PlayerTag in project Denizen-For-Bukkit by DenizenScript.
the class ServerListPingScriptEventPaperImpl method applyDetermination.
@Override
public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) {
String determination = determinationObj.toString();
String lower = CoreUtilities.toLowerCase(determination);
if (lower.startsWith("protocol_version:") && ArgumentHelper.matchesInteger(determination.substring("protocol_version:".length()))) {
((PaperServerListPingEvent) event).setProtocolVersion(Integer.parseInt(determination.substring("protocol_version:".length())));
return true;
} else if (lower.startsWith("version_name:")) {
((PaperServerListPingEvent) event).setVersion(determination.substring("version_name:".length()));
return true;
} else if (lower.startsWith("exclude_players:")) {
HashSet<UUID> exclusions = new HashSet<>();
for (PlayerTag player : ListTag.valueOf(determination.substring("exclude_players:".length()), getTagContext(path)).filter(PlayerTag.class, getTagContext(path))) {
exclusions.add(player.getUUID());
}
Iterator<Player> players = ((PaperServerListPingEvent) event).iterator();
while (players.hasNext()) {
if (exclusions.contains(players.next().getUniqueId())) {
players.remove();
}
}
return true;
}
return super.applyDetermination(path, determinationObj);
}
use of com.denizenscript.denizen.objects.PlayerTag in project Denizen-For-Bukkit by DenizenScript.
the class PlayerElytraBoostScriptEvent method onPlayerElytraBoost.
@EventHandler
public void onPlayerElytraBoost(PlayerElytraBoostEvent event) {
firework = new ItemTag(event.getItemStack());
player = new PlayerTag(event.getPlayer());
this.event = event;
fire(event);
}
use of com.denizenscript.denizen.objects.PlayerTag in project Denizen-For-Bukkit by DenizenScript.
the class PlayerJumpsScriptEventPaperImpl method onPlayerJumps.
@EventHandler
public void onPlayerJumps(PlayerJumpEvent event) {
if (EntityTag.isNPC(event.getPlayer())) {
return;
}
location = new LocationTag(event.getFrom());
player = new PlayerTag(event.getPlayer());
fire(event);
}
use of com.denizenscript.denizen.objects.PlayerTag in project Denizen-For-Bukkit by DenizenScript.
the class PlayerClosesInvScriptEvent method onPlayerClosesInv.
@EventHandler
public void onPlayerClosesInv(InventoryCloseEvent event) {
if (EntityTag.isNPC(event.getPlayer())) {
return;
}
inventory = InventoryTag.mirrorBukkitInventory(event.getInventory());
player = new PlayerTag((Player) event.getPlayer());
this.event = event;
fire(event);
}
Aggregations