mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-25 01:47:39 +01:00
parent
e70f230f39
commit
b4f8024eef
@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.entities.Entity1_16_2Types;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_16;
|
||||
import com.viaversion.viaversion.api.type.types.Particle;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.Protocol1_16_2To1_16_1;
|
||||
import com.viaversion.viaversion.rewriter.EntityRewriter;
|
||||
@ -39,12 +39,12 @@ public class MetadataRewriter1_16_2To1_16_1 extends EntityRewriter<Protocol1_16_
|
||||
|
||||
@Override
|
||||
public void handleMetadata(int entityId, EntityType type, Metadata metadata, List<Metadata> metadatas, UserConnection connection) throws Exception {
|
||||
if (metadata.metaType() == MetaType1_14.Slot) {
|
||||
if (metadata.metaType() == MetaType1_16.ITEM) {
|
||||
protocol.getItemRewriter().handleItemToClient((Item) metadata.getValue());
|
||||
} else if (metadata.metaType() == MetaType1_14.BlockID) {
|
||||
} else if (metadata.metaType() == MetaType1_16.BLOCK_STATE) {
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
} else if (metadata.metaType() == MetaType1_14.PARTICLE) {
|
||||
} else if (metadata.metaType() == MetaType1_16.PARTICLE) {
|
||||
rewriteParticle((Particle) metadata.getValue());
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
|
||||
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_16;
|
||||
import com.viaversion.viaversion.api.type.types.Particle;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2;
|
||||
import com.viaversion.viaversion.rewriter.EntityRewriter;
|
||||
@ -40,12 +40,13 @@ public class MetadataRewriter1_16To1_15_2 extends EntityRewriter<Protocol1_16To1
|
||||
|
||||
@Override
|
||||
public void handleMetadata(int entityId, EntityType type, Metadata metadata, List<Metadata> metadatas, UserConnection connection) throws Exception {
|
||||
if (metadata.metaType() == MetaType1_14.Slot) {
|
||||
metadata.setMetaType(MetaType1_16.byId(metadata.metaType().typeId()));
|
||||
if (metadata.metaType() == MetaType1_16.ITEM) {
|
||||
protocol.getItemRewriter().handleItemToClient((Item) metadata.getValue());
|
||||
} else if (metadata.metaType() == MetaType1_14.BlockID) {
|
||||
} else if (metadata.metaType() == MetaType1_16.BLOCK_STATE) {
|
||||
int data = (int) metadata.getValue();
|
||||
metadata.setValue(protocol.getMappingData().getNewBlockStateId(data));
|
||||
} else if (metadata.metaType() == MetaType1_14.PARTICLE) {
|
||||
} else if (metadata.metaType() == MetaType1_16.PARTICLE) {
|
||||
rewriteParticle((Particle) metadata.getValue());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user