mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Fix some adapter issues
regen 1.13, tile get npe, null block type values
This commit is contained in:
@ -2,7 +2,6 @@ package com.boydti.fawe;
|
||||
|
||||
import com.boydti.fawe.beta.implementation.queue.QueueHandler;
|
||||
import com.boydti.fawe.beta.implementation.cache.preloader.Preloader;
|
||||
import com.boydti.fawe.object.FaweCommand;
|
||||
import com.boydti.fawe.regions.FaweMaskManager;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.boydti.fawe.util.image.ImageViewer;
|
||||
|
@ -1,45 +0,0 @@
|
||||
package com.boydti.fawe.object;
|
||||
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
|
||||
public abstract class FaweCommand<T> {
|
||||
public final String perm;
|
||||
public final boolean safe;
|
||||
|
||||
public FaweCommand(String perm) {
|
||||
this(perm, true);
|
||||
}
|
||||
|
||||
public FaweCommand(String perm, boolean safe) {
|
||||
this.perm = perm;
|
||||
this.safe = safe;
|
||||
}
|
||||
|
||||
public String getPerm() {
|
||||
return this.perm;
|
||||
}
|
||||
|
||||
public boolean executeSafe(Actor player, String... args) {
|
||||
try {
|
||||
if (!safe) {
|
||||
execute(player, args);
|
||||
return true;
|
||||
} else if (player == null) {
|
||||
TaskManager.IMP.async(() -> execute(player, args));
|
||||
} else {
|
||||
if (!player.runAction(() -> execute(player, args), true, true)) {
|
||||
player.printError(TranslatableComponent.of("fawe.info.worldedit.command.limit"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract boolean execute(Actor actor, String... args);
|
||||
}
|
Reference in New Issue
Block a user