Skip to content

Commit

Permalink
made get/set_entity_persistence booleans make more sense
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Gallarno committed Jul 26, 2013
1 parent af8cc7b commit 08be45b
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -1411,23 +1411,23 @@ public String docs() {
public static class get_entity_persistence extends EntityGetterFunction {

public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
return new CBoolean(Static.getLivingEntity(Static.getInt32(args[0], t), t).getRemoveWhenFarAway(), t);
return new CBoolean(!Static.getLivingEntity(Static.getInt32(args[0], t), t).getRemoveWhenFarAway(), t);
}

public String getName() {
return "get_entity_persistence";
}

public String docs() {
return "boolean {entityID} Returns whether the specified living entity will despawn. True means it will.";
return "boolean {entityID} Returns whether the specified living entity will despawn. True means it will not.";
}
}

@api
public static class set_entity_persistence extends EntitySetterFunction {

public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
Static.getLivingEntity(Static.getInt32(args[0], t), t).setRemoveWhenFarAway(Static.getBoolean(args[1]));
Static.getLivingEntity(Static.getInt32(args[0], t), t).setRemoveWhenFarAway(!Static.getBoolean(args[1]));
return new CVoid(t);
}

Expand All @@ -1436,7 +1436,7 @@ public String getName() {
}

public String docs() {
return "void {entityID, boolean} Sets whether a living entity will despawn. True means it will.";
return "void {entityID, boolean} Sets whether a living entity will despawn. True means it will not.";
}
}

Expand Down

0 comments on commit 08be45b

Please sign in to comment.