Apply IJ code reformat, rename rewriter methods, change metadata references to entity data

Doing lots of things in one commit to not muddy file history too much - almost all of these changes are fully automated
This commit is contained in:
Nassim Jahnke 2024-05-13 10:20:45 +02:00
parent b3f0c3e9a7
commit 75d86851ce
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
280 changed files with 2621 additions and 2758 deletions

View File

@ -8,7 +8,7 @@ tab_width = 4
[*.java]
ij_java_class_count_to_use_import_on_demand = 999999
ij_java_names_count_to_use_import_on_demand = 999999
ij_java_imports_layout = *,|,$*
ij_java_imports_layout = *, |, $*
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true

View File

@ -8,7 +8,7 @@
it works on any platform you can think of.**
The base ViaVersion jar runs on Paper, Velocity, Bungee, and Sponge. We also have projects integrating ViaVersion to run
on Fabric, Forge, or as a standalone proxy to join from basically any client version on any server version from the
on Fabric, Forge, or as a standalone proxy to join from basically any client version on any server version from the
past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.**
Supported Versions:

View File

@ -27,7 +27,6 @@ import com.viaversion.viaversion.api.connection.StorableObject;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.WorldIdentifiers;
import com.viaversion.viaversion.api.protocol.version.BlockedProtocolVersions;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ViaVersionConfig extends Config {

View File

@ -54,6 +54,15 @@ public class FullMappingsBase implements FullMappings {
this.mappings = mappings;
}
private static Object2IntMap<String> toInverseMap(final List<String> list) {
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(list.size());
map.defaultReturnValue(-1);
for (int i = 0; i < list.size(); i++) {
map.put(list.get(i), i);
}
return map;
}
@Override
public int id(final String identifier) {
return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
@ -119,13 +128,4 @@ public class FullMappingsBase implements FullMappings {
public FullMappings inverse() {
return new FullMappingsBase(mappedStringToId, stringToId, mappedIdToString, idToString, mappings.inverse());
}
private static Object2IntMap<String> toInverseMap(final List<String> list) {
final Object2IntMap<String> map = new Object2IntOpenHashMap<>(list.size());
map.defaultReturnValue(-1);
for (int i = 0; i < list.size(); i++) {
map.put(list.get(i), i);
}
return map;
}
}

View File

@ -22,6 +22,14 @@
*/
package com.viaversion.viaversion.api.data;
import com.google.common.annotations.Beta;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.viaversion.nbt.io.NBTIO;
import com.viaversion.nbt.io.TagReader;
import com.viaversion.nbt.tag.ByteTag;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag;
@ -29,14 +37,6 @@ import com.viaversion.nbt.tag.IntTag;
import com.viaversion.nbt.tag.ListTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.nbt.io.NBTIO;
import com.viaversion.nbt.io.TagReader;
import com.google.common.annotations.Beta;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.util.GsonUtil;
import it.unimi.dsi.fastutil.objects.Object2IntMap;

View File

@ -48,11 +48,11 @@ public interface TrackedEntity {
boolean hasData();
/**
* Returns whether metadata has already been sent at least once for this entity.
* Returns whether entity data has already been sent at least once for this entity.
*
* @return whether metadata has already been sent at least once for this entity
* @return whether entity data has already been sent at least once for this entity
*/
boolean hasSentMetadata();
boolean hasSentEntityData();
void sentMetadata(boolean sentMetadata);
void sentEntityData(boolean sentEntityData);
}

View File

@ -20,7 +20,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata;
package com.viaversion.viaversion.api.minecraft;
import java.util.Objects;
@ -82,8 +82,8 @@ public final class ChunkPosition {
@Override
public String toString() {
return "ChunkPosition{" +
"chunkX=" + chunkX +
", chunkZ=" + chunkZ +
'}';
"chunkX=" + chunkX +
", chunkZ=" + chunkZ +
'}';
}
}

View File

@ -27,7 +27,7 @@ public enum GameMode {
SURVIVAL("Survival Mode"),
CREATIVE("Creative Mode"),
ADVENTURE("Adventure Mode"),
SPECTATOR( "Spectator Mode");
SPECTATOR("Spectator Mode");
private final String text;

View File

@ -57,10 +57,10 @@ public final class GlobalPosition extends Position {
@Override
public String toString() {
return "GlobalPosition{" +
"dimension='" + dimension + '\'' +
", x=" + x +
", y=" + y +
", z=" + z +
'}';
"dimension='" + dimension + '\'' +
", x=" + x +
", y=" + y +
", z=" + z +
'}';
}
}

View File

@ -112,9 +112,9 @@ public final class Particle implements IdHolder {
@Override
public String toString() {
return "ParticleData{" +
"type=" + type +
", value=" + value +
'}';
"type=" + type +
", value=" + value +
'}';
}
}
}

View File

@ -79,9 +79,9 @@ public class Position {
@Override
public String toString() {
return "Position{" +
"x=" + x +
", y=" + y +
", z=" + z +
'}';
"x=" + x +
", y=" + y +
", z=" + z +
'}';
}
}

View File

@ -137,6 +137,7 @@ public final class DataPaletteImpl implements DataPalette {
interface ChunkData {
int get(int idx);
void set(int idx, int val);
}

View File

@ -20,15 +20,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata;
package com.viaversion.viaversion.api.minecraft.entitydata;
import com.google.common.base.Preconditions;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
public final class Metadata {
public final class EntityData {
private int id;
private MetaType metaType;
private EntityDataType metaType;
private Object value;
/**
@ -39,7 +39,7 @@ public final class Metadata {
* @param value value if present
* @throws IllegalArgumentException if the value and metaType are incompatible
*/
public Metadata(int id, MetaType metaType, @Nullable Object value) {
public EntityData(int id, EntityDataType metaType, @Nullable Object value) {
this.id = id;
this.metaType = metaType;
this.value = checkValue(metaType, value);
@ -53,7 +53,7 @@ public final class Metadata {
this.id = id;
}
public MetaType metaType() {
public EntityDataType dataType() {
return metaType;
}
@ -62,9 +62,9 @@ public final class Metadata {
*
* @param metaType metadata type
* @throws IllegalArgumentException if the metadata type and current value are incompatible
* @see #setTypeAndValue(MetaType, Object)
* @see #setTypeAndValue(EntityDataType, Object)
*/
public void setMetaType(MetaType metaType) {
public void setDataType(EntityDataType metaType) {
checkValue(metaType, this.value);
this.metaType = metaType;
}
@ -82,7 +82,7 @@ public final class Metadata {
*
* @param value value
* @throws IllegalArgumentException if the value and current metaType are incompatible
* @see #setTypeAndValue(MetaType, Object)
* @see #setTypeAndValue(EntityDataType, Object)
*/
public void setValue(@Nullable Object value) {
this.value = checkValue(this.metaType, value);
@ -95,22 +95,22 @@ public final class Metadata {
* @param value value
* @throws IllegalArgumentException if the value and metaType are incompatible
*/
public void setTypeAndValue(MetaType metaType, @Nullable Object value) {
public void setTypeAndValue(EntityDataType metaType, @Nullable Object value) {
this.value = checkValue(metaType, value);
this.metaType = metaType;
}
private Object checkValue(MetaType metaType, @Nullable Object value) {
private Object checkValue(EntityDataType metaType, @Nullable Object value) {
Preconditions.checkNotNull(metaType);
if (value != null && !metaType.type().getOutputClass().isAssignableFrom(value.getClass())) {
throw new IllegalArgumentException("Metadata value and metaType are incompatible. Type=" + metaType
+ ", value=" + value + " (" + value.getClass().getSimpleName() + ")");
+ ", value=" + value + " (" + value.getClass().getSimpleName() + ")");
}
return value;
}
@Deprecated
public void setMetaTypeUnsafe(MetaType type) {
public void setDataTypeUnsafe(EntityDataType type) {
this.metaType = type;
}
@ -118,7 +118,7 @@ public final class Metadata {
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Metadata metadata = (Metadata) o;
EntityData metadata = (EntityData) o;
if (id != metadata.id) return false;
if (metaType != metadata.metaType) return false;
return Objects.equals(value, metadata.value);
@ -135,9 +135,9 @@ public final class Metadata {
@Override
public String toString() {
return "Metadata{" +
"id=" + id +
", metaType=" + metaType +
", value=" + value +
'}';
"id=" + id +
", metaType=" + metaType +
", value=" + value +
'}';
}
}

View File

@ -20,12 +20,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata;
package com.viaversion.viaversion.api.minecraft.entitydata;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.type.Type;
public interface MetaType {
public interface EntityDataType {
/**
* Get the write/read type
@ -41,15 +41,15 @@ public interface MetaType {
*/
int typeId();
static MetaType create(final int typeId, final Type<?> type) {
return new MetaTypeImpl(typeId, type);
static EntityDataType create(final int typeId, final Type<?> type) {
return new EntityDataTypeImpl(typeId, type);
}
final class MetaTypeImpl implements MetaType {
final class EntityDataTypeImpl implements EntityDataType {
private final int typeId;
private final Type<?> type;
MetaTypeImpl(final int typeId, final Type<?> type) {
EntityDataTypeImpl(final int typeId, final Type<?> type) {
Preconditions.checkNotNull(type);
this.typeId = typeId;
this.type = type;
@ -67,17 +67,17 @@ public interface MetaType {
@Override
public String toString() {
return "MetaType{" +
"typeId=" + typeId +
", type=" + type +
'}';
return "EntityDataType{" +
"typeId=" + typeId +
", type=" + type +
'}';
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final MetaTypeImpl metaType = (MetaTypeImpl) o;
final EntityDataTypeImpl metaType = (EntityDataTypeImpl) o;
if (typeId != metaType.typeId) return false;
return type.equals(metaType.type);
}

View File

@ -20,31 +20,31 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Type;
public abstract class AbstractMetaTypes implements MetaTypes {
public abstract class AbstractEntityDataTypes implements EntityDataTypes {
private final MetaType[] values;
private final EntityDataType[] values;
protected AbstractMetaTypes(final int values) {
this.values = new MetaType[values];
protected AbstractEntityDataTypes(final int values) {
this.values = new EntityDataType[values];
}
@Override
public MetaType byId(final int id) {
public EntityDataType byId(final int id) {
return values[id];
}
@Override
public MetaType[] values() {
public EntityDataType[] values() {
return values;
}
protected MetaType add(final int typeId, final Type<?> type) {
final MetaType metaType = MetaType.create(typeId, type);
protected EntityDataType add(final int typeId, final Type<?> type) {
final EntityDataType metaType = EntityDataType.create(typeId, type);
values[typeId] = metaType;
return metaType;
}

View File

@ -20,11 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
public interface MetaTypes {
public interface EntityDataTypes {
/**
* Returns the meta type by the given id.
@ -33,12 +33,12 @@ public interface MetaTypes {
* @return meta type by id
* @throws IndexOutOfBoundsException if id is out of bounds
*/
MetaType byId(int id);
EntityDataType byId(int id);
/**
* Returns an array of meta types.
*
* @return array of meta types
*/
MetaType[] values();
EntityDataType[] values();
}

View File

@ -20,13 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_12 implements MetaType {
public enum EntityDataTypes1_12 implements EntityDataType {
BYTE(Types.BYTE),
VAR_INT(Types.VAR_INT),
FLOAT(Types.FLOAT),
@ -44,11 +44,11 @@ public enum MetaType1_12 implements MetaType {
private final Type<?> type;
MetaType1_12(Type<?> type) {
EntityDataTypes1_12(Type<?> type) {
this.type = type;
}
public static MetaType1_12 byId(int id) {
public static EntityDataTypes1_12 byId(int id) {
return values()[id];
}

View File

@ -0,0 +1,52 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_13 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType floatType = add(2, Types.FLOAT);
public final EntityDataType stringType = add(3, Types.STRING);
public final EntityDataType componentType = add(4, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(6, Types.ITEM1_13);
public final EntityDataType booleanType = add(7, Types.BOOLEAN);
public final EntityDataType rotationsType = add(8, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(9, Types.BLOCK_POSITION1_8);
public final EntityDataType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION1_8);
public final EntityDataType directionType = add(11, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final EntityDataType optionalBlockStateType = add(13, Types.VAR_INT);
public final EntityDataType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public EntityDataTypes1_13(final ParticleType particleType) {
super(16);
this.particleType = add(15, particleType);
}
}

View File

@ -0,0 +1,52 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_13_2 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType floatType = add(2, Types.FLOAT);
public final EntityDataType stringType = add(3, Types.STRING);
public final EntityDataType componentType = add(4, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(6, Types.ITEM1_13_2);
public final EntityDataType booleanType = add(7, Types.BOOLEAN);
public final EntityDataType rotationsType = add(8, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(9, Types.BLOCK_POSITION1_8);
public final EntityDataType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION1_8);
public final EntityDataType directionType = add(11, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final EntityDataType optionalBlockStateType = add(13, Types.VAR_INT);
public final EntityDataType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public EntityDataTypes1_13_2(final ParticleType particleType) {
super(16);
this.particleType = add(15, particleType);
}
}

View File

@ -0,0 +1,55 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_14 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType floatType = add(2, Types.FLOAT);
public final EntityDataType stringType = add(3, Types.STRING);
public final EntityDataType componentType = add(4, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(6, Types.ITEM1_13_2);
public final EntityDataType booleanType = add(7, Types.BOOLEAN);
public final EntityDataType rotationsType = add(8, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(9, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(11, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final EntityDataType optionalBlockStateType = add(13, Types.VAR_INT);
public final EntityDataType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(16, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(17, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(18, Types.VAR_INT);
public EntityDataTypes1_14(final ParticleType particleType) {
super(19);
this.particleType = add(15, particleType);
}
}

View File

@ -0,0 +1,59 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_19 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType floatType = add(2, Types.FLOAT);
public final EntityDataType stringType = add(3, Types.STRING);
public final EntityDataType componentType = add(4, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(6, Types.ITEM1_13_2);
public final EntityDataType booleanType = add(7, Types.BOOLEAN);
public final EntityDataType rotationsType = add(8, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(9, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(11, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final EntityDataType optionalBlockStateType = add(13, Types.VAR_INT);
public final EntityDataType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(16, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(17, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(18, Types.VAR_INT);
public final EntityDataType catVariantType = add(19, Types.VAR_INT);
public final EntityDataType frogVariantType = add(20, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(21, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(22, Types.VAR_INT);
public EntityDataTypes1_19(final ParticleType particleType) {
super(23);
this.particleType = add(15, particleType);
}
}

View File

@ -0,0 +1,60 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_19_3 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType longType = add(2, Types.VAR_LONG);
public final EntityDataType floatType = add(3, Types.FLOAT);
public final EntityDataType stringType = add(4, Types.STRING);
public final EntityDataType componentType = add(5, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(7, Types.ITEM1_13_2);
public final EntityDataType booleanType = add(8, Types.BOOLEAN);
public final EntityDataType rotationsType = add(9, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(12, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final EntityDataType optionalBlockStateType = add(14, Types.VAR_INT);
public final EntityDataType compoundTagType = add(15, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(17, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(18, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(19, Types.VAR_INT);
public final EntityDataType catVariantType = add(20, Types.VAR_INT);
public final EntityDataType frogVariantType = add(21, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(22, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(23, Types.VAR_INT);
public EntityDataTypes1_19_3(final ParticleType particleType) {
super(24);
this.particleType = add(16, particleType);
}
}

View File

@ -0,0 +1,64 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_19_4 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType longType = add(2, Types.VAR_LONG);
public final EntityDataType floatType = add(3, Types.FLOAT);
public final EntityDataType stringType = add(4, Types.STRING);
public final EntityDataType componentType = add(5, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(7, Types.ITEM1_13_2);
public final EntityDataType booleanType = add(8, Types.BOOLEAN);
public final EntityDataType rotationsType = add(9, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(12, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final EntityDataType blockStateType = add(14, Types.VAR_INT);
public final EntityDataType optionalBlockStateType = add(15, Types.VAR_INT);
public final EntityDataType compoundTagType = add(16, Types.NAMED_COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(20, Types.VAR_INT);
public final EntityDataType catVariantType = add(21, Types.VAR_INT);
public final EntityDataType frogVariantType = add(22, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(24, Types.VAR_INT);
public final EntityDataType snifferState = add(25, Types.VAR_INT);
public final EntityDataType vector3FType = add(26, Types.VECTOR3F);
public final EntityDataType quaternionType = add(27, Types.QUATERNION);
public EntityDataTypes1_19_4(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -0,0 +1,64 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_20_2 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType longType = add(2, Types.VAR_LONG);
public final EntityDataType floatType = add(3, Types.FLOAT);
public final EntityDataType stringType = add(4, Types.STRING);
public final EntityDataType componentType = add(5, Types.COMPONENT);
public final EntityDataType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final EntityDataType itemType = add(7, Types.ITEM1_20_2);
public final EntityDataType booleanType = add(8, Types.BOOLEAN);
public final EntityDataType rotationsType = add(9, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(12, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final EntityDataType blockStateType = add(14, Types.VAR_INT);
public final EntityDataType optionalBlockStateType = add(15, Types.VAR_INT);
public final EntityDataType compoundTagType = add(16, Types.COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(20, Types.VAR_INT);
public final EntityDataType catVariantType = add(21, Types.VAR_INT);
public final EntityDataType frogVariantType = add(22, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(24, Types.VAR_INT);
public final EntityDataType snifferState = add(25, Types.VAR_INT);
public final EntityDataType vector3FType = add(26, Types.VECTOR3F);
public final EntityDataType quaternionType = add(27, Types.QUATERNION);
public EntityDataTypes1_20_2(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -0,0 +1,64 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class EntityDataTypes1_20_3 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType longType = add(2, Types.VAR_LONG);
public final EntityDataType floatType = add(3, Types.FLOAT);
public final EntityDataType stringType = add(4, Types.STRING);
public final EntityDataType componentType = add(5, Types.TAG);
public final EntityDataType optionalComponentType = add(6, Types.OPTIONAL_TAG);
public final EntityDataType itemType = add(7, Types.ITEM1_20_2);
public final EntityDataType booleanType = add(8, Types.BOOLEAN);
public final EntityDataType rotationsType = add(9, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(12, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final EntityDataType blockStateType = add(14, Types.VAR_INT);
public final EntityDataType optionalBlockStateType = add(15, Types.VAR_INT);
public final EntityDataType compoundTagType = add(16, Types.COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(20, Types.VAR_INT);
public final EntityDataType catVariantType = add(21, Types.VAR_INT);
public final EntityDataType frogVariantType = add(22, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(24, Types.VAR_INT);
public final EntityDataType snifferState = add(25, Types.VAR_INT);
public final EntityDataType vector3FType = add(26, Types.VECTOR3F);
public final EntityDataType quaternionType = add(27, Types.QUATERNION);
public EntityDataTypes1_20_3(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -0,0 +1,71 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.Particle;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.ArrayType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import com.viaversion.viaversion.api.type.types.version.Types1_20_5;
public final class EntityDataTypes1_20_5 extends AbstractEntityDataTypes {
public final EntityDataType byteType = add(0, Types.BYTE);
public final EntityDataType varIntType = add(1, Types.VAR_INT);
public final EntityDataType longType = add(2, Types.VAR_LONG);
public final EntityDataType floatType = add(3, Types.FLOAT);
public final EntityDataType stringType = add(4, Types.STRING);
public final EntityDataType componentType = add(5, Types.TAG);
public final EntityDataType optionalComponentType = add(6, Types.OPTIONAL_TAG);
public final EntityDataType itemType = add(7, Types1_20_5.ITEM);
public final EntityDataType booleanType = add(8, Types.BOOLEAN);
public final EntityDataType rotationsType = add(9, Types.ROTATIONS);
public final EntityDataType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final EntityDataType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final EntityDataType directionType = add(12, Types.VAR_INT);
public final EntityDataType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final EntityDataType blockStateType = add(14, Types.VAR_INT);
public final EntityDataType optionalBlockStateType = add(15, Types.VAR_INT);
public final EntityDataType compoundTagType = add(16, Types.COMPOUND_TAG);
public final EntityDataType particleType;
public final EntityDataType particlesType;
public final EntityDataType villagerDatatType = add(19, Types.VILLAGER_DATA);
public final EntityDataType optionalVarIntType = add(20, Types.OPTIONAL_VAR_INT);
public final EntityDataType poseType = add(21, Types.VAR_INT);
public final EntityDataType catVariantType = add(22, Types.VAR_INT);
public final EntityDataType wolfVariantType = add(23, Types.VAR_INT);
public final EntityDataType frogVariantType = add(24, Types.VAR_INT);
public final EntityDataType optionalGlobalPosition = add(25, Types.OPTIONAL_GLOBAL_POSITION);
public final EntityDataType paintingVariantType = add(26, Types.VAR_INT);
public final EntityDataType snifferState = add(27, Types.VAR_INT);
public final EntityDataType armadilloState = add(28, Types.VAR_INT);
public final EntityDataType vector3FType = add(29, Types.VECTOR3F);
public final EntityDataType quaternionType = add(30, Types.QUATERNION);
public EntityDataTypes1_20_5(final ParticleType particleType, final ArrayType<Particle> particlesType) {
super(31);
this.particleType = add(17, particleType);
this.particlesType = add(18, particlesType);
}
}

View File

@ -20,13 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_8 implements MetaType {
public enum EntityDataTypes1_8 implements EntityDataType {
BYTE(Types.BYTE),
SHORT(Types.SHORT),
INT(Types.INT),
@ -38,11 +38,11 @@ public enum MetaType1_8 implements MetaType {
private final Type<?> type;
MetaType1_8(Type<?> type) {
EntityDataTypes1_8(Type<?> type) {
this.type = type;
}
public static MetaType1_8 byId(int id) {
public static EntityDataTypes1_8 byId(int id) {
return values()[id];
}

View File

@ -20,13 +20,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
package com.viaversion.viaversion.api.minecraft.entitydata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_9 implements MetaType {
public enum EntityDataTypes1_9 implements EntityDataType {
BYTE(Types.BYTE),
VAR_INT(Types.VAR_INT),
FLOAT(Types.FLOAT),
@ -43,11 +43,11 @@ public enum MetaType1_9 implements MetaType {
private final Type<?> type;
MetaType1_9(Type<?> type) {
EntityDataTypes1_9(Type<?> type) {
this.type = type;
}
public static MetaType1_9 byId(int id) {
public static EntityDataTypes1_9 byId(int id) {
return values()[id];
}

View File

@ -22,8 +22,8 @@
*/
package com.viaversion.viaversion.api.minecraft.item;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.gson.annotations.SerializedName;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.minecraft.data.StructuredDataContainer;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.minecraft.item.data;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.minecraft.item.data;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf;

View File

@ -22,7 +22,6 @@
*/
package com.viaversion.viaversion.api.minecraft.item.data;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf;

View File

@ -1,53 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_13 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType floatType = add(2, Types.FLOAT);
public final MetaType stringType = add(3, Types.STRING);
public final MetaType componentType = add(4, Types.COMPONENT);
public final MetaType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(6, Types.ITEM1_13);
public final MetaType booleanType = add(7, Types.BOOLEAN);
public final MetaType rotationsType = add(8, Types.ROTATIONS);
public final MetaType blockPositionType = add(9, Types.BLOCK_POSITION1_8);
public final MetaType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION1_8);
public final MetaType directionType = add(11, Types.VAR_INT);
public final MetaType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final MetaType optionalBlockStateType = add(13, Types.VAR_INT);
public final MetaType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public MetaTypes1_13(final ParticleType particleType) {
super(16);
this.particleType = add(15, particleType);
}
}

View File

@ -1,53 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_13_2 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType floatType = add(2, Types.FLOAT);
public final MetaType stringType = add(3, Types.STRING);
public final MetaType componentType = add(4, Types.COMPONENT);
public final MetaType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(6, Types.ITEM1_13_2);
public final MetaType booleanType = add(7, Types.BOOLEAN);
public final MetaType rotationsType = add(8, Types.ROTATIONS);
public final MetaType blockPositionType = add(9, Types.BLOCK_POSITION1_8);
public final MetaType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION1_8);
public final MetaType directionType = add(11, Types.VAR_INT);
public final MetaType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final MetaType optionalBlockStateType = add(13, Types.VAR_INT);
public final MetaType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public MetaTypes1_13_2(final ParticleType particleType) {
super(16);
this.particleType = add(15, particleType);
}
}

View File

@ -1,56 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_14 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType floatType = add(2, Types.FLOAT);
public final MetaType stringType = add(3, Types.STRING);
public final MetaType componentType = add(4, Types.COMPONENT);
public final MetaType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(6, Types.ITEM1_13_2);
public final MetaType booleanType = add(7, Types.BOOLEAN);
public final MetaType rotationsType = add(8, Types.ROTATIONS);
public final MetaType blockPositionType = add(9, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(11, Types.VAR_INT);
public final MetaType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final MetaType optionalBlockStateType = add(13, Types.VAR_INT);
public final MetaType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(16, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(17, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(18, Types.VAR_INT);
public MetaTypes1_14(final ParticleType particleType) {
super(19);
this.particleType = add(15, particleType);
}
}

View File

@ -1,60 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_19 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType floatType = add(2, Types.FLOAT);
public final MetaType stringType = add(3, Types.STRING);
public final MetaType componentType = add(4, Types.COMPONENT);
public final MetaType optionalComponentType = add(5, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(6, Types.ITEM1_13_2);
public final MetaType booleanType = add(7, Types.BOOLEAN);
public final MetaType rotationsType = add(8, Types.ROTATIONS);
public final MetaType blockPositionType = add(9, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(10, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(11, Types.VAR_INT);
public final MetaType optionalUUIDType = add(12, Types.OPTIONAL_UUID);
public final MetaType optionalBlockStateType = add(13, Types.VAR_INT);
public final MetaType compoundTagType = add(14, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(16, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(17, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(18, Types.VAR_INT);
public final MetaType catVariantType = add(19, Types.VAR_INT);
public final MetaType frogVariantType = add(20, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(21, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(22, Types.VAR_INT);
public MetaTypes1_19(final ParticleType particleType) {
super(23);
this.particleType = add(15, particleType);
}
}

View File

@ -1,61 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_19_3 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType longType = add(2, Types.VAR_LONG);
public final MetaType floatType = add(3, Types.FLOAT);
public final MetaType stringType = add(4, Types.STRING);
public final MetaType componentType = add(5, Types.COMPONENT);
public final MetaType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(7, Types.ITEM1_13_2);
public final MetaType booleanType = add(8, Types.BOOLEAN);
public final MetaType rotationsType = add(9, Types.ROTATIONS);
public final MetaType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(12, Types.VAR_INT);
public final MetaType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final MetaType optionalBlockStateType = add(14, Types.VAR_INT);
public final MetaType compoundTagType = add(15, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(17, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(18, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(19, Types.VAR_INT);
public final MetaType catVariantType = add(20, Types.VAR_INT);
public final MetaType frogVariantType = add(21, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(22, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(23, Types.VAR_INT);
public MetaTypes1_19_3(final ParticleType particleType) {
super(24);
this.particleType = add(16, particleType);
}
}

View File

@ -1,65 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_19_4 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType longType = add(2, Types.VAR_LONG);
public final MetaType floatType = add(3, Types.FLOAT);
public final MetaType stringType = add(4, Types.STRING);
public final MetaType componentType = add(5, Types.COMPONENT);
public final MetaType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(7, Types.ITEM1_13_2);
public final MetaType booleanType = add(8, Types.BOOLEAN);
public final MetaType rotationsType = add(9, Types.ROTATIONS);
public final MetaType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(12, Types.VAR_INT);
public final MetaType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final MetaType blockStateType = add(14, Types.VAR_INT);
public final MetaType optionalBlockStateType = add(15, Types.VAR_INT);
public final MetaType compoundTagType = add(16, Types.NAMED_COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(20, Types.VAR_INT);
public final MetaType catVariantType = add(21, Types.VAR_INT);
public final MetaType frogVariantType = add(22, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(24, Types.VAR_INT);
public final MetaType snifferState = add(25, Types.VAR_INT);
public final MetaType vector3FType = add(26, Types.VECTOR3F);
public final MetaType quaternionType = add(27, Types.QUATERNION);
public MetaTypes1_19_4(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -1,65 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_20_2 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType longType = add(2, Types.VAR_LONG);
public final MetaType floatType = add(3, Types.FLOAT);
public final MetaType stringType = add(4, Types.STRING);
public final MetaType componentType = add(5, Types.COMPONENT);
public final MetaType optionalComponentType = add(6, Types.OPTIONAL_COMPONENT);
public final MetaType itemType = add(7, Types.ITEM1_20_2);
public final MetaType booleanType = add(8, Types.BOOLEAN);
public final MetaType rotationsType = add(9, Types.ROTATIONS);
public final MetaType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(12, Types.VAR_INT);
public final MetaType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final MetaType blockStateType = add(14, Types.VAR_INT);
public final MetaType optionalBlockStateType = add(15, Types.VAR_INT);
public final MetaType compoundTagType = add(16, Types.COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(20, Types.VAR_INT);
public final MetaType catVariantType = add(21, Types.VAR_INT);
public final MetaType frogVariantType = add(22, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(24, Types.VAR_INT);
public final MetaType snifferState = add(25, Types.VAR_INT);
public final MetaType vector3FType = add(26, Types.VECTOR3F);
public final MetaType quaternionType = add(27, Types.QUATERNION);
public MetaTypes1_20_2(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -1,65 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
public final class MetaTypes1_20_3 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType longType = add(2, Types.VAR_LONG);
public final MetaType floatType = add(3, Types.FLOAT);
public final MetaType stringType = add(4, Types.STRING);
public final MetaType componentType = add(5, Types.TAG);
public final MetaType optionalComponentType = add(6, Types.OPTIONAL_TAG);
public final MetaType itemType = add(7, Types.ITEM1_20_2);
public final MetaType booleanType = add(8, Types.BOOLEAN);
public final MetaType rotationsType = add(9, Types.ROTATIONS);
public final MetaType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(12, Types.VAR_INT);
public final MetaType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final MetaType blockStateType = add(14, Types.VAR_INT);
public final MetaType optionalBlockStateType = add(15, Types.VAR_INT);
public final MetaType compoundTagType = add(16, Types.COMPOUND_TAG);
public final MetaType particleType;
public final MetaType villagerDatatType = add(18, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(19, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(20, Types.VAR_INT);
public final MetaType catVariantType = add(21, Types.VAR_INT);
public final MetaType frogVariantType = add(22, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(23, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(24, Types.VAR_INT);
public final MetaType snifferState = add(25, Types.VAR_INT);
public final MetaType vector3FType = add(26, Types.VECTOR3F);
public final MetaType quaternionType = add(27, Types.QUATERNION);
public MetaTypes1_20_3(final ParticleType particleType) {
super(28);
this.particleType = add(17, particleType);
}
}

View File

@ -1,72 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.Particle;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.ArrayType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import com.viaversion.viaversion.api.type.types.version.Types1_20_5;
public final class MetaTypes1_20_5 extends AbstractMetaTypes {
public final MetaType byteType = add(0, Types.BYTE);
public final MetaType varIntType = add(1, Types.VAR_INT);
public final MetaType longType = add(2, Types.VAR_LONG);
public final MetaType floatType = add(3, Types.FLOAT);
public final MetaType stringType = add(4, Types.STRING);
public final MetaType componentType = add(5, Types.TAG);
public final MetaType optionalComponentType = add(6, Types.OPTIONAL_TAG);
public final MetaType itemType = add(7, Types1_20_5.ITEM);
public final MetaType booleanType = add(8, Types.BOOLEAN);
public final MetaType rotationsType = add(9, Types.ROTATIONS);
public final MetaType blockPositionType = add(10, Types.BLOCK_POSITION1_14);
public final MetaType optionalBlockPositionType = add(11, Types.OPTIONAL_POSITION_1_14);
public final MetaType directionType = add(12, Types.VAR_INT);
public final MetaType optionalUUIDType = add(13, Types.OPTIONAL_UUID);
public final MetaType blockStateType = add(14, Types.VAR_INT);
public final MetaType optionalBlockStateType = add(15, Types.VAR_INT);
public final MetaType compoundTagType = add(16, Types.COMPOUND_TAG);
public final MetaType particleType;
public final MetaType particlesType;
public final MetaType villagerDatatType = add(19, Types.VILLAGER_DATA);
public final MetaType optionalVarIntType = add(20, Types.OPTIONAL_VAR_INT);
public final MetaType poseType = add(21, Types.VAR_INT);
public final MetaType catVariantType = add(22, Types.VAR_INT);
public final MetaType wolfVariantType = add(23, Types.VAR_INT);
public final MetaType frogVariantType = add(24, Types.VAR_INT);
public final MetaType optionalGlobalPosition = add(25, Types.OPTIONAL_GLOBAL_POSITION);
public final MetaType paintingVariantType = add(26, Types.VAR_INT);
public final MetaType snifferState = add(27, Types.VAR_INT);
public final MetaType armadilloState = add(28, Types.VAR_INT);
public final MetaType vector3FType = add(29, Types.VECTOR3F);
public final MetaType quaternionType = add(30, Types.QUATERNION);
public MetaTypes1_20_5(final ParticleType particleType, final ArrayType<Particle> particlesType) {
super(31);
this.particleType = add(17, particleType);
this.particlesType = add(18, particlesType);
}
}

View File

@ -24,7 +24,6 @@ package com.viaversion.viaversion.api.minecraft.signature;
import com.viaversion.viaversion.api.platform.providers.Provider;
import com.viaversion.viaversion.util.Pair;
import java.util.List;
public abstract class SignableCommandArgumentsProvider implements Provider {

View File

@ -26,7 +26,6 @@ import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
import com.viaversion.viaversion.api.minecraft.signature.model.DecoratableMessage;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import com.viaversion.viaversion.util.GsonUtil;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_1;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.util.UUID;
public class MessageHeader {

View File

@ -26,7 +26,6 @@ import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.nio.charset.StandardCharsets;
import java.time.Instant;

View File

@ -24,7 +24,6 @@ package com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_3;
import com.google.common.primitives.Ints;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.util.UUID;
public class MessageLink {

View File

@ -25,7 +25,6 @@ package com.viaversion.viaversion.api.minecraft.signature.storage;
import com.viaversion.viaversion.api.connection.StorableObject;
import com.viaversion.viaversion.api.minecraft.ProfileKey;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.SignatureException;

View File

@ -26,7 +26,6 @@ import com.viaversion.viaversion.api.minecraft.ProfileKey;
import com.viaversion.viaversion.api.minecraft.signature.model.DecoratableMessage;
import com.viaversion.viaversion.api.minecraft.signature.model.MessageMetadata;
import com.viaversion.viaversion.util.GsonUtil;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets;

View File

@ -28,7 +28,6 @@ import com.viaversion.viaversion.api.minecraft.signature.model.DecoratableMessag
import com.viaversion.viaversion.api.minecraft.signature.model.MessageMetadata;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_1.MessageBody;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_1.MessageHeader;
import java.security.PrivateKey;
import java.security.SignatureException;
import java.util.UUID;

View File

@ -28,7 +28,6 @@ import com.viaversion.viaversion.api.minecraft.ProfileKey;
import com.viaversion.viaversion.api.minecraft.signature.model.MessageMetadata;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_3.MessageBody;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_3.MessageLink;
import java.security.PrivateKey;
import java.security.SignatureException;
import java.util.UUID;

View File

@ -23,10 +23,8 @@
package com.viaversion.viaversion.api.platform;
import com.google.gson.JsonObject;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.ViaAPI;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.connection.UserConnection;
import java.io.File;

View File

@ -62,7 +62,7 @@ import static com.viaversion.viaversion.util.ProtocolUtil.packetTypeMap;
* @param <SU> unmapped serverbound packet type
*/
public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM extends ClientboundPacketType,
SM extends ServerboundPacketType, SU extends ServerboundPacketType> implements Protocol<CU, CM, SM, SU> {
SM extends ServerboundPacketType, SU extends ServerboundPacketType> implements Protocol<CU, CM, SM, SU> {
protected final Class<CU> unmappedClientboundPacketType;
protected final Class<CM> mappedClientboundPacketType;
protected final Class<SM> mappedServerboundPacketType;
@ -108,21 +108,21 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
// Register the rest of the ids with no handlers if necessary
if (unmappedClientboundPacketType != null && mappedClientboundPacketType != null
&& unmappedClientboundPacketType != mappedClientboundPacketType) {
&& unmappedClientboundPacketType != mappedClientboundPacketType) {
registerPacketIdChanges(
packetTypesProvider.unmappedClientboundPacketTypes(),
packetTypesProvider.mappedClientboundPacketTypes(),
this::hasRegisteredClientbound,
this::registerClientbound
packetTypesProvider.unmappedClientboundPacketTypes(),
packetTypesProvider.mappedClientboundPacketTypes(),
this::hasRegisteredClientbound,
this::registerClientbound
);
}
if (mappedServerboundPacketType != null && unmappedServerboundPacketType != null &&
mappedServerboundPacketType != unmappedServerboundPacketType) {
mappedServerboundPacketType != unmappedServerboundPacketType) {
registerPacketIdChanges(
packetTypesProvider.unmappedServerboundPacketTypes(),
packetTypesProvider.mappedServerboundPacketTypes(),
this::hasRegisteredServerbound,
this::registerServerbound
packetTypesProvider.unmappedServerboundPacketTypes(),
packetTypesProvider.mappedServerboundPacketTypes(),
this::hasRegisteredServerbound,
this::registerServerbound
);
}
}
@ -173,10 +173,10 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
}
private <U extends PacketType, M extends PacketType> void registerPacketIdChanges(
Map<State, PacketTypeMap<U>> unmappedPacketTypes,
Map<State, PacketTypeMap<M>> mappedPacketTypes,
Predicate<U> registeredPredicate,
BiConsumer<U, M> registerConsumer
Map<State, PacketTypeMap<U>> unmappedPacketTypes,
Map<State, PacketTypeMap<M>> mappedPacketTypes,
Predicate<U> registeredPredicate,
BiConsumer<U, M> registerConsumer
) {
for (Map.Entry<State, PacketTypeMap<M>> entry : mappedPacketTypes.entrySet()) {
PacketTypeMap<M> mappedTypes = entry.getValue();
@ -241,10 +241,10 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
protected PacketTypesProvider<CU, CM, SM, SU> createPacketTypesProvider() {
return new SimplePacketTypesProvider<>(
packetTypeMap(unmappedClientboundPacketType, unmappedClientboundPacketType),
packetTypeMap(mappedClientboundPacketType, mappedClientboundPacketType),
packetTypeMap(mappedServerboundPacketType, mappedServerboundPacketType),
packetTypeMap(unmappedServerboundPacketType, unmappedServerboundPacketType)
packetTypeMap(unmappedClientboundPacketType, unmappedClientboundPacketType),
packetTypeMap(mappedClientboundPacketType, mappedClientboundPacketType),
packetTypeMap(mappedServerboundPacketType, mappedServerboundPacketType),
packetTypeMap(unmappedServerboundPacketType, unmappedServerboundPacketType)
);
}
@ -280,7 +280,7 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
PacketMapping packetMapping = PacketMapping.of(mappedPacketId, handler);
if (!override && serverboundMappings.hasMapping(state, unmappedPacketId)) {
Via.getPlatform().getLogger().log(Level.WARNING, unmappedPacketId + " already registered!" +
" If this override is intentional, set override to true. Stacktrace: ", new Exception());
" If this override is intentional, set override to true. Stacktrace: ", new Exception());
}
serverboundMappings.addMapping(state, unmappedPacketId, packetMapping);
}
@ -296,7 +296,7 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
PacketMapping packetMapping = PacketMapping.of(mappedPacketId, handler);
if (!override && clientboundMappings.hasMapping(state, unmappedPacketId)) {
Via.getPlatform().getLogger().log(Level.WARNING, unmappedPacketId + " already registered!" +
" If override is intentional, set override to true. Stacktrace: ", new Exception());
" If override is intentional, set override to true. Stacktrace: ", new Exception());
}
clientboundMappings.addMapping(state, unmappedPacketId, packetMapping);
}
@ -349,9 +349,9 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
if (mappedPacketType != null) {
checkPacketType(mappedPacketType, mappedPacketClass == null || mappedPacketClass.isInstance(mappedPacketType));
Preconditions.checkArgument(packetType.state() == mappedPacketType.state(),
"Packet type state does not match mapped packet type state");
"Packet type state does not match mapped packet type state");
Preconditions.checkArgument(packetType.direction() == mappedPacketType.direction(),
"Packet type direction does not match mapped packet type state");
"Packet type direction does not match mapped packet type state");
}
PacketMapping packetMapping = PacketMapping.of(mappedPacketType, handler);
@ -440,7 +440,7 @@ public abstract class AbstractProtocol<CU extends ClientboundPacketType, CM exte
Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName() + " IN REMAP OF " + packetType + " (" + ProtocolUtil.toNiceHex(unmappedPacketId) + ")");
} else {
Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName()
+ " IN REMAP OF " + state + " " + ProtocolUtil.toNiceHex(unmappedPacketId) + "->" + ProtocolUtil.toNiceHex(mappedPacketId));
+ " IN REMAP OF " + state + " " + ProtocolUtil.toNiceHex(unmappedPacketId) + "->" + ProtocolUtil.toNiceHex(mappedPacketId));
}
}

View File

@ -28,7 +28,7 @@ package com.viaversion.viaversion.api.protocol;
* {@link AbstractProtocol} should be preferred over this class in most cases.
*/
public abstract class AbstractSimpleProtocol extends AbstractProtocol<SimpleProtocol.DummyPacketTypes, SimpleProtocol.DummyPacketTypes,
SimpleProtocol.DummyPacketTypes, SimpleProtocol.DummyPacketTypes> implements SimpleProtocol {
SimpleProtocol.DummyPacketTypes, SimpleProtocol.DummyPacketTypes> implements SimpleProtocol {
protected AbstractSimpleProtocol() {
super(null, null, null, null);

View File

@ -31,7 +31,6 @@ import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType;
import com.viaversion.viaversion.api.protocol.packet.VersionedPacketTransformer;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.VersionType;
import io.netty.buffer.ByteBuf;
import java.util.Collection;
import java.util.List;

View File

@ -22,11 +22,10 @@
*/
package com.viaversion.viaversion.api.protocol.packet.provider;
import com.viaversion.viaversion.api.protocol.packet.PacketType;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import com.viaversion.viaversion.api.protocol.packet.PacketType;
import org.checkerframework.checker.nullness.qual.Nullable;
final class PacketTypeArrayMap<P extends PacketType> implements PacketTypeMap<P> {

View File

@ -28,9 +28,9 @@ import com.viaversion.viaversion.api.protocol.packet.State;
import java.util.Map;
public record SimplePacketTypesProvider<CU extends ClientboundPacketType, CM extends ClientboundPacketType, SM extends ServerboundPacketType, SU extends ServerboundPacketType>(
Map<State, PacketTypeMap<CU>> unmappedClientboundPacketTypes,
Map<State, PacketTypeMap<CM>> mappedClientboundPacketTypes,
Map<State, PacketTypeMap<SM>> mappedServerboundPacketTypes,
Map<State, PacketTypeMap<SU>> unmappedServerboundPacketTypes
Map<State, PacketTypeMap<CU>> unmappedClientboundPacketTypes,
Map<State, PacketTypeMap<CM>> mappedClientboundPacketTypes,
Map<State, PacketTypeMap<SM>> mappedServerboundPacketTypes,
Map<State, PacketTypeMap<SU>> unmappedServerboundPacketTypes
) implements PacketTypesProvider<CU, CM, SM, SU> {
}

View File

@ -25,7 +25,7 @@ package com.viaversion.viaversion.api.rewriter;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.protocol.Protocol;
import java.util.List;
@ -65,7 +65,7 @@ public interface EntityRewriter<T extends Protocol<?, ?, ?, ?>> extends Rewriter
* @param metadataList full, mutable list of metadata
* @param connection user connection
*/
void handleMetadata(int entityId, List<Metadata> metadataList, UserConnection connection);
void handleEntityData(int entityId, List<EntityData> metadataList, UserConnection connection);
/**
* Returns the entity tracker for the current protocol.

View File

@ -42,7 +42,7 @@ import com.viaversion.viaversion.api.minecraft.VillagerData;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.minecraft.item.data.Enchantments;
import com.viaversion.viaversion.api.minecraft.metadata.ChunkPosition;
import com.viaversion.viaversion.api.minecraft.ChunkPosition;
import com.viaversion.viaversion.api.type.types.ArrayType;
import com.viaversion.viaversion.api.type.types.BitSetType;
import com.viaversion.viaversion.api.type.types.BooleanType;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.type.OptionalType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -32,7 +32,7 @@ import java.nio.charset.StandardCharsets;
public class StringType extends Type<String> {
// String#length() (used to limit the string in Minecraft source code) uses char[]#length
private static final int MAX_CHAR_UTF_8_LENGTH = Character.toString(Character.MAX_VALUE)
.getBytes(StandardCharsets.UTF_8).length;
.getBytes(StandardCharsets.UTF_8).length;
private final int maxLength;
public StringType() {
@ -49,13 +49,13 @@ public class StringType extends Type<String> {
int len = Types.VAR_INT.readPrimitive(buffer);
Preconditions.checkArgument(len <= maxLength * MAX_CHAR_UTF_8_LENGTH,
"Cannot receive string longer than Short.MAX_VALUE * " + MAX_CHAR_UTF_8_LENGTH + " bytes (got %s bytes)", len);
"Cannot receive string longer than Short.MAX_VALUE * " + MAX_CHAR_UTF_8_LENGTH + " bytes (got %s bytes)", len);
String string = buffer.toString(buffer.readerIndex(), len, StandardCharsets.UTF_8);
buffer.skipBytes(len);
Preconditions.checkArgument(string.length() <= maxLength,
"Cannot receive string longer than Short.MAX_VALUE characters (got %s bytes)", string.length());
"Cannot receive string longer than Short.MAX_VALUE characters (got %s bytes)", string.length());
return string;
}

View File

@ -68,7 +68,7 @@ public class ChunkSectionType1_13 extends Type<ChunkSection> {
if (blockData.length == expectedLength) {
DataPalette blockPalette = chunkSection.palette(PaletteType.BLOCKS);
CompactArrayUtil.iterateCompactArray(bitsPerBlock, ChunkSection.SIZE, blockData,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
}
}
@ -98,7 +98,7 @@ public class ChunkSectionType1_13 extends Type<ChunkSection> {
}
long[] data = CompactArrayUtil.createCompactArray(bitsPerBlock, ChunkSection.SIZE,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
Types.LONG_ARRAY_PRIMITIVE.write(buffer, data);
}
}

View File

@ -69,7 +69,7 @@ public class ChunkSectionType1_16 extends Type<ChunkSection> {
if (blockData.length == expectedLength) {
DataPalette blockPalette = chunkSection.palette(PaletteType.BLOCKS);
CompactArrayUtil.iterateCompactArrayWithPadding(bitsPerBlock, ChunkSection.SIZE, blockData,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
}
}
@ -99,7 +99,7 @@ public class ChunkSectionType1_16 extends Type<ChunkSection> {
}
long[] data = CompactArrayUtil.createCompactArrayWithPadding(bitsPerBlock, ChunkSection.SIZE,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
Types.LONG_ARRAY_PRIMITIVE.write(buffer, data);
}
}

View File

@ -67,7 +67,7 @@ public class ChunkSectionType1_9 extends Type<ChunkSection> {
int expectedLength = (int) Math.ceil(ChunkSection.SIZE * bitsPerBlock / 64.0);
if (blockData.length == expectedLength) {
CompactArrayUtil.iterateCompactArray(bitsPerBlock, ChunkSection.SIZE, blockData,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::setIdAt : blockPalette::setPaletteIndexAt);
}
}
@ -99,7 +99,7 @@ public class ChunkSectionType1_9 extends Type<ChunkSection> {
}
long[] data = CompactArrayUtil.createCompactArray(bitsPerBlock, ChunkSection.SIZE,
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
bitsPerBlock == GLOBAL_PALETTE ? blockPalette::idAt : blockPalette::paletteIndexAt);
Types.LONG_ARRAY_PRIMITIVE.write(buffer, data);
}
}

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -22,9 +22,8 @@
*/
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.Via;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -22,8 +22,8 @@
*/
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.common.base.Preconditions;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk1_18;

View File

@ -22,8 +22,8 @@
*/
package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.common.base.Preconditions;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk1_18;

View File

@ -33,7 +33,6 @@ import com.viaversion.viaversion.api.type.types.version.Types1_8;
import com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.ArrayList;
import java.util.logging.Level;

View File

@ -32,7 +32,6 @@ import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.version.Types1_9;
import com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.logging.Level;

View File

@ -33,7 +33,6 @@ import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.version.Types1_9;
import com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

View File

@ -77,7 +77,7 @@ public final class PaletteType1_18 extends Type<DataPalette> {
final int expectedLength = (type.size() + valuesPerLong - 1) / valuesPerLong;
if (values.length == expectedLength) { // Thanks, Hypixel
CompactArrayUtil.iterateCompactArrayWithPadding(bitsPerValue, type.size(), values,
bitsPerValue == globalPaletteBits ? palette::setIdAt : palette::setPaletteIndexAt);
bitsPerValue == globalPaletteBits ? palette::setIdAt : palette::setPaletteIndexAt);
}
}
return palette;

View File

@ -20,27 +20,27 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.type.Type;
import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
public final class MetaListType extends MetaListTypeTemplate {
private final Type<Metadata> type;
public final class EntityDataListType extends EntityDataListTypeTemplate {
private final Type<EntityData> type;
public MetaListType(Type<Metadata> type) {
public EntityDataListType(Type<EntityData> type) {
Preconditions.checkNotNull(type);
this.type = type;
}
@Override
public List<Metadata> read(final ByteBuf buffer) {
final List<Metadata> list = new ArrayList<>();
Metadata meta;
public List<EntityData> read(final ByteBuf buffer) {
final List<EntityData> list = new ArrayList<>();
EntityData meta;
do {
meta = this.type.read(buffer);
if (meta != null) {
@ -51,8 +51,8 @@ public final class MetaListType extends MetaListTypeTemplate {
}
@Override
public void write(final ByteBuf buffer, final List<Metadata> object) {
for (final Metadata metadata : object) {
public void write(final ByteBuf buffer, final List<EntityData> object) {
for (final EntityData metadata : object) {
this.type.write(buffer, metadata);
}
this.type.write(buffer, null);

View File

@ -20,20 +20,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.type.Type;
import java.util.List;
public abstract class MetaListTypeTemplate extends Type<List<Metadata>> {
public abstract class EntityDataListTypeTemplate extends Type<List<EntityData>> {
protected MetaListTypeTemplate() {
super("MetaData List", List.class);
protected EntityDataListTypeTemplate() {
super("Entity data list", List.class);
}
@Override
public Class<? extends Type> getBaseClass() {
return MetaListTypeTemplate.class;
return EntityDataListTypeTemplate.class;
}
}

View File

@ -20,22 +20,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes;
import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes;
public final class MetadataType extends ModernMetaType {
public final class EntityDataType extends ModernEntityDataType {
private final MetaTypes metaTypes;
private final EntityDataTypes metaTypes;
public MetadataType(final MetaTypes metaTypes) {
public EntityDataType(final EntityDataTypes metaTypes) {
this.metaTypes = metaTypes;
}
@Override
protected MetaType getType(final int index) {
protected com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType getType(final int index) {
return metaTypes.byId(index);
}
}

View File

@ -20,16 +20,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_12;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_8;
import com.viaversion.viaversion.api.type.types.metadata.OldMetaType;
public class MetadataType1_8 extends OldMetaType {
public class EntityDataType1_12 extends ModernEntityDataType {
@Override
protected MetaType getType(int index) {
return MetaType1_8.byId(index);
protected EntityDataType getType(final int index) {
return EntityDataTypes1_12.byId(index);
}
}

View File

@ -20,7 +20,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
package com.viaversion.viaversion.api.type.types.entitydata;
public record Position3d(double x, double y, double z) {
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_8;
public class EntityDataType1_8 extends OldEntityDataType {
@Override
protected EntityDataType getType(int index) {
return EntityDataTypes1_8.byId(index);
}
}

View File

@ -20,15 +20,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_9;
import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_9;
public class MetadataType1_9 extends ModernMetaType {
public class EntityDataType1_9 extends ModernEntityDataType {
@Override
protected MetaType getType(final int index) {
return MetaType1_9.byId(index);
protected EntityDataType getType(final int index) {
return EntityDataTypes1_9.byId(index);
}
}

View File

@ -20,18 +20,18 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.type.Type;
public abstract class MetaTypeTemplate extends Type<Metadata> {
protected MetaTypeTemplate() {
super("Metadata type", Metadata.class);
public abstract class EntityDataTypeTemplate extends Type<EntityData> {
protected EntityDataTypeTemplate() {
super("Entity data type", EntityData.class);
}
@Override
public Class<? extends Type> getBaseClass() {
return MetaTypeTemplate.class;
return EntityDataTypeTemplate.class;
}
}

View File

@ -20,33 +20,33 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;
public abstract class ModernMetaType extends MetaTypeTemplate {
public abstract class ModernEntityDataType extends EntityDataTypeTemplate {
private static final int END = 255;
@Override
public Metadata read(final ByteBuf buffer) {
public EntityData read(final ByteBuf buffer) {
final short index = buffer.readUnsignedByte();
if (index == END) return null; // End of metadata
final MetaType type = this.getType(Types.VAR_INT.readPrimitive(buffer));
return new Metadata(index, type, type.type().read(buffer));
final EntityDataType type = this.getType(Types.VAR_INT.readPrimitive(buffer));
return new EntityData(index, type, type.type().read(buffer));
}
protected abstract MetaType getType(final int index);
protected abstract EntityDataType getType(final int index);
@Override
public void write(final ByteBuf buffer, final Metadata object) {
public void write(final ByteBuf buffer, final EntityData object) {
if (object == null) {
buffer.writeByte(END);
} else {
buffer.writeByte(object.id());
final MetaType type = object.metaType();
final EntityDataType type = object.dataType();
Types.VAR_INT.writePrimitive(buffer, type.typeId());
type.type().write(buffer, object.getValue());
}

View File

@ -20,34 +20,33 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
package com.viaversion.viaversion.api.type.types.entitydata;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.type.types.metadata.MetaTypeTemplate;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import io.netty.buffer.ByteBuf;
public abstract class OldMetaType extends MetaTypeTemplate {
public abstract class OldEntityDataType extends EntityDataTypeTemplate {
private static final int END = 127;
@Override
public Metadata read(final ByteBuf buffer) {
public EntityData read(final ByteBuf buffer) {
final byte index = buffer.readByte();
if (index == END) return null; // End of metadata
final MetaType type = this.getType((index & 224) >> 5);
return new Metadata(index & 31, type, type.type().read(buffer));
final EntityDataType type = this.getType((index & 224) >> 5);
return new EntityData(index & 31, type, type.type().read(buffer));
}
protected abstract MetaType getType(final int index);
protected abstract EntityDataType getType(final int index);
@Override
public void write(final ByteBuf buffer, final Metadata object) {
public void write(final ByteBuf buffer, final EntityData object) {
if (object == null) {
buffer.writeByte(END);
} else {
final int index = (object.metaType().typeId() << 5 | object.id() & 31) & 255;
final int index = (object.dataType().typeId() << 5 | object.id() & 31) & 255;
buffer.writeByte(index);
object.metaType().type().write(buffer, object.getValue());
object.dataType().type().write(buffer, object.getValue());
}
}
}

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.item;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.item;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.item;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -22,7 +22,7 @@
*/
package com.viaversion.viaversion.api.type.types.math;
import com.viaversion.viaversion.api.minecraft.metadata.ChunkPosition;
import com.viaversion.viaversion.api.minecraft.ChunkPosition;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -47,8 +47,8 @@ public class PositionType1_14 extends Type<Position> {
@Override
public void write(ByteBuf buffer, Position object) {
buffer.writeLong((((long) object.x() & 0x3ffffff) << 38)
| (object.y() & 0xfff)
| ((((long) object.z()) & 0x3ffffff) << 12));
| (object.y() & 0xfff)
| ((((long) object.z()) & 0x3ffffff) << 12));
}
public static final class OptionalPosition1_14Type extends OptionalType<Position> {

View File

@ -1,34 +0,0 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2024 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.type.types.metadata;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_12;
import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType;
public class MetadataType1_12 extends ModernMetaType {
@Override
protected MetaType getType(final int index) {
return MetaType1_12.byId(index);
}
}

View File

@ -22,9 +22,9 @@
*/
package com.viaversion.viaversion.api.type.types.misc;
import com.viaversion.nbt.limiter.TagLimiter;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.nbt.limiter.TagLimiter;
import com.viaversion.viaversion.api.type.OptionalType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.misc;
import com.viaversion.viaversion.api.minecraft.SoundEvent;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf;

View File

@ -23,8 +23,8 @@
package com.viaversion.viaversion.api.type.types.misc;
import com.viaversion.nbt.io.TagRegistry;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.nbt.limiter.TagLimiter;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viaversion.api.type.OptionalType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;

View File

@ -22,10 +22,10 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_12;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType1_12;
import java.util.List;
public final class Types1_12 {
@ -33,9 +33,9 @@ public final class Types1_12 {
/**
* Metadata type for 1.12
*/
public static final Type<Metadata> METADATA = new MetadataType1_12();
public static final Type<EntityData> ENTITY_DATA = new EntityDataType1_12();
/**
* Metadata list type for 1.12
*/
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -23,12 +23,12 @@
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_13;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_13;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_13;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
@ -36,7 +36,7 @@ public final class Types1_13 {
public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_13();
public static final ParticleType PARTICLE = new ParticleType();
public static final MetaTypes1_13 META_TYPES = new MetaTypes1_13(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_13 ENTITY_DATA_TYPES = new EntityDataTypes1_13(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -22,18 +22,18 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_13_2;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_13_2;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
public final class Types1_13_2 {
public static final ParticleType PARTICLE = new ParticleType();
public static final MetaTypes1_13_2 META_TYPES = new MetaTypes1_13_2(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_13_2 ENTITY_DATA_TYPES = new EntityDataTypes1_13_2(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -22,18 +22,18 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_14;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
public final class Types1_14 {
public static final ParticleType PARTICLE = new ParticleType();
public static final MetaTypes1_14 META_TYPES = new MetaTypes1_14(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_14 ENTITY_DATA_TYPES = new EntityDataTypes1_14(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -23,12 +23,12 @@
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_14;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_16;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
@ -36,7 +36,7 @@ public final class Types1_16 {
public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_16();
public static final ParticleType PARTICLE = new ParticleType(); // Only safe to use after protocol loading
public static final MetaTypes1_14 META_TYPES = new MetaTypes1_14(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_14 ENTITY_DATA_TYPES = new EntityDataTypes1_14(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -22,18 +22,18 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_14;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
public final class Types1_17 {
public static final ParticleType PARTICLE = new ParticleType(); // Only safe to use after protocol loading
public static final MetaTypes1_14 META_TYPES = new MetaTypes1_14(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_14 ENTITY_DATA_TYPES = new EntityDataTypes1_14(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -22,18 +22,18 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_14;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
public final class Types1_18 {
public static final ParticleType PARTICLE = new ParticleType(); // Only safe to use after protocol loading
public static final MetaTypes1_14 META_TYPES = new MetaTypes1_14(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_14 ENTITY_DATA_TYPES = new EntityDataTypes1_14(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

View File

@ -22,18 +22,18 @@
*/
package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_19;
import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_19;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List;
public final class Types1_19 {
public static final ParticleType PARTICLE = new ParticleType(); // Only safe to use after protocol loading
public static final MetaTypes1_19 META_TYPES = new MetaTypes1_19(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES);
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA);
public static final EntityDataTypes1_19 ENTITY_DATA_TYPES = new EntityDataTypes1_19(PARTICLE);
public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
}

Some files were not shown because too many files have changed in this diff Show More