mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Merge branch 'breaking' of https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13 into breaking
This commit is contained in:
@ -43,8 +43,10 @@ processResources {
|
||||
from('src/main/resources') {
|
||||
include 'fawe.properties'
|
||||
expand(
|
||||
internalVersion: "${project.parent.version}",
|
||||
version: "${project.parent.version}",
|
||||
name: project.parent.name,
|
||||
commit: "${git.head().abbreviatedId}",
|
||||
date: "${git.head().getDate().format("yy.MM.dd")}",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,7 @@ import com.sk89q.worldedit.session.request.Request;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.management.InstanceAlreadyExistsException;
|
||||
import javax.management.NotificationEmitter;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryMXBean;
|
||||
import java.lang.management.MemoryPoolMXBean;
|
||||
@ -316,15 +313,17 @@ public class Fawe {
|
||||
// Setting up config.yml
|
||||
File file = new File(this.IMP.getDirectory(), "config.yml");
|
||||
Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", "");
|
||||
try {
|
||||
InputStream stream = getClass().getResourceAsStream("/fawe.properties");
|
||||
java.util.Scanner scanner = new java.util.Scanner(stream).useDelimiter("\\A");
|
||||
String versionString = scanner.next().trim();
|
||||
scanner.close();
|
||||
this.version = new FaweVersion(versionString);
|
||||
try (InputStream stream = getClass().getResourceAsStream("/fawe.properties");
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(stream))) {
|
||||
// java.util.Scanner scanner = new java.util.Scanner(stream).useDelimiter("\\A");
|
||||
String versionString = br.readLine();
|
||||
String commitString = br.readLine();
|
||||
String dateString = br.readLine();
|
||||
// scanner.close();
|
||||
this.version = FaweVersion.tryParse(versionString, commitString, dateString);
|
||||
Settings.IMP.DATE = new Date(100 + version.year, version.month, version.day).toGMTString();
|
||||
Settings.IMP.BUILD = "https://ci.athion.net/job/FastAsyncWorldEdit/" + version.build;
|
||||
Settings.IMP.COMMIT = "https://github.com/boy0001/FastAsyncWorldedit/commit/" + Integer.toHexString(version.hash);
|
||||
Settings.IMP.BUILD = "https://ci.athion.net/job/FastAsyncWorldEdit-Breaking/" + version.build;
|
||||
Settings.IMP.COMMIT = "https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/commit/" + Integer.toHexString(version.hash);
|
||||
} catch (Throwable ignore) {}
|
||||
try {
|
||||
Settings.IMP.reload(file);
|
||||
|
@ -1,24 +1,33 @@
|
||||
package com.boydti.fawe;
|
||||
|
||||
public class FaweVersion {
|
||||
public final int year, month, day, hash, build, major, minor, patch;
|
||||
public final int year, month, day, hash, build;
|
||||
|
||||
public FaweVersion(String version) {
|
||||
String[] split = version.substring(version.indexOf('=') + 1).split("-");
|
||||
if (split[0].equals("unknown")) {
|
||||
this.year = month = day = hash = build = major = minor = patch = 0;
|
||||
return;
|
||||
public FaweVersion(int year, int month, int day, int hash, int build) {
|
||||
this.year = year;
|
||||
this.month = month;
|
||||
this.day = day;
|
||||
this.hash = hash;
|
||||
this.build = build;
|
||||
}
|
||||
|
||||
public FaweVersion(String version, String commit, String date) {
|
||||
String[] split = version.substring(version.indexOf('=') + 1).split("\\.");
|
||||
this.build = Integer.parseInt(split[1]);
|
||||
this.hash = Integer.parseInt(commit.substring(commit.indexOf('=') + 1), 16);
|
||||
String[] split1 = date.substring(date.indexOf('=') + 1).split("\\.");
|
||||
this.year = Integer.parseInt(split1[0]);
|
||||
this.month = Integer.parseInt(split1[1]);
|
||||
this.day = Integer.parseInt(split1[2]);
|
||||
}
|
||||
|
||||
public static FaweVersion tryParse(String version, String commit, String date) {
|
||||
try {
|
||||
return new FaweVersion(version, commit, date);
|
||||
} catch (Exception ignore) {
|
||||
ignore.printStackTrace();
|
||||
return new FaweVersion(0, 0, 0, 0, 0);
|
||||
}
|
||||
String[] date = split[0].split("\\.");
|
||||
this.year = Integer.parseInt(date[0]);
|
||||
this.month = Integer.parseInt(date[1]);
|
||||
this.day = Integer.parseInt(date[2]);
|
||||
this.hash = Integer.parseInt(split[1], 16);
|
||||
this.build = Integer.parseInt(split[2]);
|
||||
String[] semver = split[3].split("\\.");
|
||||
this.major = Integer.parseInt(semver[0]);
|
||||
this.minor = Integer.parseInt(semver[1]);
|
||||
this.patch = Integer.parseInt(semver[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -27,6 +36,6 @@ public class FaweVersion {
|
||||
}
|
||||
|
||||
public boolean isNewer(FaweVersion other) {
|
||||
return other.build < this.build && (this.major > other.major || (this.major == other.major && this.minor > other.minor) || (this.major == other.major && this.minor == other.minor && this.patch > other.patch));
|
||||
return other.build < this.build;
|
||||
}
|
||||
}
|
@ -3,6 +3,8 @@ package com.boydti.fawe.installer;
|
||||
import com.boydti.fawe.FaweVersion;
|
||||
import com.boydti.fawe.util.MainUtil;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@ -149,11 +151,11 @@ public class InstallerFrame extends JFrame {
|
||||
java.util.Scanner scanner = new java.util.Scanner(stream).useDelimiter("\\A");
|
||||
String versionString = scanner.next().trim();
|
||||
scanner.close();
|
||||
FaweVersion version = new FaweVersion(versionString);
|
||||
FaweVersion version = null;
|
||||
String date = new Date(100 + version.year, version.month, version.day).toGMTString();
|
||||
String build = "https://ci.athion.net/job/FastAsyncWorldEdit/" + version.build;
|
||||
String commit = "https://github.com/boy0001/FastAsyncWorldedit/commit/" + Integer.toHexString(version.hash);
|
||||
String footerMessage = "FAWE v" + version.major + "." + version.minor + "." + version.patch + " by Empire92 (c) 2017 (GPL v3.0)";
|
||||
String footerMessage = "FAWE v" + version.year + "." + version.month + "." + version.day + " by Empire92 (c) 2017 (GPL v3.0)";
|
||||
URL licenseUrl = new URL("https://github.com/boy0001/FastAsyncWorldedit/blob/master/LICENSE");
|
||||
URLButton licenseButton = new URLButton(licenseUrl, footerMessage);
|
||||
bottomBar.add(licenseButton);
|
||||
|
@ -161,7 +161,7 @@ public abstract class HelpBuilder implements Runnable {
|
||||
visited.add(args.getString(i));
|
||||
isRootLevel = false;
|
||||
} else {
|
||||
String msg = String.format("'%s' has no sub-commands. (Maybe '%s' is for a parameter?)",
|
||||
String msg = String.format(BBC.getPrefix() + "'%s' has no sub-commands. (Maybe '%s' is for a parameter?)",
|
||||
Joiner.on(" ").join(visited), command);
|
||||
displayFailure(msg);
|
||||
return;
|
||||
@ -200,7 +200,7 @@ public abstract class HelpBuilder implements Runnable {
|
||||
|
||||
// Box
|
||||
if (offset >= aliases.size()) {
|
||||
displayFailure(String.format("There is no page %d (total number of pages is %d).", page + 1, pageTotal));
|
||||
displayFailure(String.format(BBC.getPrefix() + "There is no page %d (total number of pages is %d).", page + 1, pageTotal));
|
||||
} else {
|
||||
int end = Math.min(offset + perPage, aliases.size());
|
||||
List<CommandMapping> subAliases = aliases.subList(offset, end);
|
||||
|
@ -137,7 +137,7 @@ public class RegionCommands extends MethodCommands {
|
||||
FawePlayer fp = FawePlayer.wrap(player);
|
||||
final FaweLocation loc = fp.getLocation();
|
||||
FaweQueue queue = fp.getFaweQueue(false);
|
||||
fp.sendMessage("Light: " + queue.getEmmittedLight(loc.x, loc.y, loc.z) + " | " + queue.getSkyLight(loc.x, loc.y, loc.z));
|
||||
fp.sendMessage(BBC.getPrefix() + "Light: " + queue.getEmmittedLight(loc.x, loc.y, loc.z) + " | " + queue.getSkyLight(loc.x, loc.y, loc.z));
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -23,9 +23,7 @@ import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweVersion;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.util.*;
|
||||
import com.google.common.io.Files;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
@ -35,21 +33,12 @@ import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
|
||||
import com.sk89q.worldedit.extension.platform.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extension.platform.PlatformManager;
|
||||
import com.sk89q.worldedit.util.paste.ActorCallbackPaste;
|
||||
import com.sk89q.worldedit.util.report.ConfigReport;
|
||||
import com.sk89q.worldedit.util.report.ReportList;
|
||||
import com.sk89q.worldedit.util.report.SystemInfoReport;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@ -89,7 +78,7 @@ public class WorldEditCommands {
|
||||
PlatformManager pm = we.getPlatformManager();
|
||||
actor.printDebug("Platforms:");
|
||||
for (Platform platform : pm.getPlatforms()) {
|
||||
actor.printDebug(String.format(" - %s (%s)", platform.getPlatformName(), platform.getPlatformVersion()));
|
||||
actor.printDebug(String.format(" - %s (%s)", platform.getPlatformName(), platform.getVersion()));
|
||||
}
|
||||
actor.printDebug("Capabilities:");
|
||||
for (Capability capability : Capability.values()) {
|
||||
|
@ -1 +1,3 @@
|
||||
version=${internalVersion}
|
||||
version=${version}
|
||||
commit=${commit}
|
||||
date=${date}
|
||||
|
Reference in New Issue
Block a user