block destroyed bug
@@ -41,6 +41,7 @@ public void onDestroy(DestroyEvent event, EntityRef entity) {
private void recordDestroyed(DestroyEvent event, EntityRef entityRef) {
EntityRef instigator = event.getInstigator();
+ if (instigator != null) {
if (entityRef.hasComponent(BlockComponent.class)) {
BlockComponent blockComponent = entityRef.getComponent(BlockComponent.class);
String blockName = blockComponent.getBlock().getDisplayName();
@@ -79,3 +80,4 @@ private void recordDestroyed(DestroyEvent event, EntityRef entityRef) {
}
}
}
+}
