geforkt von Mirrors/FastAsyncWorldEdit
Added version information for SP.
Dieser Commit ist enthalten in:
Ursprung
46229c6790
Commit
f69184f9ab
@ -60,6 +60,7 @@ public abstract class LocalConfiguration {
|
||||
public Set<Integer> allowedDataCycleBlocks = new HashSet<Integer>();
|
||||
public String saveDir = "schematics";
|
||||
public String scriptsDir = "craftscripts";
|
||||
public boolean showFirstUseVersion = true;
|
||||
|
||||
/**
|
||||
* Loads the configuration.
|
||||
|
@ -40,6 +40,8 @@ public class LocalSession {
|
||||
|
||||
public static final int MAX_HISTORY_SIZE = 15;
|
||||
|
||||
private LocalConfiguration config;
|
||||
|
||||
private boolean placeAtPos1 = false;
|
||||
private Vector pos1, pos2;
|
||||
private Region region;
|
||||
@ -57,6 +59,16 @@ public class LocalSession {
|
||||
private String lastScript;
|
||||
private CompassMode compassMode = CompassMode.JUMPTO;
|
||||
private BrushShape brushShape = null;
|
||||
private boolean beenToldVersion = false;
|
||||
|
||||
/**
|
||||
* Construct the object.
|
||||
*
|
||||
* @param config
|
||||
*/
|
||||
public LocalSession(LocalConfiguration config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear history.
|
||||
@ -463,4 +475,17 @@ public class LocalSession {
|
||||
public void setBrushShape(BrushShape brushShape) {
|
||||
this.brushShape = brushShape;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the player the WorldEdit version.
|
||||
*/
|
||||
public void tellVersion(LocalPlayer player) {
|
||||
if (config.showFirstUseVersion) {
|
||||
if (!beenToldVersion) {
|
||||
player.printRaw("\u00A78WorldEdit ver. " + WorldEdit.getVersion()
|
||||
+ " (http://sk89q.com/projects/worldedit/)");
|
||||
beenToldVersion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import com.sk89q.worldedit.patterns.*;
|
||||
*/
|
||||
public class WorldEdit {
|
||||
public static final Logger logger = Logger.getLogger("Minecraft.WorldEdit");
|
||||
private static String version;
|
||||
|
||||
/**
|
||||
* Interface to the server.
|
||||
@ -74,6 +75,13 @@ public class WorldEdit {
|
||||
private HashMap<String,LocalSession> sessions =
|
||||
new HashMap<String,LocalSession>();
|
||||
|
||||
/**
|
||||
* Initialize statically.
|
||||
*/
|
||||
static {
|
||||
getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct an instance of the plugin
|
||||
*
|
||||
@ -112,7 +120,7 @@ public class WorldEdit {
|
||||
return sessions.get(player.getName());
|
||||
}
|
||||
|
||||
LocalSession session = new LocalSession();
|
||||
LocalSession session = new LocalSession(config);
|
||||
|
||||
// Set the limit on the number of blocks that an operation can
|
||||
// change at once, or don't if the player has an override or there
|
||||
@ -818,6 +826,8 @@ public class WorldEdit {
|
||||
LocalSession session = getSession(player);
|
||||
BlockBag blockBag = session.getBlockBag(player);
|
||||
|
||||
session.tellVersion(player);
|
||||
|
||||
EditSession editSession =
|
||||
new EditSession(server, player.getWorld(),
|
||||
session.getBlockChangeLimit(), blockBag);
|
||||
@ -988,4 +998,33 @@ public class WorldEdit {
|
||||
public LocalConfiguration getConfiguration() {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the version.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getVersion() {
|
||||
if (version != null) {
|
||||
return version;
|
||||
}
|
||||
|
||||
Package p = WorldEdit.class.getPackage();
|
||||
|
||||
if (p == null) {
|
||||
p = Package.getPackage("com.sk89q.worldedit");
|
||||
}
|
||||
|
||||
if (p == null) {
|
||||
version = "(unknown)";
|
||||
} else {
|
||||
version = p.getImplementationVersion();
|
||||
|
||||
if (version == null) {
|
||||
version = "(unknown)";
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ public class BukkitConfiguration extends LocalConfiguration {
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
showFirstUseVersion = false;
|
||||
|
||||
profile = config.getBoolean("debug", profile);
|
||||
wandItem = config.getInt("wand-item", wandItem);
|
||||
defaultChangeLimit = Math.max(-1, config.getInt(
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren