Mappings fix

This commit is contained in:
= 2024-12-14 23:34:54 +02:00
parent 4134dadaa9
commit beaa0cfc33
5 changed files with 98 additions and 84 deletions

View file

@ -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<WrapperEntity> 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<WrapperEntity> iterator() {
return getEntities().iterator();
}
}

View file

@ -20,42 +20,7 @@ public interface EntityContainer extends Iterable<WrapperEntity> {
} }
static EntityContainer empty() { static EntityContainer empty() {
return new EntityContainer() { return EmptyContainer.INSTANCE;
@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<WrapperEntity> 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<WrapperEntity> iterator() {
return getEntities().iterator();
}
};
} }

View file

@ -3,6 +3,7 @@ package me.tofaa.entitylib.extras;
import net.kyori.adventure.util.RGBLike; import net.kyori.adventure.util.RGBLike;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@Deprecated
public enum DyeColor implements RGBLike { public enum DyeColor implements RGBLike {
WHITE(new Color(0xf9fffe), new Color(0xffffff), new Color(0xf0f0f0), 8), WHITE(new Color(0xf9fffe), new Color(0xffffff), new Color(0xf0f0f0), 8),

View file

@ -44,7 +44,7 @@ public class ViewerEngine {
getTracked0().forEach(entity -> { getTracked0().forEach(entity -> {
for (UUID viewer : entity.getViewers()) { for (UUID viewer : entity.getViewers()) {
if (!canSpawnFor(viewer, entity)) { if (!canSpawnFor(viewer, entity)) {
entity.removeViewer(viewer); entity.removeViewer(viewer);
} }
} }
}); });

View file

@ -6,7 +6,7 @@
"name": "airTicks", "name": "airTicks",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 1 "offset": 1
} }
@ -16,7 +16,7 @@
"name": "customName", "name": "customName",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 2 "offset": 2
} }
@ -26,7 +26,7 @@
"name": "customNameVisible", "name": "customNameVisible",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 3 "offset": 3
} }
@ -36,7 +36,7 @@
"name": "silent", "name": "silent",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 4 "offset": 4
} }
@ -46,7 +46,7 @@
"name": "hasNoGravity", "name": "hasNoGravity",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 5 "offset": 5
} }
@ -56,7 +56,7 @@
"name": "pose", "name": "pose",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 6 "offset": 6
} }
@ -66,7 +66,7 @@
"name": "ticksFrozenInPowderedSnow", "name": "ticksFrozenInPowderedSnow",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 47, "to": 47,
"offset": 7 "offset": 7
} }
@ -74,9 +74,6 @@
} }
] ]
}, },
{ {
"class-name": "AbstractDisplayMeta", "class-name": "AbstractDisplayMeta",
"offsets": [ "offsets": [
@ -84,7 +81,7 @@
"name": "interpolationDelay", "name": "interpolationDelay",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 762, "to": 762,
"offset": 8 "offset": 8
} }
@ -94,7 +91,7 @@
"name": "transformationDuration", "name": "transformationDuration",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 762, "to": 762,
"offset": 9 "offset": 9
} }
@ -104,7 +101,7 @@
"name": "positionRotationInterpolationDuration", "name": "positionRotationInterpolationDuration",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 10 "offset": 10
} }
@ -114,7 +111,7 @@
"name": "translation", "name": "translation",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 11 "offset": 11
}, },
@ -129,7 +126,7 @@
"name": "scale", "name": "scale",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 12 "offset": 12
}, },
@ -144,7 +141,7 @@
"name": "leftRotation", "name": "leftRotation",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 13 "offset": 13
}, },
@ -159,7 +156,7 @@
"name": "rightRotation", "name": "rightRotation",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 14 "offset": 14
}, },
@ -174,7 +171,7 @@
"name": "billboardConstraints", "name": "billboardConstraints",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 15 "offset": 15
}, },
@ -189,7 +186,7 @@
"name": "brightnessOverride", "name": "brightnessOverride",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 16 "offset": 16
}, },
@ -204,7 +201,7 @@
"name": "viewRange", "name": "viewRange",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 17 "offset": 17
}, },
@ -219,7 +216,7 @@
"name": "shadowRadius", "name": "shadowRadius",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 18 "offset": 18
}, },
@ -234,7 +231,7 @@
"name": "shadowStrength", "name": "shadowStrength",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 19 "offset": 19
}, },
@ -249,7 +246,7 @@
"name": "width", "name": "width",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 20 "offset": 20
}, },
@ -264,7 +261,7 @@
"name": "height", "name": "height",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 21 "offset": 21
}, },
@ -279,7 +276,7 @@
"name": "glowColorOverride", "name": "glowColorOverride",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 22 "offset": 22
}, },
@ -299,7 +296,7 @@
"name": "blockId", "name": "blockId",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 23 "offset": 23
}, },
@ -319,7 +316,7 @@
"name": "item", "name": "item",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 24 "offset": 24
}, },
@ -334,7 +331,7 @@
"name": "displayType", "name": "displayType",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 25 "offset": 25
}, },
@ -354,7 +351,7 @@
"name": "text", "name": "text",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 26 "offset": 26
}, },
@ -369,7 +366,7 @@
"name": "textColor", "name": "textColor",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 27 "offset": 27
}, },
@ -384,7 +381,7 @@
"name": "textBackgroundColor", "name": "textBackgroundColor",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 28 "offset": 28
}, },
@ -399,7 +396,7 @@
"name": "textBackground", "name": "textBackground",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 29 "offset": 29
}, },
@ -414,7 +411,7 @@
"name": "textScale", "name": "textScale",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 30 "offset": 30
}, },
@ -429,12 +426,12 @@
"name": "textAlignment", "name": "textAlignment",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 31 "offset": 31
}, },
{ {
"from": 767, "from": 769,
"to": 762, "to": 762,
"offset": 30 "offset": 30
} }
@ -444,7 +441,7 @@
"name": "lineWidth", "name": "lineWidth",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 32 "offset": 32
}, },
@ -459,7 +456,7 @@
"name": "backgroundColor", "name": "backgroundColor",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 33 "offset": 33
}, },
@ -474,7 +471,7 @@
"name": "textOpacity", "name": "textOpacity",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 34 "offset": 34
}, },
@ -489,7 +486,7 @@
"name": "shadow", "name": "shadow",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 35 "offset": 35
}, },
@ -504,7 +501,7 @@
"name": "seeThrough", "name": "seeThrough",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 36 "offset": 36
}, },
@ -519,7 +516,7 @@
"name": "useDefaultBackground", "name": "useDefaultBackground",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 37 "offset": 37
}, },
@ -531,10 +528,10 @@
] ]
}, },
{ {
"name": "allighnLeft", "name": "alignLeft",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 38 "offset": 38
}, },
@ -546,10 +543,10 @@
] ]
}, },
{ {
"name": "allighnRight", "name": "alignRight",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 39 "offset": 39
}, },
@ -561,10 +558,10 @@
] ]
}, },
{ {
"name": "allighnCenter", "name": "alignCenter",
"checks": [ "checks": [
{ {
"from": 767, "from": 769,
"to": 764, "to": 764,
"offset": 40 "offset": 40
}, },