From 0f1eb9b4f910b4f61f4c89fbad14b6485c372756 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 14 Dec 2011 16:04:15 +0100 Subject: Moved signs code to a new module --- EssentialsProtect/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/plugin.yml b/EssentialsProtect/src/plugin.yml index 6407c45ee..bbe628e67 100644 --- a/EssentialsProtect/src/plugin.yml +++ b/EssentialsProtect/src/plugin.yml @@ -3,7 +3,7 @@ name: EssentialsProtect main: com.earth2me.essentials.protect.EssentialsProtect # Note to developers: This next line cannot change, or the automatic versioning system will break. version: TeamCity -website: http://www.earth2me.net:8001/ +website: http://tiny.cc/EssentialsWiki description: Provides protection for various parts of the world. authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits] softdepend: [Essentials] \ No newline at end of file -- cgit v1.2.3 From 0155bcedb7f00726d0b2f14e612a5342322a8278 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 14 Dec 2011 16:31:08 +0100 Subject: Updated all modules to new api, some settings are still missing --- .../com/earth2me/essentials/protect/EssentialsConnect.java | 14 +++++++------- .../essentials/protect/EssentialsProtectBlockListener.java | 8 ++++---- .../protect/EssentialsProtectEntityListener.java | 12 ++++++------ .../protect/EssentialsProtectPlayerListener.java | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 569123cd5..7f9ec44e4 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -1,8 +1,8 @@ package com.earth2me.essentials.protect; -import com.earth2me.essentials.IConf; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IReload; +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.protect.data.ProtectedBlockMemory; import com.earth2me.essentials.protect.data.ProtectedBlockMySQL; import com.earth2me.essentials.protect.data.ProtectedBlockSQLite; @@ -45,7 +45,7 @@ public class EssentialsConnect return ess; } - public void alert(final User user, final String item, final String type) + public void alert(final IUser user, final String item, final String type) { final Location loc = user.getLocation(); final String warnMessage = _("alertFormat", user.getName(), type, item, @@ -54,7 +54,7 @@ public class EssentialsConnect LOGGER.log(Level.WARNING, warnMessage); for (Player p : ess.getServer().getOnlinePlayers()) { - final User alertUser = ess.getUser(p); + final IUser alertUser = ess.getUser(p); if (alertUser.isAuthorized("essentials.protect.alerts")) { alertUser.sendMessage(warnMessage); @@ -63,10 +63,10 @@ public class EssentialsConnect } - private class ProtectReloader implements IConf + private class ProtectReloader implements IReload { @Override - public void reloadConfig() + public void onReload() { if (protect.getStorage() != null) { diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index 03ad19cb4..f30de1d81 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -1,8 +1,8 @@ package com.earth2me.essentials.protect; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.protect.data.IProtectedBlock; import java.util.ArrayList; import java.util.List; @@ -31,7 +31,7 @@ public class EssentialsProtectBlockListener extends BlockListener return; } - final User user = ess.getUser(event.getPlayer()); + final IUser user = ess.getUser(event.getPlayer()); if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) { @@ -228,7 +228,7 @@ public class EssentialsProtectBlockListener extends BlockListener { return; } - final User user = ess.getUser(event.getPlayer()); + final IUser user = ess.getUser(event.getPlayer()); if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) { diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 89167b2b9..41b4a69a5 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.protect; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.craftbukkit.FakeExplosion; import java.util.Locale; import org.bukkit.Material; @@ -39,7 +39,7 @@ public class EssentialsProtectEntityListener extends EntityListener return; } - final User user = ess.getUser(target); + final IUser user = target instanceof Player ? ess.getUser((Player)target) : null; if (event instanceof EntityDamageByBlockEvent) { final DamageCause cause = event.getCause(); @@ -77,7 +77,7 @@ public class EssentialsProtectEntityListener extends EntityListener { final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; final Entity eAttack = edEvent.getDamager(); - final User attacker = ess.getUser(eAttack); + final IUser attacker = eAttack instanceof Player ? ess.getUser((Player)eAttack) : null; // PVP Settings if (target instanceof Player && eAttack instanceof Player @@ -134,7 +134,7 @@ public class EssentialsProtectEntityListener extends EntityListener || (((Projectile)edEvent.getDamager()).getShooter() instanceof Player && prot.getSettingBool(ProtectConfig.disable_pvp) && (!user.isAuthorized("essentials.protect.pvp") - || !ess.getUser(((Projectile)edEvent.getDamager()).getShooter()).isAuthorized("essentials.protect.pvp"))))) + || !ess.getUser((Player)((Projectile)edEvent.getDamager()).getShooter()).isAuthorized("essentials.protect.pvp"))))) { event.setCancelled(true); return; @@ -299,7 +299,7 @@ public class EssentialsProtectEntityListener extends EntityListener { return; } - final User user = ess.getUser(event.getTarget()); + final IUser user = ess.getUser((Player)event.getTarget()); if ((event.getReason() == TargetReason.CLOSEST_PLAYER || event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY || event.getReason() == TargetReason.PIG_ZOMBIE_TARGET diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java index ad7831a53..a3f13a428 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java @@ -1,8 +1,8 @@ package com.earth2me.essentials.protect; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IUser; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.event.block.Action; @@ -26,7 +26,7 @@ public class EssentialsProtectPlayerListener extends PlayerListener public void onPlayerInteract(final PlayerInteractEvent event) { // Do not return if cancelled, because the interact event has 2 cancelled states. - final User user = ess.getUser(event.getPlayer()); + final IUser user = ess.getUser(event.getPlayer()); if (event.hasItem() && (event.getItem().getType() == Material.WATER_BUCKET -- cgit v1.2.3 From d2c1b24e4bea0b54b1af2a3f78e78eb2c840b51b Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 2 Jan 2012 23:45:50 +0100 Subject: Prototype for grouping permissions into an enum --- .../earth2me/essentials/protect/Permissions.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java new file mode 100644 index 000000000..699af6a9b --- /dev/null +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -0,0 +1,25 @@ +package com.earth2me.essentials.protect; + +import com.earth2me.essentials.api.IPermission; +import java.util.Locale; + + +public enum Permissions implements IPermission +{ + PREVENTDAMAGE_FALL, + PREVENTDAMAGE_NONE + ; + private static final String base = "essentials.protect."; + private final String permission; + + private Permissions() + { + permission = base + toString().toLowerCase(Locale.ENGLISH).replace('_', '.'); + } + + @Override + public String getPermission() + { + return permission; + } +} -- cgit v1.2.3 From 7153676137a23f6780b21682456377b0f86b6fb1 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 3 Jan 2012 00:07:44 +0100 Subject: Starting to break Protect --- .../essentials/protect/EssentialsConnect.java | 11 +++++---- .../essentials/protect/EssentialsProtect.java | 28 ++++++++++++++-------- .../protect/EssentialsProtectBlockListener.java | 4 ++-- .../com/earth2me/essentials/protect/IProtect.java | 20 +++++++--------- .../earth2me/essentials/protect/Permissions.java | 1 + .../earth2me/essentials/protect/ProtectConfig.java | 10 ++++---- .../earth2me/essentials/protect/ProtectHolder.java | 22 +++++++++++++++++ 7 files changed, 62 insertions(+), 34 deletions(-) create mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 7f9ec44e4..6f724ac87 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -1,13 +1,13 @@ package com.earth2me.essentials.protect; -import com.earth2me.essentials.api.IReload; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IReload; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.protect.data.ProtectedBlockMemory; import com.earth2me.essentials.protect.data.ProtectedBlockMySQL; import com.earth2me.essentials.protect.data.ProtectedBlockSQLite; import java.beans.PropertyVetoException; -import static com.earth2me.essentials.I18n._; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; @@ -30,7 +30,7 @@ public class EssentialsConnect ess = (IEssentials)essPlugin; protect = (IProtect)essProtect; ProtectReloader pr = new ProtectReloader(); - pr.reloadConfig(); + pr.onReload(); ess.addReloadListener(pr); LOGGER.info(_("loadinfo", essProtect.getDescription().getName(), essProtect.getDescription().getVersion(), "essentials team")); @@ -72,7 +72,8 @@ public class EssentialsConnect { protect.getStorage().onPluginDeactivation(); } - for (ProtectConfig protectConfig : ProtectConfig.values()) + + /*for (ProtectConfig protectConfig : ProtectConfig.values()) { if (protectConfig.isList()) { @@ -87,7 +88,7 @@ public class EssentialsConnect protect.getSettingsBoolean().put(protectConfig, ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), protectConfig.getDefaultValueBoolean())); } - } + }*/ if (protect.getSettingString(ProtectConfig.datatype).equalsIgnoreCase("mysql")) { diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index e313298cd..43975216e 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -1,9 +1,6 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.protect.data.IProtectedBlock; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; import java.util.logging.Filter; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -20,11 +17,12 @@ public class EssentialsProtect extends JavaPlugin implements IProtect { private static final Logger LOGGER = Logger.getLogger("Minecraft"); private static com.mchange.v2.log.MLogger C3P0logger; - private final transient Map settingsBoolean = new EnumMap(ProtectConfig.class); - private final transient Map settingsString = new EnumMap(ProtectConfig.class); - private final transient Map> settingsList = new EnumMap>(ProtectConfig.class); + //private final transient Map settingsBoolean = new EnumMap(ProtectConfig.class); + //private final transient Map settingsString = new EnumMap(ProtectConfig.class); + //private final transient Map> settingsList = new EnumMap>(ProtectConfig.class); private transient IProtectedBlock storage = null; private transient EssentialsConnect ess = null; + private transient ProtectHolder settings = null; @Override public void onLoad() @@ -95,12 +93,12 @@ public class EssentialsProtect extends JavaPlugin implements IProtect LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now."); } - @Override + /*@Override public boolean checkProtectionItems(final ProtectConfig list, final int id) { final List itemList = settingsList.get(list); return itemList != null && !itemList.isEmpty() && itemList.contains(id); - } + }*/ @Override public IProtectedBlock getStorage() @@ -119,7 +117,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect return ess; } - public Map getSettingsBoolean() + /*public Map getSettingsBoolean() { return settingsBoolean; } @@ -146,7 +144,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect { final String str = settingsString.get(protectConfig); return str == null ? protectConfig.getDefaultValueString() : str; - } + }*/ public void onDisable() { @@ -163,4 +161,14 @@ public class EssentialsProtect extends JavaPlugin implements IProtect { } } + + public ProtectHolder getSettings() + { + return settings; + } + + public void setSettings(final ProtectHolder settings) + { + this.settings = settings; + } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index f30de1d81..abbbe5939 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -33,7 +33,7 @@ public class EssentialsProtectBlockListener extends BlockListener final IUser user = ess.getUser(event.getPlayer()); - if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) + if (prot.getSettingBool(ProtectConfig.disable_build) && !user.isAuthorized(Permissions.BUILD)) { event.setCancelled(true); return; @@ -230,7 +230,7 @@ public class EssentialsProtectBlockListener extends BlockListener } final IUser user = ess.getUser(event.getPlayer()); - if (prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) + if (prot.getSettingBool(ProtectConfig.disable_build) && !user.isAuthorized(Permissions.BUILD)) { event.setCancelled(true); return; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java index afcb6e8ce..d25661bf8 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java @@ -1,28 +1,24 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.protect.data.IProtectedBlock; -import java.util.List; -import java.util.Map; import org.bukkit.plugin.Plugin; public interface IProtect extends Plugin { - boolean checkProtectionItems(final ProtectConfig list, final int id); - - boolean getSettingBool(final ProtectConfig protectConfig); - - String getSettingString(final ProtectConfig protectConfig); - +// boolean checkProtectionItems(final ProtectConfig list, final int id); +// boolean getSettingBool(final ProtectConfig protectConfig); +// String getSettingString(final ProtectConfig protectConfig); IProtectedBlock getStorage(); void setStorage(IProtectedBlock pb); EssentialsConnect getEssentialsConnect(); - Map getSettingsBoolean(); - - Map getSettingsString(); +// Map getSettingsBoolean(); +// Map getSettingsString(); +// Map> getSettingsList(); + ProtectHolder getSettings(); - Map> getSettingsList(); + void setSettings(ProtectHolder settings); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 699af6a9b..04b9d47df 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -6,6 +6,7 @@ import java.util.Locale; public enum Permissions implements IPermission { + BUILD, PREVENTDAMAGE_FALL, PREVENTDAMAGE_NONE ; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java index bee8d0f4d..feeeb19df 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.protect; -public enum ProtectConfig +/*public enum ProtectConfig { datatype("protect.datatype", "sqlite"), mysqlDB("protect.mysqlDb", "jdbc:mysql://localhost:3306/minecraft"), @@ -87,7 +87,7 @@ public enum ProtectConfig /** * @return the configName - */ + *//* public String getConfigName() { return configName; @@ -95,7 +95,7 @@ public enum ProtectConfig /** * @return the default value String - */ + *//* public String getDefaultValueString() { return defValueString; @@ -103,7 +103,7 @@ public enum ProtectConfig /** * @return the default value boolean - */ + *//* public boolean getDefaultValueBoolean() { return defValueBoolean; @@ -118,4 +118,4 @@ public enum ProtectConfig { return isList; } -} +}*/ diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java new file mode 100644 index 000000000..2e2451397 --- /dev/null +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java @@ -0,0 +1,22 @@ +package com.earth2me.essentials.protect; + +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.settings.protect.Protect; +import com.earth2me.essentials.storage.AsyncStorageObjectHolder; +import java.io.File; +import java.io.IOException; + + +public class ProtectHolder extends AsyncStorageObjectHolder +{ + public ProtectHolder(IEssentials ess) + { + super(ess, Protect.class); + } + + @Override + public File getStorageFile() throws IOException + { + return new File(ess.getDataFolder(), "protect.yml"); + } +} -- cgit v1.2.3 From 869d79ae73e30a034c2c406d84ce41bcd7c2d67a Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 3 Jan 2012 01:53:38 +0100 Subject: This feels so good D: --- .../earth2me/essentials/protect/Permissions.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 04b9d47df..0fedc33cf 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -1,7 +1,10 @@ package com.earth2me.essentials.protect; +import com.earth2me.essentials.Util; import com.earth2me.essentials.api.IPermission; import java.util.Locale; +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionDefault; public enum Permissions implements IPermission @@ -12,10 +15,18 @@ public enum Permissions implements IPermission ; private static final String base = "essentials.protect."; private final String permission; + private final PermissionDefault defaultPerm; + private transient Permission bukkitPerm = null; private Permissions() + { + this(PermissionDefault.OP); + } + + private Permissions(final PermissionDefault defaultPerm) { permission = base + toString().toLowerCase(Locale.ENGLISH).replace('_', '.'); + this.defaultPerm = defaultPerm; } @Override @@ -23,4 +34,23 @@ public enum Permissions implements IPermission { return permission; } + + @Override + public Permission getBukkitPermission() + { + if (bukkitPerm != null) + { + return bukkitPerm; + } + else + { + return Util.registerPermission(getPermission(), getPermissionDefault()); + } + } + + @Override + public PermissionDefault getPermissionDefault() + { + return this.defaultPerm; + } } -- cgit v1.2.3 From 801562ac2c0c64770eeaee5cc5815954cd5af72e Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 3 Jan 2012 02:51:19 +0100 Subject: More work on Protect --- .../essentials/protect/BlockBreakPermissions.java | 43 ++++ .../essentials/protect/BlockPlacePermissions.java | 42 +++ .../protect/EssentialsProtectBlockListener.java | 281 ++++++++++++--------- .../protect/EssentialsProtectEntityListener.java | 25 +- .../earth2me/essentials/protect/Permissions.java | 12 +- 5 files changed, 262 insertions(+), 141 deletions(-) create mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java create mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java new file mode 100644 index 000000000..74ebe38dc --- /dev/null +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java @@ -0,0 +1,43 @@ +package com.earth2me.essentials.protect; + +import com.earth2me.essentials.api.IPermission; +import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Map; +import org.bukkit.Material; +import org.bukkit.permissions.PermissionDefault; + +public class BlockBreakPermissions extends AbstractSuperpermsPermission{ + private static Map permissions = new EnumMap(Material.class); + private static final String base = "essentials.protect.blockbreak."; + private final String permission; + + public static IPermission getPermission(Material mat) + { + IPermission perm = permissions.get(mat); + if (perm == null) { + perm = new BlockBreakPermissions(mat.toString().toLowerCase(Locale.ENGLISH)); + permissions.put(mat, perm); + } + return perm; + } + + private BlockBreakPermissions(String matName) + { + this.permission = base + matName; + } + + @Override + public String getPermission() + { + return this.permission; + } + + @Override + public PermissionDefault getPermissionDefault() + { + return PermissionDefault.TRUE; + } +} + diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java new file mode 100644 index 000000000..23ce7e053 --- /dev/null +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java @@ -0,0 +1,42 @@ +package com.earth2me.essentials.protect; + +import com.earth2me.essentials.api.IPermission; +import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Map; +import org.bukkit.Material; +import org.bukkit.permissions.PermissionDefault; + +public class BlockPlacePermissions extends AbstractSuperpermsPermission{ + private static Map permissions = new EnumMap(Material.class); + private static final String base = "essentials.protect.blockplace."; + private final String permission; + + public static IPermission getPermission(Material mat) + { + IPermission perm = permissions.get(mat); + if (perm == null) { + perm = new BlockPlacePermissions(mat.toString().toLowerCase(Locale.ENGLISH)); + permissions.put(mat, perm); + } + return perm; + } + + private BlockPlacePermissions(String matName) + { + this.permission = base + matName; + } + + @Override + public String getPermission() + { + return this.permission; + } + + @Override + public PermissionDefault getPermissionDefault() + { + return PermissionDefault.TRUE; + } +} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index abbbe5939..b67025cba 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -32,64 +32,72 @@ public class EssentialsProtectBlockListener extends BlockListener } final IUser user = ess.getUser(event.getPlayer()); - - if (prot.getSettingBool(ProtectConfig.disable_build) && !user.isAuthorized(Permissions.BUILD)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; - } + if (!user.isAuthorized(Permissions.BUILD)) + { + event.setCancelled(true); + return; + } - final Block blockPlaced = event.getBlockPlaced(); - final int id = blockPlaced.getTypeId(); + final Block blockPlaced = event.getBlockPlaced(); + final int id = blockPlaced.getTypeId(); - if (prot.checkProtectionItems(ProtectConfig.blacklist_placement, id) && !user.isAuthorized("essentials.protect.exemptplacement")) - { - event.setCancelled(true); - return; - } + if (!user.isAuthorized(BlockPlacePermissions.getPermission(blockPlaced.getType()))) + { + event.setCancelled(true); + return; + } - if (prot.checkProtectionItems(ProtectConfig.alert_on_placement, id)) - { - prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced")); - } + if (settings.getData().getAlertOnPlacement().contains(blockPlaced.getType())) + { + prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced")); + } - final Block below = blockPlaced.getRelative(BlockFace.DOWN); - if ((below.getType() == Material.RAILS || below.getType() == Material.POWERED_RAIL || below.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.prevent_block_on_rail) - && prot.getStorage().isProtected(below, user.getName())) - { - event.setCancelled(true); - return; - } + final Block below = blockPlaced.getRelative(BlockFace.DOWN); + if ((below.getType() == Material.RAILS || below.getType() == Material.POWERED_RAIL || below.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isPreventBlockAboveRails() + && prot.getStorage().isProtected(below, user.getName())) + { + event.setCancelled(true); + return; + } - final List protect = new ArrayList(); - if ((blockPlaced.getType() == Material.RAILS || blockPlaced.getType() == Material.POWERED_RAIL || blockPlaced.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails) - && user.isAuthorized("essentials.protect")) - { - protect.add(blockPlaced); - if (prot.getSettingBool(ProtectConfig.protect_below_rails) - && !prot.getStorage().isProtected(blockPlaced.getRelative(BlockFace.DOWN), user.getName())) + final List protect = new ArrayList(); + if ((blockPlaced.getType() == Material.RAILS || blockPlaced.getType() == Material.POWERED_RAIL || blockPlaced.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isRails() + && user.isAuthorized("essentials.protect")) { - protect.add(blockPlaced.getRelative(BlockFace.DOWN)); + protect.add(blockPlaced); + if (settings.getData().getSignsAndRails().isBlockBelow() + && !prot.getStorage().isProtected(blockPlaced.getRelative(BlockFace.DOWN), user.getName())) + { + protect.add(blockPlaced.getRelative(BlockFace.DOWN)); + } } - } - if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) - && prot.getSettingBool(ProtectConfig.protect_signs) - && user.isAuthorized("essentials.protect")) - { - protect.add(blockPlaced); - if (prot.getSettingBool(ProtectConfig.protect_against_signs) - && event.getBlockAgainst().getType() != Material.SIGN_POST - && event.getBlockAgainst().getType() != Material.WALL_SIGN - && !prot.getStorage().isProtected(event.getBlockAgainst(), user.getName())) + if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) + && settings.getData().getSignsAndRails().isSigns() + && user.isAuthorized("essentials.protect")) { - protect.add(event.getBlockAgainst()); + protect.add(blockPlaced); + if (settings.getData().getSignsAndRails().isBlockBelow() + && event.getBlockAgainst().getType() != Material.SIGN_POST + && event.getBlockAgainst().getType() != Material.WALL_SIGN + && !prot.getStorage().isProtected(event.getBlockAgainst(), user.getName())) + { + protect.add(event.getBlockAgainst()); + } + } + for (Block block : protect) + { + prot.getStorage().protectBlock(block, user.getName()); } } - for (Block block : protect) + finally { - prot.getStorage().protectBlock(block, user.getName()); + settings.unlock(); } } @@ -100,47 +108,56 @@ public class EssentialsProtectBlockListener extends BlockListener { return; } - final Block block = event.getBlock(); - if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails)) - { - event.setCancelled(true); - return; - } - if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) - && prot.getSettingBool(ProtectConfig.protect_signs)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; - } - if (event.getBlock().getType() == Material.OBSIDIAN - || event.getBlock().getRelative(BlockFace.DOWN).getType() == Material.OBSIDIAN) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_portal_creation)); - return; - } + final Block block = event.getBlock(); + if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isRails()) + { + event.setCancelled(true); + return; + } + if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) + && settings.getData().getSignsAndRails().isSigns()) + { + event.setCancelled(true); + return; + } + if (event.getBlock().getType() == Material.OBSIDIAN + || event.getBlock().getRelative(BlockFace.DOWN).getType() == Material.OBSIDIAN) + { + event.setCancelled(settings.getData().getPrevent().isPortalCreation()); + return; + } - if (event.getCause().equals(BlockIgniteEvent.IgniteCause.SPREAD)) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_fire_spread)); - return; - } + if (event.getCause().equals(BlockIgniteEvent.IgniteCause.SPREAD)) + { + event.setCancelled(settings.getData().getPrevent().isFirespread()); + return; + } - if (event.getCause().equals(BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL)) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_flint_fire)); - return; - } + if (event.getCause().equals(BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) && event.getPlayer() != null) + { + event.setCancelled(ess.getUser(event.getPlayer()).isAuthorized(Permissions.USEFLINTSTEEL)); + return; + } - if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LAVA)) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_lava_fire_spread)); - return; + if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LAVA)) + { + event.setCancelled(settings.getData().getPrevent().isLavaFirespread()); + return; + } + if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LIGHTNING)) + { + event.setCancelled(settings.getData().getPrevent().isLightningFirespread()); + return; + } } - if (event.getCause().equals(BlockIgniteEvent.IgniteCause.LIGHTNING)) + finally { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_lightning_fire_spread)); - return; + settings.unlock(); } } @@ -151,37 +168,46 @@ public class EssentialsProtectBlockListener extends BlockListener { return; } - final Block toBlock = event.getToBlock(); - if ((toBlock.getType() == Material.RAILS || toBlock.getType() == Material.POWERED_RAIL || toBlock.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; - } - if ((toBlock.getType() == Material.WALL_SIGN || toBlock.getType() == Material.SIGN_POST) - && prot.getSettingBool(ProtectConfig.protect_signs)) - { - event.setCancelled(true); - return; - } + final Block toBlock = event.getToBlock(); + if ((toBlock.getType() == Material.RAILS || toBlock.getType() == Material.POWERED_RAIL || toBlock.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isRails()) + { + event.setCancelled(true); + return; + } + if ((toBlock.getType() == Material.WALL_SIGN || toBlock.getType() == Material.SIGN_POST) + && settings.getData().getSignsAndRails().isSigns()) + { + event.setCancelled(true); + return; + } - final Block block = event.getBlock(); - if (block.getType() == Material.WATER || block.getType() == Material.STATIONARY_WATER) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_flow)); - return; - } + final Block block = event.getBlock(); + if (block.getType() == Material.WATER || block.getType() == Material.STATIONARY_WATER) + { + event.setCancelled(settings.getData().getPrevent().isWaterFlow()); + return; + } - if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) - { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_lava_flow)); - return; + if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) + { + event.setCancelled(settings.getData().getPrevent().isLavaFlow()); + return; + } + // TODO: Test if this still works + /* + * if (block.getType() == Material.AIR) { + * event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_bucket_flow)); return; + } + */ } - - if (block.getType() == Material.AIR) + finally { - event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_bucket_flow)); - return; + settings.unlock(); } } @@ -192,22 +218,32 @@ public class EssentialsProtectBlockListener extends BlockListener { return; } - final Block block = event.getBlock(); - if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) && prot.getSettingBool(ProtectConfig.protect_rails)) - { - event.setCancelled(true); - return; - } - if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) - && prot.getSettingBool(ProtectConfig.protect_signs)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; + final Block block = event.getBlock(); + if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isRails()) + { + event.setCancelled(true); + return; + } + if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) + && settings.getData().getSignsAndRails().isSigns()) + { + event.setCancelled(true); + return; + } + if (settings.getData().getPrevent().isFirespread()) + { + event.setCancelled(true); + return; + } } - if (prot.getSettingBool(ProtectConfig.prevent_fire_spread)) + finally { - event.setCancelled(true); - return; + settings.unlock(); } } private final static BlockFace[] faces = new BlockFace[] @@ -230,7 +266,7 @@ public class EssentialsProtectBlockListener extends BlockListener } final IUser user = ess.getUser(event.getPlayer()); - if (prot.getSettingBool(ProtectConfig.disable_build) && !user.isAuthorized(Permissions.BUILD)) + if (!user.isAuthorized(Permissions.BUILD)) { event.setCancelled(true); return; @@ -238,8 +274,7 @@ public class EssentialsProtectBlockListener extends BlockListener final Block block = event.getBlock(); final int typeId = block.getTypeId(); - if (prot.checkProtectionItems(ProtectConfig.blacklist_break, typeId) - && !user.isAuthorized("essentials.protect.exemptbreak")) + if (!user.isAuthorized(BlockBreakPermissions.getPermission(block.getType()))) { event.setCancelled(true); return; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 41b4a69a5..05e062b0b 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -145,43 +145,38 @@ public class EssentialsProtectEntityListener extends EntityListener if (target instanceof Player) { if (cause == DamageCause.FALL - && prot.getSettingBool(ProtectConfig.disable_fall) - && !(user.isAuthorized("essentials.protect.damage.fall") - && !user.isAuthorized("essentials.protect.damage.disable"))) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_FALL) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) { event.setCancelled(true); return; } if (cause == DamageCause.SUFFOCATION - && prot.getSettingBool(ProtectConfig.disable_suffocate) - && !(user.isAuthorized("essentials.protect.damage.suffocation") - && !user.isAuthorized("essentials.protect.damage.disable"))) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_SUFFOCATION) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) { event.setCancelled(true); return; } if ((cause == DamageCause.FIRE || cause == DamageCause.FIRE_TICK) - && prot.getSettingBool(ProtectConfig.disable_firedmg) - && !(user.isAuthorized("essentials.protect.damage.fire") - && !user.isAuthorized("essentials.protect.damage.disable"))) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIRE) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) { event.setCancelled(true); return; } if (cause == DamageCause.DROWNING - && prot.getSettingBool(ProtectConfig.disable_drown) - && !(user.isAuthorized("essentials.protect.damage.drowning") - && !user.isAuthorized("essentials.protect.damage.disable"))) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_DROWNING) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) { event.setCancelled(true); return; } if (cause == DamageCause.LIGHTNING - && prot.getSettingBool(ProtectConfig.disable_lightning) - && !(user.isAuthorized("essentials.protect.damage.lightning") - && !user.isAuthorized("essentials.protect.damage.disable"))) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_LIGHTNING) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) { event.setCancelled(true); return; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 0fedc33cf..20826bf36 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -9,9 +9,15 @@ import org.bukkit.permissions.PermissionDefault; public enum Permissions implements IPermission { - BUILD, - PREVENTDAMAGE_FALL, - PREVENTDAMAGE_NONE + BUILD(PermissionDefault.TRUE), + INTERACT(PermissionDefault.TRUE), + USEFLINTSTEEL(PermissionDefault.TRUE), + PREVENTDAMAGE_FALL(PermissionDefault.FALSE), + PREVENTDAMAGE_SUFFOCATION(PermissionDefault.FALSE), + PREVENTDAMAGE_FIRE(PermissionDefault.FALSE), + PREVENTDAMAGE_DROWNING(PermissionDefault.FALSE), + PREVENTDAMAGE_LIGHTNING(PermissionDefault.FALSE), + PREVENTDAMAGE_NONE(PermissionDefault.FALSE) ; private static final String base = "essentials.protect."; private final String permission; -- cgit v1.2.3 From d64c73fc51817b3698510b7eea0cdfa274a58c63 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 10 Jan 2012 00:36:09 +0100 Subject: Finished Protect, Essentials should build now. --- .../essentials/protect/EssentialsConnect.java | 79 ++-- .../protect/EssentialsProtectBlockListener.java | 228 +++++++----- .../protect/EssentialsProtectEntityListener.java | 406 +++++++++++---------- .../protect/EssentialsProtectPlayerListener.java | 88 +++-- .../protect/EssentialsProtectWeatherListener.java | 50 ++- .../essentials/protect/ItemUsePermissions.java | 42 +++ .../earth2me/essentials/protect/Permissions.java | 11 +- 7 files changed, 513 insertions(+), 391 deletions(-) create mode 100644 EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 6f724ac87..b208b5e43 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -72,54 +72,59 @@ public class EssentialsConnect { protect.getStorage().onPluginDeactivation(); } - - /*for (ProtectConfig protectConfig : ProtectConfig.values()) - { - if (protectConfig.isList()) - { - protect.getSettingsList().put(protectConfig, ess.getSettings().getProtectList(protectConfig.getConfigName())); - } - else if (protectConfig.isString()) - { - protect.getSettingsString().put(protectConfig, ess.getSettings().getProtectString(protectConfig.getConfigName())); - } - else - { - protect.getSettingsBoolean().put(protectConfig, ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), protectConfig.getDefaultValueBoolean())); - } - }*/ + /* + * for (ProtectConfig protectConfig : ProtectConfig.values()) { if (protectConfig.isList()) { + * protect.getSettingsList().put(protectConfig, + * ess.getSettings().getProtectList(protectConfig.getConfigName())); } else if (protectConfig.isString()) { + * protect.getSettingsString().put(protectConfig, + * ess.getSettings().getProtectString(protectConfig.getConfigName())); } else { + * protect.getSettingsBoolean().put(protectConfig, + * ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), + * protectConfig.getDefaultValueBoolean())); } + * + * } + */ - if (protect.getSettingString(ProtectConfig.datatype).equalsIgnoreCase("mysql")) + ProtectHolder settings = protect.getSettings(); + settings.acquireReadLock(); + try { - try + if (settings.getData().getDbtype().equalsIgnoreCase("mysql")) { - protect.setStorage(new ProtectedBlockMySQL( - protect.getSettingString(ProtectConfig.mysqlDB), - protect.getSettingString(ProtectConfig.dbUsername), - protect.getSettingString(ProtectConfig.dbPassword))); + try + { + protect.setStorage(new ProtectedBlockMySQL( + settings.getData().getDburl(), + settings.getData().getDbuser(), + settings.getData().getDbpassword())); + } + catch (PropertyVetoException ex) + { + LOGGER.log(Level.SEVERE, null, ex); + } } - catch (PropertyVetoException ex) - { - LOGGER.log(Level.SEVERE, null, ex); - } - } - else - { - try + else { - protect.setStorage(new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db")); + try + { + protect.setStorage(new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db")); + } + catch (PropertyVetoException ex) + { + LOGGER.log(Level.SEVERE, null, ex); + } } - catch (PropertyVetoException ex) + /*if (protect.getSettingBool(ProtectConfig.memstore)) { - LOGGER.log(Level.SEVERE, null, ex); - } + protect.setStorage(new ProtectedBlockMemory(protect.getStorage(), protect)); + }*/ + } - if (protect.getSettingBool(ProtectConfig.memstore)) + finally { - protect.setStorage(new ProtectedBlockMemory(protect.getStorage(), protect)); + settings.unlock(); } - } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index b67025cba..117c27a57 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -67,7 +67,7 @@ public class EssentialsProtectBlockListener extends BlockListener final List protect = new ArrayList(); if ((blockPlaced.getType() == Material.RAILS || blockPlaced.getType() == Material.POWERED_RAIL || blockPlaced.getType() == Material.DETECTOR_RAIL) - && settings.getData().getSignsAndRails().isRails() + && settings.getData().getSignsAndRails().isProtectRails() && user.isAuthorized("essentials.protect")) { protect.add(blockPlaced); @@ -78,7 +78,7 @@ public class EssentialsProtectBlockListener extends BlockListener } } if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) - && settings.getData().getSignsAndRails().isSigns() + && settings.getData().getSignsAndRails().isProtectSigns() && user.isAuthorized("essentials.protect")) { protect.add(blockPlaced); @@ -114,13 +114,13 @@ public class EssentialsProtectBlockListener extends BlockListener { final Block block = event.getBlock(); if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) - && settings.getData().getSignsAndRails().isRails()) + && settings.getData().getSignsAndRails().isProtectRails()) { event.setCancelled(true); return; } if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) - && settings.getData().getSignsAndRails().isSigns()) + && settings.getData().getSignsAndRails().isProtectSigns()) { event.setCancelled(true); return; @@ -174,13 +174,13 @@ public class EssentialsProtectBlockListener extends BlockListener { final Block toBlock = event.getToBlock(); if ((toBlock.getType() == Material.RAILS || toBlock.getType() == Material.POWERED_RAIL || toBlock.getType() == Material.DETECTOR_RAIL) - && settings.getData().getSignsAndRails().isRails()) + && settings.getData().getSignsAndRails().isProtectRails()) { event.setCancelled(true); return; } if ((toBlock.getType() == Material.WALL_SIGN || toBlock.getType() == Material.SIGN_POST) - && settings.getData().getSignsAndRails().isSigns()) + && settings.getData().getSignsAndRails().isProtectSigns()) { event.setCancelled(true); return; @@ -201,8 +201,7 @@ public class EssentialsProtectBlockListener extends BlockListener // TODO: Test if this still works /* * if (block.getType() == Material.AIR) { - * event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_bucket_flow)); return; - } + * event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_water_bucket_flow)); return; } */ } finally @@ -224,13 +223,13 @@ public class EssentialsProtectBlockListener extends BlockListener { final Block block = event.getBlock(); if ((block.getType() == Material.RAILS || block.getType() == Material.POWERED_RAIL || block.getType() == Material.DETECTOR_RAIL) - && settings.getData().getSignsAndRails().isRails()) + && settings.getData().getSignsAndRails().isProtectRails()) { event.setCancelled(true); return; } if ((block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) - && settings.getData().getSignsAndRails().isSigns()) + && settings.getData().getSignsAndRails().isProtectSigns()) { event.setCancelled(true); return; @@ -279,23 +278,36 @@ public class EssentialsProtectBlockListener extends BlockListener event.setCancelled(true); return; } - final Material type = block.getType(); - - if (prot.checkProtectionItems(ProtectConfig.alert_on_break, typeId)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke")); - } - final IProtectedBlock storage = prot.getStorage(); + final Material type = block.getType(); - if (user.isAuthorized("essentials.protect.admin")) - { - if (type == Material.WALL_SIGN || type == Material.SIGN_POST || type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL) + if (settings.getData().getAlertOnBreak().contains(type)) + { + prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke")); + } + final IProtectedBlock storage = prot.getStorage(); + + if (user.isAuthorized("essentials.protect.admin")) { - storage.unprotectBlock(block); - if (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL || type == Material.SIGN_POST) + if (type == Material.WALL_SIGN || type == Material.SIGN_POST || type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL) { - final Block below = block.getRelative(BlockFace.DOWN); - storage.unprotectBlock(below); + storage.unprotectBlock(block); + if (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL || type == Material.SIGN_POST) + { + final Block below = block.getRelative(BlockFace.DOWN); + storage.unprotectBlock(below); + } + else + { + for (BlockFace blockFace : faces) + { + final Block against = block.getRelative(blockFace); + storage.unprotectBlock(against); + } + } } else { @@ -308,30 +320,30 @@ public class EssentialsProtectBlockListener extends BlockListener } else { - for (BlockFace blockFace : faces) + + final boolean isProtected = storage.isProtected(block, user.getName()); + if (isProtected) { - final Block against = block.getRelative(blockFace); - storage.unprotectBlock(against); + event.setCancelled(true); } - } - } - else - { - - final boolean isProtected = storage.isProtected(block, user.getName()); - if (isProtected) - { - event.setCancelled(true); - } - else - { - if (type == Material.WALL_SIGN || type == Material.SIGN_POST || type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL) + else { - storage.unprotectBlock(block); - if (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL || type == Material.SIGN_POST) + if (type == Material.WALL_SIGN || type == Material.SIGN_POST || type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL) { - final Block below = block.getRelative(BlockFace.DOWN); - storage.unprotectBlock(below); + storage.unprotectBlock(block); + if (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL || type == Material.SIGN_POST) + { + final Block below = block.getRelative(BlockFace.DOWN); + storage.unprotectBlock(below); + } + else + { + for (BlockFace blockFace : faces) + { + final Block against = block.getRelative(blockFace); + storage.unprotectBlock(against); + } + } } else { @@ -342,28 +354,89 @@ public class EssentialsProtectBlockListener extends BlockListener } } } - else + } + } + finally + { + settings.unlock(); + } + } + + @Override + public void onBlockPistonExtend(BlockPistonExtendEvent event) + { + if (event.isCancelled()) + { + return; + } + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try + { + for (Block block : event.getBlocks()) + { + if (settings.getData().getPrevent().getPistonPush().contains(block.getType())) + { + event.setCancelled(true); + return; + } + if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS + || block.getType() == Material.RAILS + || block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL + || block.getType() == Material.POWERED_RAIL + || block.getRelative(BlockFace.UP).getType() == Material.DETECTOR_RAIL + || block.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isProtectRails()) + { + event.setCancelled(true); + return; + } + if (settings.getData().getSignsAndRails().isProtectSigns()) { for (BlockFace blockFace : faces) { - final Block against = block.getRelative(blockFace); - storage.unprotectBlock(against); + if (blockFace == BlockFace.DOWN) + { + continue; + } + final Block sign = block.getRelative(blockFace); + if ((blockFace == BlockFace.UP || blockFace == BlockFace.SELF) + && sign.getType() == Material.SIGN_POST) + { + event.setCancelled(true); + return; + } + if ((blockFace == BlockFace.NORTH || blockFace == BlockFace.EAST + || blockFace == BlockFace.SOUTH || blockFace == BlockFace.WEST + || blockFace == BlockFace.SELF) + && sign.getType() == Material.WALL_SIGN) + { + event.setCancelled(true); + return; + } } } } } + finally + { + settings.unlock(); + } } @Override - public void onBlockPistonExtend(BlockPistonExtendEvent event) + public void onBlockPistonRetract(BlockPistonRetractEvent event) { - if (event.isCancelled()) + if (event.isCancelled() || !event.isSticky()) { return; } - for (Block block : event.getBlocks()) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId())) + final Block block = event.getRetractLocation().getBlock(); + if (settings.getData().getPrevent().getPistonPush().contains(block.getType())) { event.setCancelled(true); return; @@ -374,12 +447,12 @@ public class EssentialsProtectBlockListener extends BlockListener || block.getType() == Material.POWERED_RAIL || block.getRelative(BlockFace.UP).getType() == Material.DETECTOR_RAIL || block.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails)) + && settings.getData().getSignsAndRails().isProtectRails()) { event.setCancelled(true); return; } - if (prot.getSettingBool(ProtectConfig.protect_signs)) + if (settings.getData().getSignsAndRails().isProtectSigns()) { for (BlockFace blockFace : faces) { @@ -405,56 +478,9 @@ public class EssentialsProtectBlockListener extends BlockListener } } } - } - - @Override - public void onBlockPistonRetract(BlockPistonRetractEvent event) - { - if (event.isCancelled() || !event.isSticky()) - { - return; - } - final Block block = event.getRetractLocation().getBlock(); - if (prot.checkProtectionItems(ProtectConfig.blacklist_piston, block.getTypeId())) - { - event.setCancelled(true); - return; - } - if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS - || block.getType() == Material.RAILS - || block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL - || block.getType() == Material.POWERED_RAIL - || block.getRelative(BlockFace.UP).getType() == Material.DETECTOR_RAIL - || block.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails)) - { - event.setCancelled(true); - return; - } - if (prot.getSettingBool(ProtectConfig.protect_signs)) + finally { - for (BlockFace blockFace : faces) - { - if (blockFace == BlockFace.DOWN) - { - continue; - } - final Block sign = block.getRelative(blockFace); - if ((blockFace == BlockFace.UP || blockFace == BlockFace.SELF) - && sign.getType() == Material.SIGN_POST) - { - event.setCancelled(true); - return; - } - if ((blockFace == BlockFace.NORTH || blockFace == BlockFace.EAST - || blockFace == BlockFace.SOUTH || blockFace == BlockFace.WEST - || blockFace == BlockFace.SELF) - && sign.getType() == Material.WALL_SIGN) - { - event.setCancelled(true); - return; - } - } + settings.unlock(); } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 05e062b0b..99b0c72e7 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.craftbukkit.FakeExplosion; -import java.util.Locale; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -20,6 +19,7 @@ public class EssentialsProtectEntityListener extends EntityListener public EssentialsProtectEntityListener(final IProtect prot) { + super(); this.prot = prot; this.ess = prot.getEssentialsConnect().getEssentials(); } @@ -31,228 +31,219 @@ public class EssentialsProtectEntityListener extends EntityListener { return; } - final Entity target = event.getEntity(); - - if (target instanceof Villager && prot.getSettingBool(ProtectConfig.prevent_villager_death)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; - } - - final IUser user = target instanceof Player ? ess.getUser((Player)target) : null; - if (event instanceof EntityDamageByBlockEvent) - { - final DamageCause cause = event.getCause(); + final Entity target = event.getEntity(); - if (prot.getSettingBool(ProtectConfig.disable_contactdmg) - && cause == DamageCause.CONTACT - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.contact") - && !user.isAuthorized("essentials.protect.damage.disable"))) + if (target instanceof Villager && settings.getData().getPrevent().isVillagerDeath()) { event.setCancelled(true); return; } - if (prot.getSettingBool(ProtectConfig.disable_lavadmg) - && cause == DamageCause.LAVA - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.lava") - && !user.isAuthorized("essentials.protect.damage.disable"))) + + final IUser user = target instanceof Player ? ess.getUser((Player)target) : null; + if (target instanceof Player && event instanceof EntityDamageByBlockEvent) { - event.setCancelled(true); - return; + final DamageCause cause = event.getCause(); + + if (cause == DamageCause.CONTACT + && (user.isAuthorized(Permissions.PREVENTDAMAGE_CONTACT) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } + if (cause == DamageCause.LAVA + && (user.isAuthorized(Permissions.PREVENTDAMAGE_LAVADAMAGE) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } + if (cause == DamageCause.BLOCK_EXPLOSION + && (user.isAuthorized(Permissions.PREVENTDAMAGE_TNT) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } } - if (prot.getSettingBool(ProtectConfig.prevent_tnt_explosion) - && cause == DamageCause.BLOCK_EXPLOSION - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.tnt") - && !user.isAuthorized("essentials.protect.damage.disable"))) + + if (target instanceof Player && event instanceof EntityDamageByEntityEvent) { - event.setCancelled(true); - return; - } - } + final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; + final Entity eAttack = edEvent.getDamager(); + final IUser attacker = eAttack instanceof Player ? ess.getUser((Player)eAttack) : null; - if (event instanceof EntityDamageByEntityEvent) - { - final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; - final Entity eAttack = edEvent.getDamager(); - final IUser attacker = eAttack instanceof Player ? ess.getUser((Player)eAttack) : null; + // PVP Settings + if (target instanceof Player && eAttack instanceof Player + && (!user.isAuthorized(Permissions.PVP) || !attacker.isAuthorized(Permissions.PVP))) + { + event.setCancelled(true); + return; + } - // PVP Settings - if (target instanceof Player && eAttack instanceof Player - && prot.getSettingBool(ProtectConfig.disable_pvp) - && (!user.isAuthorized("essentials.protect.pvp") || !attacker.isAuthorized("essentials.protect.pvp"))) - { - event.setCancelled(true); - return; - } + //Creeper explode prevention + if (eAttack instanceof Creeper && settings.getData().getPrevent().isCreeperExplosion() + || (user.isAuthorized(Permissions.PREVENTDAMAGE_CREEPER) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } - //Creeper explode prevention - if (eAttack instanceof Creeper && prot.getSettingBool(ProtectConfig.prevent_creeper_explosion) - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.creeper") - && !user.isAuthorized("essentials.protect.damage.disable"))) - { - event.setCancelled(true); - return; - } + if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIREBALL) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } - if (eAttack instanceof Creeper && prot.getSettingBool(ProtectConfig.prevent_creeper_playerdmg) - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.creeper") - && !user.isAuthorized("essentials.protect.damage.disable"))) - { - event.setCancelled(true); - return; - } + if (eAttack instanceof TNTPrimed + && (user.isAuthorized(Permissions.PREVENTDAMAGE_TNT) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } - if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) - && prot.getSettingBool(ProtectConfig.prevent_fireball_playerdmg) - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.fireball") - && !user.isAuthorized("essentials.protect.damage.disable"))) - { - event.setCancelled(true); - return; + if (edEvent.getDamager() instanceof Projectile + && ((user.isAuthorized(Permissions.PREVENTDAMAGE_PROJECTILES) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE)) + || (((Projectile)edEvent.getDamager()).getShooter() instanceof Player + && (!user.isAuthorized(Permissions.PVP) + || !ess.getUser((Player)((Projectile)edEvent.getDamager()).getShooter()).isAuthorized(Permissions.PVP))))) + { + event.setCancelled(true); + return; + } } - if (eAttack instanceof TNTPrimed && prot.getSettingBool(ProtectConfig.prevent_tnt_playerdmg) - && !(target instanceof Player - && user.isAuthorized("essentials.protect.damage.tnt") - && !user.isAuthorized("essentials.protect.damage.disable"))) + final DamageCause cause = event.getCause(); + if (target instanceof Player) { - event.setCancelled(true); - return; - } + if (cause == DamageCause.FALL + && (user.isAuthorized(Permissions.PREVENTDAMAGE_FALL) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } - if (edEvent.getDamager() instanceof Projectile - && target instanceof Player - && ((prot.getSettingBool(ProtectConfig.disable_projectiles) - && !(user.isAuthorized("essentials.protect.damage.projectiles") - && !user.isAuthorized("essentials.protect.damage.disable"))) - || (((Projectile)edEvent.getDamager()).getShooter() instanceof Player - && prot.getSettingBool(ProtectConfig.disable_pvp) - && (!user.isAuthorized("essentials.protect.pvp") - || !ess.getUser((Player)((Projectile)edEvent.getDamager()).getShooter()).isAuthorized("essentials.protect.pvp"))))) - { - event.setCancelled(true); - return; + if (cause == DamageCause.SUFFOCATION + && (user.isAuthorized(Permissions.PREVENTDAMAGE_SUFFOCATION) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } + if ((cause == DamageCause.FIRE + || cause == DamageCause.FIRE_TICK) + && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIRE) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } + if (cause == DamageCause.DROWNING + && (user.isAuthorized(Permissions.PREVENTDAMAGE_DROWNING) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } + if (cause == DamageCause.LIGHTNING + && (user.isAuthorized(Permissions.PREVENTDAMAGE_LIGHTNING) + && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + { + event.setCancelled(true); + return; + } } } + finally + { + settings.unlock(); + } + } - final DamageCause cause = event.getCause(); - if (target instanceof Player) + @Override + public void onEntityExplode(final EntityExplodeEvent event) + { + if (event.isCancelled()) { - if (cause == DamageCause.FALL - && (user.isAuthorized(Permissions.PREVENTDAMAGE_FALL) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) - { - event.setCancelled(true); - return; - } + return; + } + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try + { + final int maxHeight = settings.getData().getCreeperMaxHeight(); - if (cause == DamageCause.SUFFOCATION - && (user.isAuthorized(Permissions.PREVENTDAMAGE_SUFFOCATION) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + if (event.getEntity() instanceof EnderDragon + && settings.getData().getPrevent().isEnderdragonBlockdamage()) { event.setCancelled(true); return; } - if ((cause == DamageCause.FIRE - || cause == DamageCause.FIRE_TICK) - && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIRE) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + else if (event.getEntity() instanceof Creeper + && (settings.getData().getPrevent().isCreeperExplosion() + || settings.getData().getPrevent().isCreeperBlockdamage() + || (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight))) { + //Nicccccccccce plaaacccccccccce.. + FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); event.setCancelled(true); return; } - if (cause == DamageCause.DROWNING - && (user.isAuthorized(Permissions.PREVENTDAMAGE_DROWNING) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + else if (event.getEntity() instanceof TNTPrimed + && settings.getData().getPrevent().isTntExplosion()) { event.setCancelled(true); return; } - if (cause == DamageCause.LIGHTNING - && (user.isAuthorized(Permissions.PREVENTDAMAGE_LIGHTNING) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + else if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) + && settings.getData().getPrevent().isFireballExplosion()) { event.setCancelled(true); return; } - } - } - - @Override - public void onEntityExplode(final EntityExplodeEvent event) - { - if (event.isCancelled()) - { - return; - } - final int maxHeight = ess.getSettings().getProtectCreeperMaxHeight(); + // This code will prevent explosions near protected rails, signs or protected chests + // TODO: Use protect db instead of this code - if (event.getEntity() instanceof EnderDragon - && prot.getSettingBool(ProtectConfig.prevent_enderdragon_blockdmg)) - { - if (prot.getSettingBool(ProtectConfig.enderdragon_fakeexplosions)) + for (Block block : event.blockList()) { - FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); + if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS + || block.getType() == Material.RAILS + || block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL + || block.getType() == Material.POWERED_RAIL + || block.getRelative(BlockFace.UP).getType() == Material.DETECTOR_RAIL + || block.getType() == Material.DETECTOR_RAIL) + && settings.getData().getSignsAndRails().isProtectRails()) + { + event.setCancelled(true); + return; + } + if ((block.getType() == Material.WALL_SIGN + || block.getRelative(BlockFace.NORTH).getType() == Material.WALL_SIGN + || block.getRelative(BlockFace.EAST).getType() == Material.WALL_SIGN + || block.getRelative(BlockFace.SOUTH).getType() == Material.WALL_SIGN + || block.getRelative(BlockFace.WEST).getType() == Material.WALL_SIGN + || block.getType() == Material.SIGN_POST + || block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST) + && settings.getData().getSignsAndRails().isProtectSigns()) + { + event.setCancelled(true); + return; + } } - event.setCancelled(true); - return; - } - else if (event.getEntity() instanceof Creeper - && (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion) - || prot.getSettingBool(ProtectConfig.prevent_creeper_blockdmg) - || (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight))) - { - //Nicccccccccce plaaacccccccccce.. - FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); - event.setCancelled(true); - return; - } - else if (event.getEntity() instanceof TNTPrimed - && prot.getSettingBool(ProtectConfig.prevent_tnt_explosion)) - { - event.setCancelled(true); - return; } - else if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) - && prot.getSettingBool(ProtectConfig.prevent_fireball_explosion)) + finally { - event.setCancelled(true); - return; - } - // This code will prevent explosions near protected rails, signs or protected chests - // TODO: Use protect db instead of this code - - for (Block block : event.blockList()) - { - if ((block.getRelative(BlockFace.UP).getType() == Material.RAILS - || block.getType() == Material.RAILS - || block.getRelative(BlockFace.UP).getType() == Material.POWERED_RAIL - || block.getType() == Material.POWERED_RAIL - || block.getRelative(BlockFace.UP).getType() == Material.DETECTOR_RAIL - || block.getType() == Material.DETECTOR_RAIL) - && prot.getSettingBool(ProtectConfig.protect_rails)) - { - event.setCancelled(true); - return; - } - if ((block.getType() == Material.WALL_SIGN - || block.getRelative(BlockFace.NORTH).getType() == Material.WALL_SIGN - || block.getRelative(BlockFace.EAST).getType() == Material.WALL_SIGN - || block.getRelative(BlockFace.SOUTH).getType() == Material.WALL_SIGN - || block.getRelative(BlockFace.WEST).getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST - || block.getRelative(BlockFace.UP).getType() == Material.SIGN_POST) - && prot.getSettingBool(ProtectConfig.protect_signs)) - { - event.setCancelled(true); - return; - } + settings.unlock(); } } @@ -272,25 +263,26 @@ public class EssentialsProtectEntityListener extends EntityListener { return; } - final String creatureName = creature.toString().toLowerCase(Locale.ENGLISH); - if (creatureName == null || creatureName.isEmpty()) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - return; + final Boolean prevent = settings.getData().getPrevent().getSpawn().get(creature); + if (prevent != null && prevent) + { + event.setCancelled(true); + } } - if (ess.getSettings().getProtectPreventSpawn(creatureName)) + finally { - event.setCancelled(true); + settings.unlock(); } } @Override public void onEntityTarget(final EntityTargetEvent event) { - if (event.isCancelled()) - { - return; - } - if (!(event.getTarget() instanceof Player)) + if (event.isCancelled() || !(event.getTarget() instanceof Player)) { return; } @@ -301,8 +293,7 @@ public class EssentialsProtectEntityListener extends EntityListener || event.getReason() == TargetReason.RANDOM_TARGET || event.getReason() == TargetReason.TARGET_ATTACKED_OWNER || event.getReason() == TargetReason.OWNER_ATTACKED_TARGET) - && prot.getSettingBool(ProtectConfig.prevent_entitytarget) - && !user.isAuthorized("essentials.protect.entitytarget.bypass")) + && user.isAuthorized(Permissions.ENTITYTARGET)) { event.setCancelled(true); return; @@ -310,26 +301,43 @@ public class EssentialsProtectEntityListener extends EntityListener } @Override - public void onExplosionPrime(ExplosionPrimeEvent event) + public void onExplosionPrime(final ExplosionPrimeEvent event) { - if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) - && prot.getSettingBool(ProtectConfig.prevent_fireball_fire)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setFire(false); + if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) + && settings.getData().getPrevent().isFireballFire()) + { + event.setFire(false); + } + } + finally + { + settings.unlock(); } } @Override - public void onEndermanPickup(EndermanPickupEvent event) + public void onEndermanPickup(final EndermanPickupEvent event) { if (event.isCancelled()) { return; } - if (prot.getSettingBool(ProtectConfig.prevent_enderman_pickup)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); - return; + if (settings.getData().getPrevent().isEndermanPickup()) + { + event.setCancelled(true); + } + } + finally + { + settings.unlock(); } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java index a3f13a428..5e6da11cc 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java @@ -28,62 +28,70 @@ public class EssentialsProtectPlayerListener extends PlayerListener // Do not return if cancelled, because the interact event has 2 cancelled states. final IUser user = ess.getUser(event.getPlayer()); - if (event.hasItem() - && (event.getItem().getType() == Material.WATER_BUCKET - || event.getItem().getType() == Material.LAVA_BUCKET) - && prot.getSettingBool(ProtectConfig.disable_build) && !user.canBuild()) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - if (ess.getSettings().warnOnBuildDisallow()) + if (event.hasItem() + && (event.getItem().getType() == Material.WATER_BUCKET + || event.getItem().getType() == Material.LAVA_BUCKET) + && !user.isAuthorized(Permissions.BUILD)) { - user.sendMessage(_("buildAlert")); + if (settings.getData().isWarnOnBuildDisallow()) + { + user.sendMessage(_("buildAlert")); + } + event.setCancelled(true); + return; } - event.setCancelled(true); - return; - } - if (prot.getSettingBool(ProtectConfig.disable_use) && !user.canBuild()) - { - if (ess.getSettings().warnOnBuildDisallow()) + if (!user.isAuthorized(Permissions.INTERACT)) { - user.sendMessage(_("buildAlert")); + if (settings.getData().isWarnOnBuildDisallow()) + { + user.sendMessage(_("buildAlert")); + } + event.setCancelled(true); + return; } - event.setCancelled(true); - return; - } - final ItemStack item = event.getItem(); - if (item != null - && prot.checkProtectionItems(ProtectConfig.blacklist_usage, item.getTypeId()) - && !user.isAuthorized("essentials.protect.exemptusage")) - { - event.setCancelled(true); - return; - } + final ItemStack item = event.getItem(); + if (item != null + && !user.isAuthorized(ItemUsePermissions.getPermission(item.getType()))) + { + event.setCancelled(true); + return; + } - if (user.isAuthorized("essentials.protect.ownerinfo") && event.getAction() == Action.RIGHT_CLICK_BLOCK) - { - final StringBuilder stringBuilder = new StringBuilder(); - boolean first = true; - final Block blockClicked = event.getClickedBlock(); - for (String owner : prot.getStorage().getOwners(blockClicked)) + if (user.isAuthorized("essentials.protect.ownerinfo") && event.getAction() == Action.RIGHT_CLICK_BLOCK) { - if (!first) + final StringBuilder stringBuilder = new StringBuilder(); + boolean first = true; + final Block blockClicked = event.getClickedBlock(); + for (String owner : prot.getStorage().getOwners(blockClicked)) + { + if (!first) + { + stringBuilder.append(", "); + } + first = false; + stringBuilder.append(owner); + } + final String ownerNames = stringBuilder.toString(); + if (ownerNames != null && !ownerNames.isEmpty()) { - stringBuilder.append(", "); + user.sendMessage(_("protectionOwner", ownerNames)); } - first = false; - stringBuilder.append(owner); } - final String ownerNames = stringBuilder.toString(); - if (ownerNames != null && !ownerNames.isEmpty()) + if (item != null + && settings.getData().getAlertOnUse().contains(item.getType())) { - user.sendMessage(_("protectionOwner", ownerNames)); + prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed")); } } - if (item != null - && prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId())) + finally { - prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed")); + settings.unlock(); } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java index e81efc72b..4097275dd 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java @@ -18,33 +18,59 @@ public class EssentialsProtectWeatherListener extends WeatherListener @Override public void onWeatherChange(final WeatherChangeEvent event) { - if (!event.isCancelled() - && prot.getSettingBool(ProtectConfig.disable_weather_storm) - && event.toWeatherState()) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); + if (!event.isCancelled() + && settings.getData().isDisableStorm() + && event.toWeatherState()) + { + event.setCancelled(true); + } + } + finally + { + settings.unlock(); } - } @Override public void onLightningStrike(final LightningStrikeEvent event) { - if (!event.isCancelled() - && prot.getSettingBool(ProtectConfig.disable_weather_lightning)) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try { - event.setCancelled(true); + if (!event.isCancelled() + && settings.getData().isDisableLighting()) + { + event.setCancelled(true); + } + } + finally + { + settings.unlock(); } } @Override public void onThunderChange(final ThunderChangeEvent event) { - if (!event.isCancelled() - && prot.getSettingBool(ProtectConfig.disable_weather_thunder) - && event.toThunderState()) + final ProtectHolder settings = prot.getSettings(); + settings.acquireReadLock(); + try + { + if (!event.isCancelled() + && settings.getData().isDisableThunder() + && event.toThunderState()) + { + event.setCancelled(true); + } + } + finally { - event.setCancelled(true); + settings.unlock(); } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java new file mode 100644 index 000000000..258a93761 --- /dev/null +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java @@ -0,0 +1,42 @@ +package com.earth2me.essentials.protect; + +import com.earth2me.essentials.api.IPermission; +import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Map; +import org.bukkit.Material; +import org.bukkit.permissions.PermissionDefault; + +public class ItemUsePermissions extends AbstractSuperpermsPermission{ + private static Map permissions = new EnumMap(Material.class); + private static final String base = "essentials.protect.itemuse."; + private final String permission; + + public static IPermission getPermission(Material mat) + { + IPermission perm = permissions.get(mat); + if (perm == null) { + perm = new ItemUsePermissions(mat.toString().toLowerCase(Locale.ENGLISH)); + permissions.put(mat, perm); + } + return perm; + } + + private ItemUsePermissions(String matName) + { + this.permission = base + matName; + } + + @Override + public String getPermission() + { + return this.permission; + } + + @Override + public PermissionDefault getPermissionDefault() + { + return PermissionDefault.TRUE; + } +} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 20826bf36..61ac1b295 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -12,13 +12,20 @@ public enum Permissions implements IPermission BUILD(PermissionDefault.TRUE), INTERACT(PermissionDefault.TRUE), USEFLINTSTEEL(PermissionDefault.TRUE), + PVP(PermissionDefault.TRUE), + ENTITYTARGET(PermissionDefault.TRUE), PREVENTDAMAGE_FALL(PermissionDefault.FALSE), + PREVENTDAMAGE_CREEPER(PermissionDefault.FALSE), + PREVENTDAMAGE_CONTACT(PermissionDefault.FALSE), + PREVENTDAMAGE_FIREBALL(PermissionDefault.FALSE), + PREVENTDAMAGE_PROJECTILES(PermissionDefault.FALSE), + PREVENTDAMAGE_LAVADAMAGE(PermissionDefault.FALSE), + PREVENTDAMAGE_TNT(PermissionDefault.FALSE), PREVENTDAMAGE_SUFFOCATION(PermissionDefault.FALSE), PREVENTDAMAGE_FIRE(PermissionDefault.FALSE), PREVENTDAMAGE_DROWNING(PermissionDefault.FALSE), PREVENTDAMAGE_LIGHTNING(PermissionDefault.FALSE), - PREVENTDAMAGE_NONE(PermissionDefault.FALSE) - ; + PREVENTDAMAGE_NONE(PermissionDefault.FALSE); private static final String base = "essentials.protect."; private final String permission; private final PermissionDefault defaultPerm; -- cgit v1.2.3 From 703c5741bd665078f5363651fe2fa95dd36acbfb Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 10 Jan 2012 01:02:23 +0100 Subject: Essentials should run now... --- .../src/com/earth2me/essentials/protect/EssentialsConnect.java | 1 + 1 file changed, 1 insertion(+) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index b208b5e43..38c6cc3f9 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -29,6 +29,7 @@ public class EssentialsConnect } ess = (IEssentials)essPlugin; protect = (IProtect)essProtect; + protect.setSettings(new ProtectHolder(ess)); ProtectReloader pr = new ProtectReloader(); pr.onReload(); ess.addReloadListener(pr); -- cgit v1.2.3 From 01a37df70070f50995e0314fc1af222b633af261 Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 23 Jan 2012 16:00:23 +0000 Subject: Add new permission essentials.protect.alerts.notrigger If user has this permisson they do not trigger EssProtect block alerts Fix spawnmob sign command args --- .../earth2me/essentials/protect/EssentialsProtectBlockListener.java | 5 +++-- .../earth2me/essentials/protect/EssentialsProtectPlayerListener.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index 1d90384c1..0e3fb6a5e 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -51,7 +51,8 @@ public class EssentialsProtectBlockListener extends BlockListener return; } - if (settings.getData().getAlertOnPlacement().contains(blockPlaced.getType())) + if (!user.hasPermission("essentials.protect.alerts.notrigger") && + settings.getData().getAlertOnPlacement().contains(blockPlaced.getType())) { prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced")); } @@ -284,7 +285,7 @@ public class EssentialsProtectBlockListener extends BlockListener { final Material type = block.getType(); - if (settings.getData().getAlertOnBreak().contains(type)) + if (!user.hasPermission("essentials.protect.alerts.notrigger") && settings.getData().getAlertOnBreak().contains(type)) { prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke")); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java index 5e6da11cc..b5c7980c2 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java @@ -84,7 +84,8 @@ public class EssentialsProtectPlayerListener extends PlayerListener } } if (item != null - && settings.getData().getAlertOnUse().contains(item.getType())) + && !user.hasPermission("essentials.protect.alerts.notrigger") + && settings.getData().getAlertOnUse().contains(item.getType())) { prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed")); } -- cgit v1.2.3 From c689b55c4ddff6483799e021334e403db745562e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 25 Jan 2012 23:53:31 +0000 Subject: Fix depends --- .../src/com/earth2me/essentials/protect/EssentialsProtect.java | 2 +- EssentialsProtect/src/plugin.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index 75a462888..4f392e141 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -38,7 +38,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect public void onEnable() { final PluginManager pm = this.getServer().getPluginManager(); - final Plugin essPlugin = pm.getPlugin("Essentials"); + final Plugin essPlugin = pm.getPlugin("Essentials3"); if (essPlugin == null || !essPlugin.isEnabled()) { enableEmergencyMode(pm); diff --git a/EssentialsProtect/src/plugin.yml b/EssentialsProtect/src/plugin.yml index bbe628e67..42fe156b9 100644 --- a/EssentialsProtect/src/plugin.yml +++ b/EssentialsProtect/src/plugin.yml @@ -6,4 +6,4 @@ version: TeamCity website: http://tiny.cc/EssentialsWiki description: Provides protection for various parts of the world. authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits] -softdepend: [Essentials] \ No newline at end of file +softdepend: [Essentials3] \ No newline at end of file -- cgit v1.2.3 From f4413633b8c1ad5dd888370158fe412fa00a66d3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 28 Jan 2012 13:48:30 +0000 Subject: Clean more imports. --- .../src/com/earth2me/essentials/protect/EssentialsConnect.java | 1 - 1 file changed, 1 deletion(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 5988bd06f..0b39920b5 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IReload; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.protect.data.ProtectedBlockMemory; import com.earth2me.essentials.protect.data.ProtectedBlockMySQL; import com.earth2me.essentials.protect.data.ProtectedBlockSQLite; import java.beans.PropertyVetoException; -- cgit v1.2.3 From 8ab5bad988f7ad9c8a1fafd504cf108f3ec84cc3 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 5 Feb 2012 17:19:32 +0100 Subject: Modified BetterLocation, and new Permission-System --- .../essentials/protect/EssentialsConnect.java | 4 +- .../protect/EssentialsProtectBlockListener.java | 30 +++++------ .../protect/EssentialsProtectEntityListener.java | 63 +++++++++++----------- .../protect/EssentialsProtectPlayerListener.java | 16 +++--- .../earth2me/essentials/protect/Permissions.java | 18 +++++-- 5 files changed, 71 insertions(+), 60 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 0b39920b5..539ff208b 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -43,7 +43,7 @@ public class EssentialsConnect return ess; } - public void alert(final IUser user, final String item, final String type) + public void alert(final Player user, final String item, final String type) { final Location loc = user.getLocation(); final String warnMessage = _("alertFormat", user.getName(), type, item, @@ -53,7 +53,7 @@ public class EssentialsConnect for (Player p : ess.getServer().getOnlinePlayers()) { final IUser alertUser = ess.getUser(p); - if (alertUser.isAuthorized("essentials.protect.alerts")) + if (Permissions.ALERTS.isAuthorized(alertUser)) { alertUser.sendMessage(warnMessage); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java index cdd0c2543..f69ede53a 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java @@ -2,13 +2,13 @@ package com.earth2me.essentials.protect; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; -import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.protect.data.IProtectedBlock; import java.util.ArrayList; import java.util.List; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -34,12 +34,12 @@ public class EssentialsProtectBlockListener implements Listener return; } - final IUser user = ess.getUser(event.getPlayer()); + final Player user = event.getPlayer(); final ProtectHolder settings = prot.getSettings(); settings.acquireReadLock(); try { - if (!user.isAuthorized(Permissions.BUILD)) + if (!Permissions.BUILD.isAuthorized(user)) { event.setCancelled(true); return; @@ -48,13 +48,13 @@ public class EssentialsProtectBlockListener implements Listener final Block blockPlaced = event.getBlockPlaced(); final int id = blockPlaced.getTypeId(); - if (!user.isAuthorized(BlockPlacePermissions.getPermission(blockPlaced.getType()))) + if (!BlockPlacePermissions.getPermission(blockPlaced.getType()).isAuthorized(user)) { event.setCancelled(true); return; } - if (!user.hasPermission("essentials.protect.alerts.notrigger") && + if (!Permissions.ALERTS_NOTRIGGER.isAuthorized(user) && settings.getData().getAlertOnPlacement().contains(blockPlaced.getType())) { prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced")); @@ -72,7 +72,7 @@ public class EssentialsProtectBlockListener implements Listener final List protect = new ArrayList(); if ((blockPlaced.getType() == Material.RAILS || blockPlaced.getType() == Material.POWERED_RAIL || blockPlaced.getType() == Material.DETECTOR_RAIL) && settings.getData().getSignsAndRails().isProtectRails() - && user.isAuthorized("essentials.protect")) + && Permissions.RAILS.isAuthorized(user)) { protect.add(blockPlaced); if (settings.getData().getSignsAndRails().isBlockBelow() @@ -81,7 +81,7 @@ public class EssentialsProtectBlockListener implements Listener protect.add(blockPlaced.getRelative(BlockFace.DOWN)); } } - if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) + /*if ((blockPlaced.getType() == Material.SIGN_POST || blockPlaced.getType() == Material.WALL_SIGN) && settings.getData().getSignsAndRails().isProtectSigns() && user.isAuthorized("essentials.protect")) { @@ -93,7 +93,7 @@ public class EssentialsProtectBlockListener implements Listener { protect.add(event.getBlockAgainst()); } - } + }*/ for (Block block : protect) { prot.getStorage().protectBlock(block, user.getName()); @@ -144,7 +144,7 @@ public class EssentialsProtectBlockListener implements Listener if (event.getCause().equals(BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL) && event.getPlayer() != null) { - event.setCancelled(ess.getUser(event.getPlayer()).isAuthorized(Permissions.USEFLINTSTEEL)); + event.setCancelled(Permissions.USEFLINTSTEEL.isAuthorized(event.getPlayer())); return; } @@ -267,9 +267,9 @@ public class EssentialsProtectBlockListener implements Listener { return; } - final IUser user = ess.getUser(event.getPlayer()); + final Player user = event.getPlayer(); - if (!user.isAuthorized(Permissions.BUILD)) + if (!Permissions.BUILD.isAuthorized(user)) { event.setCancelled(true); return; @@ -277,7 +277,7 @@ public class EssentialsProtectBlockListener implements Listener final Block block = event.getBlock(); final int typeId = block.getTypeId(); - if (!user.isAuthorized(BlockBreakPermissions.getPermission(block.getType()))) + if (!BlockBreakPermissions.getPermission(block.getType()).isAuthorized(user)) { event.setCancelled(true); return; @@ -288,13 +288,13 @@ public class EssentialsProtectBlockListener implements Listener { final Material type = block.getType(); - if (!user.hasPermission("essentials.protect.alerts.notrigger") && settings.getData().getAlertOnBreak().contains(type)) + if (!Permissions.ALERTS_NOTRIGGER.isAuthorized(user) && settings.getData().getAlertOnBreak().contains(type)) { prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke")); } final IProtectedBlock storage = prot.getStorage(); - if (user.isAuthorized("essentials.protect.admin")) + if (Permissions.ADMIN.isAuthorized(user)) { if (type == Material.WALL_SIGN || type == Material.SIGN_POST || type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL) { @@ -489,7 +489,7 @@ public class EssentialsProtectBlockListener implements Listener } } - private boolean isProtected(final Block block, final IUser user, final ProtectHolder settings) + private boolean isProtected(final Block block, final Player user, final ProtectHolder settings) { final Material type = block.getType(); if (settings.getData().getSignsAndRails().isProtectSigns()) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index bba267d41..d99497f15 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IEssentials; -import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.craftbukkit.FakeExplosion; import org.bukkit.Material; import org.bukkit.block.Block; @@ -46,28 +45,28 @@ public class EssentialsProtectEntityListener implements Listener return; } - final IUser user = target instanceof Player ? ess.getUser((Player)target) : null; + final Player user = target instanceof Player ? (Player)target : null; if (target instanceof Player && event instanceof EntityDamageByBlockEvent) { final DamageCause cause = event.getCause(); if (cause == DamageCause.CONTACT - && (user.isAuthorized(Permissions.PREVENTDAMAGE_CONTACT) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_CONTACT.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (cause == DamageCause.LAVA - && (user.isAuthorized(Permissions.PREVENTDAMAGE_LAVADAMAGE) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_LAVADAMAGE.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (cause == DamageCause.BLOCK_EXPLOSION - && (user.isAuthorized(Permissions.PREVENTDAMAGE_TNT) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_TNT.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; @@ -78,11 +77,11 @@ public class EssentialsProtectEntityListener implements Listener { final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; final Entity eAttack = edEvent.getDamager(); - final IUser attacker = eAttack instanceof Player ? ess.getUser((Player)eAttack) : null; + final Player attacker = eAttack instanceof Player ? (Player)eAttack : null; // PVP Settings if (target instanceof Player && eAttack instanceof Player - && (!user.isAuthorized(Permissions.PVP) || !attacker.isAuthorized(Permissions.PVP))) + && (!Permissions.PVP.isAuthorized(user) || !Permissions.PVP.isAuthorized(attacker))) { event.setCancelled(true); return; @@ -90,35 +89,35 @@ public class EssentialsProtectEntityListener implements Listener //Creeper explode prevention if (eAttack instanceof Creeper && settings.getData().getPrevent().isCreeperExplosion() - || (user.isAuthorized(Permissions.PREVENTDAMAGE_CREEPER) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + || (Permissions.PREVENTDAMAGE_CREEPER.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball) - && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIREBALL) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_FIREBALL.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (eAttack instanceof TNTPrimed - && (user.isAuthorized(Permissions.PREVENTDAMAGE_TNT) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_TNT.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (edEvent.getDamager() instanceof Projectile - && ((user.isAuthorized(Permissions.PREVENTDAMAGE_PROJECTILES) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE)) + && ((Permissions.PREVENTDAMAGE_PROJECTILES.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user)) || (((Projectile)edEvent.getDamager()).getShooter() instanceof Player - && (!user.isAuthorized(Permissions.PVP) - || !ess.getUser((Player)((Projectile)edEvent.getDamager()).getShooter()).isAuthorized(Permissions.PVP))))) + && (!Permissions.PVP.isAuthorized(user) + || !Permissions.PVP.isAuthorized((Player)((Projectile)edEvent.getDamager()).getShooter()))))) { event.setCancelled(true); return; @@ -129,38 +128,38 @@ public class EssentialsProtectEntityListener implements Listener if (target instanceof Player) { if (cause == DamageCause.FALL - && (user.isAuthorized(Permissions.PREVENTDAMAGE_FALL) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_FALL.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (cause == DamageCause.SUFFOCATION - && (user.isAuthorized(Permissions.PREVENTDAMAGE_SUFFOCATION) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_SUFFOCATION.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if ((cause == DamageCause.FIRE || cause == DamageCause.FIRE_TICK) - && (user.isAuthorized(Permissions.PREVENTDAMAGE_FIRE) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_FIRE.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (cause == DamageCause.DROWNING - && (user.isAuthorized(Permissions.PREVENTDAMAGE_DROWNING) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_DROWNING.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; } if (cause == DamageCause.LIGHTNING - && (user.isAuthorized(Permissions.PREVENTDAMAGE_LIGHTNING) - && !user.isAuthorized(Permissions.PREVENTDAMAGE_NONE))) + && (Permissions.PREVENTDAMAGE_LIGHTNING.isAuthorized(user) + && !Permissions.PREVENTDAMAGE_NONE.isAuthorized(user))) { event.setCancelled(true); return; @@ -289,14 +288,14 @@ public class EssentialsProtectEntityListener implements Listener { return; } - final IUser user = ess.getUser((Player)event.getTarget()); + final Player user = (Player)event.getTarget(); if ((event.getReason() == TargetReason.CLOSEST_PLAYER || event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY || event.getReason() == TargetReason.PIG_ZOMBIE_TARGET || event.getReason() == TargetReason.RANDOM_TARGET || event.getReason() == TargetReason.TARGET_ATTACKED_OWNER || event.getReason() == TargetReason.OWNER_ATTACKED_TARGET) - && user.isAuthorized(Permissions.ENTITYTARGET)) + && Permissions.ENTITYTARGET.isAuthorized(user)) { event.setCancelled(true); return; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java index 7fe1ea33f..a14fde8bc 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java @@ -2,9 +2,9 @@ package com.earth2me.essentials.protect; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; -import com.earth2me.essentials.api.IUser; import org.bukkit.Material; import org.bukkit.block.Block; +import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -28,7 +28,7 @@ public class EssentialsProtectPlayerListener implements Listener public void onPlayerInteract(final PlayerInteractEvent event) { // Do not return if cancelled, because the interact event has 2 cancelled states. - final IUser user = ess.getUser(event.getPlayer()); + final Player user = event.getPlayer(); final ProtectHolder settings = prot.getSettings(); settings.acquireReadLock(); @@ -37,7 +37,7 @@ public class EssentialsProtectPlayerListener implements Listener if (event.hasItem() && (event.getItem().getType() == Material.WATER_BUCKET || event.getItem().getType() == Material.LAVA_BUCKET) - && !user.isAuthorized(Permissions.BUILD)) + && !Permissions.BUILD.isAuthorized(user)) { if (settings.getData().isWarnOnBuildDisallow()) { @@ -47,7 +47,7 @@ public class EssentialsProtectPlayerListener implements Listener return; } - if (!user.isAuthorized(Permissions.INTERACT)) + if (!Permissions.INTERACT.isAuthorized(user)) { if (settings.getData().isWarnOnBuildDisallow()) { @@ -59,13 +59,13 @@ public class EssentialsProtectPlayerListener implements Listener final ItemStack item = event.getItem(); if (item != null - && !user.isAuthorized(ItemUsePermissions.getPermission(item.getType()))) + && !ItemUsePermissions.getPermission(item.getType()).isAuthorized(user)) { event.setCancelled(true); return; } - if (user.isAuthorized("essentials.protect.ownerinfo") && event.getAction() == Action.RIGHT_CLICK_BLOCK) + if (Permissions.OWNERINFO.isAuthorized(user) && event.getAction() == Action.RIGHT_CLICK_BLOCK) { final StringBuilder stringBuilder = new StringBuilder(); boolean first = true; @@ -86,8 +86,8 @@ public class EssentialsProtectPlayerListener implements Listener } } if (item != null - && !user.hasPermission("essentials.protect.alerts.notrigger") - && settings.getData().getAlertOnUse().contains(item.getType())) + && !Permissions.ALERTS_NOTRIGGER.isAuthorized(user) + && settings.getData().getAlertOnUse().contains(item.getType())) { prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed")); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 61ac1b295..1ed32ddda 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -3,17 +3,21 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.Util; import com.earth2me.essentials.api.IPermission; import java.util.Locale; +import org.bukkit.command.CommandSender; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; public enum Permissions implements IPermission { + ALERTS, + ALERTS_NOTRIGGER, + ADMIN, BUILD(PermissionDefault.TRUE), + ENTITYTARGET(PermissionDefault.TRUE), INTERACT(PermissionDefault.TRUE), - USEFLINTSTEEL(PermissionDefault.TRUE), + OWNERINFO, PVP(PermissionDefault.TRUE), - ENTITYTARGET(PermissionDefault.TRUE), PREVENTDAMAGE_FALL(PermissionDefault.FALSE), PREVENTDAMAGE_CREEPER(PermissionDefault.FALSE), PREVENTDAMAGE_CONTACT(PermissionDefault.FALSE), @@ -25,7 +29,9 @@ public enum Permissions implements IPermission PREVENTDAMAGE_FIRE(PermissionDefault.FALSE), PREVENTDAMAGE_DROWNING(PermissionDefault.FALSE), PREVENTDAMAGE_LIGHTNING(PermissionDefault.FALSE), - PREVENTDAMAGE_NONE(PermissionDefault.FALSE); + PREVENTDAMAGE_NONE(PermissionDefault.FALSE), + RAILS(PermissionDefault.TRUE), + USEFLINTSTEEL(PermissionDefault.TRUE); private static final String base = "essentials.protect."; private final String permission; private final PermissionDefault defaultPerm; @@ -66,4 +72,10 @@ public enum Permissions implements IPermission { return this.defaultPerm; } + + @Override + public boolean isAuthorized(CommandSender sender) + { + return sender.hasPermission(getBukkitPermission()); + } } -- cgit v1.2.3 From 7b8a9d60d7da4cba5013671920b1064f711b4538 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 2 Mar 2012 21:48:03 +1100 Subject: I honestly have no idea if this works, but on paper it does. Will be great, now to figure out how to test. --- .../essentials/protect/EssentialsConnect.java | 16 ++--- .../essentials/protect/EssentialsProtect.java | 84 +++++----------------- .../essentials/protect/data/IProtectedBlock.java | 2 - .../protect/data/ProtectedBlockJDBC.java | 42 ++++------- .../protect/data/ProtectedBlockMemory.java | 5 -- .../protect/data/ProtectedBlockMySQL.java | 3 +- .../protect/data/ProtectedBlockSQLite.java | 3 +- 7 files changed, 40 insertions(+), 115 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 539ff208b..9f1cc122a 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -66,10 +66,6 @@ public class EssentialsConnect @Override public void onReload() { - if (protect.getStorage() != null) - { - protect.getStorage().onPluginDeactivation(); - } /* * for (ProtectConfig protectConfig : ProtectConfig.values()) { if (protectConfig.isList()) { @@ -97,7 +93,7 @@ public class EssentialsConnect settings.getData().getDbuser(), settings.getData().getDbpassword())); } - catch (PropertyVetoException ex) + catch (ClassNotFoundException ex) { LOGGER.log(Level.SEVERE, null, ex); } @@ -108,15 +104,15 @@ public class EssentialsConnect { protect.setStorage(new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db")); } - catch (PropertyVetoException ex) + catch (ClassNotFoundException ex) { LOGGER.log(Level.SEVERE, null, ex); } } - /*if (protect.getSettingBool(ProtectConfig.memstore)) - { - protect.setStorage(new ProtectedBlockMemory(protect.getStorage(), protect)); - }*/ + /* + * if (protect.getSettingBool(ProtectConfig.memstore)) { protect.setStorage(new + * ProtectedBlockMemory(protect.getStorage(), protect)); } + */ } finally diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index 72000eeba..5c3e3eab7 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -1,9 +1,7 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.protect.data.IProtectedBlock; -import java.util.logging.Filter; import java.util.logging.Level; -import java.util.logging.LogRecord; import java.util.logging.Logger; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -14,7 +12,6 @@ import org.bukkit.plugin.java.JavaPlugin; public class EssentialsProtect extends JavaPlugin implements IProtect { private static final Logger LOGGER = Logger.getLogger("Minecraft"); - private static com.mchange.v2.log.MLogger C3P0logger; //private final transient Map settingsBoolean = new EnumMap(ProtectConfig.class); //private final transient Map settingsString = new EnumMap(ProtectConfig.class); //private final transient Map> settingsList = new EnumMap>(ProtectConfig.class); @@ -23,18 +20,6 @@ public class EssentialsProtect extends JavaPlugin implements IProtect private transient ProtectHolder settings = null; @Override - public void onLoad() - { - C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class); - C3P0logger.setFilter(new Filter() - { - public boolean isLoggable(LogRecord lr) - { - return lr.getLevel() != Level.INFO; - } - }); - } - public void onEnable() { final PluginManager pm = this.getServer().getPluginManager(); @@ -71,13 +56,10 @@ public class EssentialsProtect extends JavaPlugin implements IProtect LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now."); } - /*@Override - public boolean checkProtectionItems(final ProtectConfig list, final int id) - { - final List itemList = settingsList.get(list); - return itemList != null && !itemList.isEmpty() && itemList.contains(id); - }*/ - + /* + * @Override public boolean checkProtectionItems(final ProtectConfig list, final int id) { final List + * itemList = settingsList.get(list); return itemList != null && !itemList.isEmpty() && itemList.contains(id); } + */ @Override public IProtectedBlock getStorage() { @@ -94,52 +76,20 @@ public class EssentialsProtect extends JavaPlugin implements IProtect { return ess; } - - /*public Map getSettingsBoolean() - { - return settingsBoolean; - } - - public Map getSettingsString() - { - return settingsString; - } - - public Map> getSettingsList() - { - return settingsList; - } - - @Override - public boolean getSettingBool(final ProtectConfig protectConfig) - { - final Boolean bool = settingsBoolean.get(protectConfig); - return bool == null ? protectConfig.getDefaultValueBoolean() : bool; - } - - @Override - public String getSettingString(final ProtectConfig protectConfig) - { - final String str = settingsString.get(protectConfig); - return str == null ? protectConfig.getDefaultValueString() : str; - }*/ - - public void onDisable() - { - if (storage != null) - { - storage.onPluginDeactivation(); - } - // Sleep for a second to allow the database to close. - try - { - Thread.sleep(1000); - } - catch (InterruptedException ex) - { - } - } + /* + * public Map getSettingsBoolean() { return settingsBoolean; } + * + * public Map getSettingsString() { return settingsString; } + * + * public Map> getSettingsList() { return settingsList; } + * + * @Override public boolean getSettingBool(final ProtectConfig protectConfig) { final Boolean bool = + * settingsBoolean.get(protectConfig); return bool == null ? protectConfig.getDefaultValueBoolean() : bool; } + * + * @Override public String getSettingString(final ProtectConfig protectConfig) { final String str = + * settingsString.get(protectConfig); return str == null ? protectConfig.getDefaultValueString() : str; } + */ public ProtectHolder getSettings() { return settings; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java index 755baface..d8267429f 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java @@ -19,6 +19,4 @@ public interface IProtectedBlock public List getOwners(Block block); public int unprotectBlock(Block block); - - public void onPluginDeactivation(); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java index e24a71b80..30ac5ae8e 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java @@ -1,11 +1,6 @@ package com.earth2me.essentials.protect.data; -import com.mchange.v2.c3p0.ComboPooledDataSource; -import java.beans.PropertyVetoException; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -16,7 +11,7 @@ import org.bukkit.block.Block; public abstract class ProtectedBlockJDBC implements IProtectedBlock { protected static final Logger LOGGER = Logger.getLogger("Minecraft"); - protected final transient ComboPooledDataSource cpds; + protected String url; protected abstract PreparedStatement getStatementCreateTable(Connection conn) throws SQLException; @@ -34,22 +29,20 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock protected abstract PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException; - public ProtectedBlockJDBC(String driver, String url) throws PropertyVetoException + public ProtectedBlockJDBC(String driver, String url) throws ClassNotFoundException { this(driver, url, null, null); } - public ProtectedBlockJDBC(String driver, String url, String username, String password) throws PropertyVetoException + public ProtectedBlockJDBC(String driver, String url, String username, String password) throws ClassNotFoundException { - cpds = new ComboPooledDataSource(); - cpds.setDriverClass(driver); - cpds.setJdbcUrl(url); + Class.forName(driver); + this.url = url; if (username != null) { - cpds.setUser(username); - cpds.setPassword(password); + url += "?user=" + username; + url += "&password=" + password; } - cpds.setMaxStatements(20); createAndConvertTable(); } @@ -59,7 +52,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementCreateTable(conn); ps.execute(); ps.close(); @@ -103,7 +96,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementDeleteAll(conn); ps.executeUpdate(); } @@ -158,7 +151,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock List blocks = new ArrayList(); try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementAllBlocks(conn); rs = ps.executeQuery(); while (rs.next()) @@ -227,7 +220,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementInsert(conn, world, x, y, z, playerName); ps.executeUpdate(); } @@ -269,7 +262,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock ResultSet rs = null; try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementPlayerCountByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), playerName); rs = ps.executeQuery(); return rs.next() && rs.getInt(1) > 0 && rs.getInt(2) == 0; @@ -325,7 +318,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock List owners = new ArrayList(); try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementPlayersByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ()); rs = ps.executeQuery(); while (rs.next()) @@ -383,7 +376,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = cpds.getConnection(); + conn = DriverManager.getConnection(url); ps = getStatementDeleteByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ()); return ps.executeUpdate(); } @@ -418,9 +411,4 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock } } } - - public void onPluginDeactivation() - { - cpds.close(); - } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java index 876c8a575..61e38a848 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java @@ -240,9 +240,4 @@ public class ProtectedBlockMemory implements IProtectedBlock } return id; } - - public void onPluginDeactivation() - { - storage.onPluginDeactivation(); - } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java index 2a0077698..96f399d27 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java @@ -1,6 +1,5 @@ package com.earth2me.essentials.protect.data; -import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -11,7 +10,7 @@ import java.util.logging.Logger; public class ProtectedBlockMySQL extends ProtectedBlockJDBC { - public ProtectedBlockMySQL(String url, String username, String password) throws PropertyVetoException + public ProtectedBlockMySQL(String url, String username, String password) throws ClassNotFoundException { super("com.mysql.jdbc.Driver", url, username, password); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java index cf256f1ec..84aff3823 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java @@ -1,6 +1,5 @@ package com.earth2me.essentials.protect.data; -import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -8,7 +7,7 @@ import java.sql.SQLException; public class ProtectedBlockSQLite extends ProtectedBlockJDBC { - public ProtectedBlockSQLite(String url) throws PropertyVetoException + public ProtectedBlockSQLite(String url) throws ClassNotFoundException { super("org.sqlite.JDBC", url); } -- cgit v1.2.3 From 22a37a0c1bfdad81196a38e23c120e9ddee4b43f Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 3 Mar 2012 02:40:22 +0100 Subject: Revert "I honestly have no idea if this works, but on paper it does. Will be great, now to figure out how to test." until there is a real alternative. This reverts commit 7b8a9d60d7da4cba5013671920b1064f711b4538. --- .../essentials/protect/EssentialsConnect.java | 16 +++-- .../essentials/protect/EssentialsProtect.java | 84 +++++++++++++++++----- .../essentials/protect/data/IProtectedBlock.java | 2 + .../protect/data/ProtectedBlockJDBC.java | 42 +++++++---- .../protect/data/ProtectedBlockMemory.java | 5 ++ .../protect/data/ProtectedBlockMySQL.java | 3 +- .../protect/data/ProtectedBlockSQLite.java | 3 +- 7 files changed, 115 insertions(+), 40 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 9f1cc122a..539ff208b 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -66,6 +66,10 @@ public class EssentialsConnect @Override public void onReload() { + if (protect.getStorage() != null) + { + protect.getStorage().onPluginDeactivation(); + } /* * for (ProtectConfig protectConfig : ProtectConfig.values()) { if (protectConfig.isList()) { @@ -93,7 +97,7 @@ public class EssentialsConnect settings.getData().getDbuser(), settings.getData().getDbpassword())); } - catch (ClassNotFoundException ex) + catch (PropertyVetoException ex) { LOGGER.log(Level.SEVERE, null, ex); } @@ -104,15 +108,15 @@ public class EssentialsConnect { protect.setStorage(new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db")); } - catch (ClassNotFoundException ex) + catch (PropertyVetoException ex) { LOGGER.log(Level.SEVERE, null, ex); } } - /* - * if (protect.getSettingBool(ProtectConfig.memstore)) { protect.setStorage(new - * ProtectedBlockMemory(protect.getStorage(), protect)); } - */ + /*if (protect.getSettingBool(ProtectConfig.memstore)) + { + protect.setStorage(new ProtectedBlockMemory(protect.getStorage(), protect)); + }*/ } finally diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index 5c3e3eab7..72000eeba 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -1,7 +1,9 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.protect.data.IProtectedBlock; +import java.util.logging.Filter; import java.util.logging.Level; +import java.util.logging.LogRecord; import java.util.logging.Logger; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -12,6 +14,7 @@ import org.bukkit.plugin.java.JavaPlugin; public class EssentialsProtect extends JavaPlugin implements IProtect { private static final Logger LOGGER = Logger.getLogger("Minecraft"); + private static com.mchange.v2.log.MLogger C3P0logger; //private final transient Map settingsBoolean = new EnumMap(ProtectConfig.class); //private final transient Map settingsString = new EnumMap(ProtectConfig.class); //private final transient Map> settingsList = new EnumMap>(ProtectConfig.class); @@ -20,6 +23,18 @@ public class EssentialsProtect extends JavaPlugin implements IProtect private transient ProtectHolder settings = null; @Override + public void onLoad() + { + C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class); + C3P0logger.setFilter(new Filter() + { + public boolean isLoggable(LogRecord lr) + { + return lr.getLevel() != Level.INFO; + } + }); + } + public void onEnable() { final PluginManager pm = this.getServer().getPluginManager(); @@ -56,10 +71,13 @@ public class EssentialsProtect extends JavaPlugin implements IProtect LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now."); } - /* - * @Override public boolean checkProtectionItems(final ProtectConfig list, final int id) { final List - * itemList = settingsList.get(list); return itemList != null && !itemList.isEmpty() && itemList.contains(id); } - */ + /*@Override + public boolean checkProtectionItems(final ProtectConfig list, final int id) + { + final List itemList = settingsList.get(list); + return itemList != null && !itemList.isEmpty() && itemList.contains(id); + }*/ + @Override public IProtectedBlock getStorage() { @@ -76,20 +94,52 @@ public class EssentialsProtect extends JavaPlugin implements IProtect { return ess; } + + /*public Map getSettingsBoolean() + { + return settingsBoolean; + } + + public Map getSettingsString() + { + return settingsString; + } + + public Map> getSettingsList() + { + return settingsList; + } + + @Override + public boolean getSettingBool(final ProtectConfig protectConfig) + { + final Boolean bool = settingsBoolean.get(protectConfig); + return bool == null ? protectConfig.getDefaultValueBoolean() : bool; + } + + @Override + public String getSettingString(final ProtectConfig protectConfig) + { + final String str = settingsString.get(protectConfig); + return str == null ? protectConfig.getDefaultValueString() : str; + }*/ + + public void onDisable() + { + if (storage != null) + { + storage.onPluginDeactivation(); + } + // Sleep for a second to allow the database to close. + try + { + Thread.sleep(1000); + } + catch (InterruptedException ex) + { + } + } - /* - * public Map getSettingsBoolean() { return settingsBoolean; } - * - * public Map getSettingsString() { return settingsString; } - * - * public Map> getSettingsList() { return settingsList; } - * - * @Override public boolean getSettingBool(final ProtectConfig protectConfig) { final Boolean bool = - * settingsBoolean.get(protectConfig); return bool == null ? protectConfig.getDefaultValueBoolean() : bool; } - * - * @Override public String getSettingString(final ProtectConfig protectConfig) { final String str = - * settingsString.get(protectConfig); return str == null ? protectConfig.getDefaultValueString() : str; } - */ public ProtectHolder getSettings() { return settings; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java index d8267429f..755baface 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java @@ -19,4 +19,6 @@ public interface IProtectedBlock public List getOwners(Block block); public int unprotectBlock(Block block); + + public void onPluginDeactivation(); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java index 30ac5ae8e..e24a71b80 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java @@ -1,6 +1,11 @@ package com.earth2me.essentials.protect.data; -import java.sql.*; +import com.mchange.v2.c3p0.ComboPooledDataSource; +import java.beans.PropertyVetoException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -11,7 +16,7 @@ import org.bukkit.block.Block; public abstract class ProtectedBlockJDBC implements IProtectedBlock { protected static final Logger LOGGER = Logger.getLogger("Minecraft"); - protected String url; + protected final transient ComboPooledDataSource cpds; protected abstract PreparedStatement getStatementCreateTable(Connection conn) throws SQLException; @@ -29,20 +34,22 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock protected abstract PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException; - public ProtectedBlockJDBC(String driver, String url) throws ClassNotFoundException + public ProtectedBlockJDBC(String driver, String url) throws PropertyVetoException { this(driver, url, null, null); } - public ProtectedBlockJDBC(String driver, String url, String username, String password) throws ClassNotFoundException + public ProtectedBlockJDBC(String driver, String url, String username, String password) throws PropertyVetoException { - Class.forName(driver); - this.url = url; + cpds = new ComboPooledDataSource(); + cpds.setDriverClass(driver); + cpds.setJdbcUrl(url); if (username != null) { - url += "?user=" + username; - url += "&password=" + password; + cpds.setUser(username); + cpds.setPassword(password); } + cpds.setMaxStatements(20); createAndConvertTable(); } @@ -52,7 +59,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementCreateTable(conn); ps.execute(); ps.close(); @@ -96,7 +103,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementDeleteAll(conn); ps.executeUpdate(); } @@ -151,7 +158,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock List blocks = new ArrayList(); try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementAllBlocks(conn); rs = ps.executeQuery(); while (rs.next()) @@ -220,7 +227,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementInsert(conn, world, x, y, z, playerName); ps.executeUpdate(); } @@ -262,7 +269,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock ResultSet rs = null; try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementPlayerCountByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), playerName); rs = ps.executeQuery(); return rs.next() && rs.getInt(1) > 0 && rs.getInt(2) == 0; @@ -318,7 +325,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock List owners = new ArrayList(); try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementPlayersByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ()); rs = ps.executeQuery(); while (rs.next()) @@ -376,7 +383,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock PreparedStatement ps = null; try { - conn = DriverManager.getConnection(url); + conn = cpds.getConnection(); ps = getStatementDeleteByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ()); return ps.executeUpdate(); } @@ -411,4 +418,9 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock } } } + + public void onPluginDeactivation() + { + cpds.close(); + } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java index 61e38a848..876c8a575 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java @@ -240,4 +240,9 @@ public class ProtectedBlockMemory implements IProtectedBlock } return id; } + + public void onPluginDeactivation() + { + storage.onPluginDeactivation(); + } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java index 96f399d27..2a0077698 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.protect.data; +import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -10,7 +11,7 @@ import java.util.logging.Logger; public class ProtectedBlockMySQL extends ProtectedBlockJDBC { - public ProtectedBlockMySQL(String url, String username, String password) throws ClassNotFoundException + public ProtectedBlockMySQL(String url, String username, String password) throws PropertyVetoException { super("com.mysql.jdbc.Driver", url, username, password); } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java index 84aff3823..cf256f1ec 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.protect.data; +import java.beans.PropertyVetoException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -7,7 +8,7 @@ import java.sql.SQLException; public class ProtectedBlockSQLite extends ProtectedBlockJDBC { - public ProtectedBlockSQLite(String url) throws ClassNotFoundException + public ProtectedBlockSQLite(String url) throws PropertyVetoException { super("org.sqlite.JDBC", url); } -- cgit v1.2.3 From 6ea02b53de2835102a95fead290d87e726f4bb59 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 13 Mar 2012 03:14:24 +0100 Subject: Merging of master into 3.0 Squashed commit of the following: commit dfd63a81acdae71b23bb40523bc40dbd58a4d75b Author: KHobbits Date: Mon Mar 12 16:50:32 2012 +0000 Missed a TL key. commit dfbc1956c981c18b8331fbf52786982063657c97 Author: KHobbits Date: Mon Mar 12 15:35:20 2012 +0000 Fixing a few TL Keys commit c0490c08902dafe6db021f8ac5c08610f3a58d9e Author: KHobbits Date: Mon Mar 12 15:21:37 2012 +0000 New TL Key, allow formatting/colouring of help output. commit 2da802d4b7b73ecdacfe6a02ce9197a468c75cbc Author: KHobbits Date: Mon Mar 12 15:00:44 2012 +0000 New permission: essentials.seen.banreason With this permission players can see why a user was banned, in /seen. commit adffbab6783aa016a7402ae20c922232389f18e1 Author: KHobbits Date: Mon Mar 12 01:15:10 2012 +0000 Adding jail time to /whois. commit e11525ab64fb1044a4e7d2c5e2aa4654699b3c34 Author: KHobbits Date: Mon Mar 12 01:00:57 2012 +0000 Update offline user check. Add ban reason to /seen commit 8dcd591beb12bd0bc03f2a3d6092ce1a7654495b Author: KHobbits Date: Sun Mar 11 23:59:59 2012 +0000 Update setworth to allow /setworth ingame Allow /setworth to be used from console. commit a40c936bcff0a05887d3acc9ab096aaab4b9df2d Author: KHobbits Date: Sun Mar 11 20:58:54 2012 +0000 New Permission: essentials.lightning.others With this permission you can use /lightning , without only strike based on direction. commit 5c2622b39051846f02d44638fbe8b37aa06fe64c Author: KHobbits Date: Sun Mar 11 01:46:01 2012 +0000 Add Enderman check to EntityChangeEvent (Should fix sheep eating grass). commit c7046b696ab7f6136acf4c22fb0e7b0d88d91629 Author: KHobbits Date: Sat Mar 10 21:42:46 2012 +0000 Use ignoreCancelled on event registration. commit 9ac5ce8a752bbd546dfba6e75b73d873be2265e5 Author: KHobbits Date: Wed Mar 7 12:14:32 2012 +0000 Update info.txt to hint at /einfo. commit 5c55e18d33c64d1dd4f82b7c4ddeda8061a96cd7 Author: KHobbits Date: Tue Mar 6 23:17:10 2012 +0000 Fixing typo in config.yml commit 1db5d619450af8db2522324cbd40d174e6297e0e Merge: 0b60d4e 1e34a39 Author: KHobbits Date: Mon Mar 5 16:25:35 2012 +0000 Merge branch 'release' Conflicts: lib/bukkit.jar lib/craftbukkit.jar commit 1e34a396cd1ab01c1b5cae038deac09bbf776615 Author: KHobbits Date: Mon Mar 5 15:51:15 2012 +0000 Change starter kit to default to stone tools commit ba96117f55384275c655e9be3bae891d284e7631 Author: KHobbits Date: Mon Mar 5 14:17:09 2012 +0000 Temp fix to disable version check on R7 commit 96b217cbe8336810dcb760dfc1845b0472057682 Author: KHobbits Date: Mon Mar 5 08:41:19 2012 +0000 Craftbukkit/Bukkit R7 commit 0dd5c0370ee0cd01ec07cf3b6acef67985e5999e Author: md_5 Date: Mon Mar 5 18:40:18 2012 +1100 I dont think free noteblocks are a good idea commit bdf32cde9e3ca43c0fcf35dac57160e8cd1db4ac Author: KHobbits Date: Mon Mar 5 00:39:37 2012 +0000 Missed one. commit e91ed6044141a60d70d65dba464d5e3d189b056a Author: KHobbits Date: Mon Mar 5 00:22:31 2012 +0000 Fixing spawnmob count. commit 8577202f4882a588f458423bd3026b4ec3cefbed Author: KHobbits Date: Mon Mar 5 00:19:40 2012 +0000 Add listgroups as TL key commit 7819b9d2f027cd0fc4c6a11e325e2f2dbc839946 Author: KHobbits Date: Mon Mar 5 00:08:37 2012 +0000 Apply colors to group tags. commit 15c0565923cf521daa8af3dac10aed6b38133c98 Author: KHobbits Date: Sun Mar 4 21:54:51 2012 +0000 Build custom mob list /spawnmob commit 2b25ca2932d9a0d72f4651cf77a8895045f97a98 Author: KHobbits Date: Sun Mar 4 21:43:24 2012 +0000 CME commit c7a6677d528a92e4820e297cb08bcbe642c5c6ae Author: KHobbits Date: Sun Mar 4 20:06:50 2012 +0000 Adding starter/newbie kit to EssentialsSpawn Optimization to EssentialsSpawn join event. commit c3d5b32986bcd5c34df8d534bc9045b9a5ff70da Author: KHobbits Date: Sun Mar 4 16:17:16 2012 +0000 Extra command alias. commit cbfb52419577fffca58c8e334a6c8b8caa1961f6 Author: KHobbits Date: Sun Mar 4 10:11:58 2012 +0000 Allow more currency customization. Added currency key to messages. commit b16a1f7237f58a3c7728bc238923fb90e218659e Author: KHobbits Date: Sun Mar 4 09:20:03 2012 +0000 Adding option to modify all users balances (including offline) /eco reset ** commit e28f1b1be3bf9a44a0eb4c4116a9a166cec7be20 Author: KHobbits Date: Sun Mar 4 08:18:25 2012 +0000 Half-revert double backflip. 10 points. (op prefix changes that md-5 broke, thinking I broke op prefixes) commit b512a243e71034dc56ecdc37281d18e39b21109f Author: md_5 Date: Sun Mar 4 15:43:00 2012 +1100 Fix op colours, which KHobbits broke! commit 873c9880dd361e1edae6e0ecca745e1592cafc67 Author: Chris Ward Date: Sat Mar 3 19:21:27 2012 +1100 Cleanup Signed-off-by: Chris Ward commit e6736e48a5da9a3dd8480fef3640eae85f4b13ce Author: Chris Ward Date: Sat Mar 3 18:07:43 2012 +1100 Cleanup Signed-off-by: Chris Ward commit caf598f55b271cf1e009c8073cb4d13538559a73 Author: KHobbits Date: Sat Mar 3 07:09:41 2012 +0000 Capital case for formatting. commit 619e099a04a8453365121865cb587447be8174a2 Author: KHobbits Date: Sat Mar 3 07:03:54 2012 +0000 Force all kits to lowercase. commit faba1e3604808a46c78bb74d8890351ab49ddb5a Author: KHobbits Date: Sat Mar 3 05:27:02 2012 +0000 *make it look like i'm doing something* commit 7cb728b15fcf79d2d39c5f6749f6cb9209c4f635 Author: KHobbits Date: Sat Mar 3 05:09:03 2012 +0000 I think switches are better. commit 3e3c7f0d545955912f925b08049adf38372e5472 Author: KHobbits Date: Fri Mar 2 19:05:30 2012 +0000 Only update displayname on world change, not every teleport. commit a45c19a08ba657144d536725e3c33b319372d763 Author: KHobbits Date: Fri Mar 2 17:05:55 2012 +0000 Extra command aliases commit eb74a1de9c1edfca947614759dff6d0e9889c945 Author: KHobbits Date: Fri Mar 2 17:03:34 2012 +0000 Make the antioch message optional. commit 8450734cf115aa8ee11910705118799424791e40 Author: KHobbits Date: Fri Mar 2 16:54:12 2012 +0000 Entity event cleanup commit 016299a1ddf7dd3bd5cf5fe26a96ad9909e8b8e5 Author: KHobbits Date: Fri Mar 2 16:33:20 2012 +0000 Shouldn't really be canceling events at priority monitor, oops. commit d27ff9abb6eb33b53f6c3c56d3dbff0346a024ee Author: KHobbits Date: Fri Mar 2 16:29:06 2012 +0000 Don't think we need animation event anymore. commit cdf5d454839c73e5ff392ba041dbcec259d9b4e3 Author: Iaccidentally Date: Thu Mar 1 23:10:32 2012 -0500 update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) commit 0b60d4efe2fed324131e083f6d4168256d943588 Author: md_5 Date: Mon Mar 5 18:40:18 2012 +1100 I dont think free noteblocks are a good idea commit d31e434e4dd8f58ea1da760f931693342631565c Author: md_5 Date: Mon Mar 5 18:28:04 2012 +1100 Allow spamming of this, by reducing explosion damage to 0, same effect, no mess commit fabc1c3dd95ce18422f8896d90bc81ce600df965 Author: KHobbits Date: Mon Mar 5 00:39:37 2012 +0000 Missed one. commit 68fbc4060541697e209852d3716bad47f41669fe Author: KHobbits Date: Mon Mar 5 00:22:31 2012 +0000 Fixing spawnmob count. commit 8b7c5cf2eda4d501b7022b2cfc18b66cd7314014 Author: KHobbits Date: Mon Mar 5 00:19:40 2012 +0000 Add listgroups as TL key commit 1811631b93c5d1d2d731b5aced8b9e780b5b4fc4 Author: KHobbits Date: Mon Mar 5 00:08:37 2012 +0000 Apply colors to group tags. commit 7cec1564b9e2b5074cae24f36de75b0838309b2a Author: KHobbits Date: Sun Mar 4 21:54:51 2012 +0000 Build custom mob list /spawnmob commit a75eefcdd47f50292fe2ca4d3d8740ebc10b253b Author: KHobbits Date: Sun Mar 4 21:43:24 2012 +0000 CME commit 6a9027da6d7cd2c2c0c35f0163dc0207720708e6 Author: KHobbits Date: Sun Mar 4 20:06:50 2012 +0000 Adding starter/newbie kit to EssentialsSpawn Optimization to EssentialsSpawn join event. commit e55aa3cea7f8c12dd843a62f955c83a7b3153ce4 Author: KHobbits Date: Sun Mar 4 16:17:16 2012 +0000 Extra command alias. commit 1ce2c60bf4e3a4a38ae8c58cd76849656f37f895 Author: KHobbits Date: Sun Mar 4 16:01:49 2012 +0000 Updating Craftbukkit #2034 Bukkit #1378 commit 6da705c86fb04f0baaae0a7bfe69288325433297 Author: KHobbits Date: Sun Mar 4 10:11:58 2012 +0000 Allow more currency customization. Added currency key to messages. commit c3fa56322bc9c81c00bbed7e8de8341a89c54d08 Author: KHobbits Date: Sun Mar 4 09:20:03 2012 +0000 Adding option to modify all users balances (including offline) /eco reset ** commit 53cfab229b8983a020d835e35b42c839fda08be3 Author: KHobbits Date: Sun Mar 4 08:18:25 2012 +0000 Half-revert double backflip. 10 points. (op prefix changes that md-5 broke, thinking I broke op prefixes) commit b62217f301e920300ce1ba6645a7f464114b5cb7 Merge: 860f6a4 d9a8453 Author: KHobbits Date: Sun Mar 4 08:13:29 2012 +0000 Merge branch 'master' of github.com:essentials/Essentials commit d9a8453995329a5984cf33a9ec6134dc7ad080cd Author: md_5 Date: Sun Mar 4 15:43:00 2012 +1100 Fix op colours, which KHobbits broke! commit e6181928e828802f41621d5f877bd3fa3a462431 Author: snowleo Date: Sat Mar 3 17:01:53 2012 +0100 Cleanup of /spawnmob commit 860f6a41acfb2f2b37c6869ef6bb75e2f5ca2c9b Merge: 8aa7b1f cea5c81 Author: KHobbits Date: Sat Mar 3 13:49:26 2012 +0000 Merge branch 'master' of github.com:essentials/Essentials commit 8aa7b1f301764d747c5da2109601ec0e93570982 Author: KHobbits Date: Sat Mar 3 13:48:58 2012 +0000 Update CB #2032 B #1377 Min CB #2015 commit cea5c81d4463d7da71f9b4c3729b87ad3e9748bc Merge: 504f28d 35576ab Author: md-5 Date: Sat Mar 3 00:34:00 2012 -0800 Merge pull request #56 from Iaccidentally/patch-4 Allow spawning baby villagers and ocelots commit 504f28df1a7c094d27a0eaed10aa85417e4c4c3c Merge: 3360551 74a5755 Author: md-5 Date: Sat Mar 3 00:31:48 2012 -0800 Merge pull request #55 from chrisward/master Just a really small cleanup commit 74a57553f68114948614eb6e77abe201ee0bcd36 Author: Chris Ward Date: Sat Mar 3 19:21:27 2012 +1100 Cleanup Signed-off-by: Chris Ward commit 35576ab64ab05acee039d3e28b5bc0ef2d110bd7 Author: Iaccidentally Date: Sat Mar 3 03:04:54 2012 -0500 add little babbys commit 33605517ffa89bc5f84d841101e6a29f091a72d5 Author: KHobbits Date: Sat Mar 3 07:09:41 2012 +0000 Capital case for formatting. commit 6da6e4d2e889b7bbeb15e4adf68a9fdc8b0b330f Author: Chris Ward Date: Sat Mar 3 18:07:43 2012 +1100 Cleanup Signed-off-by: Chris Ward commit c0fa03ede259bedb8946bc559a0e64e54c9b464e Author: KHobbits Date: Sat Mar 3 07:03:54 2012 +0000 Force all kits to lowercase. commit 301b609e9357a21931653baffe9c3bed1f06dd8f Author: KHobbits Date: Sat Mar 3 05:27:02 2012 +0000 *make it look like i'm doing something* commit b6bbe237ea7c99eab0af8d07826ba84d4d766112 Author: KHobbits Date: Sat Mar 3 05:09:03 2012 +0000 I think switches are better. commit de7ab13c03f3b6086511566aa4c67376abaaed66 Author: KHobbits Date: Fri Mar 2 19:05:30 2012 +0000 Only update displayname on world change, not every teleport. commit 7a0f4da86099a2cdcf450312affa8f6385f7a413 Author: KHobbits Date: Fri Mar 2 17:05:55 2012 +0000 Extra command aliases commit 1bbbfe1c96cf62fad3fe9f9eab5b56d28935e4e4 Author: KHobbits Date: Fri Mar 2 17:03:34 2012 +0000 Make the antioch message optional. commit 25ebe68389a74ae5b5faa9780e76afff75a5a963 Author: KHobbits Date: Fri Mar 2 16:54:12 2012 +0000 Entity event cleanup commit 7737d19c5a79938adb8f87e8280c01e20fa8680a Author: KHobbits Date: Fri Mar 2 16:33:20 2012 +0000 Shouldn't really be canceling events at priority monitor, oops. commit 622ca4bf8a10337892e56cbc0958a6a2c2e464ec Author: KHobbits Date: Fri Mar 2 16:29:06 2012 +0000 Don't think we need animation event anymore. commit b090afbeb327c685de137d9d41a89753c758c136 Merge: 21a248e dce1495 Author: KHobbits Date: Thu Mar 1 20:15:16 2012 -0800 Merge pull request #54 from Iaccidentally/patch-3 update messages.properties for the new bukkit download link (ci.bukkit,o... commit dce149511e63406b778e34934059d7888ec50c2c Author: Iaccidentally Date: Thu Mar 1 23:10:32 2012 -0500 update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) commit 21a248e94d6ee28410838877b956cb94cc37a965 Author: snowleo Date: Fri Mar 2 01:30:52 2012 +0100 Will be removed until the next release XD commit f1aed4b52172232d765b4379cf15c134700e960f Author: snowleo Date: Fri Mar 2 00:40:50 2012 +0100 Better cats commit 7564ebf79e3207c651bdbae5d0616260cbffc5c1 Author: snowleo Date: Fri Mar 2 00:18:31 2012 +0100 Fix world heights commit b9aecbe1d4aac5046c871bcb4439ea3ad11eee5c Author: snowleo Date: Fri Mar 2 00:12:22 2012 +0100 Min version CB# 2004 commit 49eb451a764f3d3cc57f673a4351788f56be5e5c Author: snowleo Date: Fri Mar 2 00:09:50 2012 +0100 New eggs commit 64d866a77dd42a3e26edf2aac83412003fe7df32 Author: snowleo Date: Fri Mar 2 00:06:57 2012 +0100 New Entities and Items for 1.2 commit f75779aa7a08034682041931a124ef0c5e6f6564 Author: snowleo Date: Thu Mar 1 23:57:34 2012 +0100 CB#2004 B#1368 commit 562288260267e4b6cdf40f31c9003ab16c096a95 Merge: b3d3928 6df3b90 Author: KHobbits Date: Thu Mar 1 22:37:15 2012 +0000 Merge branch 'master' of github.com:essentials/Essentials commit b3d3928db8b9d5cf28436980834b82d36658b6c1 Author: KHobbits Date: Thu Mar 1 22:36:51 2012 +0000 Kit sign cleanup commit 6df3b9008a50922987c5100b17b400f9458d4a65 Author: snowleo Date: Thu Mar 1 23:23:23 2012 +0100 update inventory commit c36ca65e09b8612731c7466b5c5f2b93e946e8ff Author: snowleo Date: Thu Mar 1 23:09:48 2012 +0100 Bukkit broke this sign :( commit 2e788802fe8856344235c1056bb5f6d66fecf23e Author: KHobbits Date: Thu Mar 1 22:04:50 2012 +0000 Fix kit timers resetting on server restart. commit b0552019f53df8d76f051ceca26120ae1e524abf Author: KHobbits Date: Thu Mar 1 21:47:01 2012 +0000 Fix version matching. commit dae69622a587ba929fdc0ee6c204484de2308ae6 Merge: 696b930 a8da3ee Author: snowleo Date: Thu Mar 1 19:08:52 2012 +0100 Merge branch 'refs/heads/master' into release commit 696b930fb24a7739f2e7b13d20b924ffb5f10ca9 Author: snowleo Date: Thu Mar 1 17:33:09 2012 +0100 EntityType instead of CreatureType commit e43a62f99251570e02c00be1445f1e992cd51a60 Author: snowleo Date: Thu Mar 1 16:17:40 2012 +0100 Requires #1988 because of the new Inventory stuff commit 02c1cb05c7d5f4f8d472d714b24c57b9a0de4f5e Author: snowleo Date: Thu Mar 1 16:15:37 2012 +0100 Updated to R6 commit b44d738867544386b905e23bd32c4066863de5d4 Author: snowleo Date: Thu Mar 1 15:56:17 2012 +0100 CB# 1988 B# 1360 commit e1818f7e62b56f0e4970923518cd953db9edbe11 Author: md_5 Date: Thu Mar 1 14:40:57 2012 +1100 Separate config sections evenly commit e5081db7e40b41e2755d2483400d1afd100f7db5 Author: md_5 Date: Thu Mar 1 12:27:59 2012 +1100 Remove old, unwanted manifest.mf files commit ba346bd797ee101fba94b028861683f215d661d0 Author: ElgarL Date: Tue Feb 28 10:46:10 2012 +0000 Make 'manload' reload the config correctly. commit 0670ece7f3602602794b9636da073c21b7076377 Author: KHobbits Date: Sat Feb 25 17:57:26 2012 +0000 Updating Bukkit: CB #1858, B #1334 commit a8da3eebd72eaf74303502a251a2daa8a371de92 Merge: 056303b 3823e7a Author: snowleo Date: Thu Mar 1 17:33:25 2012 +0100 Merge remote-tracking branch 'origin/groupmanager' commit 056303b53c953f4a9effa661b1a61d35893a8858 Author: snowleo Date: Thu Mar 1 17:33:09 2012 +0100 EntityType instead of CreatureType commit 454f7d30de818268e4e1c2baf5daace6e3592908 Author: snowleo Date: Thu Mar 1 16:17:40 2012 +0100 Requires #1988 because of the new Inventory stuff commit 6d1c270976bc417206bf53ffc408c4b5c08e7f33 Author: snowleo Date: Thu Mar 1 16:15:37 2012 +0100 Updated to R6 commit d1001274bb043fb4ada717577b4b6da7aaa87e96 Author: snowleo Date: Thu Mar 1 15:56:17 2012 +0100 CB# 1988 B# 1360 commit 3099855562b3223ec13b796dee2679c7a8e0411b Merge: 3f26d4a 833a5b2 Author: md_5 Date: Thu Mar 1 16:23:21 2012 +1100 Merge remote-tracking branch 'origin/master' commit 3f26d4ad9841b4ab30253222217edaaa60db3075 Author: md_5 Date: Thu Mar 1 14:40:57 2012 +1100 Separate config sections evenly commit bae337cc4946374640433700f8abb0f10c25dd24 Author: md_5 Date: Thu Mar 1 12:27:59 2012 +1100 Remove old, unwanted manifest.mf files commit 3823e7a108eaff2ecc65cb9221ad344d36f8c9ef Author: ElgarL Date: Tue Feb 28 10:46:10 2012 +0000 Make 'manload' reload the config correctly. commit 1c2221f52fdb523aa5d4aaef74d8b105c38badc3 Author: KHobbits Date: Mon Feb 27 15:31:43 2012 +0000 Adding option to log all eco api transactions. commit 1b780a43641a197e0c75ebc926bf49866d024bcf Author: KHobbits Date: Mon Feb 27 03:40:18 2012 +0000 Prevent EssSpawn trying to handle spawning of jailed players. commit ac3e65a82947431b1504d79444d4b0219e20f366 Author: KHobbits Date: Mon Feb 27 03:24:58 2012 +0000 Change jail listener to catch respawn at Highest commit 332f19177e961a60c984e674e499c78a87f4fb49 Author: KHobbits Date: Sun Feb 26 05:10:04 2012 +0000 Allow people to hit exactly 'min money'. commit 6ab57b9abefd0e0f9676127fda741da1507b2629 Author: KHobbits Date: Sun Feb 26 05:06:03 2012 +0000 Cleanup. commit 862f3aad599bb04a570411c774cfa23a5a2f1bb1 Author: KHobbits Date: Sun Feb 26 05:01:40 2012 +0000 Adjustments to negative eco give/take. commit e277acf80eab14b75c999881b009616a949f52a5 Author: KHobbits Date: Sun Feb 26 04:27:13 2012 +0000 Display users new balance on /eco give/take. commit 9f893e68e98252fae5999760ee67e0bac3810fda Author: KHobbits Date: Sun Feb 26 04:15:14 2012 +0000 Add Minimum Balance, to allow people to manage overdrafts. commit 833a5b2b552f297a9c5aeec3e11d58f0486c7e24 Author: KHobbits Date: Mon Feb 27 15:31:43 2012 +0000 Adding option to log all eco api transactions. commit 340f0c68eb3b79cd20fc96dd23c0a4e50cde7bce Author: KHobbits Date: Mon Feb 27 03:40:18 2012 +0000 Prevent EssSpawn trying to handle spawning of jailed players. commit a5e3182dadec976ab5117d755b678f75acda8a4f Author: KHobbits Date: Mon Feb 27 03:24:58 2012 +0000 Change jail listener to catch respawn at Highest commit 10ae9c3aa2f0a206c8d715717b0cbaf5247752c1 Author: KHobbits Date: Sun Feb 26 05:10:04 2012 +0000 Allow people to hit exactly 'min money'. commit bcf903de924cf9e682a501ec419d2bd72b71831c Author: KHobbits Date: Sun Feb 26 05:06:03 2012 +0000 Cleanup. commit ad08d275042c9841b48bc3945abd694649fd7529 Author: KHobbits Date: Sun Feb 26 05:01:40 2012 +0000 Adjustments to negative eco give/take. commit d24f77dbd5816e018de99a9bf5ab9ed07bdf53d5 Author: KHobbits Date: Sun Feb 26 04:27:13 2012 +0000 Display users new balance on /eco give/take. commit a5b38ce1a492edb69c14239d976ff72db84915ef Author: KHobbits Date: Sun Feb 26 04:15:14 2012 +0000 Add Minimum Balance, to allow people to manage overdrafts. commit 5d048d2c1dbfccf2db5188a7b2e3f9f303d9c273 Author: KHobbits Date: Sat Feb 25 17:57:26 2012 +0000 Updating Bukkit: CB #1858, B #1334 commit 13d3cc33061ff0810efd815efa64338e5eaeb70e Author: KHobbits Date: Sat Feb 25 17:40:00 2012 +0000 Lowering min bukkit to r4 - 1838, this build should still be compatible. commit 9f02fb4dd4367fcaa8cca03b61e520e76c58030b Merge: 8042cef 07baa6e Author: KHobbits Date: Sat Feb 25 17:22:39 2012 +0000 Merge branch 'master' into release commit 07baa6e611f153dd75b512127a4aa9996fd04892 Merge: 28f478d 50bd586 Author: KHobbits Date: Sat Feb 25 17:22:01 2012 +0000 Merge remote branch 'remotes/origin/groupmanager' commit 50bd5869bf18421918c6ef9f5ffe0fa46ccfb894 Author: ElgarL Date: Sat Feb 25 09:29:54 2012 +0000 Prevent promoting players to, and demoting to GlobalGroups. commit fa49fc91d2454b2da193ed2b757356b2496d504c Author: ElgarL Date: Sat Feb 25 09:22:54 2012 +0000 Prevent adding inheritances to globalgroups. These are permissions collections, not player groups. commit 28f478dd04c16d3deb21625aebf74a25b57665b2 Author: KHobbits Date: Thu Feb 23 17:25:00 2012 +0000 Write to user files less, on money update. commit 6fb8dad0eca654c0a4a07ae8337419562088b914 Author: KHobbits Date: Thu Feb 23 15:17:23 2012 +0000 Balance top now has server total on first line. Balance top will update ess balance backup if using register/vault eco. commit 9f605e9a885022144999b1f27bb74627c47b97b6 Author: KHobbits Date: Thu Feb 23 14:49:23 2012 +0000 Fixing upgrade script to allow powertool upgrade. commit e5b91dae73839b4311bf67ea6510ed88a9f4af80 Author: KHobbits Date: Wed Feb 22 12:32:51 2012 +0000 Fixing kits for new config classes. commit e1749fecd1293759fd899594e275a253646b5890 Author: KHobbits Date: Wed Feb 22 01:29:37 2012 +0000 Extra command aliases. commit 358edff798e8388a95b2640edd5735b188025c5c Author: KHobbits Date: Wed Feb 22 00:22:22 2012 +0000 Powertools dispatch commands as delayed tasks (should reduce any conflict issues). commit 34f13ba89cdb270e42fbc0f0225e0634d80b9676 Author: KHobbits Date: Wed Feb 22 00:11:21 2012 +0000 Switch powertools to use different event. Reduce multiple triggering of powertool events. Abort event when used with powertool. commit 945ba6f8ab8a9d3094e61fe6ccd943638eaa792a Author: KHobbits Date: Wed Feb 22 00:10:13 2012 +0000 Fix powertools with new config format. commit 46f05ee92f1deabe18dde1f527494fb717a079bd Author: KHobbits Date: Tue Feb 21 22:14:11 2012 +0000 Check to see if home section exists. commit 6d46fc66ce1f762de998824a13a38811c8364f0c Author: KHobbits Date: Tue Feb 21 22:12:37 2012 +0000 Fixing home list. commit ed7fe9213f260147b00dc33088fb4f788cf74078 Author: KHobbits Date: Tue Feb 21 21:39:25 2012 +0000 Fix /sudo message display. commit 9c68cbae727f84a7b4dfb2594c458c3353a739d3 Author: ElgarL Date: Tue Feb 21 18:40:54 2012 +0000 Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. commit c0df77153958bb3cbd3f07c5be305027440a773e Author: ElgarL Date: Tue Feb 21 18:38:08 2012 +0000 Update for Bukkit R5 compatability. Removed some unused variables. commit 9bd0c33fef968ecac42054888437de96509a433c Author: snowleo Date: Tue Feb 21 18:41:27 2012 +0100 Never give our user object to other plugins! commit 8042cefd3daca229066578fe83a9b75eac09bb31 Merge: 16a0f44 514f07c Author: KHobbits Date: Sun Feb 19 01:20:50 2012 +0000 Merge branch 'master' into release commit 16a0f44b4d8e3f582547a4357b1e6e17b60b7316 Merge: 1a2acb4 7633b13 Author: KHobbits Date: Wed Feb 15 19:09:02 2012 +0000 Merge remote branch 'remotes/origin/master' into release commit 1a2acb43aeb2217b772351dcf8cf829e6dd6d8ac Merge: 36d07cb f0c0ee1 Author: KHobbits Date: Tue Feb 14 23:56:02 2012 +0000 Merge branch 'master' into release commit 36d07cb539f92ae727934d2286130d687652d8f9 Merge: 6ca1cde effe0d5 Author: KHobbits Date: Mon Feb 13 17:35:05 2012 +0000 Merge branch 'master' into release commit 6ca1cdec4f2b57de8063d955bf8a1058bdf85ca5 Merge: e2abf05 86a1dda Author: KHobbits Date: Thu Feb 2 11:41:18 2012 +0000 Merge branch 'master' into release commit e2abf05a27b375fcb961156f5fb3cede8ac47b8f Merge: d9e6f29 8500542 Author: KHobbits Date: Mon Jan 30 05:36:03 2012 +0000 Merge branch 'master' into release commit d9e6f2975ac750073e488f940ccac3bcc6bfbf26 Merge: d8ac358 2f1d9ad Author: KHobbits Date: Sun Jan 29 21:44:30 2012 +0000 Merge branch 'master' into release commit d8ac3587ac55a920547d2406853339116187ddc1 Merge: 85c4fbd a2418a6 Author: KHobbits Date: Sun Jan 29 21:39:05 2012 +0000 Merge branch 'master' into release commit 85c4fbdf4f95074e59ae816cd4a6860bc3cf85aa Merge: 5a7f38f dff8f54 Author: KHobbits Date: Sun Jan 29 21:20:56 2012 +0000 Merge branch 'master' into release commit 5a7f38fa2928968873240595a362dded0d282465 Merge: 417148f 6a5fefb Author: KHobbits Date: Sun Jan 29 05:00:04 2012 +0000 Merge branch 'master' into release commit 417148f5da6f5927cf3232d3589a9919df81d318 Merge: a85cbdd 8f03505 Author: KHobbits Date: Sun Jan 29 01:45:40 2012 +0000 Merge branch 'master' into release commit a85cbdd5050b7163b80eaa171f3fe635bb1ca9d8 Merge: b4d9197 c6aa340 Author: KHobbits Date: Sat Jan 28 12:59:15 2012 +0000 Merge branch 'master' into release commit b4d91978c722fda3cb7996c52806cff7b6f97743 Merge: 16bde87 8aa260e Author: snowleo Date: Thu Jan 26 04:51:10 2012 +0100 Merge branch 'refs/heads/master' into release commit 16bde87982f031d649df90422dcdf0d48afe639a Merge: 2705336 b8944d0 Author: KHobbits Date: Thu Jan 26 00:31:05 2012 +0000 Merge branch 'master' into release commit 270533652b2013b7a87ec70a0d331c2fb3b0dc02 Merge: 03d6402 324dd05 Author: ementalo Date: Wed Jan 25 14:29:05 2012 +0000 Merge branch 'master' into release commit 03d640260d241cf796cad9c556fba2588f6c47a2 Merge: f27b229 da3a6af Author: KHobbits Date: Wed Jan 25 00:04:08 2012 +0000 Merge branch 'master' into release commit f27b2290dc0f3f0f6f0ceb43de886e474a9cd330 Merge: efda9be 0ea41d9 Author: snowleo Date: Tue Jan 24 03:43:49 2012 +0100 Merge branch 'refs/heads/master' into release commit efda9beece60b5f556debb39c530614bada81d34 Merge: c7c7e5e 4b61ac9 Author: KHobbits Date: Sat Jan 21 17:19:12 2012 +0000 Merge branch 'master' into release commit c7c7e5e4cee259d71c91c6c9d2b863ab7734ae97 Merge: f61f801 f26cccb Author: KHobbits Date: Mon Jan 16 12:43:09 2012 +0000 Merge remote branch 'remotes/origin/master' into release commit f61f80164db481ccd10115cc8bbed98596202a92 Merge: d16fef9 f0def90 Author: KHobbits Date: Sat Jan 14 15:52:55 2012 +0000 Merge branch 'master' into release commit d16fef9f7f6ac2fff63a80c43d9fb962127889ec Merge: 4425d53 43f1c0f Author: KHobbits Date: Sat Jan 14 13:16:33 2012 +0000 Merge branch 'master' into release ~ GM needs testing before release ~ commit 4425d536640d5deebc95e72a0f3f9f6c760563e1 Author: snowleo Date: Tue Dec 20 12:24:59 2011 +0100 Only info not a warning if a file is missing commit ee5e015a637b6ef9a573dc5aef273ade60f90bb4 Author: snowleo Date: Tue Dec 20 12:20:12 2011 +0100 Correctly match release and non release versions of bukkit. commit 839ce3d526ce666e189998e1722f1ad98e9955f9 Author: snowleo Date: Tue Dec 20 11:57:22 2011 +0100 Fix sending our player object to other plugins. commit cc0611721083e2cea902d6b8e7e819e7818680f5 Merge: cbd5b6c 5a092f0 Author: snowleo Date: Mon Dec 19 12:07:28 2011 +0100 Merge branch 'refs/heads/master' into release commit cbd5b6c0f43a7be652c7ead7199939fadd6cc422 Merge: 867e66e fec3b61 Author: KHobbits Date: Mon Dec 19 05:04:15 2011 +0000 Merge remote branch 'remotes/origin/master' into release commit 867e66e774bca268fccc696ef9d724ca47763796 Merge: 45ffeaf 9eaebad Author: snowleo Date: Wed Dec 14 11:56:09 2011 +0100 Merge branch 'refs/heads/master' into release commit 45ffeaffeca33813d9f7c12e2fbcbbb2e37f80b8 Merge: f91b622 79861b1 Author: snowleo Date: Tue Dec 13 23:52:58 2011 +0100 Merge branch 'refs/heads/master' into release commit f91b62264691336ca0a21c18df3cf282a436bb33 Merge: 40a9c28 70bd9bd Author: snowleo Date: Tue Dec 13 10:32:59 2011 +0100 Merge branch 'refs/heads/master' into release commit 40a9c28699d2bedd450160102042249385850021 Merge: 081491d e37ab86 Author: KHobbits Date: Mon Dec 12 23:15:48 2011 +0000 Merge branch 'master' into release commit 081491d0a14afc3c9ac7dc9b8acd01ac11fa46e1 Merge: 8d0230d f936cd5 Author: KHobbits Date: Mon Dec 12 23:06:40 2011 +0000 Merge branch 'master' into release commit 8d0230d6a8f323749dc0a0fadfcbc226dc4c2ab8 Merge: 37e5260 e379ac5 Author: snowleo Date: Thu Dec 8 05:41:00 2011 +0100 Merge branch 'refs/heads/master' into release commit 37e5260cda3fa1cbd07f8bbd15506190445e48db Merge: 19b8031 e169e95 Author: snowleo Date: Tue Nov 29 21:55:09 2011 +0100 Merge branch 'refs/heads/master' into release commit 19b803193379c2d5fadc315f66810508dafca5cc Merge: 99211fd 91cdff9 Author: snowleo Date: Mon Nov 28 22:42:17 2011 +0100 Merge branch 'refs/heads/master' into release commit 99211fd4075a1620f6850ce895089997a71cc65f Merge: 3d839c2 5e24584 Author: snowleo Date: Mon Nov 28 20:28:05 2011 +0100 Merge branch 'refs/heads/master' into release commit 3d839c2b211307c09ef2e856f6b0fbd7b1635419 Merge: e1e7a1c 9acc7db Author: snowleo Date: Mon Nov 28 20:03:09 2011 +0100 Merge branch 'refs/heads/master' into release commit e1e7a1cfdb3fe6ceab20981db8edc7ee387cb776 Merge: 0ed7f87 b637e49 Author: snowleo Date: Mon Nov 28 04:23:38 2011 +0100 Merge branch 'refs/heads/master' into release commit 0ed7f87ee0f8c077f6bb66bee696352d371fe7a4 Merge: 579bbc9 aceda4c Author: snowleo Date: Sun Nov 27 20:59:19 2011 +0100 Merge branch 'refs/heads/master' into release commit 579bbc9f2cd003fc92dce1e38dc3a02c86cfbd7b Merge: e672de9 af456a7 Author: snowleo Date: Thu Nov 24 04:26:05 2011 +0100 Merge branch 'refs/heads/master' into release commit e672de949c6e4d0dcba6869a3e0669f0d9688297 Merge: f72762b 19f5a23 Author: snowleo Date: Sun Nov 20 21:46:02 2011 +0100 Merge branch 'refs/heads/master' into release commit f72762bcb27b9ee8ae099c84c012e594a6a93a26 Merge: 7ecc3c2 4f8319b Author: snowleo Date: Sat Nov 19 16:04:00 2011 +0100 Merge branch 'refs/heads/master' into release commit 7ecc3c25b01b718aa0b21774cc0289ba3c64a394 Merge: adcffba 41c0385 Author: snowleo Date: Thu Nov 17 19:06:44 2011 +0100 Merge branch 'refs/heads/master' into release commit adcffba7cf5e45a1dcd35ee9f6c1a65688b8c61e Merge: e271e60 2a4c26e Author: snowleo Date: Thu Nov 17 16:34:39 2011 +0100 Merge branch 'refs/heads/master' into release commit e271e6014491cd05aa78408924429e4298330225 Merge: 16be869 c5c29ae Author: snowleo Date: Thu Nov 17 15:34:27 2011 +0100 Merge branch 'refs/heads/master' into release commit 16be86953ffabe4736e939fde6fe4125f247724f Merge: 1f527cd eda827b Author: snowleo Date: Tue Nov 15 22:52:42 2011 +0100 Merge branch 'refs/heads/master' into release commit 1f527cdb9e3439a175d01bb80c4eedbc127bcb17 Merge: 11e8240 90c9fe7 Author: KHobbits Date: Tue Nov 8 05:17:42 2011 +0000 Merge branch 'essmaster' into essrelease commit 11e8240c5cbadca9cf9d0a69c97e99220f808e69 Merge: 4aecc03 aa922c5 Author: snowleo Date: Sat Oct 22 11:55:01 2011 +0200 Merge branch 'refs/heads/master' into release Conflicts: EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java commit 4aecc034c26d6d9c71024f90183e25e431217b7b Author: KHobbits Date: Tue Oct 11 22:51:30 2011 +0100 Fixing typo in release build. commit a111a07bcaf303a7b53b9810b3e936b6253d0fc6 Merge: eb71097 9ec398b Author: KHobbits Date: Tue Oct 11 20:06:23 2011 +0100 Merge branch 'essmaster' into essrelease commit eb71097546e2f072e451223612226f3ecadc7e13 Merge: c7fcb72 1bb3eb0 Author: KHobbits Date: Tue Oct 11 17:52:56 2011 +0100 Merge remote branch 'remotes/ess/master' into essrelease commit c7fcb72d6c97b33432d08ade9d4b222a84402fef Merge: 04af8ef 02ee314 Author: KHobbits Date: Mon Oct 10 17:21:48 2011 +0100 Merge remote branch 'remotes/ess/master' into essrelease commit 04af8ef3291381ce0fefdda007714de89e554581 Merge: 4cdf803 a34c92d Author: snowleo Date: Mon Oct 10 00:30:47 2011 +0200 Merge branch 'master' into release commit 4cdf803ab7bbed4a5484cf28ddad758389e28aa3 Merge: 4595c15 6012086 Author: snowleo Date: Sun Oct 9 23:52:15 2011 +0200 Merge branch 'master' into release commit 4595c15bee01bd28318f05b72054de077848a8f5 Merge: 1e3d2fb 8199416 Author: snowleo Date: Sun Oct 9 17:54:59 2011 +0200 Merge branch 'master' into release commit 1e3d2fbfd28068095cce01b5c6bba889794dd1b1 Merge: 57c25bf 313df99 Author: snowleo Date: Sat Oct 8 19:43:07 2011 +0200 Merge branch 'master' into release commit 57c25bf1517ca91216025591314326a1c141096c Merge: ae030b2 55fc8bd Author: snowleo Date: Tue Oct 4 23:07:30 2011 +0200 Merge branch 'master' into release commit ae030b227a2e189429cff5f4e0c4bcfa116a6cb8 Merge: 4f85751 0645d58 Author: snowleo Date: Tue Oct 4 22:20:10 2011 +0200 Merge branch 'master' into release commit 4f85751694b97628cb51f9bcfed9a9ee3187d5f7 Merge: 6b0d0da 65a78a6 Author: snowleo Date: Tue Oct 4 21:34:28 2011 +0200 Merge branch 'master' into release commit 6b0d0daa2e000be06f92faa4f947e35e824a4018 Merge: 401498a 9718e65 Author: KHobbits Date: Tue Oct 4 14:40:12 2011 +0100 Merge branch 'essmaster' into essrelease commit 401498a4f760263868e4833d9d2ae285213ff468 Merge: 8bb5018 acdad5c Author: KHobbits Date: Tue Oct 4 09:51:51 2011 +0100 Merge branch 'essmaster' into essrelease commit 8bb50189bc3a23e6d6a529474f08e82ffb47e60f Merge: eb665a0 f2407bc Author: KHobbits Date: Thu Sep 29 00:43:42 2011 +0100 Merge remote branch 'remotes/ess/master' into essrelease commit eb665a059ad6ffdb8ca832d9cddf75fe0ac7a5e4 Merge: 3dc29be a8cfbe1 Author: KHobbits Date: Thu Sep 29 00:40:16 2011 +0100 Merge branch 'essmaster' into essrelease commit 3dc29be0830b10bb7a37b743df1115c4acc0b300 Merge: 82e5447 ee00fb7 Author: KHobbits Date: Tue Sep 27 02:01:52 2011 +0100 Merge branch 'essmaster' into essrelease commit 82e5447526fcdb90fac3800f4d11dad8525b6d49 Merge: 066f3fd 8b23f86 Author: KHobbits Date: Mon Sep 26 23:06:02 2011 +0100 Merge branch 'essmaster' into essrelease commit 066f3fd726f583f5afdca381437cb4738e4c5d20 Merge: f0acf73 e9c0bb2 Author: KHobbits Date: Thu Sep 22 15:29:47 2011 +0100 Merge branch 'essmaster' into essrelease commit f0acf733a58c1fd0679750c5f65a9eb1ac51cd7f Merge: 96c4dd2 33c6fc1 Author: snowleo Date: Thu Sep 22 10:47:58 2011 +0200 Merge branch 'master' into release commit 96c4dd2ab93e10e7c8b20e32803274ea09bf2e3c Merge: df3b9a7 998d097 Author: snowleo Date: Mon Sep 5 14:15:07 2011 +0200 Merge branch 'master' into release commit df3b9a7ef9bfe32723a72cca05f74edfb642b8d4 Merge: 70a3a59 fd6f768 Author: snowleo Date: Sun Sep 4 20:47:46 2011 +0200 Merge branch 'master' into release commit 70a3a5919e358246bd9cecb7de234a19d939585d Merge: 688d37e fc7a3e0 Author: snowleo Date: Fri Sep 2 00:05:05 2011 +0200 Merge branch 'master' into release commit 688d37ee60858ce6f2bb57969414bc3c3b971949 Merge: 3dcf8bc 382bd24 Author: snowleo Date: Thu Sep 1 16:35:47 2011 +0200 Merge branch 'master' into release commit 3dcf8bc8fc53137c8c38b65a490429880b968462 Merge: 7039d61 ecc1a0a Author: snowleo Date: Tue Aug 30 09:46:49 2011 +0200 Merge branch 'master' into release commit 7039d613eee66f7e389353fc158c792481c0bff6 Merge: 256c963 12e3eb1 Author: snowleo Date: Mon Aug 29 20:43:49 2011 +0200 Merge branch 'master' into release commit 256c9633706e7a8d087e21926871437320895057 Merge: 7b8c2a4 d818f70 Author: snowleo Date: Sun Aug 21 21:44:58 2011 +0200 Merge branch 'master' into release commit 7b8c2a4575a49186ee5002e3a6723bf97cab879f Merge: 7f1ba0d 040e2be Author: snowleo Date: Sun Aug 21 20:22:28 2011 +0200 Merge branch 'master' into release commit 7f1ba0d6ae01e2981758415d26d6bef3bc754907 Merge: 7e5b79a 2b48045 Author: snowleo Date: Fri Aug 19 02:32:56 2011 +0200 Merge branch 'master' into release commit 7e5b79aa145f81677c75ce34e59500b98cd21b65 Merge: 086343e a53d8dd Author: snowleo Date: Fri Aug 19 02:10:36 2011 +0200 Merge branch 'master' into release commit 086343ee482747ae20116165659e35620dc59cc6 Merge: a1ad512 c79ac59 Author: snowleo Date: Fri Aug 19 01:06:52 2011 +0200 Merge branch 'master' into release commit a1ad512a80dcbe15d59ba3e911b0e5f3500a3336 Merge: 9bb2ef9 6a9865c Author: snowleo Date: Fri Aug 19 00:42:26 2011 +0200 Merge branch 'master' into release commit 9bb2ef9cbe99d08beab8606446dfc5c5b3bc2377 Merge: 832910d beb34a7 Author: snowleo Date: Wed Jul 27 01:04:37 2011 +0200 Merge branch 'master' into release commit 832910d480bf2a209df49607c643b930e81b11f8 Merge: 13da2b2 1645417 Author: snowleo Date: Sat Jul 23 22:34:43 2011 +0200 Merge branch 'master' into release commit 13da2b29248be399ab4dcff29853c54a093aeeed Merge: 84ac520 7aea9e7 Author: snowleo Date: Sat Jul 23 20:06:00 2011 +0200 Merge branch 'master' into release commit 84ac520353ce7f80f762e7f5b4098d951567e239 Author: snowleo Date: Sat Jul 23 20:05:44 2011 +0200 Master and Release branch are now identical again. Removed warning for an older bukkit version. commit 5613975314ec358c66246ee6bef4eb4faa58dbed Merge: 662d30a dc0ca35 Author: snowleo Date: Sat Jul 23 03:11:14 2011 +0200 Merge branch 'master' into release commit 662d30ae45d5c655b7617d8342ceef6808374934 Merge: 57bee44 4099755 Author: snowleo Date: Sat Jul 23 03:07:38 2011 +0200 Merge branch 'master' into release commit 57bee443b1cecf0516b4c3d8733fc4382cf3f17d Merge: 621618e 0f3c0e8 Author: snowleo Date: Sat Jul 23 02:39:37 2011 +0200 Merge branch 'master' into release commit 621618e41fe1b8b4021aade20ee32693b3528bb3 Merge: 6ccb608 5455917 Author: snowleo Date: Thu Jul 21 02:58:39 2011 +0200 Merge branch 'master' into release commit 6ccb60813a165d2beb5df5e5080ac6041dd41b29 Merge: b341199 2067bb8 Author: snowleo Date: Thu Jul 21 02:52:25 2011 +0200 Merge branch 'master' into release commit b34119901ed89a0e3026df2aea0eca24bc0addd2 Merge: b317aef 4f31d27 Author: snowleo Date: Thu Jul 21 02:29:45 2011 +0200 Merge branch 'master' into release commit b317aef8c9b9574642c8e91c4d4c4b094da15cb8 Merge: fdbc6fa 8b41219 Author: snowleo Date: Thu Jul 21 00:31:39 2011 +0200 Merge branch 'master' into release commit fdbc6fa94fad33410962c99ea73a756d0fbf34ef Merge: 0ffe249 28dd14d Author: snowleo Date: Wed Jul 20 23:18:34 2011 +0200 Merge branch 'master' into release commit 0ffe24903abc266a7b1070b80e59a48c055c29da Merge: e550a7c f6e6e00 Author: snowleo Date: Wed Jul 20 23:09:40 2011 +0200 Merge branch 'master' into release commit e550a7cc44bf9bd323ae7bffa93f816e8bb94854 Merge: 82165a2 9efc084 Author: snowleo Date: Wed Jul 20 22:37:43 2011 +0200 Merge branch 'master' into release commit 82165a2af6c484efb1e30e6960ebe698ded50730 Merge: 63a4fe3 815b700 Author: snowleo Date: Wed Jul 20 22:22:02 2011 +0200 Merge branch 'master' into release commit 63a4fe32c178b849cd6bb75b5e8524256155650d Merge: 1c44a25 06dc9c2 Author: snowleo Date: Wed Jul 20 18:40:04 2011 +0200 Merge branch 'master' into release commit 1c44a25a4a96784b2ea4ee1e5bb71c88b275f865 Merge: cf21ece 0483635 Author: snowleo Date: Wed Jul 20 12:13:24 2011 +0200 Merge branch 'master' into release commit cf21ecee2ef61d45b622e0debf7de833ff76d36e Merge: 5467e50 3b59dd0 Author: snowleo Date: Tue Jul 19 12:09:48 2011 +0200 Merge branch 'master' into release commit 5467e502a58bfe73b6236855d7a5dd8c2e08a310 Merge: 6af9ec2 e805d10 Author: snowleo Date: Tue Jul 19 11:42:18 2011 +0200 Merge branch 'master' into release commit 6af9ec266b5fd6f054d93ca1f35f43d72dacb625 Merge: faa7e0e 150a0e0 Author: snowleo Date: Tue Jul 19 01:52:44 2011 +0200 Merge branch 'master' into release commit faa7e0e7a9f3459436524d17418b01bb4f912931 Merge: aa36060 fdbb651 Author: snowleo Date: Tue Jul 19 00:47:14 2011 +0200 Merge branch 'master' into release commit aa3606007acf56de3ed09848136e3c80f04f9164 Merge: db59749 d0bf190 Author: snowleo Date: Tue Jul 19 00:42:10 2011 +0200 Merge branch 'master' into release commit db5974970d757de0fdf41e85938c05ad97fb9547 Merge: ba2539d d2bc7e0 Author: snowleo Date: Mon Jul 18 20:55:31 2011 +0200 Merge branch 'master' into release commit ba2539db67ce7b177c8669d88b34629647206b6f Merge: 21d0661 e3a470e Author: snowleo Date: Mon Jul 18 02:30:16 2011 +0200 Merge branch 'master' into release commit 21d0661d79ff75af7d12298a43e6c2a2681dcc87 Merge: 9f3eb46 1556801 Author: snowleo Date: Mon Jul 18 01:49:45 2011 +0200 Merge branch 'master' into release commit 9f3eb461a97c2762f9c4692573ece8c23960c611 Merge: 34b0deb 48230f6 Author: snowleo Date: Sat Jul 16 17:04:46 2011 +0200 Merge branch 'master' into release commit 34b0deba29b4730fd3eb87925aa574bbb02ebb99 Merge: d9a93d8 088f50c Author: snowleo Date: Sat Jul 16 16:53:13 2011 +0200 Merge branch 'master' into release commit d9a93d8dfff77aea0a2d8b726954333efb9f1f26 Merge: 7477763 5ad12b5 Author: snowleo Date: Sat Jul 16 14:04:49 2011 +0200 Merge branch 'master' into release commit 747776344b275b02f37a7857b560d198c9ba0838 Author: snowleo Date: Sat Jul 16 13:32:10 2011 +0200 Fixing merge error commit f979a79081e6b9d97654d9142cc92d2277889f17 Merge: 367e984 e6685ab Author: snowleo Date: Sat Jul 16 13:25:12 2011 +0200 Merge branch 'master' into release Conflicts: Essentials/src/com/earth2me/essentials/Essentials.java Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java Essentials/src/com/earth2me/essentials/commands/Commandspawner.java Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java Essentials/src/com/earth2me/essentials/register/payment/Methods.java Essentials/src/items.csv EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java lib/bukkit-0.0.1-SNAPSHOT.jar lib/craftbukkit-0.0.1-SNAPSHOT.jar commit 367e9840cc51b3fc56ca556574035fbeebc2847c Author: snowleo Date: Tue Jun 7 22:18:57 2011 +0200 Fix save inventory after logout for new players. commit ea590c2ed1c67009c1170680f28e15f4cec22534 Author: snowleo Date: Sun Jun 5 00:00:41 2011 +0000 NPE fix for offline users in UserData git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1583 e251c2fe-e539-e718-e476-b85c1f46cddb commit d93120257b170526a74a3620ef0064301f14dc58 Author: snowleo Date: Sat Jul 2 01:10:48 2011 +0200 Update of bukkit version number in essentials class commit e763b362d9f65941f6423e0613a0f5433fabb475 Author: snowleo Date: Sat Jul 2 01:09:19 2011 +0200 CB# 953 B# 754 commit e5eb1ca0cb610409ec719beb3d0ffc5603e0b28e Author: snowleo Date: Fri Jul 1 10:52:59 2011 +0200 More names for pistons (items.csv) Fix for /unlimited and pistons commit ea2649db5e6ded860b4fd096ad9938246f8857f7 Author: snowleo Date: Thu Jun 30 19:16:50 2011 +0200 Updated items.csv commit b53fc9cadc5a3f77c73bf34e768bd6f968537967 Author: snowleo Date: Thu Jun 30 18:54:05 2011 +0200 Renamed functions commit 4b35e1b72982295358e1a557f8cd78a38c81bc0e Author: snowleo Date: Thu Jun 30 18:43:23 2011 +0200 CB #946 B #750 commit 40e106db13fd58351bee9b82733b1900e96dc6a0 Author: snowleo Date: Mon Jun 27 11:57:03 2011 +0200 Fix /spawner command The name had to be first letter uppercase, the rest lowercase commit 3dc0659f664e0ac7f56f1e555da2fa9e97d7b2e8 Author: snowleo Date: Mon Jun 27 11:53:57 2011 +0200 Another fix to /spawnmob Merged for release commit e652ed2981888e39687fe0040b84683e04f74228 Author: snowleo Date: Sun Jun 26 02:00:57 2011 +0200 Copy&Paste is bad. commit 28db891aa51dcea8d15e8eb0bc3c5eb55ee24b59 Author: snowleo Date: Sun Jun 26 01:43:59 2011 +0200 Fix for Register inside Essentials commit b63ae9b771b10a4c0a5122501b98597ab939c62c Author: snowleo Date: Sun Jun 26 01:43:19 2011 +0200 SEVERE error messages for other plugins, that try to manually enable Essentials, FakePermissions or GroupManager commit 27c84ceaac8bf7ad7f192e087fcd324616a23611 Author: snowleo Date: Sat Jun 25 15:34:33 2011 +0200 Remove the restriction of EssEcoApi to not use iConomy or BOSE commit d67ccd03cadf77faf95cc253fbf50d88922a4209 Merge: 96b0f27 5e2f4bc Author: snowleo Date: Sat Jun 25 14:27:30 2011 +0200 Merge branch 'bukkitupdate' into release commit 96b0f27c5117c189a2686f6d1fc534a462e433c2 Author: snowleo Date: Sun Jun 12 02:47:50 2011 +0200 Fix for Craftbukkit Bug 912 --- .../earth2me/essentials/protect/EssentialsProtectEntityListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 9a754a374..9766a1a11 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -332,7 +332,7 @@ public class EssentialsProtectEntityListener implements Listener settings.acquireReadLock(); try { - if (settings.getData().getPrevent().isEndermanPickup()) + if (event.getEntityType() == EntityType.ENDERMAN && settings.getData().getPrevent().isEndermanPickup()) { event.setCancelled(true); } -- cgit v1.2.3 From 1bfe63da96ca91a736da95a6a82fc2ef747e3228 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 14 Mar 2012 03:01:23 +0100 Subject: Splitting permissions and ranks (renamed from groups) Deleted all old permissions handlers, since we fully use superperms now --- .../src/com/earth2me/essentials/protect/BlockBreakPermissions.java | 2 +- .../src/com/earth2me/essentials/protect/BlockPlacePermissions.java | 2 +- .../src/com/earth2me/essentials/protect/ItemUsePermissions.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java index 74ebe38dc..b6a74df22 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockBreakPermissions.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IPermission; -import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import com.earth2me.essentials.permissions.AbstractSuperpermsPermission; import java.util.EnumMap; import java.util.Locale; import java.util.Map; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java index 23ce7e053..00f7d6c4e 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/BlockPlacePermissions.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IPermission; -import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import com.earth2me.essentials.permissions.AbstractSuperpermsPermission; import java.util.EnumMap; import java.util.Locale; import java.util.Map; diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java index 258a93761..7cd147aee 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ItemUsePermissions.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IPermission; -import com.earth2me.essentials.perm.AbstractSuperpermsPermission; +import com.earth2me.essentials.permissions.AbstractSuperpermsPermission; import java.util.EnumMap; import java.util.Locale; import java.util.Map; -- cgit v1.2.3 From 1f8cf1935f1890517ad3405c0e74ddbedba2d916 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 14 Mar 2012 03:10:22 +0100 Subject: Move utils to new package --- EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java index 1ed32ddda..2404e165f 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/Permissions.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.protect; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IPermission; import java.util.Locale; import org.bukkit.command.CommandSender; -- cgit v1.2.3 From 5014b93e169b5808bf06885fa4a5be79bb2209d7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 18 Mar 2012 14:33:16 +1100 Subject: Use maven for versioning. Note GroupManager versioning is broken. --- EssentialsProtect/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'EssentialsProtect/src') diff --git a/EssentialsProtect/src/plugin.yml b/EssentialsProtect/src/plugin.yml index 42fe156b9..f87cdc7c7 100644 --- a/EssentialsProtect/src/plugin.yml +++ b/EssentialsProtect/src/plugin.yml @@ -2,7 +2,7 @@ name: EssentialsProtect main: com.earth2me.essentials.protect.EssentialsProtect # Note to developers: This next line cannot change, or the automatic versioning system will break. -version: TeamCity +version: ${build.number} website: http://tiny.cc/EssentialsWiki description: Provides protection for various parts of the world. authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits] -- cgit v1.2.3