Fixes ViaVersion/ViaVersion#2751
This commit is contained in:
Nassim Jahnke 2021-12-03 08:59:28 +01:00
parent cadab9e6bb
commit 87aed8f3f2
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 8 additions and 2 deletions

View File

@ -33,6 +33,7 @@ import com.viaversion.viaversion.api.platform.providers.Provider;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import java.util.HashMap;
import java.util.Map;
@ -67,7 +68,12 @@ public class BackwardsBlockEntityProvider implements Provider {
* @param tag The block entity tag
*/
public CompoundTag transform(UserConnection user, Position position, CompoundTag tag) throws Exception {
String id = (String) tag.get("id").getValue();
final Tag idTag = tag.get("id");
if (!(idTag instanceof StringTag)) {
return tag;
}
String id = (String) idTag.getValue();
BackwardsBlockEntityHandler handler = handlers.get(id);
if (handler == null) {
if (Via.getManager().isDebug()) {

View File

@ -372,7 +372,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
Item item = (Item) meta.getValue();
meta.setValue(protocol.getItemRewriter().handleItemToClient(item));
} else if (type == Types1_13_2.META_TYPES.blockStateType) {
int blockstate = (Integer) meta.getValue();
int blockstate = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(blockstate));
}
});