Add DISPLAY tracking range type (#9668)

This commit is contained in:
Warrior
2023-09-17 01:02:58 +03:00
parent a9be834ffa
commit e0964c727a
2 changed files with 10 additions and 3 deletions

View File

@@ -1800,8 +1800,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public IntOr.Default other = IntOr.Default.USE_DEFAULT;
+
+ public int get(Entity entity, int def) {
+ if (entity instanceof Display) return display.or(def);
+
+ switch (TrackingRange.getTrackingRangeType(entity)) {
+ case PLAYER -> {
+ return player.or(def);
@@ -1818,6 +1816,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ case ENDERDRAGON -> {
+ return -1; // Ender dragon is exempt
+ }
+ case DISPLAY -> {
+ return display.or(def);
+ }
+ }
+
+ return other.or(def);