Add new PARTICLE MetadataType

This commit is contained in:
Jonas Herzig 2018-07-18 23:12:15 +02:00
parent 798265e509
commit e34c31e7a9
3 changed files with 9 additions and 1 deletions

View file

@ -146,6 +146,7 @@ public class MagicValues {
register(MetadataType.OPTIONAL_UUID, 12);
register(MetadataType.BLOCK_STATE, 13);
register(MetadataType.NBT_TAG, 14);
register(MetadataType.PARTICLE, 15);
register(HandshakeIntent.STATUS, 1);
register(HandshakeIntent.LOGIN, 2);

View file

@ -15,5 +15,6 @@ public enum MetadataType {
BLOCK_FACE,
OPTIONAL_UUID,
BLOCK_STATE,
NBT_TAG;
NBT_TAG,
PARTICLE;
}

View file

@ -231,6 +231,9 @@ public class NetUtil {
case NBT_TAG:
value = readNBT(in);
break;
case PARTICLE:
value = readParticle(in);
break;
default:
throw new IOException("Unknown metadata type id: " + typeId);
}
@ -302,6 +305,9 @@ public class NetUtil {
case NBT_TAG:
writeNBT(out, (CompoundTag) meta.getValue());
break;
case PARTICLE:
writeParticle(out, (Particle) meta.getValue());
break;
default:
throw new IOException("Unknown metadata type: " + meta.getType());
}