Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Cleanup optional types
Dieser Commit ist enthalten in:
Ursprung
f42a308f2c
Commit
53c54485eb
@ -62,16 +62,10 @@ import com.viaversion.viaversion.api.type.types.minecraft.FlatItemArrayType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.FlatItemType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.FlatVarIntItemArrayType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.FlatVarIntItemType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.GlobalPositionType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.ItemArrayType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.ItemType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.NBTType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptPosition1_14Type;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptPositionType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptUUIDType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptionalComponentType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptionalGlobalPositionType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptionalPlayerMessageSignatureType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptionalProfileKeyType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.OptionalVarIntType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.PlayerMessageSignatureType;
|
||||
import com.viaversion.viaversion.api.type.types.minecraft.Position1_14Type;
|
||||
@ -110,17 +104,17 @@ public abstract class Type<T> implements ByteBufReader<T>, ByteBufWriter<T> {
|
||||
|
||||
/* Other Types */
|
||||
public static final Type<JsonElement> COMPONENT = new ComponentType();
|
||||
public static final Type<JsonElement> OPTIONAL_COMPONENT = new OptionalComponentType();
|
||||
public static final Type<JsonElement> OPTIONAL_COMPONENT = new ComponentType.OptionalComponentType();
|
||||
|
||||
public static final Type<String> STRING = new StringType();
|
||||
public static final Type<String> OPTIONAL_STRING = new StringType.OptionalStringType();
|
||||
public static final Type<String[]> STRING_ARRAY = new ArrayType<>(Type.STRING);
|
||||
|
||||
public static final Type<UUID> UUID = new UUIDType();
|
||||
public static final Type<UUID> OPTIONAL_UUID = new OptUUIDType();
|
||||
public static final Type<UUID> OPTIONAL_UUID = new UUIDType.OptionalUUIDType();
|
||||
public static final Type<UUID[]> UUID_ARRAY = new ArrayType<>(Type.UUID);
|
||||
@Deprecated/*(forRemoval = true)*/
|
||||
public static final Type<UUID> UUID_INT_ARRAY = new UUIDIntArrayType();
|
||||
public static final Type<UUID[]> UUID_ARRAY = new ArrayType<>(Type.UUID);
|
||||
|
||||
public static final VarIntType VAR_INT = new VarIntType();
|
||||
public static final OptionalVarIntType OPTIONAL_VAR_INT = new OptionalVarIntType();
|
||||
@ -156,15 +150,16 @@ public abstract class Type<T> implements ByteBufReader<T>, ByteBufWriter<T> {
|
||||
|
||||
/* MC Types */
|
||||
public static final Type<Position> POSITION = new PositionType();
|
||||
public static final Type<Position> OPTIONAL_POSITION = new OptPositionType();
|
||||
public static final Type<Position> OPTIONAL_POSITION = new PositionType.OptionalPositionType();
|
||||
public static final Type<Position> POSITION1_14 = new Position1_14Type();
|
||||
public static final Type<Position> OPTIONAL_POSITION_1_14 = new OptPosition1_14Type();
|
||||
public static final Type<Position> OPTIONAL_POSITION_1_14 = new Position1_14Type.OptionalPosition1_14Type();
|
||||
public static final Type<EulerAngle> ROTATION = new EulerAngleType();
|
||||
public static final Type<Vector> VECTOR = new VectorType();
|
||||
public static final Type<CompoundTag> NBT = new NBTType();
|
||||
public static final Type<CompoundTag[]> NBT_ARRAY = new ArrayType<>(Type.NBT);
|
||||
|
||||
public static final Type<GlobalPosition> OPTIONAL_GLOBAL_POSITION = new OptionalGlobalPositionType();
|
||||
public static final Type<GlobalPosition> GLOBAL_POSITION = new GlobalPositionType();
|
||||
public static final Type<GlobalPosition> OPTIONAL_GLOBAL_POSITION = new GlobalPositionType.OptionalGlobalPositionType();
|
||||
|
||||
public static final Type<BlockChangeRecord> BLOCK_CHANGE_RECORD = new BlockChangeRecordType();
|
||||
public static final Type<BlockChangeRecord[]> BLOCK_CHANGE_RECORD_ARRAY = new ArrayType<>(Type.BLOCK_CHANGE_RECORD);
|
||||
@ -178,10 +173,10 @@ public abstract class Type<T> implements ByteBufReader<T>, ByteBufWriter<T> {
|
||||
public static final Type<Item[]> ITEM_ARRAY = new ItemArrayType();
|
||||
|
||||
public static final Type<ProfileKey> PROFILE_KEY = new ProfileKeyType();
|
||||
public static final Type<ProfileKey> OPTIONAL_PROFILE_KEY = new OptionalProfileKeyType();
|
||||
public static final Type<ProfileKey> OPTIONAL_PROFILE_KEY = new ProfileKeyType.OptionalProfileKeyType();
|
||||
|
||||
public static final Type<PlayerMessageSignature> PLAYER_MESSAGE_SIGNATURE = new PlayerMessageSignatureType();
|
||||
public static final Type<PlayerMessageSignature> OPTIONAL_PLAYER_MESSAGE_SIGNATURE = new OptionalPlayerMessageSignatureType();
|
||||
public static final Type<PlayerMessageSignature> OPTIONAL_PLAYER_MESSAGE_SIGNATURE = new PlayerMessageSignatureType.OptionalPlayerMessageSignatureType();
|
||||
public static final Type<PlayerMessageSignature[]> PLAYER_MESSAGE_SIGNATURE_ARRAY = new ArrayType<>(PLAYER_MESSAGE_SIGNATURE);
|
||||
|
||||
/* 1.13 Flat Item (no data) */
|
||||
|
@ -26,6 +26,7 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@ -51,4 +52,11 @@ public class ComponentType extends Type<JsonElement> {
|
||||
public void write(ByteBuf buffer, JsonElement object) throws Exception {
|
||||
STRING_TAG.write(buffer, object.toString());
|
||||
}
|
||||
|
||||
public static final class OptionalComponentType extends OptionalType<JsonElement> {
|
||||
|
||||
public OptionalComponentType() {
|
||||
super(Type.COMPONENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,12 +22,14 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.type.types;
|
||||
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class UUIDType extends Type<UUID> {
|
||||
|
||||
public UUIDType() {
|
||||
super(UUID.class);
|
||||
}
|
||||
@ -42,4 +44,11 @@ public class UUIDType extends Type<UUID> {
|
||||
buffer.writeLong(object.getMostSignificantBits());
|
||||
buffer.writeLong(object.getLeastSignificantBits());
|
||||
}
|
||||
|
||||
public static final class OptionalUUIDType extends OptionalType<UUID> {
|
||||
|
||||
public OptionalUUIDType() {
|
||||
super(Type.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,30 +23,32 @@
|
||||
package com.viaversion.viaversion.api.type.types.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.GlobalPosition;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class OptionalGlobalPositionType extends Type<GlobalPosition> {
|
||||
public class GlobalPositionType extends Type<GlobalPosition> {
|
||||
|
||||
public OptionalGlobalPositionType() {
|
||||
public GlobalPositionType() {
|
||||
super(GlobalPosition.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalPosition read(ByteBuf buffer) throws Exception {
|
||||
if (buffer.readBoolean()) {
|
||||
final String dimension = Type.STRING.read(buffer);
|
||||
return Type.POSITION1_14.read(buffer).withDimension(dimension);
|
||||
}
|
||||
return null;
|
||||
final String dimension = Type.STRING.read(buffer);
|
||||
return Type.POSITION1_14.read(buffer).withDimension(dimension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buffer, GlobalPosition object) throws Exception {
|
||||
buffer.writeBoolean(object != null);
|
||||
if (object != null) {
|
||||
Type.STRING.write(buffer, object.dimension());
|
||||
Type.POSITION1_14.write(buffer, object);
|
||||
Type.STRING.write(buffer, object.dimension());
|
||||
Type.POSITION1_14.write(buffer, object);
|
||||
}
|
||||
|
||||
public static final class OptionalGlobalPositionType extends OptionalType<GlobalPosition> {
|
||||
|
||||
public OptionalGlobalPositionType() {
|
||||
super(Type.GLOBAL_POSITION);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public class OptPosition1_14Type extends OptionalType<Position> {
|
||||
|
||||
public OptPosition1_14Type() {
|
||||
super(Type.POSITION1_14);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public class OptPositionType extends OptionalType<Position> {
|
||||
|
||||
public OptPositionType() {
|
||||
super(Type.POSITION);
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class OptUUIDType extends OptionalType<UUID> {
|
||||
|
||||
public OptUUIDType() {
|
||||
super(Type.UUID);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public class OptionalComponentType extends OptionalType<JsonElement> {
|
||||
|
||||
public OptionalComponentType() {
|
||||
super(Type.COMPONENT);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public class OptionalPlayerMessageSignatureType extends OptionalType<PlayerMessageSignature> {
|
||||
|
||||
public OptionalPlayerMessageSignatureType() {
|
||||
super(Type.PLAYER_MESSAGE_SIGNATURE);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
|
||||
* Copyright (C) 2016-2022 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.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.ProfileKey;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
|
||||
public class OptionalProfileKeyType extends OptionalType<ProfileKey> {
|
||||
|
||||
public OptionalProfileKeyType() {
|
||||
super(Type.PROFILE_KEY);
|
||||
}
|
||||
}
|
@ -23,6 +23,7 @@
|
||||
package com.viaversion.viaversion.api.type.types.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@ -42,4 +43,11 @@ public class PlayerMessageSignatureType extends Type<PlayerMessageSignature> {
|
||||
Type.UUID.write(buffer, value.uuid());
|
||||
Type.BYTE_ARRAY_PRIMITIVE.write(buffer, value.signatureBytes());
|
||||
}
|
||||
|
||||
public static final class OptionalPlayerMessageSignatureType extends OptionalType<PlayerMessageSignature> {
|
||||
|
||||
public OptionalPlayerMessageSignatureType() {
|
||||
super(Type.PLAYER_MESSAGE_SIGNATURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
package com.viaversion.viaversion.api.type.types.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@ -48,4 +49,11 @@ public class Position1_14Type extends Type<Position> {
|
||||
| (object.y() & 0xfff)
|
||||
| ((((long) object.z()) & 0x3ffffff) << 12));
|
||||
}
|
||||
|
||||
public static final class OptionalPosition1_14Type extends OptionalType<Position> {
|
||||
|
||||
public OptionalPosition1_14Type() {
|
||||
super(Type.POSITION1_14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
package com.viaversion.viaversion.api.type.types.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@ -48,4 +49,11 @@ public class PositionType extends Type<Position> {
|
||||
| ((((long) object.y()) & 0xfff) << 26)
|
||||
| (object.z() & 0x3ffffff));
|
||||
}
|
||||
|
||||
public static final class OptionalPositionType extends OptionalType<Position> {
|
||||
|
||||
public OptionalPositionType() {
|
||||
super(Type.POSITION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
package com.viaversion.viaversion.api.type.types.minecraft;
|
||||
|
||||
import com.viaversion.viaversion.api.minecraft.ProfileKey;
|
||||
import com.viaversion.viaversion.api.type.OptionalType;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
@ -43,4 +44,11 @@ public class ProfileKeyType extends Type<ProfileKey> {
|
||||
Type.BYTE_ARRAY_PRIMITIVE.write(buffer, object.publicKey());
|
||||
Type.BYTE_ARRAY_PRIMITIVE.write(buffer, object.keySignature());
|
||||
}
|
||||
|
||||
public static final class OptionalProfileKeyType extends OptionalType<ProfileKey> {
|
||||
|
||||
public OptionalProfileKeyType() {
|
||||
super(Type.PROFILE_KEY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren