mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-27 18:59:10 +00:00
Code cleanup
This commit is contained in:
@@ -318,11 +318,11 @@ public class ConfiguredRegion {
|
||||
try {
|
||||
File file = this.findFile(plugin);
|
||||
if (file == null) file = new File(plugin.getDataFolder() + "/regions/" + this.id + ".json");
|
||||
Writer writer = new FileWriter(file);
|
||||
Gson gson = plugin.getGson();
|
||||
gson.toJson(this, writer);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
try (Writer writer = new FileWriter(file)) {
|
||||
Gson gson = plugin.getGson();
|
||||
gson.toJson(this, writer);
|
||||
writer.flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public enum PreventType {
|
||||
PUSH;
|
||||
|
||||
public void prevent(PlayerMoveEvent event) {
|
||||
if (event.getTo() == null) return;
|
||||
Player player = event.getPlayer();
|
||||
switch (this) {
|
||||
case TELEPORT:
|
||||
|
||||
Reference in New Issue
Block a user