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

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

View File

@ -54,6 +54,15 @@ public class FullMappingsBase implements FullMappings {
this.mappings = mappings; 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 @Override
public int id(final String identifier) { public int id(final String identifier) {
return stringToId.getInt(Key.stripMinecraftNamespace(identifier)); return stringToId.getInt(Key.stripMinecraftNamespace(identifier));
@ -119,13 +128,4 @@ public class FullMappingsBase implements FullMappings {
public FullMappings inverse() { public FullMappings inverse() {
return new FullMappingsBase(mappedStringToId, stringToId, mappedIdToString, idToString, mappings.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; 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.ByteTag;
import com.viaversion.nbt.tag.CompoundTag; import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag; 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.ListTag;
import com.viaversion.nbt.tag.StringTag; import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag; 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.api.Via;
import com.viaversion.viaversion.util.GsonUtil; import com.viaversion.viaversion.util.GsonUtil;
import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntMap;

View File

@ -48,11 +48,11 @@ public interface TrackedEntity {
boolean hasData(); 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
package com.viaversion.viaversion.api.minecraft.metadata; package com.viaversion.viaversion.api.minecraft;
import java.util.Objects; import java.util.Objects;

View File

@ -137,6 +137,7 @@ public final class DataPaletteImpl implements DataPalette {
interface ChunkData { interface ChunkData {
int get(int idx); int get(int idx);
void set(int idx, int val); 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
package com.viaversion.viaversion.api.minecraft.metadata; package com.viaversion.viaversion.api.minecraft.entitydata;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import java.util.Objects; import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
public final class Metadata { public final class EntityData {
private int id; private int id;
private MetaType metaType; private EntityDataType metaType;
private Object value; private Object value;
/** /**
@ -39,7 +39,7 @@ public final class Metadata {
* @param value value if present * @param value value if present
* @throws IllegalArgumentException if the value and metaType are incompatible * @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.id = id;
this.metaType = metaType; this.metaType = metaType;
this.value = checkValue(metaType, value); this.value = checkValue(metaType, value);
@ -53,7 +53,7 @@ public final class Metadata {
this.id = id; this.id = id;
} }
public MetaType metaType() { public EntityDataType dataType() {
return metaType; return metaType;
} }
@ -62,9 +62,9 @@ public final class Metadata {
* *
* @param metaType metadata type * @param metaType metadata type
* @throws IllegalArgumentException if the metadata type and current value are incompatible * @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); checkValue(metaType, this.value);
this.metaType = metaType; this.metaType = metaType;
} }
@ -82,7 +82,7 @@ public final class Metadata {
* *
* @param value value * @param value value
* @throws IllegalArgumentException if the value and current metaType are incompatible * @throws IllegalArgumentException if the value and current metaType are incompatible
* @see #setTypeAndValue(MetaType, Object) * @see #setTypeAndValue(EntityDataType, Object)
*/ */
public void setValue(@Nullable Object value) { public void setValue(@Nullable Object value) {
this.value = checkValue(this.metaType, value); this.value = checkValue(this.metaType, value);
@ -95,12 +95,12 @@ public final class Metadata {
* @param value value * @param value value
* @throws IllegalArgumentException if the value and metaType are incompatible * @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.value = checkValue(metaType, value);
this.metaType = metaType; this.metaType = metaType;
} }
private Object checkValue(MetaType metaType, @Nullable Object value) { private Object checkValue(EntityDataType metaType, @Nullable Object value) {
Preconditions.checkNotNull(metaType); Preconditions.checkNotNull(metaType);
if (value != null && !metaType.type().getOutputClass().isAssignableFrom(value.getClass())) { if (value != null && !metaType.type().getOutputClass().isAssignableFrom(value.getClass())) {
throw new IllegalArgumentException("Metadata value and metaType are incompatible. Type=" + metaType throw new IllegalArgumentException("Metadata value and metaType are incompatible. Type=" + metaType
@ -110,7 +110,7 @@ public final class Metadata {
} }
@Deprecated @Deprecated
public void setMetaTypeUnsafe(MetaType type) { public void setDataTypeUnsafe(EntityDataType type) {
this.metaType = type; this.metaType = type;
} }
@ -118,7 +118,7 @@ public final class Metadata {
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
Metadata metadata = (Metadata) o; EntityData metadata = (EntityData) o;
if (id != metadata.id) return false; if (id != metadata.id) return false;
if (metaType != metadata.metaType) return false; if (metaType != metadata.metaType) return false;
return Objects.equals(value, metadata.value); return Objects.equals(value, metadata.value);

View File

@ -20,12 +20,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
package com.viaversion.viaversion.api.minecraft.metadata; package com.viaversion.viaversion.api.minecraft.entitydata;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
public interface MetaType { public interface EntityDataType {
/** /**
* Get the write/read type * Get the write/read type
@ -41,15 +41,15 @@ public interface MetaType {
*/ */
int typeId(); int typeId();
static MetaType create(final int typeId, final Type<?> type) { static EntityDataType create(final int typeId, final Type<?> type) {
return new MetaTypeImpl(typeId, type); return new EntityDataTypeImpl(typeId, type);
} }
final class MetaTypeImpl implements MetaType { final class EntityDataTypeImpl implements EntityDataType {
private final int typeId; private final int typeId;
private final Type<?> type; private final Type<?> type;
MetaTypeImpl(final int typeId, final Type<?> type) { EntityDataTypeImpl(final int typeId, final Type<?> type) {
Preconditions.checkNotNull(type); Preconditions.checkNotNull(type);
this.typeId = typeId; this.typeId = typeId;
this.type = type; this.type = type;
@ -67,7 +67,7 @@ public interface MetaType {
@Override @Override
public String toString() { public String toString() {
return "MetaType{" + return "EntityDataType{" +
"typeId=" + typeId + "typeId=" + typeId +
", type=" + type + ", type=" + type +
'}'; '}';
@ -77,7 +77,7 @@ public interface MetaType {
public boolean equals(final Object o) { public boolean equals(final Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
final MetaTypeImpl metaType = (MetaTypeImpl) o; final EntityDataTypeImpl metaType = (EntityDataTypeImpl) o;
if (typeId != metaType.typeId) return false; if (typeId != metaType.typeId) return false;
return type.equals(metaType.type); 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.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) { protected AbstractEntityDataTypes(final int values) {
this.values = new MetaType[values]; this.values = new EntityDataType[values];
} }
@Override @Override
public MetaType byId(final int id) { public EntityDataType byId(final int id) {
return values[id]; return values[id];
} }
@Override @Override
public MetaType[] values() { public EntityDataType[] values() {
return values; return values;
} }
protected MetaType add(final int typeId, final Type<?> type) { protected EntityDataType add(final int typeId, final Type<?> type) {
final MetaType metaType = MetaType.create(typeId, type); final EntityDataType metaType = EntityDataType.create(typeId, type);
values[typeId] = metaType; values[typeId] = metaType;
return 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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. * Returns the meta type by the given id.
@ -33,12 +33,12 @@ public interface MetaTypes {
* @return meta type by id * @return meta type by id
* @throws IndexOutOfBoundsException if id is out of bounds * @throws IndexOutOfBoundsException if id is out of bounds
*/ */
MetaType byId(int id); EntityDataType byId(int id);
/** /**
* Returns an array of meta types. * Returns an array of meta types.
* *
* @return 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_12 implements MetaType { public enum EntityDataTypes1_12 implements EntityDataType {
BYTE(Types.BYTE), BYTE(Types.BYTE),
VAR_INT(Types.VAR_INT), VAR_INT(Types.VAR_INT),
FLOAT(Types.FLOAT), FLOAT(Types.FLOAT),
@ -44,11 +44,11 @@ public enum MetaType1_12 implements MetaType {
private final Type<?> type; private final Type<?> type;
MetaType1_12(Type<?> type) { EntityDataTypes1_12(Type<?> type) {
this.type = type; this.type = type;
} }
public static MetaType1_12 byId(int id) { public static EntityDataTypes1_12 byId(int id) {
return values()[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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_8 implements MetaType { public enum EntityDataTypes1_8 implements EntityDataType {
BYTE(Types.BYTE), BYTE(Types.BYTE),
SHORT(Types.SHORT), SHORT(Types.SHORT),
INT(Types.INT), INT(Types.INT),
@ -38,11 +38,11 @@ public enum MetaType1_8 implements MetaType {
private final Type<?> type; private final Type<?> type;
MetaType1_8(Type<?> type) { EntityDataTypes1_8(Type<?> type) {
this.type = type; this.type = type;
} }
public static MetaType1_8 byId(int id) { public static EntityDataTypes1_8 byId(int id) {
return values()[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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
public enum MetaType1_9 implements MetaType { public enum EntityDataTypes1_9 implements EntityDataType {
BYTE(Types.BYTE), BYTE(Types.BYTE),
VAR_INT(Types.VAR_INT), VAR_INT(Types.VAR_INT),
FLOAT(Types.FLOAT), FLOAT(Types.FLOAT),
@ -43,11 +43,11 @@ public enum MetaType1_9 implements MetaType {
private final Type<?> type; private final Type<?> type;
MetaType1_9(Type<?> type) { EntityDataTypes1_9(Type<?> type) {
this.type = type; this.type = type;
} }
public static MetaType1_9 byId(int id) { public static EntityDataTypes1_9 byId(int id) {
return values()[id]; return values()[id];
} }

View File

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

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.minecraft.item.data; package com.viaversion.viaversion.api.minecraft.item.data;
import com.viaversion.nbt.tag.Tag; 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;
import com.viaversion.viaversion.api.type.types.misc.HolderType; import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.minecraft.item.data; package com.viaversion.viaversion.api.minecraft.item.data;
import com.viaversion.nbt.tag.Tag; 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;
import com.viaversion.viaversion.api.type.types.misc.HolderType; import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;

View File

@ -22,7 +22,6 @@
*/ */
package com.viaversion.viaversion.api.minecraft.item.data; 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;
import com.viaversion.viaversion.api.type.types.misc.HolderType; import com.viaversion.viaversion.api.type.types.misc.HolderType;
import io.netty.buffer.ByteBuf; 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.api.platform.providers.Provider;
import com.viaversion.viaversion.util.Pair; import com.viaversion.viaversion.util.Pair;
import java.util.List; import java.util.List;
public abstract class SignableCommandArgumentsProvider implements Provider { 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.model.DecoratableMessage;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer; import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import com.viaversion.viaversion.util.GsonUtil; import com.viaversion.viaversion.util.GsonUtil;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;

View File

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

View File

@ -26,7 +26,6 @@ import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs; import com.google.common.primitives.Longs;
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature; import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer; import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.Instant; 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.google.common.primitives.Ints;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer; import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.util.UUID; import java.util.UUID;
public class MessageLink { 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.connection.StorableObject;
import com.viaversion.viaversion.api.minecraft.ProfileKey; import com.viaversion.viaversion.api.minecraft.ProfileKey;
import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer; import com.viaversion.viaversion.api.minecraft.signature.util.DataConsumer;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.Signature; import java.security.Signature;
import java.security.SignatureException; 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.DecoratableMessage;
import com.viaversion.viaversion.api.minecraft.signature.model.MessageMetadata; import com.viaversion.viaversion.api.minecraft.signature.model.MessageMetadata;
import com.viaversion.viaversion.util.GsonUtil; import com.viaversion.viaversion.util.GsonUtil;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets; 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.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.MessageBody;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_1.MessageHeader; import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_1.MessageHeader;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.SignatureException; import java.security.SignatureException;
import java.util.UUID; 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.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.MessageBody;
import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_3.MessageLink; import com.viaversion.viaversion.api.minecraft.signature.model.chain.v1_19_3.MessageLink;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.SignatureException; import java.security.SignatureException;
import java.util.UUID; import java.util.UUID;

View File

@ -23,10 +23,8 @@
package com.viaversion.viaversion.api.platform; package com.viaversion.viaversion.api.platform;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.ViaAPI; import com.viaversion.viaversion.api.ViaAPI;
import com.viaversion.viaversion.api.command.ViaCommandSender; 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.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import java.io.File; import java.io.File;

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.packet.VersionedPacketTransformer;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion; import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion;
import com.viaversion.viaversion.api.protocol.version.VersionType;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;

View File

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

View File

@ -25,7 +25,7 @@ package com.viaversion.viaversion.api.rewriter;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.entity.EntityTracker; import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.minecraft.entities.EntityType; 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 com.viaversion.viaversion.api.protocol.Protocol;
import java.util.List; import java.util.List;
@ -65,7 +65,7 @@ public interface EntityRewriter<T extends Protocol<?, ?, ?, ?>> extends Rewriter
* @param metadataList full, mutable list of metadata * @param metadataList full, mutable list of metadata
* @param connection user connection * @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. * 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.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.minecraft.item.data.Enchantments; 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.ArrayType;
import com.viaversion.viaversion.api.type.types.BitSetType; import com.viaversion.viaversion.api.type.types.BitSetType;
import com.viaversion.viaversion.api.type.types.BooleanType; import com.viaversion.viaversion.api.type.types.BooleanType;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types; package com.viaversion.viaversion.api.type.types;
import com.google.common.base.Preconditions; 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.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag; 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.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag; 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.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag; 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.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -23,7 +23,6 @@
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag; 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.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

@ -22,9 +22,8 @@
*/ */
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.common.base.Preconditions; 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.BaseChunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;

View File

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

View File

@ -22,8 +22,8 @@
*/ */
package com.viaversion.viaversion.api.type.types.chunk; package com.viaversion.viaversion.api.type.types.chunk;
import com.viaversion.nbt.tag.CompoundTag;
import com.google.common.base.Preconditions; 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.blockentity.BlockEntity;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk1_18; 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 com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.logging.Level; 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.api.type.types.version.Types1_9;
import com.viaversion.viaversion.util.ChunkUtil; import com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.BitSet; import java.util.BitSet;
import java.util.logging.Level; 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.api.type.types.version.Types1_9;
import com.viaversion.viaversion.util.ChunkUtil; import com.viaversion.viaversion.util.ChunkUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -20,27 +20,27 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.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 com.viaversion.viaversion.api.type.Type;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public final class MetaListType extends MetaListTypeTemplate { public final class EntityDataListType extends EntityDataListTypeTemplate {
private final Type<Metadata> type; private final Type<EntityData> type;
public MetaListType(Type<Metadata> type) { public EntityDataListType(Type<EntityData> type) {
Preconditions.checkNotNull(type); Preconditions.checkNotNull(type);
this.type = type; this.type = type;
} }
@Override @Override
public List<Metadata> read(final ByteBuf buffer) { public List<EntityData> read(final ByteBuf buffer) {
final List<Metadata> list = new ArrayList<>(); final List<EntityData> list = new ArrayList<>();
Metadata meta; EntityData meta;
do { do {
meta = this.type.read(buffer); meta = this.type.read(buffer);
if (meta != null) { if (meta != null) {
@ -51,8 +51,8 @@ public final class MetaListType extends MetaListTypeTemplate {
} }
@Override @Override
public void write(final ByteBuf buffer, final List<Metadata> object) { public void write(final ByteBuf buffer, final List<EntityData> object) {
for (final Metadata metadata : object) { for (final EntityData metadata : object) {
this.type.write(buffer, metadata); this.type.write(buffer, metadata);
} }
this.type.write(buffer, null); 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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 com.viaversion.viaversion.api.type.Type;
import java.util.List; import java.util.List;
public abstract class MetaListTypeTemplate extends Type<List<Metadata>> { public abstract class EntityDataListTypeTemplate extends Type<List<EntityData>> {
protected MetaListTypeTemplate() { protected EntityDataListTypeTemplate() {
super("MetaData List", List.class); super("Entity data list", List.class);
} }
@Override @Override
public Class<? extends Type> getBaseClass() { 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.entitydata.types.EntityDataTypes;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes;
import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType;
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; this.metaTypes = metaTypes;
} }
@Override @Override
protected MetaType getType(final int index) { protected com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType getType(final int index) {
return metaTypes.byId(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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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; public class EntityDataType1_12 extends ModernEntityDataType {
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 {
@Override @Override
protected MetaType getType(int index) { protected EntityDataType getType(final int index) {
return MetaType1_8.byId(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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.entitydata.EntityDataType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_9; import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_9;
import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType;
public class MetadataType1_9 extends ModernMetaType { public class EntityDataType1_9 extends ModernEntityDataType {
@Override @Override
protected MetaType getType(final int index) { protected EntityDataType getType(final int index) {
return MetaType1_9.byId(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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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 com.viaversion.viaversion.api.type.Type;
public abstract class MetaTypeTemplate extends Type<Metadata> { public abstract class EntityDataTypeTemplate extends Type<EntityData> {
protected MetaTypeTemplate() { protected EntityDataTypeTemplate() {
super("Metadata type", Metadata.class); super("Entity data type", EntityData.class);
} }
@Override @Override
public Class<? extends Type> getBaseClass() { 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
public abstract class ModernMetaType extends MetaTypeTemplate { public abstract class ModernEntityDataType extends EntityDataTypeTemplate {
private static final int END = 255; private static final int END = 255;
@Override @Override
public Metadata read(final ByteBuf buffer) { public EntityData read(final ByteBuf buffer) {
final short index = buffer.readUnsignedByte(); final short index = buffer.readUnsignedByte();
if (index == END) return null; // End of metadata if (index == END) return null; // End of metadata
final MetaType type = this.getType(Types.VAR_INT.readPrimitive(buffer)); final EntityDataType type = this.getType(Types.VAR_INT.readPrimitive(buffer));
return new Metadata(index, type, type.type().read(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 @Override
public void write(final ByteBuf buffer, final Metadata object) { public void write(final ByteBuf buffer, final EntityData object) {
if (object == null) { if (object == null) {
buffer.writeByte(END); buffer.writeByte(END);
} else { } else {
buffer.writeByte(object.id()); buffer.writeByte(object.id());
final MetaType type = object.metaType(); final EntityDataType type = object.dataType();
Types.VAR_INT.writePrimitive(buffer, type.typeId()); Types.VAR_INT.writePrimitive(buffer, type.typeId());
type.type().write(buffer, object.getValue()); 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 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * 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.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.metadata.MetaTypeTemplate;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
public abstract class OldMetaType extends MetaTypeTemplate { public abstract class OldEntityDataType extends EntityDataTypeTemplate {
private static final int END = 127; private static final int END = 127;
@Override @Override
public Metadata read(final ByteBuf buffer) { public EntityData read(final ByteBuf buffer) {
final byte index = buffer.readByte(); final byte index = buffer.readByte();
if (index == END) return null; // End of metadata if (index == END) return null; // End of metadata
final MetaType type = this.getType((index & 224) >> 5); final EntityDataType type = this.getType((index & 224) >> 5);
return new Metadata(index & 31, type, type.type().read(buffer)); 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 @Override
public void write(final ByteBuf buffer, final Metadata object) { public void write(final ByteBuf buffer, final EntityData object) {
if (object == null) { if (object == null) {
buffer.writeByte(END); buffer.writeByte(END);
} else { } 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); 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; package com.viaversion.viaversion.api.type.types.item;
import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;

View File

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

View File

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

View File

@ -22,7 +22,7 @@
*/ */
package com.viaversion.viaversion.api.type.types.math; 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.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;

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; 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.CompoundTag;
import com.viaversion.nbt.tag.Tag; 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.OptionalType;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;

View File

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

View File

@ -23,8 +23,8 @@
package com.viaversion.viaversion.api.type.types.misc; package com.viaversion.viaversion.api.type.types.misc;
import com.viaversion.nbt.io.TagRegistry; import com.viaversion.nbt.io.TagRegistry;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.nbt.limiter.TagLimiter; 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.OptionalType;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;

View File

@ -22,10 +22,10 @@
*/ */
package com.viaversion.viaversion.api.type.types.version; 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.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_12; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType1_12;
import java.util.List; import java.util.List;
public final class Types1_12 { public final class Types1_12 {
@ -33,9 +33,9 @@ public final class Types1_12 {
/** /**
* Metadata type for 1.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 * 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; package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_13; import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_13;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_13; 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.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List; 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 Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_13();
public static final ParticleType PARTICLE = new ParticleType(); public static final ParticleType PARTICLE = new ParticleType();
public static final MetaTypes1_13 META_TYPES = new MetaTypes1_13(PARTICLE); public static final EntityDataTypes1_13 ENTITY_DATA_TYPES = new EntityDataTypes1_13(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES); public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
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

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

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

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

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

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

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

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

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

@ -22,18 +22,18 @@
*/ */
package com.viaversion.viaversion.api.type.types.version; 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.minecraft.metadata.types.MetaTypes1_20_2; import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_20_2;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List; import java.util.List;
public final class Types1_20_2 { public final class Types1_20_2 {
public static final ParticleType PARTICLE = Types1_20.PARTICLE; // Only safe to use after protocol loading public static final ParticleType PARTICLE = Types1_20.PARTICLE; // Only safe to use after protocol loading
public static final MetaTypes1_20_2 META_TYPES = new MetaTypes1_20_2(PARTICLE); public static final EntityDataTypes1_20_2 ENTITY_DATA_TYPES = new EntityDataTypes1_20_2(PARTICLE);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES); public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
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

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

@ -25,15 +25,15 @@ package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.Particle; import com.viaversion.viaversion.api.minecraft.Particle;
import com.viaversion.viaversion.api.minecraft.data.StructuredData; import com.viaversion.viaversion.api.minecraft.data.StructuredData;
import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_20_5; import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_20_5;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.ArrayType; import com.viaversion.viaversion.api.type.types.ArrayType;
import com.viaversion.viaversion.api.type.types.item.ItemCostType1_20_5; import com.viaversion.viaversion.api.type.types.item.ItemCostType1_20_5;
import com.viaversion.viaversion.api.type.types.item.ItemType1_20_5; import com.viaversion.viaversion.api.type.types.item.ItemType1_20_5;
import com.viaversion.viaversion.api.type.types.item.StructuredDataType; import com.viaversion.viaversion.api.type.types.item.StructuredDataType;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType;
import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.misc.ParticleType;
import java.util.List; import java.util.List;
@ -49,7 +49,7 @@ public final class Types1_20_5 {
public static final ParticleType PARTICLE = new ParticleType(); public static final ParticleType PARTICLE = new ParticleType();
public static final ArrayType<Particle> PARTICLES = new ArrayType<>(PARTICLE); public static final ArrayType<Particle> PARTICLES = new ArrayType<>(PARTICLE);
public static final MetaTypes1_20_5 META_TYPES = new MetaTypes1_20_5(PARTICLE, PARTICLES); public static final EntityDataTypes1_20_5 ENTITY_DATA_TYPES = new EntityDataTypes1_20_5(PARTICLE, PARTICLES);
public static final Type<Metadata> METADATA = new MetadataType(META_TYPES); public static final Type<EntityData> ENTITY_DATA = new EntityDataType(ENTITY_DATA_TYPES);
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,11 +23,11 @@
package com.viaversion.viaversion.api.type.types.version; package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
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.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_8; import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_8;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_8; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType1_8;
import java.util.List; import java.util.List;
public final class Types1_8 { public final class Types1_8 {
@ -35,11 +35,11 @@ public final class Types1_8 {
/** /**
* Metadata type for 1.8 * Metadata type for 1.8
*/ */
public static final Type<Metadata> METADATA = new MetadataType1_8(); public static final Type<EntityData> ENTITY_DATA = new EntityDataType1_8();
/** /**
* Metadata list type for 1.8 * Metadata list type for 1.8
*/ */
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA); public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_8(); public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_8();
} }

View File

@ -23,22 +23,22 @@
package com.viaversion.viaversion.api.type.types.version; package com.viaversion.viaversion.api.type.types.version;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
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.Type;
import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_9; import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_9;
import com.viaversion.viaversion.api.type.types.metadata.MetaListType; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataListType;
import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_9; import com.viaversion.viaversion.api.type.types.entitydata.EntityDataType1_9;
import java.util.List; import java.util.List;
public final class Types1_9 { public final class Types1_9 {
/** /**
* Metadata type for 1.9 * Metadata type for 1.9
*/ */
public static final Type<Metadata> METADATA = new MetadataType1_9(); public static final Type<EntityData> ENTITY_DATA = new EntityDataType1_9();
/** /**
* Metadata list type for 1.9 * Metadata list type for 1.9
*/ */
public static final Type<List<Metadata>> METADATA_LIST = new MetaListType(METADATA); public static final Type<List<EntityData>> ENTITY_DATA_LIST = new EntityDataListType(ENTITY_DATA);
public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_9(); public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_9();
} }

View File

@ -19,11 +19,10 @@ package com.viaversion.viaversion.bukkit.listeners.protocol1_9to1_8;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener; import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener;
import com.viaversion.viaversion.protocols.v1_8to1_9.data.ArmorTypes1_8;
import com.viaversion.viaversion.protocols.v1_8to1_9.Protocol1_8To1_9; import com.viaversion.viaversion.protocols.v1_8to1_9.Protocol1_8To1_9;
import com.viaversion.viaversion.protocols.v1_8to1_9.data.ArmorTypes1_8;
import com.viaversion.viaversion.protocols.v1_8to1_9.packet.ClientboundPackets1_9; import com.viaversion.viaversion.protocols.v1_8to1_9.packet.ClientboundPackets1_9;
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;

View File

@ -20,19 +20,18 @@ package com.viaversion.viaversion.bukkit.listeners.protocol1_9to1_8;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener; import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener;
import com.viaversion.viaversion.protocols.v1_8to1_9.Protocol1_8To1_9; import com.viaversion.viaversion.protocols.v1_8to1_9.Protocol1_8To1_9;
import com.viaversion.viaversion.protocols.v1_8to1_9.packet.ClientboundPackets1_9; import com.viaversion.viaversion.protocols.v1_8to1_9.packet.ClientboundPackets1_9;
import com.viaversion.viaversion.util.ComponentUtil; import com.viaversion.viaversion.util.ComponentUtil;
import java.util.logging.Level;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import java.util.logging.Level;
public class DeathListener extends ViaBukkitListener { public class DeathListener extends ViaBukkitListener {

View File

@ -18,16 +18,16 @@
package com.viaversion.viaversion.bukkit.util; package com.viaversion.viaversion.bukkit.util;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.AbstractList; import java.util.AbstractList;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
public class CollisionChecker { public class CollisionChecker {
private static final CollisionChecker INSTANCE; private static final CollisionChecker INSTANCE;
static { static {
CollisionChecker instance = null; CollisionChecker instance = null;
try { try {

View File

@ -18,17 +18,14 @@
package com.viaversion.viaversion.bukkit.listeners.protocol1_15to1_14_4; package com.viaversion.viaversion.bukkit.listeners.protocol1_15to1_14_4;
import com.viaversion.viaversion.ViaVersionPlugin; import com.viaversion.viaversion.ViaVersionPlugin;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.version.Types1_14; import com.viaversion.viaversion.api.type.types.version.Types1_14;
import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener; import com.viaversion.viaversion.bukkit.listeners.ViaBukkitListener;
import com.viaversion.viaversion.protocols.v1_14_4to1_15.Protocol1_14_4To1_15; import com.viaversion.viaversion.protocols.v1_14_4to1_15.Protocol1_14_4To1_15;
import com.viaversion.viaversion.protocols.v1_14_4to1_15.packet.ClientboundPackets1_15; import com.viaversion.viaversion.protocols.v1_14_4to1_15.packet.ClientboundPackets1_15;
import java.util.Arrays; import java.util.Arrays;
import java.util.logging.Level;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -82,7 +79,7 @@ public class EntityToggleGlideListener extends ViaBukkitListener {
} }
// leave 0x80 as 0 to stop gliding // leave 0x80 as 0 to stop gliding
packet.write(Types1_14.METADATA_LIST, Arrays.asList(new Metadata(0, Types1_14.META_TYPES.byteType, bitmask))); packet.write(Types1_14.ENTITY_DATA_LIST, Arrays.asList(new EntityData(0, Types1_14.ENTITY_DATA_TYPES.byteType, bitmask)));
packet.scheduleSend(Protocol1_14_4To1_15.class); packet.scheduleSend(Protocol1_14_4To1_15.class);
} }
} }

View File

@ -20,7 +20,6 @@ package com.viaversion.viaversion.bukkit.platform;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.platform.PlatformTask; import com.viaversion.viaversion.api.platform.PlatformTask;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import org.checkerframework.checker.nullness.qual.Nullable;
public record BukkitViaTask(BukkitTask task) implements PlatformTask<BukkitTask> { public record BukkitViaTask(BukkitTask task) implements PlatformTask<BukkitTask> {

View File

@ -22,13 +22,12 @@ import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.bukkit.util.NMSUtil; import com.viaversion.viaversion.bukkit.util.NMSUtil;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.MovementTransmitterProvider; import com.viaversion.viaversion.protocols.v1_8to1_9.provider.MovementTransmitterProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.storage.MovementTracker; import com.viaversion.viaversion.protocols.v1_8to1_9.storage.MovementTracker;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.channel.ChannelHandlerContext;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.logging.Level; import java.util.logging.Level;
import com.viaversion.viaversion.util.PipelineUtil;
import io.netty.channel.ChannelHandlerContext;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -27,7 +27,6 @@ import com.viaversion.viaversion.api.protocol.ProtocolPathEntry;
import com.viaversion.viaversion.api.protocol.ProtocolPipeline; import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.bungee.storage.BungeeStorage; import com.viaversion.viaversion.bungee.storage.BungeeStorage;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.rewriter.ItemPacketRewriter1_13; import com.viaversion.viaversion.protocols.v1_12_2to1_13.rewriter.ItemPacketRewriter1_13;

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