Fixed clipboards failing to paste when a block has NBT data (#2198)

This commit is contained in:
Maddy Miller 2022-10-01 07:20:39 +10:00 committed by GitHub
parent 4267fabd3d
commit 0b6dcb1fb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ private BaseBlock transformNbtData(BaseBlock state) {
if (tag != null) {
// Handle blocks which store their rotation in NBT
LinTag<?> rotTag = tag.value().get("Rot");
if (rotTag.value() instanceof Number number) {
if (rotTag != null && rotTag.value() instanceof Number number) {
int rot = number.intValue();
Direction direction = MCDirections.fromRotation(rot);