From 2cedaf8486b788adb4c2b3962bc72aa23ecd0157 Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Tue, 28 Feb 2012 17:32:37 +0100 Subject: [PATCH 1/2] suppress suppress warning ;) --- .../minecraft/worldguard/events/PlayerAreaEvent.java | 1 - .../minecraft/worldguard/events/PlayerChangedAreaEvent.java | 1 - .../minecraft/worldguard/events/PlayerNewLocationAreaEvent.java | 1 - .../minecraft/worldguard/events/PlayerSetAreaEvent.java | 1 - .../minecraft/worldguard/events/PlayerUpdateAreaEvent.java | 1 - 5 files changed, 5 deletions(-) diff --git a/src/de/jaschastarke/minecraft/worldguard/events/PlayerAreaEvent.java b/src/de/jaschastarke/minecraft/worldguard/events/PlayerAreaEvent.java index 6ccfb3b..6ca088e 100644 --- a/src/de/jaschastarke/minecraft/worldguard/events/PlayerAreaEvent.java +++ b/src/de/jaschastarke/minecraft/worldguard/events/PlayerAreaEvent.java @@ -22,7 +22,6 @@ import org.bukkit.event.Event; import de.jaschastarke.minecraft.worldguard.ApplicableRegions; -@SuppressWarnings("serial") public abstract class PlayerAreaEvent extends Event { abstract public String getRegionHash(); abstract public ApplicableRegions getRegionSet(); diff --git a/src/de/jaschastarke/minecraft/worldguard/events/PlayerChangedAreaEvent.java b/src/de/jaschastarke/minecraft/worldguard/events/PlayerChangedAreaEvent.java index f9a20f8..c0c5d0d 100644 --- a/src/de/jaschastarke/minecraft/worldguard/events/PlayerChangedAreaEvent.java +++ b/src/de/jaschastarke/minecraft/worldguard/events/PlayerChangedAreaEvent.java @@ -24,7 +24,6 @@ import org.bukkit.event.player.PlayerTeleportEvent; import de.jaschastarke.minecraft.worldguard.ApplicableRegions; import de.jaschastarke.minecraft.worldguard.Interface; -@SuppressWarnings("serial") public class PlayerChangedAreaEvent extends PlayerNewLocationAreaEvent implements Cancellable { private PlayerMoveEvent event; private String _previous_hash; diff --git a/src/de/jaschastarke/minecraft/worldguard/events/PlayerNewLocationAreaEvent.java b/src/de/jaschastarke/minecraft/worldguard/events/PlayerNewLocationAreaEvent.java index 26adfb0..818fd14 100644 --- a/src/de/jaschastarke/minecraft/worldguard/events/PlayerNewLocationAreaEvent.java +++ b/src/de/jaschastarke/minecraft/worldguard/events/PlayerNewLocationAreaEvent.java @@ -24,7 +24,6 @@ import org.bukkit.event.HandlerList; import de.jaschastarke.minecraft.worldguard.ApplicableRegions; import de.jaschastarke.minecraft.worldguard.Interface; -@SuppressWarnings("serial") public class PlayerNewLocationAreaEvent extends PlayerAreaEvent { private Location location; private Player player; diff --git a/src/de/jaschastarke/minecraft/worldguard/events/PlayerSetAreaEvent.java b/src/de/jaschastarke/minecraft/worldguard/events/PlayerSetAreaEvent.java index 078d476..c9a300b 100644 --- a/src/de/jaschastarke/minecraft/worldguard/events/PlayerSetAreaEvent.java +++ b/src/de/jaschastarke/minecraft/worldguard/events/PlayerSetAreaEvent.java @@ -24,7 +24,6 @@ import org.bukkit.event.HandlerList; import de.jaschastarke.minecraft.worldguard.ApplicableRegions; import de.jaschastarke.minecraft.worldguard.Interface; -@SuppressWarnings("serial") public class PlayerSetAreaEvent extends PlayerAreaEvent { private Player player; private String hash; diff --git a/src/de/jaschastarke/minecraft/worldguard/events/PlayerUpdateAreaEvent.java b/src/de/jaschastarke/minecraft/worldguard/events/PlayerUpdateAreaEvent.java index 951bedd..8df2656 100644 --- a/src/de/jaschastarke/minecraft/worldguard/events/PlayerUpdateAreaEvent.java +++ b/src/de/jaschastarke/minecraft/worldguard/events/PlayerUpdateAreaEvent.java @@ -24,7 +24,6 @@ import org.bukkit.event.HandlerList; import de.jaschastarke.minecraft.worldguard.ApplicableRegions; import de.jaschastarke.minecraft.worldguard.Interface; -@SuppressWarnings("serial") public class PlayerUpdateAreaEvent extends PlayerAreaEvent { private String player; private String hash; From 6bff984ab3eeab79349c38504e9b595d84e75e2c Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Thu, 1 Mar 2012 13:28:02 +0100 Subject: [PATCH 2/2] 1.1-R4 Workaround removed --- .../limitedcreative/store/InvYamlStorage.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/de/jaschastarke/minecraft/limitedcreative/store/InvYamlStorage.java b/src/de/jaschastarke/minecraft/limitedcreative/store/InvYamlStorage.java index 44fee87..f211d22 100644 --- a/src/de/jaschastarke/minecraft/limitedcreative/store/InvYamlStorage.java +++ b/src/de/jaschastarke/minecraft/limitedcreative/store/InvYamlStorage.java @@ -17,11 +17,7 @@ */ package de.jaschastarke.minecraft.limitedcreative.store; -import java.io.BufferedReader; -import java.io.BufferedWriter; import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; import java.io.IOException; import org.bukkit.configuration.file.YamlConfiguration; @@ -40,31 +36,6 @@ public class InvYamlStorage extends InvConfStorage { @Override public void load(Inventory pinv, Target target) { -// BEGIN: VERY dirty Workaround for 1.1-R4-Bug (will be removed when r5 released) - try { - BufferedReader in = new BufferedReader(new FileReader(getFile(pinv, target))); - String line; - StringBuilder file = new StringBuilder(); - Boolean changed = false; - while ((line = in.readLine()) != null) { - if (!line.matches("\\s*==:\\s+org\\.bukkit\\.inventory\\.ItemStack\\s*")) { - file.append(line); - file.append("\n"); - } else { - changed = true; - } - } - in.close(); - - if (changed) { - BufferedWriter out = new BufferedWriter(new FileWriter(getFile(pinv, target))); - out.write(file.toString()); - out.close(); - } - } catch (IOException e1) { - e1.printStackTrace(); - } -// END: workaround load(pinv, YamlConfiguration.loadConfiguration(getFile(pinv, target))); }