Fixed IllegalStateException when modifying containers using FAWE

This commit is contained in:
Intelli 2022-12-08 13:56:14 -07:00
parent 3cedc69205
commit 026b9ce322
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,10 @@ public class CoreProtectEditSessionEvent {
return initialized;
}
public static boolean isFAWE() {
return isFAWE;
}
public static void register() {
if (isInitialized()) {
return;

View File

@ -46,7 +46,7 @@ public class CoreProtectLogger extends AbstractDelegateExtent {
// No clear way to get container content data from within the WorldEdit API
// Data may be available by converting oldBlock.toBaseBlock().getNbtData()
// e.g. BaseBlock block = eventWorld.getBlock(position);
ItemStack[] containerData = Util.getContainerContents(oldType, null, location);
ItemStack[] containerData = CoreProtectEditSessionEvent.isFAWE() ? null : Util.getContainerContents(oldType, null, location);
if (eventExtent.setBlock(position, block)) {
WorldEditLogger.postProcess(eventExtent, eventActor, position, location, block, baseBlock, oldType, oldBlock, containerData);