summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2013-01-31 14:03:27 -0500
committerIaccidentally <coryhuckaby@gmail.com>2013-01-31 14:03:27 -0500
commitd1b463c2ce5e8207441770dc63f0a6df55fff5a4 (patch)
tree1f5af5e88777e8af7e86991261891b15104dc29b /EssentialsProtect/src
parent1f649dbc958cd8cf9b6017fe02b7b0dfa9c4ec82 (diff)
downloadEssentials-d1b463c2ce5e8207441770dc63f0a6df55fff5a4.tar
Essentials-d1b463c2ce5e8207441770dc63f0a6df55fff5a4.tar.gz
Essentials-d1b463c2ce5e8207441770dc63f0a6df55fff5a4.tar.lz
Essentials-d1b463c2ce5e8207441770dc63f0a6df55fff5a4.tar.xz
Essentials-d1b463c2ce5e8207441770dc63f0a6df55fff5a4.zip
Update to 1.4.7 R1 :: remove calls to ScheduleAsyncDelayedTask, as it is deprecated :: cleanup :: WARNING: This commit may or may not be stable
Diffstat (limited to 'EssentialsProtect/src')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
index 876c8a575..e1a61f0cf 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.protect.data;
-import java.util.Map.Entry;
import java.util.*;
+import java.util.Map.Entry;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.plugin.Plugin;
@@ -123,11 +123,13 @@ public class ProtectedBlockMemory implements IProtectedBlock
importProtections(storage.exportProtections());
}
+ @Override
public void clearProtections()
{
blocks.clear();
}
+ @Override
public final void importProtections(final List<OwnedBlock> blocks)
{
for (OwnedBlock ownedBlock : blocks)
@@ -141,6 +143,7 @@ public class ProtectedBlockMemory implements IProtectedBlock
}
}
+ @Override
public List<OwnedBlock> exportProtections()
{
final List<OwnedBlock> blockList = new ArrayList<OwnedBlock>(blocks.size());
@@ -160,12 +163,14 @@ public class ProtectedBlockMemory implements IProtectedBlock
return blockList;
}
+ @Override
public void protectBlock(final Block block, final String playerName)
{
final ProtectedLocation pl = new ProtectedLocation(block, getWorldId(block.getWorld()));
protectBlock(pl, playerName);
- plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()
+ plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable()
{
+ @Override
public void run()
{
storage.protectBlock(block, playerName);
@@ -173,7 +178,7 @@ public class ProtectedBlockMemory implements IProtectedBlock
});
}
- private final void protectBlock(ProtectedLocation pl, String playerName)
+ private void protectBlock(ProtectedLocation pl, String playerName)
{
int playerId = getPlayerId(playerName);
ProtectedBy pb = blocks.get(pl);
@@ -185,6 +190,7 @@ public class ProtectedBlockMemory implements IProtectedBlock
pb.add(playerId);
}
+ @Override
public boolean isProtected(Block block, String playerName)
{
int playerId = getPlayerId(playerName);
@@ -193,6 +199,7 @@ public class ProtectedBlockMemory implements IProtectedBlock
return !pb.contains(playerId);
}
+ @Override
public List<String> getOwners(Block block)
{
ProtectedLocation pl = new ProtectedLocation(block, getWorldId(block.getWorld()));
@@ -200,12 +207,14 @@ public class ProtectedBlockMemory implements IProtectedBlock
return pb.getPlayers(playerNames);
}
+ @Override
public int unprotectBlock(final Block block)
{
ProtectedLocation pl = new ProtectedLocation(block, getWorldId(block.getWorld()));
ProtectedBy pb = blocks.remove(pl);
- plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, new Runnable()
+ plugin.getServer().getScheduler().runTaskAsynchronously(plugin, new Runnable()
{
+ @Override
public void run()
{
storage.unprotectBlock(block);
@@ -241,6 +250,7 @@ public class ProtectedBlockMemory implements IProtectedBlock
return id;
}
+ @Override
public void onPluginDeactivation()
{
storage.onPluginDeactivation();