From fdf0548beeb60561d053afaa7a2ee747a4216fc0 Mon Sep 17 00:00:00 2001 From: CypherX Date: Fri, 1 Apr 2011 00:20:04 -0400 Subject: [PATCH] Compatible with CraftBukkit #612 --- src/com/cypherx/xauth/Settings.java | 6 ++--- src/com/cypherx/xauth/Strings.java | 4 ++-- src/com/cypherx/xauth/xAuth.java | 23 ++++++++++--------- src/com/cypherx/xauth/xAuthBlockListener.java | 4 ++-- .../cypherx/xauth/xAuthPlayerListener.java | 22 +++++++++--------- src/plugin.yml | 2 +- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/com/cypherx/xauth/Settings.java b/src/com/cypherx/xauth/Settings.java index 8560854..7ac077d 100644 --- a/src/com/cypherx/xauth/Settings.java +++ b/src/com/cypherx/xauth/Settings.java @@ -20,8 +20,8 @@ public class Settings "login.strikes.enabled", "login.strikes.amount", "security.filter.enabled", - "security.filter.allowed", - "security.filter.blankname" + "security.filter.allowed" + //"security.filter.blankname" }; private static final String[][] keyUpdates = @@ -60,7 +60,7 @@ public class Settings defaults.put("login.strikes.amount", 5); defaults.put("security.filter.enabled", true); defaults.put("security.filter.allowed", "abcdefghijklmnopqrstuvwxyz0123456789_- ()[]{}"); - defaults.put("security.filter.blankname", true); + //defaults.put("security.filter.blankname", true); } public void updateKeys() diff --git a/src/com/cypherx/xauth/Strings.java b/src/com/cypherx/xauth/Strings.java index 747f433..5bdd8c9 100644 --- a/src/com/cypherx/xauth/Strings.java +++ b/src/com/cypherx/xauth/Strings.java @@ -15,7 +15,7 @@ public class Strings "changepw.err.disabled", "changepw.err.registered", "changepw.success.self", "changepw.success.other", "unregister.usage", "unregister.success", "reload.success", "toggle.usage", "toggle.err.permission", "toggle.success.reg", "toggle.success.pw", "toggle.success.save", "misc.illegal", "misc.reloaded", "misc.enabled", "misc.disabled", - "misc.filterkickmsg", "misc.blankkickmsg" + "misc.filterkickmsg"/*, "misc.blankkickmsg"*/ }; private static final String[][] keyUpdates = {}; @@ -79,7 +79,7 @@ public class Strings defaults.put("misc.enabled", "enabled"); defaults.put("misc.disabled", "disabled"); defaults.put("misc.filterkickmsg", "Your name contains one or more illegal characters."); - defaults.put("misc.blankkickmsg", "Blank names are not allowed."); + //defaults.put("misc.blankkickmsg", "Blank names are not allowed."); } private void updateKeys() diff --git a/src/com/cypherx/xauth/xAuth.java b/src/com/cypherx/xauth/xAuth.java index 762b57b..c05e489 100644 --- a/src/com/cypherx/xauth/xAuth.java +++ b/src/com/cypherx/xauth/xAuth.java @@ -1,5 +1,5 @@ -//xAuth 1.1.5a -//Built against Bukkit #486 and CraftBukkit #602 +//xAuth 1.1.6 +//Built against Bukkit #493 and CraftBukkit #612 package com.cypherx.xauth; @@ -123,20 +123,20 @@ public class xAuth extends JavaPlugin pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Event.Priority.Lowest, this); pm.registerEvent(Event.Type.PLAYER_DROP_ITEM, playerListener, Event.Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Event.Priority.Highest, this); - //pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Highest, this); - pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Event.Priority.Highest, this); + pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Event.Priority.Highest, this); + //pm.registerEvent(Event.Type.PLAYER_ITEM, playerListener, Event.Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Event.Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Event.Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_MOVE, playerListener, Event.Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Event.Priority.Lowest, this); pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Highest, this); - pm.registerEvent(Event.Type.BLOCK_INTERACT, blockListener, Priority.Highest, this); - //pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Highest, this); - pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Highest, this); + //pm.registerEvent(Event.Type.BLOCK_INTERACT, blockListener, Priority.Highest, this); + pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Highest, this); + //pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Highest, this); - //pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this); - pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Highest, this); + pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this); + //pm.registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.Highest, this); pm.registerEvent(Event.Type.ENTITY_TARGET, entityListener, Priority.Highest, this); System.out.println("[" + pdfFile.getName() + "]" + " v" + pdfFile.getVersion() + " Enabled!"); @@ -144,7 +144,7 @@ public class xAuth extends JavaPlugin //autosave stuff fullyEnabled = true; } - + public void getAuths() { System.out.println("[" + pdfFile.getName() + "] Loading player accounts.."); @@ -397,7 +397,8 @@ public class xAuth extends JavaPlugin CraftWorld cWorld = (CraftWorld)player.getWorld(); CraftPlayer cPlayer = (CraftPlayer)player; - cWorld.getHandle().m().d().a(cPlayer.getHandle()); + //cWorld.getHandle().m().d().a(cPlayer.getHandle()); + cWorld.getHandle().o().d().a(cPlayer.getHandle()); } //SESSION FUNCTIONS diff --git a/src/com/cypherx/xauth/xAuthBlockListener.java b/src/com/cypherx/xauth/xAuthBlockListener.java index 1d2dd3d..3cff06b 100644 --- a/src/com/cypherx/xauth/xAuthBlockListener.java +++ b/src/com/cypherx/xauth/xAuthBlockListener.java @@ -27,7 +27,7 @@ public class xAuthBlockListener extends BlockListener } //Prevents player from using switches, buttons, etc. - public void onBlockInteract(BlockInteractEvent event) + /*public void onBlockInteract(BlockInteractEvent event) { if (event.isCancelled()) return; @@ -37,7 +37,7 @@ public class xAuthBlockListener extends BlockListener Player player = (Player)event.getEntity(); plugin.handleEvent(player, event); } - } + }*/ //Prevents player from placing blocks public void onBlockPlace(BlockPlaceEvent event) diff --git a/src/com/cypherx/xauth/xAuthPlayerListener.java b/src/com/cypherx/xauth/xAuthPlayerListener.java index 08d1607..b10705c 100644 --- a/src/com/cypherx/xauth/xAuthPlayerListener.java +++ b/src/com/cypherx/xauth/xAuthPlayerListener.java @@ -24,11 +24,11 @@ public class xAuthPlayerListener extends PlayerListener if (xAuth.settings.getBool("security.filter.enabled") && !plugin.isNameLegal(player.getName())) event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.filterkickmsg")); - if (xAuth.settings.getBool("security.filter.blankname") && player.getName().trim().equals("")) - event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.blankkickmsg")); + //if (xAuth.settings.getBool("security.filter.blankname") && player.getName().trim().equals("")) + //event.disallow(PlayerLoginEvent.Result.KICK_OTHER, xAuth.strings.getString("misc.blankkickmsg")); } - public void onPlayerJoin(PlayerEvent event) + public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); @@ -43,13 +43,13 @@ public class xAuthPlayerListener extends PlayerListener } } - public void onPlayerQuit(PlayerEvent event) + public void onPlayerQuit(PlayerQuitEvent event) { plugin.logout(event.getPlayer()); } //Prevents players from executing commands - public void onPlayerCommandPreprocess(PlayerChatEvent event) + public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { if (event.isCancelled()) return; @@ -88,16 +88,16 @@ public class xAuthPlayerListener extends PlayerListener } //Prevents player from using an item such as food - public void onPlayerItem(PlayerItemEvent event) + /*public void onPlayerItem(PlayerItemEvent event) { if (event.isCancelled()) return; Player player = event.getPlayer(); plugin.handleEvent(player, event); - } + }*/ - /*public void onPlayerInteract(PlayerInteractEvent event) + public void onPlayerInteract(PlayerInteractEvent event) { //if (!xAuth.settings.getBool("limit.interact")) //return; @@ -107,7 +107,7 @@ public class xAuthPlayerListener extends PlayerListener Player player = event.getPlayer(); plugin.handleEvent(player, event); - }*/ + } //Prevents player from moving public void onPlayerMove(PlayerMoveEvent event) @@ -131,8 +131,8 @@ public class xAuthPlayerListener extends PlayerListener plugin.handleEvent(player, event); if (event.isCancelled()) - player.teleportTo(event.getFrom()); - //player.teleport(event.getFrom()); + player.teleport(event.getFrom()); + //player.teleportTo(event.getFrom()); } //Prevents player from picking up items diff --git a/src/plugin.yml b/src/plugin.yml index 36f49bc..586a4d0 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: xAuth main: com.cypherx.xauth.xAuth -version: 1.1.5a +version: 1.1.6 commands: register: