From beaa0cfc338854a04b6a875da5443d1ed75f568a Mon Sep 17 00:00:00 2001 From: = Date: Sat, 14 Dec 2024 23:34:54 +0200 Subject: [PATCH] Mappings fix --- .../entitylib/container/EmptyContainer.java | 51 +++++++++++ .../entitylib/container/EntityContainer.java | 37 +------- .../me/tofaa/entitylib/extras/DyeColor.java | 1 + .../me/tofaa/entitylib/ve/ViewerEngine.java | 2 +- .../src/main/resources/offset-calculator.json | 91 +++++++++---------- 5 files changed, 98 insertions(+), 84 deletions(-) create mode 100644 api/src/main/java/me/tofaa/entitylib/container/EmptyContainer.java diff --git a/api/src/main/java/me/tofaa/entitylib/container/EmptyContainer.java b/api/src/main/java/me/tofaa/entitylib/container/EmptyContainer.java new file mode 100644 index 0000000..0869d40 --- /dev/null +++ b/api/src/main/java/me/tofaa/entitylib/container/EmptyContainer.java @@ -0,0 +1,51 @@ +package me.tofaa.entitylib.container; + +import me.tofaa.entitylib.wrapper.WrapperEntity; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; +import java.util.Collections; +import java.util.Iterator; +import java.util.UUID; + +final class EmptyContainer implements EntityContainer { + + static EmptyContainer INSTANCE = new EmptyContainer(); + + @Override public void addEntity(WrapperEntity entity) {} + @Override public void removeEntity(WrapperEntity entity, boolean despawn) {} + @Override public void removeEntity(int entityId, boolean despawn) {} + @Override public void removeEntity(UUID uuid, boolean despawn) {} + @Override public void clearEntities(boolean despawn) {} + @Override public void tick() {} + @Override public Collection getEntities() {return Collections.emptyList();} + @Override + public @Nullable WrapperEntity getEntity(UUID uuid) { + return null; + } + @Override + public @Nullable WrapperEntity getEntity(int entityId) { + return null; + } + @Override + public boolean containsEntity(UUID uuid) { + return false; + } + + @Override + public boolean containsEntity(int entityId) { + return false; + } + + @Override + public boolean containsEntity(WrapperEntity entity) { + return false; + } + + @Override + public @NotNull Iterator iterator() { + return getEntities().iterator(); + } + +} diff --git a/api/src/main/java/me/tofaa/entitylib/container/EntityContainer.java b/api/src/main/java/me/tofaa/entitylib/container/EntityContainer.java index 22ab4c9..6481c0c 100644 --- a/api/src/main/java/me/tofaa/entitylib/container/EntityContainer.java +++ b/api/src/main/java/me/tofaa/entitylib/container/EntityContainer.java @@ -20,42 +20,7 @@ public interface EntityContainer extends Iterable { } static EntityContainer empty() { - return new EntityContainer() { - @Override public void addEntity(WrapperEntity entity) {} - @Override public void removeEntity(WrapperEntity entity, boolean despawn) {} - @Override public void removeEntity(int entityId, boolean despawn) {} - @Override public void removeEntity(UUID uuid, boolean despawn) {} - @Override public void clearEntities(boolean despawn) {} - @Override public void tick() {} - @Override public Collection getEntities() {return Collections.emptyList();} - @Override - public @Nullable WrapperEntity getEntity(UUID uuid) { - return null; - } - @Override - public @Nullable WrapperEntity getEntity(int entityId) { - return null; - } - @Override - public boolean containsEntity(UUID uuid) { - return false; - } - - @Override - public boolean containsEntity(int entityId) { - return false; - } - - @Override - public boolean containsEntity(WrapperEntity entity) { - return false; - } - - @Override - public @NotNull Iterator iterator() { - return getEntities().iterator(); - } - }; + return EmptyContainer.INSTANCE; } diff --git a/api/src/main/java/me/tofaa/entitylib/extras/DyeColor.java b/api/src/main/java/me/tofaa/entitylib/extras/DyeColor.java index 798036f..7a1014c 100644 --- a/api/src/main/java/me/tofaa/entitylib/extras/DyeColor.java +++ b/api/src/main/java/me/tofaa/entitylib/extras/DyeColor.java @@ -3,6 +3,7 @@ package me.tofaa.entitylib.extras; import net.kyori.adventure.util.RGBLike; import org.jetbrains.annotations.NotNull; +@Deprecated public enum DyeColor implements RGBLike { WHITE(new Color(0xf9fffe), new Color(0xffffff), new Color(0xf0f0f0), 8), diff --git a/api/src/main/java/me/tofaa/entitylib/ve/ViewerEngine.java b/api/src/main/java/me/tofaa/entitylib/ve/ViewerEngine.java index b81beaa..b1036c7 100644 --- a/api/src/main/java/me/tofaa/entitylib/ve/ViewerEngine.java +++ b/api/src/main/java/me/tofaa/entitylib/ve/ViewerEngine.java @@ -44,7 +44,7 @@ public class ViewerEngine { getTracked0().forEach(entity -> { for (UUID viewer : entity.getViewers()) { if (!canSpawnFor(viewer, entity)) { - entity.removeViewer(viewer); + entity.removeViewer(viewer); } } }); diff --git a/code-gen/src/main/resources/offset-calculator.json b/code-gen/src/main/resources/offset-calculator.json index 59eae96..120814f 100644 --- a/code-gen/src/main/resources/offset-calculator.json +++ b/code-gen/src/main/resources/offset-calculator.json @@ -6,7 +6,7 @@ "name": "airTicks", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 1 } @@ -16,7 +16,7 @@ "name": "customName", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 2 } @@ -26,7 +26,7 @@ "name": "customNameVisible", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 3 } @@ -36,7 +36,7 @@ "name": "silent", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 4 } @@ -46,7 +46,7 @@ "name": "hasNoGravity", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 5 } @@ -56,7 +56,7 @@ "name": "pose", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 6 } @@ -66,7 +66,7 @@ "name": "ticksFrozenInPowderedSnow", "checks": [ { - "from": 767, + "from": 769, "to": 47, "offset": 7 } @@ -74,9 +74,6 @@ } ] }, - - - { "class-name": "AbstractDisplayMeta", "offsets": [ @@ -84,7 +81,7 @@ "name": "interpolationDelay", "checks": [ { - "from": 767, + "from": 769, "to": 762, "offset": 8 } @@ -94,7 +91,7 @@ "name": "transformationDuration", "checks": [ { - "from": 767, + "from": 769, "to": 762, "offset": 9 } @@ -104,7 +101,7 @@ "name": "positionRotationInterpolationDuration", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 10 } @@ -114,7 +111,7 @@ "name": "translation", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 11 }, @@ -129,7 +126,7 @@ "name": "scale", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 12 }, @@ -144,7 +141,7 @@ "name": "leftRotation", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 13 }, @@ -159,7 +156,7 @@ "name": "rightRotation", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 14 }, @@ -174,7 +171,7 @@ "name": "billboardConstraints", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 15 }, @@ -189,7 +186,7 @@ "name": "brightnessOverride", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 16 }, @@ -204,7 +201,7 @@ "name": "viewRange", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 17 }, @@ -219,7 +216,7 @@ "name": "shadowRadius", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 18 }, @@ -234,7 +231,7 @@ "name": "shadowStrength", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 19 }, @@ -249,7 +246,7 @@ "name": "width", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 20 }, @@ -264,7 +261,7 @@ "name": "height", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 21 }, @@ -279,7 +276,7 @@ "name": "glowColorOverride", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 22 }, @@ -299,7 +296,7 @@ "name": "blockId", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 23 }, @@ -319,7 +316,7 @@ "name": "item", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 24 }, @@ -334,7 +331,7 @@ "name": "displayType", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 25 }, @@ -354,7 +351,7 @@ "name": "text", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 26 }, @@ -369,7 +366,7 @@ "name": "textColor", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 27 }, @@ -384,7 +381,7 @@ "name": "textBackgroundColor", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 28 }, @@ -399,7 +396,7 @@ "name": "textBackground", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 29 }, @@ -414,7 +411,7 @@ "name": "textScale", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 30 }, @@ -429,12 +426,12 @@ "name": "textAlignment", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 31 }, { - "from": 767, + "from": 769, "to": 762, "offset": 30 } @@ -444,7 +441,7 @@ "name": "lineWidth", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 32 }, @@ -459,7 +456,7 @@ "name": "backgroundColor", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 33 }, @@ -474,7 +471,7 @@ "name": "textOpacity", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 34 }, @@ -489,7 +486,7 @@ "name": "shadow", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 35 }, @@ -504,7 +501,7 @@ "name": "seeThrough", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 36 }, @@ -519,7 +516,7 @@ "name": "useDefaultBackground", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 37 }, @@ -531,10 +528,10 @@ ] }, { - "name": "allighnLeft", + "name": "alignLeft", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 38 }, @@ -546,10 +543,10 @@ ] }, { - "name": "allighnRight", + "name": "alignRight", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 39 }, @@ -561,10 +558,10 @@ ] }, { - "name": "allighnCenter", + "name": "alignCenter", "checks": [ { - "from": 767, + "from": 769, "to": 764, "offset": 40 },