Disable keep inventory when using op (just use the gamerule in this case)
@@ -9,6 +9,7 @@ import io.github.nucleuspowered.nucleus.internal.ListenerBase;
import io.github.nucleuspowered.nucleus.internal.annotations.RequireExistenceOf;
import io.github.nucleuspowered.nucleus.internal.annotations.SkipOnError;
import io.github.nucleuspowered.nucleus.internal.permissions.PermissionInformation;
+import io.github.nucleuspowered.nucleus.internal.permissions.ServiceChangeListener;
import io.github.nucleuspowered.nucleus.internal.permissions.SuggestedLevel;
import org.spongepowered.api.entity.living.Living;
import org.spongepowered.api.entity.living.player.Player;
@@ -20,7 +21,7 @@ import java.util.Map;
@SkipOnError
@RequireExistenceOf(value = "org.spongepowered.api.event.entity.DestructEntityEvent$Death#setKeepInventory", showError = false)
-public class KeepInventoryListener implements ListenerBase {
+public class KeepInventoryListener implements ListenerBase.Conditional {
@Override
public Map<String, PermissionInformation> getPermissions() {
@@ -35,4 +36,10 @@ public class KeepInventoryListener implements ListenerBase {
event.setKeepInventory(true);
}
}
+
+ @Override
+ public boolean shouldEnable() {
+ return !ServiceChangeListener.isOpOnly();
+ }
+
}
