Skip to content

Commit

Permalink
Implement tracking range y setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Oct 3, 2023
1 parent f6969b6 commit bb1c0dd
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions patches/server/0005-Paper-config-files.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1490,10 +1490,10 @@ index 0000000000000000000000000000000000000000..f0d4ec73bc8872a85e34f5c6b4d342e7
+}
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..ec5e23136423e42e4f55e6ea646b8285c1ca14e2
index 0000000000000000000000000000000000000000..456156e5f4adbe383a611bc81cebd0446ac042f7
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -0,0 +1,534 @@
@@ -0,0 +1,536 @@
+package io.papermc.paper.configuration;
+
+import com.google.common.collect.HashBasedTable;
Expand Down Expand Up @@ -1532,9 +1532,16 @@ index 0000000000000000000000000000000000000000..ec5e23136423e42e4f55e6ea646b8285
+import net.minecraft.world.entity.Display;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.entity.ExperienceOrb;
+import net.minecraft.world.entity.MobCategory;
+import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
+import net.minecraft.world.entity.decoration.HangingEntity;
+import net.minecraft.world.entity.decoration.ItemFrame;
+import net.minecraft.world.entity.decoration.Painting;
+import net.minecraft.world.entity.item.ItemEntity;
+import net.minecraft.world.entity.monster.Vindicator;
+import net.minecraft.world.entity.monster.Zombie;
+import net.minecraft.world.entity.player.Player;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.Items;
+import net.minecraft.world.level.NaturalSpawner;
Expand Down Expand Up @@ -1805,31 +1812,26 @@ index 0000000000000000000000000000000000000000..ec5e23136423e42e4f55e6ea646b8285
+ public IntOr.Default other = IntOr.Default.USE_DEFAULT;
+
+ public int get(Entity entity, int def) {
+ return def; // TODO https://github.com/PaperMC/Paper/issues/9742
+ /*
+ switch (TrackingRange.getTrackingRangeType(entity)) {
+ case PLAYER -> {
+ return player.or(def);
+ }
+ case ANIMAL -> {
+ if (entity instanceof EnderDragon) {
+ return -1; // Ender dragon is exempt
+ } else if (entity instanceof Display) {
+ return display.or(def);
+ } else if (entity instanceof Player) {
+ return player.or(def);
+ } else if (entity instanceof HangingEntity || entity instanceof ItemEntity || entity instanceof ExperienceOrb) {
+ return misc.or(def);
+ }
+ switch (entity.activationType) {
+ case ANIMAL, WATER, VILLAGER -> {
+ return animal.or(def);
+ }
+ case MONSTER -> {
+ case MONSTER, FLYING_MONSTER, RAIDER -> {
+ return monster.or(def);
+ }
+ case MISC -> {
+ return misc.or(def);
+ }
+ case ENDERDRAGON -> {
+ return -1; // Ender dragon is exempt
+ }
+ case DISPLAY -> {
+ return display.or(def);
+ default -> {
+ return other.or(def);
+ }
+ }
+
+ return other.or(def);
+ */
+ }
+ }
+ }
Expand Down

0 comments on commit bb1c0dd

Please sign in to comment.