Skip to content

Commit

Permalink
minor meta improvement (location.find tags)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed May 13, 2020
1 parent 5e1a484 commit 1a00a5a
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1976,6 +1976,7 @@ else if (yaw < 315) {
// @description
// Returns a list of matching blocks within a radius.
// Note: current implementation measures the center of nearby block's distance from the exact given location.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
if (attribute.startsWith("blocks", 2)) {
ArrayList<LocationTag> found = new ArrayList<>();
Expand Down Expand Up @@ -2044,6 +2045,7 @@ public int compare(LocationTag loc1, LocationTag loc2) {
// @returns ListTag
// @description
// Returns a list of matching surface blocks within a radius.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
else if (attribute.startsWith("surface_blocks", 2)) {
ArrayList<LocationTag> found = new ArrayList<>();
Expand Down Expand Up @@ -2110,6 +2112,7 @@ public int compare(LocationTag loc1, LocationTag loc2) {
// @returns ListTag
// @description
// Returns a list of players within a radius.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
else if (attribute.startsWith("players", 2)) {
ArrayList<PlayerTag> found = new ArrayList<>();
Expand All @@ -2135,6 +2138,7 @@ public int compare(PlayerTag pl1, PlayerTag pl2) {
// @returns ListTag
// @description
// Returns a list of NPCs within a radius.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
else if (attribute.startsWith("npcs", 2)) {
ArrayList<NPCTag> found = new ArrayList<>();
Expand All @@ -2160,6 +2164,7 @@ public int compare(NPCTag npc1, NPCTag npc2) {
// @returns ListTag
// @description
// Returns a list of entities within a radius, with an optional search parameter for the entity type.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
else if (attribute.startsWith("entities", 2)) {
ListTag ent_list = attribute.hasContext(2) ? ListTag.valueOf(attribute.getContext(2), attribute.context) : null;
Expand Down Expand Up @@ -2198,6 +2203,7 @@ public int compare(ObjectTag ent1, ObjectTag ent2) {
// @description
// Returns a list of living entities within a radius.
// This includes Players, mobs, NPCs, etc., but excludes dropped items, experience orbs, etc.
// Result list is sorted by closeness (1 = closest, 2 = next closest, ... last = farthest).
// -->
else if (attribute.startsWith("living_entities", 2)) {
ListTag found = new ListTag();
Expand Down

0 comments on commit 1a00a5a

Please sign in to comment.