fixed problem with certain commands not saving changes to disk
This commit is contained in:
parent
3e80f67770
commit
af24d7365a
@ -274,6 +274,7 @@ public class Gate
|
||||
try
|
||||
{
|
||||
DiscUtil.write(file, Plugin.gson.toJson(instances));
|
||||
Plugin.log("Saved gates to disk");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
@ -288,6 +289,7 @@ public class Gate
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.mcteam.ancientgates.Gate;
|
||||
|
||||
public class CommandClose extends BaseCommand {
|
||||
|
||||
public CommandClose() {
|
||||
@ -12,7 +14,10 @@ public class CommandClose extends BaseCommand {
|
||||
|
||||
public void perform() {
|
||||
gate.close();
|
||||
|
||||
sendMessage("The gate was closed.");
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ public class CommandCreateSetFrom extends BaseCommand
|
||||
}
|
||||
|
||||
Gate.create(id);
|
||||
Gate.save();
|
||||
sendMessage("Gate with id \"" + id + "\" was created.");
|
||||
|
||||
gate = Gate.get(id);
|
||||
@ -76,5 +75,7 @@ public class CommandCreateSetFrom extends BaseCommand
|
||||
|
||||
sendMessage("From location for gate \""+gate.getId()+"\" is now where you stand.");
|
||||
sendMessage("Your gate includes " + gateBlocks.size() + " Blocks.");
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.mcteam.ancientgates.Gate;
|
||||
|
||||
public class CommandHide extends BaseCommand
|
||||
{
|
||||
|
||||
@ -16,5 +18,7 @@ public class CommandHide extends BaseCommand
|
||||
{
|
||||
gate.setHidden(true);
|
||||
sendMessage("The gate " + gate.getId() + " is now hidden.");
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.mcteam.ancientgates.Gate;
|
||||
|
||||
|
||||
public class CommandInfo extends BaseCommand
|
||||
@ -44,5 +45,7 @@ public class CommandInfo extends BaseCommand
|
||||
else
|
||||
sendMessage(ChatColor.GREEN + "this gate has no 'to' location");
|
||||
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
@ -210,6 +210,8 @@ public class CommandList extends BaseCommand
|
||||
else
|
||||
sendMessage(messages);
|
||||
}
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.mcteam.ancientgates.Gate;
|
||||
|
||||
public class CommandOpen extends BaseCommand {
|
||||
|
||||
@ -35,6 +36,8 @@ public class CommandOpen extends BaseCommand {
|
||||
sendMessage("Failed to open the gate. Have you built a frame?");
|
||||
sendMessage("More info here: " + new CommandHelp().getUsageTemplate(true, true));
|
||||
}
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,5 +36,7 @@ public class CommandRename extends BaseCommand
|
||||
Gate.rename(gate, newId);
|
||||
|
||||
sendMessage("Gate " + oldId + " is now known as " + newId + ".");
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.mcteam.ancientgates.commands;
|
||||
|
||||
import org.mcteam.ancientgates.Gate;
|
||||
|
||||
public class CommandUnhide extends BaseCommand
|
||||
{
|
||||
|
||||
@ -18,5 +20,7 @@ public class CommandUnhide extends BaseCommand
|
||||
sendMessage("The gate " + gate.getId() + " is no longer hidden.");
|
||||
else
|
||||
sendMessage("Failed to unhide the gate. Does the portal have a frame?");
|
||||
|
||||
Gate.save();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user