3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-19 14:30:16 +01:00

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
Dieser Commit ist enthalten in:
Nassim Jahnke 2024-05-13 10:20:45 +02:00
Ursprung b3f0c3e9a7
Commit 75d86851ce
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
280 geänderte Dateien mit 2621 neuen und 2758 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -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 {

Datei anzeigen

@ -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;
}
} }

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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;
@ -82,8 +82,8 @@ public final class ChunkPosition {
@Override @Override
public String toString() { public String toString() {
return "ChunkPosition{" + return "ChunkPosition{" +
"chunkX=" + chunkX + "chunkX=" + chunkX +
", chunkZ=" + chunkZ + ", chunkZ=" + chunkZ +
'}'; '}';
} }
} }

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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,22 +95,22 @@ 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
+ ", value=" + value + " (" + value.getClass().getSimpleName() + ")"); + ", value=" + value + " (" + value.getClass().getSimpleName() + ")");
} }
return value; return value;
} }
@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);
@ -135,9 +135,9 @@ public final class Metadata {
@Override @Override
public String toString() { public String toString() {
return "Metadata{" + return "Metadata{" +
"id=" + id + "id=" + id +
", metaType=" + metaType + ", metaType=" + metaType +
", value=" + value + ", value=" + value +
'}'; '}';
} }
} }

Datei anzeigen

@ -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,17 +67,17 @@ public interface MetaType {
@Override @Override
public String toString() { public String toString() {
return "MetaType{" + return "EntityDataType{" +
"typeId=" + typeId + "typeId=" + typeId +
", type=" + type + ", type=" + type +
'}'; '}';
} }
@Override @Override
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);
} }

Datei anzeigen

@ -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;
} }

Datei anzeigen

@ -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();
} }

Datei anzeigen

@ -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];
} }

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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];
} }

Datei anzeigen

@ -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];
} }

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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 {

Datei anzeigen

@ -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;

Datei anzeigen

@ -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 {

Datei anzeigen

@ -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;

Datei anzeigen

@ -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 {

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -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;

Datei anzeigen

@ -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> {

Datei anzeigen

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

Datei anzeigen

@ -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.

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

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

Datei anzeigen

@ -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);

Datei anzeigen

@ -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;
} }
} }

Datei anzeigen

@ -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);
} }
} }

Datei anzeigen

@ -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);
} }
} }

Datei anzeigen

@ -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);
}
} }

Datei anzeigen

@ -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);
} }
} }

Datei anzeigen

@ -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;
} }
} }

Datei anzeigen

@ -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());
} }

Datei anzeigen

@ -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());
} }
} }
} }

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

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

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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;

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Datei anzeigen

@ -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);
} }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen