diff --git a/api/src/main/java/me/tofaa/entitylib/meta/MetaOffsetConverter.java b/api/src/main/java/me/tofaa/entitylib/meta/MetaOffsetConverter.java index a4566bf..7097735 100644 --- a/api/src/main/java/me/tofaa/entitylib/meta/MetaOffsetConverter.java +++ b/api/src/main/java/me/tofaa/entitylib/meta/MetaOffsetConverter.java @@ -9,12 +9,16 @@ @ApiStatus.Internal @SuppressWarnings("unused") public final class MetaOffsetConverter { - private MetaOffsetConverter() {} + private MetaOffsetConverter() { + } public static final class EntityMetaOffsets { + private EntityMetaOffsets() { + } + public static byte airTicksOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 1; } throw new RuntimeException("Unknown protocol version for this method"); @@ -22,7 +26,7 @@ public static byte airTicksOffset() { public static byte customNameOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 2; } throw new RuntimeException("Unknown protocol version for this method"); @@ -30,7 +34,7 @@ public static byte customNameOffset() { public static byte customNameVisibleOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 3; } throw new RuntimeException("Unknown protocol version for this method"); @@ -38,7 +42,7 @@ public static byte customNameVisibleOffset() { public static byte silentOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 4; } throw new RuntimeException("Unknown protocol version for this method"); @@ -46,7 +50,7 @@ public static byte silentOffset() { public static byte hasNoGravityOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 5; } throw new RuntimeException("Unknown protocol version for this method"); @@ -54,7 +58,7 @@ public static byte hasNoGravityOffset() { public static byte poseOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 6; } throw new RuntimeException("Unknown protocol version for this method"); @@ -62,7 +66,7 @@ public static byte poseOffset() { public static byte ticksFrozenInPowderedSnowOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 47 && protocolVersion <= 766) { + if (protocolVersion >= 47 && protocolVersion <= 767) { return 7; } throw new RuntimeException("Unknown protocol version for this method"); @@ -70,9 +74,12 @@ public static byte ticksFrozenInPowderedSnowOffset() { } public static final class AbstractDisplayMetaOffsets { + private AbstractDisplayMetaOffsets() { + } + public static byte interpolationDelayOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 762 && protocolVersion <= 766) { + if (protocolVersion >= 762 && protocolVersion <= 767) { return 8; } throw new RuntimeException("Unknown protocol version for this method"); @@ -80,7 +87,7 @@ public static byte interpolationDelayOffset() { public static byte transformationDurationOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 762 && protocolVersion <= 766) { + if (protocolVersion >= 762 && protocolVersion <= 767) { return 9; } throw new RuntimeException("Unknown protocol version for this method"); @@ -88,7 +95,7 @@ public static byte transformationDurationOffset() { public static byte positionRotationInterpolationDurationOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 10; } throw new RuntimeException("Unknown protocol version for this method"); @@ -96,7 +103,7 @@ public static byte positionRotationInterpolationDurationOffset() { public static byte translationOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 11; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -107,7 +114,7 @@ public static byte translationOffset() { public static byte scaleOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 12; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -118,7 +125,7 @@ public static byte scaleOffset() { public static byte leftRotationOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 13; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -129,7 +136,7 @@ public static byte leftRotationOffset() { public static byte rightRotationOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 14; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -140,7 +147,7 @@ public static byte rightRotationOffset() { public static byte billboardConstraintsOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 15; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -151,7 +158,7 @@ public static byte billboardConstraintsOffset() { public static byte brightnessOverrideOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 16; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -162,7 +169,7 @@ public static byte brightnessOverrideOffset() { public static byte viewRangeOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 17; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -173,7 +180,7 @@ public static byte viewRangeOffset() { public static byte shadowRadiusOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 18; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -184,7 +191,7 @@ public static byte shadowRadiusOffset() { public static byte shadowStrengthOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 19; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -195,7 +202,7 @@ public static byte shadowStrengthOffset() { public static byte widthOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 20; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -206,7 +213,7 @@ public static byte widthOffset() { public static byte heightOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 21; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -217,7 +224,7 @@ public static byte heightOffset() { public static byte glowColorOverrideOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 22; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -228,9 +235,12 @@ public static byte glowColorOverrideOffset() { } public static final class BlockDisplayMetaOffsets { + private BlockDisplayMetaOffsets() { + } + public static byte blockIdOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 23; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -241,9 +251,12 @@ public static byte blockIdOffset() { } public static final class ItemDisplayMetaOffsets { + private ItemDisplayMetaOffsets() { + } + public static byte itemOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 24; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -254,7 +267,7 @@ public static byte itemOffset() { public static byte displayTypeOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 25; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -265,9 +278,12 @@ public static byte displayTypeOffset() { } public static final class TextDisplayMetaOffsets { + private TextDisplayMetaOffsets() { + } + public static byte textOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 26; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -278,7 +294,7 @@ public static byte textOffset() { public static byte textColorOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 27; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -289,7 +305,7 @@ public static byte textColorOffset() { public static byte textBackgroundColorOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 28; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -300,7 +316,7 @@ public static byte textBackgroundColorOffset() { public static byte textBackgroundOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 29; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -311,7 +327,7 @@ public static byte textBackgroundOffset() { public static byte textScaleOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 30; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -322,10 +338,10 @@ public static byte textScaleOffset() { public static byte textAlignmentOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 31; } - if (protocolVersion >= 762 && protocolVersion <= 763) { + if (protocolVersion >= 762 && protocolVersion <= 767) { return 30; } throw new RuntimeException("Unknown protocol version for this method"); @@ -333,7 +349,7 @@ public static byte textAlignmentOffset() { public static byte lineWidthOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 32; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -344,7 +360,7 @@ public static byte lineWidthOffset() { public static byte backgroundColorOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 33; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -355,7 +371,7 @@ public static byte backgroundColorOffset() { public static byte textOpacityOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 34; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -366,7 +382,7 @@ public static byte textOpacityOffset() { public static byte shadowOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 35; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -377,7 +393,7 @@ public static byte shadowOffset() { public static byte seeThroughOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 36; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -388,7 +404,7 @@ public static byte seeThroughOffset() { public static byte useDefaultBackgroundOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 37; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -399,7 +415,7 @@ public static byte useDefaultBackgroundOffset() { public static byte allighnLeftOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 38; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -410,7 +426,7 @@ public static byte allighnLeftOffset() { public static byte allighnRightOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 39; } if (protocolVersion >= 762 && protocolVersion <= 763) { @@ -421,7 +437,7 @@ public static byte allighnRightOffset() { public static byte allighnCenterOffset() { int protocolVersion = getApi().getPacketEvents().getServerManager().getVersion().getProtocolVersion(); - if (protocolVersion >= 764 && protocolVersion <= 766) { + if (protocolVersion >= 764 && protocolVersion <= 767) { return 40; } if (protocolVersion >= 762 && protocolVersion <= 763) { diff --git a/code-gen/src/main/resources/offset-calculator.json b/code-gen/src/main/resources/offset-calculator.json index 079092b..59eae96 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": 765, + "from": 767, "to": 47, "offset": 1 } @@ -16,7 +16,7 @@ "name": "customName", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 2 } @@ -26,7 +26,7 @@ "name": "customNameVisible", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 3 } @@ -36,7 +36,7 @@ "name": "silent", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 4 } @@ -46,7 +46,7 @@ "name": "hasNoGravity", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 5 } @@ -56,7 +56,7 @@ "name": "pose", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 6 } @@ -66,7 +66,7 @@ "name": "ticksFrozenInPowderedSnow", "checks": [ { - "from": 765, + "from": 767, "to": 47, "offset": 7 } @@ -84,7 +84,7 @@ "name": "interpolationDelay", "checks": [ { - "from": 765, + "from": 767, "to": 762, "offset": 8 } @@ -94,7 +94,7 @@ "name": "transformationDuration", "checks": [ { - "from": 765, + "from": 767, "to": 762, "offset": 9 } @@ -104,7 +104,7 @@ "name": "positionRotationInterpolationDuration", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 10 } @@ -114,7 +114,7 @@ "name": "translation", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 11 }, @@ -129,7 +129,7 @@ "name": "scale", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 12 }, @@ -144,7 +144,7 @@ "name": "leftRotation", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 13 }, @@ -159,7 +159,7 @@ "name": "rightRotation", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 14 }, @@ -174,7 +174,7 @@ "name": "billboardConstraints", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 15 }, @@ -189,7 +189,7 @@ "name": "brightnessOverride", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 16 }, @@ -204,7 +204,7 @@ "name": "viewRange", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 17 }, @@ -219,7 +219,7 @@ "name": "shadowRadius", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 18 }, @@ -234,7 +234,7 @@ "name": "shadowStrength", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 19 }, @@ -249,7 +249,7 @@ "name": "width", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 20 }, @@ -264,7 +264,7 @@ "name": "height", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 21 }, @@ -279,7 +279,7 @@ "name": "glowColorOverride", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 22 }, @@ -299,7 +299,7 @@ "name": "blockId", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 23 }, @@ -319,7 +319,7 @@ "name": "item", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 24 }, @@ -334,7 +334,7 @@ "name": "displayType", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 25 }, @@ -354,7 +354,7 @@ "name": "text", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 26 }, @@ -369,7 +369,7 @@ "name": "textColor", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 27 }, @@ -384,7 +384,7 @@ "name": "textBackgroundColor", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 28 }, @@ -399,7 +399,7 @@ "name": "textBackground", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 29 }, @@ -414,7 +414,7 @@ "name": "textScale", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 30 }, @@ -429,12 +429,12 @@ "name": "textAlignment", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 31 }, { - "from": 763, + "from": 767, "to": 762, "offset": 30 } @@ -444,7 +444,7 @@ "name": "lineWidth", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 32 }, @@ -459,7 +459,7 @@ "name": "backgroundColor", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 33 }, @@ -474,7 +474,7 @@ "name": "textOpacity", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 34 }, @@ -489,7 +489,7 @@ "name": "shadow", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 35 }, @@ -504,7 +504,7 @@ "name": "seeThrough", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 36 }, @@ -519,7 +519,7 @@ "name": "useDefaultBackground", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 37 }, @@ -534,7 +534,7 @@ "name": "allighnLeft", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 38 }, @@ -549,7 +549,7 @@ "name": "allighnRight", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 39 }, @@ -564,7 +564,7 @@ "name": "allighnCenter", "checks": [ { - "from": 765, + "from": 767, "to": 764, "offset": 40 },