Fix NPE
This commit is contained in:
parent
5eff53f1f8
commit
bde226e7cd
@ -261,6 +261,9 @@ public class Fawe {
|
||||
private WorldEdit worldedit;
|
||||
|
||||
public WorldEdit getWorldEdit() {
|
||||
if (this.worldedit == null) {
|
||||
return worldedit = WorldEdit.getInstance();
|
||||
}
|
||||
return this.worldedit;
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ public abstract class FawePlayer<T> {
|
||||
* @return
|
||||
*/
|
||||
public LocalSession getSession() {
|
||||
return (this.session != null || this.getPlayer() == null) ? this.session : (session = Fawe.get().getWorldEdit().getSession(this.getPlayer()));
|
||||
return (this.session != null || this.getPlayer() == null || Fawe.get() == null) ? this.session : (session = Fawe.get().getWorldEdit().getSession(this.getPlayer()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,9 @@ package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.database.DBHandler;
|
||||
import com.boydti.fawe.database.RollbackDatabase;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
@ -64,6 +67,10 @@ public class HistoryCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.history.undo")
|
||||
public void faweRollback(Player player, LocalSession session, String user, int radius, String time) throws WorldEditException {
|
||||
if (!Settings.HISTORY.USE_DATABASE) {
|
||||
BBC.SETTING_DISABLE.send(player, "history.use-database");
|
||||
return;
|
||||
}
|
||||
UUID other = Fawe.imp().getUUID(user);
|
||||
if (other == null) {
|
||||
BBC.PLAYER_NOT_FOUND.send(player, user);
|
||||
@ -79,6 +86,9 @@ public class HistoryCommands {
|
||||
WorldVector origin = player.getPosition();
|
||||
Vector bot = origin.subtract(radius, radius, radius);
|
||||
Vector top = origin.add(radius, radius, radius);
|
||||
RollbackDatabase database = DBHandler.IMP.getDatabase(Fawe.imp().getWorldName(world));
|
||||
|
||||
|
||||
|
||||
// TODO
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user