mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Fixed SQLite errors
Added stacktraces to clear (Settings.DEBUG)
This commit is contained in:
parent
0d0825d614
commit
04167997ad
@ -9,24 +9,14 @@
|
|||||||
|
|
||||||
package com.intellectualcrafters.plot;
|
package com.intellectualcrafters.plot;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import java.util.HashMap;
|
import org.bukkit.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Chunk;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.Sign;
|
import org.bukkit.block.Sign;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* plot functions
|
* plot functions
|
||||||
@ -562,6 +552,12 @@ public class PlotHelper {
|
|||||||
SetBlockFast.update(requester);
|
SetBlockFast.update(requester);
|
||||||
return;
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
if(Settings.DEBUG) {
|
||||||
|
PlotMain.sendConsoleSenderMessage(C.PREFIX.s() + "Debug Mode Enabled -> Throwing epic stacktrace.");
|
||||||
|
e.printStackTrace();
|
||||||
|
} else {
|
||||||
|
PlotMain.sendConsoleSenderMessage(C.PREFIX.s() + "Something went wrong with plot clearing... Enable debug to get stacktraces.");
|
||||||
|
}
|
||||||
PlayerFunctions.sendMessage(requester, C.PREFIX.s() + "&cPlot clear failed... Trying again...");
|
PlayerFunctions.sendMessage(requester, C.PREFIX.s() + "&cPlot clear failed... Trying again...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,10 +277,7 @@ public class DBFunc {
|
|||||||
// each time.
|
// each time.
|
||||||
HashMap<String, Object> settings = getSettings(id);
|
HashMap<String, Object> settings = getSettings(id);
|
||||||
UUID owner = UUID.fromString(r.getString("owner"));
|
UUID owner = UUID.fromString(r.getString("owner"));
|
||||||
Biome plotBiome = Biome.valueOf((String) settings.get("biome"));
|
Biome plotBiome = Biome.FOREST;
|
||||||
if (plotBiome == null) {
|
|
||||||
plotBiome = Biome.FOREST;
|
|
||||||
}
|
|
||||||
String[] flags_string;
|
String[] flags_string;
|
||||||
if (settings.get("flags") == null) {
|
if (settings.get("flags") == null) {
|
||||||
flags_string = new String[] {};
|
flags_string = new String[] {};
|
||||||
@ -315,6 +312,10 @@ public class DBFunc {
|
|||||||
}
|
}
|
||||||
PlotHomePosition position = null;
|
PlotHomePosition position = null;
|
||||||
for (PlotHomePosition plotHomePosition : PlotHomePosition.values()) {
|
for (PlotHomePosition plotHomePosition : PlotHomePosition.values()) {
|
||||||
|
if (settings.get("position") == null) {
|
||||||
|
position = PlotHomePosition.DEFAULT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (plotHomePosition.isMatching((String) settings.get("position"))) {
|
if (plotHomePosition.isMatching((String) settings.get("position"))) {
|
||||||
position = plotHomePosition;
|
position = plotHomePosition;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user