mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-15 01:08:35 +00:00
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:
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user