Check if WORLDEDIT_RESTRICTIONS is enabled

Unregister if disabled.
This commit is contained in:
Jesse Boyd 2019-11-11 19:44:51 +00:00
parent 10e5760ba8
commit 55d6217c32
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -23,8 +23,7 @@ import java.util.Set;
public class WESubscriber { public class WESubscriber {
@Subscribe(priority = Priority.VERY_EARLY) public void onEditSession(EditSessionEvent event) { @Subscribe(priority = Priority.VERY_EARLY) public void onEditSession(EditSessionEvent event) {
WorldEdit worldedit = PlotSquared.get().worldedit; if (!Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) {
if (worldedit == null) {
WorldEdit.getInstance().getEventBus().unregister(this); WorldEdit.getInstance().getEventBus().unregister(this);
return; return;
} }