mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-20 02:45:00 +00:00
Should fix broken config generation some people have been getting
This commit is contained in:
parent
cbc331da7d
commit
ccfabd94b9
@ -132,6 +132,13 @@ public class BaseBlock {
|
|||||||
&& (data == ((BaseBlock) o).data || data == -1 || ((BaseBlock) o).data == -1);
|
&& (data == ((BaseBlock) o).data || data == -1 || ((BaseBlock) o).data == -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int ret = type << 3;
|
||||||
|
if (data != (byte)-1) ret |= data;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "BaseBlock id: " + getType() + " with damage: " + getData();
|
return "BaseBlock id: " + getType() + " with damage: " + getData();
|
||||||
|
@ -20,10 +20,14 @@
|
|||||||
package com.sk89q.worldedit.bukkit;
|
package com.sk89q.worldedit.bukkit;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.jar.JarFile;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -170,9 +174,16 @@ public class WorldEditPlugin extends JavaPlugin {
|
|||||||
protected void createDefaultConfiguration(String name) {
|
protected void createDefaultConfiguration(String name) {
|
||||||
File actual = new File(getDataFolder(), name);
|
File actual = new File(getDataFolder(), name);
|
||||||
if (!actual.exists()) {
|
if (!actual.exists()) {
|
||||||
|
|
||||||
InputStream input =
|
InputStream input =
|
||||||
WorldEdit.class.getResourceAsStream("/defaults/" + name);
|
null;
|
||||||
|
try {
|
||||||
|
JarFile file = new JarFile(getFile());
|
||||||
|
ZipEntry copy = file.getEntry("defaults" + File.separator + name);
|
||||||
|
if (copy == null) throw new FileNotFoundException();
|
||||||
|
input = file.getInputStream(copy);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.severe(getDescription().getName() + ": Unable to read default configuration: " + name);
|
||||||
|
}
|
||||||
if (input != null) {
|
if (input != null) {
|
||||||
FileOutputStream output = null;
|
FileOutputStream output = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user