3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-08 04:20:06 +01:00

Don't attempt to run null P2 tasks

Dieser Commit ist enthalten in:
dordsor21 2021-10-19 13:35:00 +01:00
Ursprung bd9476a175
Commit b5479e480d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
2 geänderte Dateien mit 30 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -73,9 +73,11 @@ public class FaweDelegateRegionManager {
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
} }
} }
}
}); });
return true; return true;
} }
@ -176,8 +178,10 @@ public class FaweDelegateRegionManager {
null, null,
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.IMP.LIGHTING.MODE) RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.IMP.LIGHTING.MODE)
); );
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
} }
}
}); });
return true; return true;
} }
@ -239,8 +243,10 @@ public class FaweDelegateRegionManager {
), null, ), null,
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.IMP.LIGHTING.MODE) RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.IMP.LIGHTING.MODE)
); );
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
} }
}
}); });
} }
@ -266,8 +272,10 @@ public class FaweDelegateRegionManager {
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
} }
}
}); });
} }
@ -317,7 +325,9 @@ public class FaweDelegateRegionManager {
e.printStackTrace(); e.printStackTrace();
} }
} }
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
}
}); });
return true; return true;
} }
@ -339,8 +349,10 @@ public class FaweDelegateRegionManager {
editSession.regenerate(region); editSession.regenerate(region);
editSession.flushQueue(); editSession.flushQueue();
} }
if (whenDone != null) {
TaskManager.IMP.task(whenDone); TaskManager.IMP.task(whenDone);
} }
}
}); });
return true; return true;
} }

Datei anzeigen

@ -70,7 +70,9 @@ public class FaweDelegateSchematicHandler {
whenDone.value = false; whenDone.value = false;
} }
if (schematic == null) { if (schematic == null) {
if (whenDone != null) {
TaskManager.runTask(whenDone); TaskManager.runTask(whenDone);
}
return; return;
} }
BlockVector3 dimension = schematic.getClipboard().getDimensions(); BlockVector3 dimension = schematic.getClipboard().getDimensions();
@ -82,7 +84,9 @@ public class FaweDelegateSchematicHandler {
if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || ( if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || (
(region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT
> 256)) { > 256)) {
if (whenDone != null) {
TaskManager.runTask(whenDone); TaskManager.runTask(whenDone);
}
return; return;
} }
// Calculate the optimal height to paste the schematic at // Calculate the optimal height to paste the schematic at
@ -121,9 +125,11 @@ public class FaweDelegateSchematicHandler {
clipboard.paste(editSession, to, true, false, true); clipboard.paste(editSession, to, true, false, true);
if (whenDone != null) { if (whenDone != null) {
whenDone.value = true; whenDone.value = true;
if (whenDone != null) {
TaskManager.runTask(whenDone); TaskManager.runTask(whenDone);
} }
} }
}
}; };
if (Fawe.isMainThread()) { if (Fawe.isMainThread()) {
com.fastasyncworldedit.core.util.TaskManager.IMP.async(r); com.fastasyncworldedit.core.util.TaskManager.IMP.async(r);
@ -175,7 +181,9 @@ public class FaweDelegateSchematicHandler {
public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) { public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) {
if (tag == null) { if (tag == null) {
LOGGER.warn("Cannot save empty tag"); LOGGER.warn("Cannot save empty tag");
com.plotsquared.core.util.task.TaskManager.runTask(whenDone); if (whenDone != null) {
TaskManager.runTask(whenDone);
}
return; return;
} }
final CompoundTag weTag = (CompoundTag) FaweCache.IMP.asTag(tag); final CompoundTag weTag = (CompoundTag) FaweCache.IMP.asTag(tag);