character selector
This commit is contained in:
parent
0af8ca57d1
commit
74f730e450
24 changed files with 554 additions and 154 deletions
|
@ -40,8 +40,8 @@ public class EntityListParser extends EntityParser {
|
|||
else if(input.equals("*")) {
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
for(Player plr : env.getServer().getPlayers()) {
|
||||
if(plr.getEntity() != null)
|
||||
list.add(plr.getEntity());
|
||||
if(plr.getPresentEntity() != null)
|
||||
list.add(plr.getPresentEntity());
|
||||
}
|
||||
if(list.isEmpty())
|
||||
throw new RunException("Keine Spieler gefunden");
|
||||
|
|
|
@ -19,8 +19,8 @@ public class PlayerEntityListParser extends PlayerEntityParser {
|
|||
if(input.equals("*")) {
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
for(Player plr : env.getServer().getPlayers()) {
|
||||
if(plr.getEntity() != null)
|
||||
list.add(plr.getEntity());
|
||||
if(plr.getPresentEntity() != null)
|
||||
list.add(plr.getPresentEntity());
|
||||
}
|
||||
if(list.isEmpty())
|
||||
throw new RunException("Keine Spieler gefunden");
|
||||
|
|
|
@ -10,7 +10,7 @@ public class PlayerEntityParser extends PlayerParser {
|
|||
|
||||
public Object parse(CommandEnvironment env, String input) {
|
||||
Player net = (Player)super.parse(env, input);
|
||||
EntityNPC entity = net.getEntity();
|
||||
EntityNPC entity = net.getPresentEntity();
|
||||
if(entity == null)
|
||||
throw new RunException("Spieler-Objekt von '%s' wurde nicht gefunden", input);
|
||||
return entity;
|
||||
|
@ -18,7 +18,7 @@ public class PlayerEntityParser extends PlayerParser {
|
|||
|
||||
public Object getDefault(CommandEnvironment env) {
|
||||
Player net = (Player)super.getDefault(env);
|
||||
return net == null ? null : net.getEntity();
|
||||
return net == null ? null : net.getPresentEntity();
|
||||
}
|
||||
|
||||
public Class<?> getTypeClass() {
|
||||
|
|
|
@ -28,7 +28,7 @@ public class CommandOfflinetp extends Command {
|
|||
|
||||
public Object exec(CommandEnvironment env, Executor exec, String user, List<Entity> entities) {
|
||||
Player player = env.getServer().getPlayer(user);
|
||||
Position pos = player != null ? player.getEntity().getPos() : env.getServer().getOfflinePosition(user);
|
||||
Position pos = player != null ? (player.getPresentEntity() != null ? player.getPresentEntity().getPos() : null) : env.getServer().getOfflinePosition(user);
|
||||
if(pos == null)
|
||||
throw new RunException("Spieler '%s' konnte nicht gefunden werden", user);
|
||||
for(Entity entity : entities) {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CommandSpawn extends Command {
|
|||
}
|
||||
world.strikeLightning(pos.xCoord, pos.yCoord, pos.zCoord, color,
|
||||
tag != null && tag.hasKey("damage", 3) ? tag.getInteger("damage") : 0, tag != null && tag.hasKey("fire", 1) && tag.getBoolean("fire"),
|
||||
exec instanceof Player && tag != null && tag.hasKey("summoned", 1) && tag.getBoolean("summoned") ? ((Player)exec).getEntity() : null);
|
||||
exec instanceof Player && tag != null && tag.hasKey("summoned", 1) && tag.getBoolean("summoned") ? ((Player)exec).getPresentEntity() : null);
|
||||
}
|
||||
exec.logConsole("%sBlitz bei %d, %d, %d in %s erschaffen", count == 1 ? "" : (count + "x "), (int)pos.xCoord, (int)pos.yCoord, (int)pos.zCoord, world.dimension.getFormattedName(false));
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue