3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00

Implement tracking range y setting

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-10-03 22:19:39 +10:00
Ursprung f6969b6374
Commit bb1c0dd6fa
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -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;
@ -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;
@ -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);
+ */
+ }
+ }
+ }