Fixed where the default gate is saved to.
This commit is contained in:
parent
fe1c136e63
commit
13dbf6e8f1
2
README
2
README
@ -73,6 +73,8 @@ Configuration
|
||||
=============
|
||||
Changes
|
||||
=============
|
||||
[Version 0.07]
|
||||
- Fixed where the default gate is saved to.
|
||||
[Version 0.06]
|
||||
- Forgot to make gates load from new location, oops
|
||||
[Version 0.05]
|
||||
|
@ -87,11 +87,11 @@ public class Gate {
|
||||
this.controls = controlList.toArray(this.controls);
|
||||
}
|
||||
|
||||
public void save() {
|
||||
public void save(String gateFolder) {
|
||||
HashMap<Integer, Character> reverse = new HashMap<Integer, Character>();
|
||||
|
||||
try {
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter("stargates/" + filename));
|
||||
BufferedWriter bw = new BufferedWriter(new FileWriter(gateFolder + filename));
|
||||
|
||||
writeConfig(bw, "portal-open", portalBlockOpen);
|
||||
writeConfig(bw, "portal-closed", portalBlockClosed);
|
||||
@ -313,7 +313,7 @@ public class Gate {
|
||||
Stargate.log.log(Level.SEVERE, "Could not load Gate " + file.getName() + " - Gates must have exactly 2 control points.");
|
||||
return null;
|
||||
} else {
|
||||
gate.save(); // Updates format for version changes
|
||||
gate.save(file.getParent() + File.separator); // Updates format for version changes
|
||||
return gate;
|
||||
}
|
||||
}
|
||||
@ -342,7 +342,7 @@ public class Gate {
|
||||
|
||||
if (files.length == 0) {
|
||||
dir.mkdir();
|
||||
populateDefaults(dir);
|
||||
populateDefaults(gateFolder);
|
||||
} else {
|
||||
for (File file : files) {
|
||||
Gate gate = loadGate(file);
|
||||
@ -351,7 +351,7 @@ public class Gate {
|
||||
}
|
||||
}
|
||||
|
||||
public static void populateDefaults(File dir) {
|
||||
public static void populateDefaults(String gateFolder) {
|
||||
Integer[][] layout = new Integer[][] {
|
||||
{ANYTHING, Portal.OBSIDIAN, Portal.OBSIDIAN, ANYTHING},
|
||||
{Portal.OBSIDIAN, ENTRANCE, ENTRANCE, Portal.OBSIDIAN},
|
||||
@ -364,7 +364,7 @@ public class Gate {
|
||||
types.put('-', Portal.OBSIDIAN);
|
||||
|
||||
Gate gate = new Gate("nethergate.gate", layout, types);
|
||||
gate.save();
|
||||
gate.save(gateFolder);
|
||||
registerGate(gate);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: Stargate
|
||||
main: net.TheDgtl.Stargate.Stargate
|
||||
version: 0.06
|
||||
version: 0.07
|
||||
description: Stargate mod for Bukkit
|
||||
author: Drakia
|
||||
website: http://www.thedgtl.net
|
Loading…
x
Reference in New Issue
Block a user