Import ItemStack and minor cleanup.

This commit is contained in:
garbagemule 2012-12-20 12:35:42 +01:00
parent d9f349e46f
commit df605b13fb
3 changed files with 8 additions and 10 deletions

View File

@ -56,7 +56,7 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerPreLoginEvent; import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
@ -232,12 +232,9 @@ public class ArenaListener
// Otherwise, block was placed during a session. // Otherwise, block was placed during a session.
arena.addBlock(b); arena.addBlock(b);
switch (b.getType()){ if (b.getType() == Material.WOODEN_DOOR || b.getType() == Material.IRON_DOOR_BLOCK) {
// For doors, add the block just above (so we get both halves) // For doors, add the block just above (so we get both halves)
case WOODEN_DOOR: arena.addBlock(b.getRelative(0, 1, 0));
case IRON_DOOR_BLOCK:
arena.addBlock(b.getRelative(0, 1, 0));
break;
} }
} }
@ -957,8 +954,8 @@ public class ArenaListener
Messenger.tellPlayer(p, Msg.MISC_COMMAND_NOT_ALLOWED); Messenger.tellPlayer(p, Msg.MISC_COMMAND_NOT_ALLOWED);
} }
public void onPlayerPreLogin(PlayerPreLoginEvent event) { public void onPlayerPreLogin(PlayerLoginEvent event) {
Player p = plugin.getServer().getPlayer(event.getName()); Player p = event.getPlayer();
if (p == null || !p.isOnline()) return; if (p == null || !p.isOnline()) return;
Arena arena = plugin.getArenaMaster().getArenaWithPlayer(p); Arena arena = plugin.getArenaMaster().getArenaWithPlayer(p);

View File

@ -228,7 +228,7 @@ public class MAGlobalListener implements Listener
if (!am.notifyOnUpdates() || !event.getPlayer().isOp()) return; if (!am.notifyOnUpdates() || !event.getPlayer().isOp()) return;
final Player p = event.getPlayer(); final Player p = event.getPlayer();
plugin.getServer().getScheduler().scheduleAsyncDelayedTask(plugin, plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,
new Runnable() new Runnable()
{ {
public void run() public void run()
@ -295,7 +295,7 @@ public class MAGlobalListener implements Listener
} }
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void playerPreLogin(PlayerPreLoginEvent event) { public void playerPreLogin(PlayerLoginEvent event) {
for (Arena arena : am.getArenas()) { for (Arena arena : am.getArenas()) {
arena.getEventListener().onPlayerPreLogin(event); arena.getEventListener().onPlayerPreLogin(event);
} }

View File

@ -17,6 +17,7 @@ import org.bukkit.entity.Skeleton;
import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.entity.Slime; import org.bukkit.entity.Slime;
import org.bukkit.entity.Wolf; import org.bukkit.entity.Wolf;
import org.bukkit.inventory.ItemStack;
import com.garbagemule.MobArena.MobArena; import com.garbagemule.MobArena.MobArena;
import com.garbagemule.MobArena.framework.Arena; import com.garbagemule.MobArena.framework.Arena;