Various minor

Fix image brush
Fix some java 9 issues
Fix metrics being disabled
Fix compile: duplicate method in SimpleBlockMaterial
Load as both FastAsyncWorldEdit and WorldEdit
This commit is contained in:
Jesse Boyd
2018-08-16 23:21:39 +10:00
parent 6ebdc00fba
commit 4ffb9bce6c
11 changed files with 90 additions and 96 deletions

View File

@ -668,6 +668,10 @@ public class MainUtil {
}
public static File copyFile(File jar, String resource, File output) {
return copyFile(jar, resource, output, resource);
}
public static File copyFile(File jar, String resource, File output, String fileName) {
try {
if (output == null) {
output = Fawe.imp().getDirectory();
@ -675,11 +679,11 @@ public class MainUtil {
if (!output.exists()) {
output.mkdirs();
}
File newFile = new File(output, resource);
File newFile = new File(output, fileName);
if (newFile.exists()) {
return newFile;
}
try (InputStream stream = Fawe.imp().getClass().getResourceAsStream(resource.startsWith("/") ? resource : "/" + resource)) {
try (InputStream stream = Fawe.class.getResourceAsStream(resource.startsWith("/") ? resource : "/" + resource)) {
byte[] buffer = new byte[2048];
if (stream == null) {
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(jar))) {
@ -687,7 +691,6 @@ public class MainUtil {
while (ze != null) {
String name = ze.getName();
if (name.equals(resource)) {
new File(newFile.getParent()).mkdirs();
try (FileOutputStream fos = new FileOutputStream(newFile)) {
int len;
while ((len = zis.read(buffer)) > 0) {

View File

@ -117,12 +117,8 @@ public class ReflectionUtils9 {
}
try {
System.out.println("Target " + target + " | " + field.getName());
if (target == null) field.set(null, value);
else field.set(target, value);
// FieldAccessor fa = ReflectionFactory.getReflectionFactory().newFieldAccessor(field, false);
// fa.set(target, value);
} catch (NoSuchMethodError error) {
field.set(target, value);
}