Remove MetaType1_8#NonExistent (#3774)

This commit is contained in:
EnZaXD 2024-04-05 19:48:59 +02:00 committed by GitHub
parent 5569caf610
commit 617ef10667
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View File

@ -24,7 +24,6 @@ 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.VoidType;
public enum MetaType1_8 implements MetaType {
Byte(0, Type.BYTE),
@ -34,9 +33,7 @@ public enum MetaType1_8 implements MetaType {
String(4, Type.STRING),
Slot(5, Type.ITEM1_8),
Position(6, Type.VECTOR),
Rotation(7, Type.ROTATION),
@Deprecated
NonExistent(-1, new VoidType());
Rotation(7, Type.ROTATION);
private final int typeID;
private final Type type;

View File

@ -57,7 +57,7 @@ public enum MetaIndex {
PLAYER_HUMAN_BYTE(ENTITY_HUMAN, 16, MetaType1_8.Byte, null), // unused on 1.8
PLAYER_ADDITIONAL_HEARTS(ENTITY_HUMAN, 17, MetaType1_8.Float, 10, MetaType1_9.Float),
PLAYER_SCORE(ENTITY_HUMAN, 18, MetaType1_8.Int, 11, MetaType1_9.VarInt),
PLAYER_HAND(ENTITY_HUMAN, -1, MetaType1_8.NonExistent, 5, MetaType1_9.Byte), // new in 1.9
PLAYER_HAND(ENTITY_HUMAN, 5, MetaType1_9.Byte), // new in 1.9
// horse
HORSE_INFO(HORSE, 16, MetaType1_8.Int, 12, MetaType1_9.Byte),
HORSE_TYPE(HORSE, 19, MetaType1_8.Byte, 13, MetaType1_9.VarInt),
@ -150,7 +150,7 @@ public enum MetaIndex {
// ender crystal
ENDERCRYSTAL_HEALTH(ENDER_CRYSTAL, 8, MetaType1_8.Int, null),
// ender dragon
ENDERDRAGON_PHASE(ENDER_DRAGON, -1, MetaType1_8.NonExistent, 11, MetaType1_9.VarInt);
ENDERDRAGON_PHASE(ENDER_DRAGON, 11, MetaType1_9.VarInt);
private static final HashMap<Pair<EntityTypes1_10.EntityType, Integer>, MetaIndex> metadataRewrites = new HashMap<>();
@ -173,6 +173,14 @@ public enum MetaIndex {
this.newType = newType;
}
MetaIndex(EntityTypes1_10.EntityType type, int newIndex, @Nullable MetaType1_9 newType) {
this.clazz = type;
this.index = -1;
this.oldType = null;
this.newIndex = newIndex;
this.newType = newType;
}
MetaIndex(EntityTypes1_10.EntityType type, int index, MetaType1_8 oldType, int newIndex, @Nullable MetaType1_9 newType) {
this.clazz = type;
this.index = index;