Fix NPE when right-clicking a >1.13 block

This commit is contained in:
dordsor21 2019-02-13 13:43:22 +00:00
parent 3e8308ecd7
commit 8710f2f83b

View File

@ -1876,10 +1876,14 @@ import java.util.regex.Pattern;
eventType = PlayerBlockEventType.TELEPORT_OBJECT; eventType = PlayerBlockEventType.TELEPORT_OBJECT;
break; break;
default: default:
int blockId = ((LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings() LegacyPlotBlock legacyPlotBlock =
.fromStringToLegacy(blockType.name())).id; (LegacyPlotBlock) PlotSquared.get().IMP.getLegacyMappings()
if (blockId > 197) { .fromStringToLegacy(blockType.name());
eventType = PlayerBlockEventType.INTERACT_BLOCK; if (legacyPlotBlock != null) {
int blockId = legacyPlotBlock.id;
if (blockId > 197) {
eventType = PlayerBlockEventType.INTERACT_BLOCK;
}
} }
break; break;
} }