From 5d048d2c1dbfccf2db5188a7b2e3f9f303d9c273 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 25 Feb 2012 17:57:26 +0000 Subject: Updating Bukkit: CB #1858, B #1334 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 17 ++++++++++++----- .../earth2me/essentials/craftbukkit/FakeWorld.java | 6 ++++++ lib/bukkit.jar | Bin 4614591 -> 4620068 bytes lib/craftbukkit.jar | Bin 10786423 -> 10793996 bytes 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a75e12aad..ff082efa7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1938; + public static final int BUKKIT_VERSION = 1958; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 440d3fad3..ba5f97c71 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -172,11 +172,6 @@ public class OfflinePlayer implements Player return false; } - public boolean isPlayer() - { - return false; - } - @Override public int getRemainingAir() { @@ -901,4 +896,16 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public T launchProjectile(Class arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityType getType() + { + return EntityType.PLAYER; + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index 0ea06e72b..f39c6e451 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -584,4 +584,10 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public LivingEntity spawnCreature(Location arg0, EntityType arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/lib/bukkit.jar b/lib/bukkit.jar index e343a9723..aa22b004e 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index d51826640..24d7801c3 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From a5b38ce1a492edb69c14239d976ff72db84915ef Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:15:14 +0000 Subject: Add Minimum Balance, to allow people to manage overdrafts. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/IUser.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 16 ++++++++++++++++ Essentials/src/com/earth2me/essentials/Trade.java | 6 ++---- Essentials/src/com/earth2me/essentials/User.java | 13 +++++++++++-- Essentials/src/com/earth2me/essentials/api/Economy.java | 4 ++++ .../src/com/earth2me/essentials/commands/Commandeco.java | 4 ++++ Essentials/src/com/earth2me/essentials/user/User.java | 11 +++++++++++ Essentials/src/config.yml | 6 +++++- 9 files changed, 57 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index e567673b6..cded5bde5 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -115,6 +115,8 @@ public interface ISettings extends IConf boolean warnOnSmite(); double getMaxMoney(); + + double getMinMoney(); boolean isEcoLogEnabled(); diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java index bff556ab4..df5401886 100644 --- a/Essentials/src/com/earth2me/essentials/IUser.java +++ b/Essentials/src/com/earth2me/essentials/IUser.java @@ -32,6 +32,8 @@ public interface IUser extends Player void takeMoney(double value); void giveMoney(double value); + + boolean canAfford(double value); String getGroup(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 40fb47f6c..39179b957 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -539,6 +539,22 @@ public class Settings implements ISettings } return max; } + + private final static double MINMONEY = -10000000000000.0; + + @Override + public double getMinMoney() + { + double min = config.getDouble("min-money", MINMONEY); + if (min > 0) { + min = -min; + } + if (min < MINMONEY) + { + min = MINMONEY; + } + return min; + } @Override public boolean isEcoLogEnabled() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 933b54b3f..5ed80d35b 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -143,8 +143,7 @@ public class Trade { if (getMoney() != null) { - final double mon = user.getMoney(); - if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(getMoney()) && getMoney() > 0) { throw new ChargeException(_("notEnoughMoney")); } @@ -163,9 +162,8 @@ public class Trade && !user.isAuthorized("essentials.nocommandcost.all") && !user.isAuthorized("essentials.nocommandcost." + command)) { - final double mon = user.getMoney(); final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); - if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(cost) && cost > 0) { throw new ChargeException(_("notEnoughMoney")); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 7225e1dba..a799653a8 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -153,9 +153,18 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } public boolean canAfford(final double cost) + { + return canAfford(cost, true); + } + + public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - return mon >= cost || isAuthorized("essentials.eco.loan"); + if (!permcheck || isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; } public void dispose() @@ -384,7 +393,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void updateMoneyCache(final double value) { if (ess.getPaymentMethod().hasMethod() && super.getMoney() != value) - { + { super.setMoney(value); } } diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index 1d45c8df9..a1d421c38 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -115,6 +115,10 @@ public final class Economy { throw new UserDoesNotExistException(name); } + if (balance < ess.getSettings().getMinMoney()) + { + throw new NoLoanPermittedException(); + } if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan")) { throw new NoLoanPermittedException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index 8f432ca6e..d2efc1845 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import java.util.Locale; import org.bukkit.Server; @@ -45,6 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount); break; diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 0e544ae06..5249c8718 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -196,4 +196,15 @@ public class User extends UserBase implements IUser unlock(); } } + + @Override + public boolean canAfford(final double cost) + { + final double mon = getMoney(); + if (isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 00585f35f..97b73e4c5 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -281,10 +281,10 @@ spawn-if-no-home: true update-bed-at-daytime: true # Allow players to have multiple homes. +# Players need essentials.sethome.multiple before they can have more than 1 home, default to 'default' below. # Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip # People with essentials.sethome.multiple.unlimited are not limited by these numbers. sethome-multiple: - # essentials.sethome.multiple default: 3 # essentials.sethome.multiple.vip vip: 5 @@ -321,6 +321,10 @@ currency-symbol: '$' # The amount is always limited to 10 trillions because of the limitations of a java double max-money: 10000000000000 +# Set the minimum amount of money a player can have +# Setting this to 0, will disable overdrafts/loans compeltely. Users need 'essentials.eco.loan' perm to go below 0. +min-money: -10000000000000 + # Enable this to log all interactions with trade/buy/sell signs and sell command economy-log-enabled: false -- cgit v1.2.3 From d24f77dbd5816e018de99a9bf5ab9ed07bdf53d5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:27:13 +0000 Subject: Display users new balance on /eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandeco.java | 9 +++++++-- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index a799653a8..501577878 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -109,7 +109,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("addedToAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } @@ -148,7 +148,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index d2efc1845..b9694ee49 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -46,8 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: - if (!player.canAfford(amount, false)) { - throw new Exception(_("notEnoughMoney")); + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); } player.takeMoney(amount); break; @@ -68,6 +69,10 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount, sender); break; diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 8489b6262..118c61ca4 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 82145afc1..a2719ddd1 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -4,7 +4,7 @@ # by: Dysp, dysperen@gmail.com action=* {0} {1} addedToAccount=\u00a7a{0} er blevet tilf\u00f8jet til din konto. -addedToOthersAccount=\u00a7a{0} er blevet tilf\u00f8jet til {1} konto. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival takenFromAccount=\u00a7c{0} er blevet taget fra din konto. -takenFromOthersAccount=\u00a7c{0} er blevet taget fra {1}''s konto. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 2572f7cf2..b5ca8a800 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt. -addedToOthersAccount=\u00a7a{0} wurden zu {1}s Konto hinzugef\u00fcgt. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=zerst\u00f6rt: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3} alertPlaced=platziert: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Lebewohl grausame Welt... suicideSuccess= \u00a77{0} hat sich das Leben genommen. survival=survival takenFromAccount=\u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen. -takenFromOthersAccount=\u00a7c{0} wurde von {1} wurde Rechnung getragen. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet... teleportAll=\u00a77Teleportiere alle Spieler... teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index a2acdf9a2..dac209927 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 38d62f6c4..0c1ca7452 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} ha sido agregado a tu cuenta. -addedToOthersAccount=\u00a7a{0} ha sido agregado a la cuenta de {1}. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. -takenFromOthersAccount=\u00a7c{0} ha sido sacado de la cuenta de {1}. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 290c1b668..bd93cb8e8 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -4,7 +4,7 @@ # by: L\u00e9a Gris action=* {0} {1} addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte. -addedToOthersAccount=\u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte. +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=a cass\u00e9 : alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertPlaced=a plac\u00e9 : @@ -318,7 +318,7 @@ suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. -takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 8997bfec6..f2c9f9b2f 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -4,7 +4,7 @@ # by: Geertje123 action=* {0} {1} addedToAccount=\u00a7a{0} is gestort op je account. -addedToOthersAccount=\u00a7a{0} is overgemaakt naar {1}''s rekening +addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. -takenFromOthersAccount=\u00a7c{0} is overgenomen uit {1} account. +takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From ad08d275042c9841b48bc3945abd694649fd7529 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:01:40 +0000 Subject: Adjustments to negative eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 3 ++- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 501577878..bd712bf87 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -160,9 +160,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); + ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 5249c8718..d77790938 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 118c61ca4..f7958319d 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a2719ddd1..0d8260947 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -4,7 +4,7 @@ # by: Dysp, dysperen@gmail.com action=* {0} {1} addedToAccount=\u00a7a{0} er blevet tilf\u00f8jet til din konto. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival takenFromAccount=\u00a7c{0} er blevet taget fra din konto. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b5ca8a800..815972f03 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=zerst\u00f6rt: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3} alertPlaced=platziert: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Lebewohl grausame Welt... suicideSuccess= \u00a77{0} hat sich das Leben genommen. survival=survival takenFromAccount=\u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet... teleportAll=\u00a77Teleportiere alle Spieler... teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index dac209927..dfc7600dc 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 0c1ca7452..909ec7434 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} ha sido agregado a tu cuenta. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index bd93cb8e8..a74be475b 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -4,7 +4,7 @@ # by: L\u00e9a Gris action=* {0} {1} addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=a cass\u00e9 : alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertPlaced=a plac\u00e9 : @@ -318,7 +318,7 @@ suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index f2c9f9b2f..51bbe2bed 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -4,7 +4,7 @@ # by: Geertje123 action=* {0} {1} addedToAccount=\u00a7a{0} is gestort op je account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From bcf903de924cf9e682a501ec419d2bd72b71831c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:06:03 +0000 Subject: Cleanup. --- Essentials/src/com/earth2me/essentials/Settings.java | 14 ++++++-------- Essentials/src/com/earth2me/essentials/User.java | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 39179b957..b6b1f4994 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.signs.EssentialsSign; import com.earth2me.essentials.signs.Signs; import com.earth2me.essentials.textreader.IText; -import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextInput; -import com.earth2me.essentials.textreader.SimpleTextPager; import java.io.File; import java.text.MessageFormat; import java.util.*; @@ -218,10 +216,10 @@ public class Settings implements ISettings if (config.isConfigurationSection("kits")) { final ConfigurationSection kits = getKits(); - if (kits.isConfigurationSection(name)) + if (kits.isConfigurationSection(name)) { return kits.getConfigurationSection(name).getValues(true); - } + } } return null; } @@ -539,15 +537,15 @@ public class Settings implements ISettings } return max; } - private final static double MINMONEY = -10000000000000.0; - + @Override public double getMinMoney() { double min = config.getDouble("min-money", MINMONEY); - if (min > 0) { - min = -min; + if (min > 0) + { + min = -min; } if (min < MINMONEY) { diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index bd712bf87..86a3bcbfe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -7,7 +7,6 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.logging.Logger; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -160,7 +159,6 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { return (mon - cost) > ess.getSettings().getMinMoney(); -- cgit v1.2.3 From 10ae9c3aa2f0a206c8d715717b0cbaf5247752c1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:10:04 +0000 Subject: Allow people to hit exactly 'min money'. --- Essentials/src/com/earth2me/essentials/User.java | 2 +- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 86a3bcbfe..0be375c88 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -161,7 +161,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser final double mon = getMoney(); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index d77790938..0e77dd6a9 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } -- cgit v1.2.3 From a5e3182dadec976ab5117d755b678f75acda8a4f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 03:24:58 +0000 Subject: Change jail listener to catch respawn at Highest --- Essentials/src/com/earth2me/essentials/Jails.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 0011905ec..7217992ad 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -193,7 +193,7 @@ public class Jails extends AsyncStorageObjectHolder Date: Mon, 27 Feb 2012 03:40:18 +0000 Subject: Prevent EssSpawn trying to handle spawning of jailed players. --- .../com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 083fd66a5..c7a17845a 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -35,6 +35,11 @@ public class EssentialsSpawnPlayerListener implements Listener { final User user = ess.getUser(event.getPlayer()); + if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty()) + { + return; + } + if (ess.getSettings().getRespawnAtHome()) { Location home; -- cgit v1.2.3 From 833a5b2b552f297a9c5aeec3e11d58f0486c7e24 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 15:31:43 +0000 Subject: Adding option to log all eco api transactions. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ Essentials/src/com/earth2me/essentials/Trade.java | 3 ++- Essentials/src/com/earth2me/essentials/User.java | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index cded5bde5..6186736b4 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -119,6 +119,8 @@ public interface ISettings extends IConf double getMinMoney(); boolean isEcoLogEnabled(); + + boolean isEcoLogUpdateEnabled(); boolean removeGodOnDisconnect(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index b6b1f4994..732b5485c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -559,6 +559,12 @@ public class Settings implements ISettings { return config.getBoolean("economy-log-enabled", false); } + + @Override + public boolean isEcoLogUpdateEnabled() + { + return config.getBoolean("economy-log-update-enabled", false); + } @Override public boolean removeGodOnDisconnect() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 5ed80d35b..3594c3137 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -198,7 +198,8 @@ public class Trade public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess) { - if (!ess.getSettings().isEcoLogEnabled()) + if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled()) + || (loc != null && !ess.getSettings().isEcoLogEnabled())) { return; } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 0be375c88..ba34548fe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -385,8 +385,9 @@ public class User extends UserData implements Comparable, IReplyTo, IUser catch (Throwable ex) { } - } + } super.setMoney(value); + Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess); } public void updateMoneyCache(final double value) -- cgit v1.2.3 From 3823e7a108eaff2ecc65cb9221ad344d36f8c9ef Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 28 Feb 2012 10:46:10 +0000 Subject: Make 'manload' reload the config correctly. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 1159607ed..9d7187690 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -145,4 +145,5 @@ v 1.9: - Update for Bukkit R5 compatability. - Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. - Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups. - - Prevent promoting players to, and demoting to GlobalGroups. \ No newline at end of file + - Prevent promoting players to, and demoting to GlobalGroups. + - Make 'manload' reload the config correctly. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b0d46ca1a..00c71a41e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -121,15 +121,15 @@ public class GroupManager extends JavaPlugin { ch = new GMLoggerHandler(); GroupManager.logger.addHandler(ch); logger.setLevel(Level.ALL); - if (worldsHolder == null) { - // Create the backup folder, if it doesn't exist. - prepareFileFields(); - // Load the config.yml - prepareConfig(); - // Load the global groups - globalGroups = new GlobalGroups(this); - worldsHolder = new WorldsHolder(this); - } + + // Create the backup folder, if it doesn't exist. + prepareFileFields(); + // Load the config.yml + prepareConfig(); + // Load the global groups + globalGroups = new GlobalGroups(this); + worldsHolder = new WorldsHolder(this); + PluginDescriptionFile pdfFile = this.getDescription(); if (worldsHolder == null) { -- cgit v1.2.3 From bae337cc4946374640433700f8abb0f10c25dd24 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 12:27:59 +1100 Subject: Remove old, unwanted manifest.mf files --- EssentialsGeoIP/manifest.mf | 3 --- EssentialsProtect/MANIFEST.MF | 1 - EssentialsUpdate/manifest.mf | 3 --- EssentialsXMPP/manifest.mf | 3 --- 4 files changed, 10 deletions(-) delete mode 100644 EssentialsGeoIP/manifest.mf delete mode 100644 EssentialsProtect/MANIFEST.MF delete mode 100644 EssentialsUpdate/manifest.mf delete mode 100644 EssentialsXMPP/manifest.mf diff --git a/EssentialsGeoIP/manifest.mf b/EssentialsGeoIP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsGeoIP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsProtect/MANIFEST.MF b/EssentialsProtect/MANIFEST.MF deleted file mode 100644 index 9d885be53..000000000 --- a/EssentialsProtect/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -Manifest-Version: 1.0 diff --git a/EssentialsUpdate/manifest.mf b/EssentialsUpdate/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsUpdate/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsXMPP/manifest.mf b/EssentialsXMPP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsXMPP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - -- cgit v1.2.3 From 3f26d4ad9841b4ab30253222217edaaa60db3075 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 14:40:57 +1100 Subject: Separate config sections evenly --- Essentials/src/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 00585f35f..0c9f00f1e 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -18,8 +18,6 @@ # - CraftBukkit and Permissions have been updated: CraftBukkit and Essentials almost always line up, but sometimes other plugins fall behind CraftBukkit's multiple daily updates # - You have saved the document as UTF-8, NOT the default, ANSI - - ############################################################ # +------------------------------------------------------+ # # | Essentials (Global) | # @@ -368,8 +366,6 @@ chat: # If your using group formats make sure to remove the '#' to allow the setting to be read. - - ############################################################ # +------------------------------------------------------+ # # | EssentialsProtect | # @@ -525,7 +521,6 @@ protect: # Should we tell people they are not allowed to build warn-on-build-disallow: true - # Disable weather options weather: storm: false -- cgit v1.2.3 From d1001274bb043fb4ada717577b4b6da7aaa87e96 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 15:56:17 +0100 Subject: CB# 1988 B# 1360 --- lib/bukkit.jar | Bin 4620068 -> 4686754 bytes lib/craftbukkit.jar | Bin 10793996 -> 10919232 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index aa22b004e..28e143709 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 24d7801c3..ce2ecfeb8 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 6d1c270976bc417206bf53ffc408c4b5c08e7f33 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:15:37 +0100 Subject: Updated to R6 --- .../src/com/earth2me/essentials/OfflinePlayer.java | 121 ++++++++++++++++++++- .../essentials/commands/Commandkillall.java | 8 +- .../essentials/craftbukkit/FakeInventory.java | 35 ++++++ .../earth2me/essentials/craftbukkit/FakeWorld.java | 37 +++++++ .../essentials/craftbukkit/ShowInventory.java | 46 -------- .../earth2me/essentials/signs/SignDisposal.java | 4 +- .../com/earth2me/essentials/signs/SignFree.java | 7 +- .../earth2me/essentials/textreader/HelpInput.java | 6 +- .../test/com/earth2me/essentials/FakeServer.java | 28 +++++ .../earth2me/essentials/update/VersionInfo.java | 2 +- .../update/states/InstallationFinishedEvent.java | 7 ++ 11 files changed, 242 insertions(+), 59 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index ba5f97c71..a1c46c3ea 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1,18 +1,22 @@ package com.earth2me.essentials; -import com.earth2me.essentials.craftbukkit.OfflineBedLocation; import static com.earth2me.essentials.I18n._; import java.net.InetSocketAddress; import java.util.*; import lombok.Delegate; import org.bukkit.*; import org.bukkit.block.Block; +import org.bukkit.conversations.Conversation; import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.map.MapView; +import org.bukkit.metadata.MetadataValue; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; @@ -908,4 +912,119 @@ public class OfflinePlayer implements Player { return EntityType.PLAYER; } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setWindowProperty(Property prprt, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView getOpenInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openInventory(Inventory invntr) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openWorkbench(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openEnchanting(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void openInventory(InventoryView iv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void closeInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemOnCursor() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemOnCursor(ItemStack is) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + + @Override + public boolean isConversing() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptConversationInput(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean beginConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String[] strings) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index b9679e8b9..c0b47d20f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -125,7 +125,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -135,7 +135,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -143,14 +143,14 @@ public class Commandkillall extends EssentialsCommand } else if (all) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; } else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass())) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java index 992791710..01e7bd5b2 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java @@ -1,8 +1,13 @@ package com.earth2me.essentials.craftbukkit; import java.util.HashMap; +import java.util.List; +import java.util.ListIterator; import org.bukkit.Material; +import org.bukkit.entity.HumanEntity; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; @@ -187,4 +192,34 @@ public class FakeInventory implements Inventory items[i] = null; } } + + @Override + public List getViewers() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTitle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryType getType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryHolder getHolder() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ListIterator iterator() + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index f39c6e451..91e5d5239 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -12,6 +12,7 @@ import org.bukkit.entity.*; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; import org.bukkit.inventory.ItemStack; +import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.util.Vector; @@ -590,4 +591,40 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location lctn, Effect effect, T t, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java deleted file mode 100644 index fb2050ce4..000000000 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.earth2me.essentials.craftbukkit; - -import java.util.logging.Level; -import java.util.logging.Logger; -import net.minecraft.server.EntityPlayer; -import net.minecraft.server.IInventory; -import net.minecraft.server.PlayerInventory; -import org.bukkit.craftbukkit.entity.CraftPlayer; -import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - - -public class ShowInventory -{ - public static void showEmptyInventory(final Player player) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - entityPlayer.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } - - public static void showFilledInventory(final Player player, final ItemStack stack) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - InventoryWorkaround.addItem(inv, true, stack); - entityPlayer.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } -} diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index f747ac07c..77e6164e5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; +import org.bukkit.event.inventory.InventoryType; public class SignDisposal extends EssentialsSign @@ -15,7 +15,7 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - ShowInventory.showEmptyInventory(player.getBase()); + player.getBase().openInventory(ess.getServer().createInventory(player, InventoryType.CHEST)); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 7af7dffd7..a69b4155f 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -4,8 +4,9 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; import org.bukkit.Material; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -33,7 +34,9 @@ public class SignFree extends EssentialsSign } item.setAmount(item.getType().getMaxStackSize() * 9 * 4); - ShowInventory.showFilledInventory(player.getBase(), item); + Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); + i.addItem(item); + player.openInventory(i); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; } diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 85c00c1b6..efe66d585 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -30,9 +30,9 @@ public class HelpInput implements IText try { final PluginDescriptionFile desc = p.getDescription(); - final HashMap> cmds = (HashMap>)desc.getCommands(); + final Map> cmds = desc.getCommands(); pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH); - for (Map.Entry> k : cmds.entrySet()) + for (Map.Entry> k : cmds.entrySet()) { try { @@ -57,7 +57,7 @@ public class HelpInput implements IText { if (ess.getSettings().showNonEssCommandsInHelp()) { - final HashMap value = k.getValue(); + final Map value = k.getValue(); Object permissions = null; if (value.containsKey(PERMISSION)) { diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index a7335a957..58fdfc5fe 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -13,7 +13,11 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.generator.ChunkGenerator; +import org.bukkit.help.HelpMap; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.map.MapView; @@ -677,4 +681,28 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public HelpMap getHelpMap() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, InventoryType it) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, int i, String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java index b9cddc38c..c06aa2e64 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java @@ -16,7 +16,7 @@ public class VersionInfo public VersionInfo(final Configuration updateConfig, final String path) { - changelog = updateConfig.getList(path + ".changelog", Collections.emptyList()); + changelog = updateConfig.getStringList(path + ".changelog"); minBukkit = updateConfig.getInt(path + ".min-bukkit", 0); maxBukkit = updateConfig.getInt(path + ".max-bukkit", 0); modules = new HashMap(); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index 02b35c3d6..82d9ee627 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.update.states; import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; public class InstallationFinishedEvent extends Event @@ -9,4 +10,10 @@ public class InstallationFinishedEvent extends Event { super(); } + + @Override + public HandlerList getHandlers() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From 454f7d30de818268e4e1c2baf5daace6e3592908 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:17:40 +0100 Subject: Requires #1988 because of the new Inventory stuff --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index ff082efa7..f480d9e8f 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1958; + public static final int BUKKIT_VERSION = 1988; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From 056303b53c953f4a9effa661b1a61d35893a8858 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 17:33:09 +0100 Subject: EntityType instead of CreatureType --- Essentials/src/com/earth2me/essentials/Mob.java | 56 +++++++++++----------- .../essentials/commands/Commandspawner.java | 3 +- .../essentials/commands/Commandspawnmob.java | 24 +++++----- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 049f7b8a3..7be698950 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -9,40 +9,40 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Server; -import org.bukkit.entity.CreatureType; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; public enum Mob { - CHICKEN("Chicken", Enemies.FRIENDLY, CreatureType.CHICKEN), - COW("Cow", Enemies.FRIENDLY, CreatureType.COW), - CREEPER("Creeper", Enemies.ENEMY, CreatureType.CREEPER), - GHAST("Ghast", Enemies.ENEMY, CreatureType.GHAST), - GIANT("Giant", Enemies.ENEMY, CreatureType.GIANT), - PIG("Pig", Enemies.FRIENDLY, CreatureType.PIG), - PIGZOMB("PigZombie", Enemies.NEUTRAL, CreatureType.PIG_ZOMBIE), - SHEEP("Sheep", Enemies.FRIENDLY, "", CreatureType.SHEEP), - SKELETON("Skeleton", Enemies.ENEMY, CreatureType.SKELETON), - SLIME("Slime", Enemies.ENEMY, CreatureType.SLIME), - SPIDER("Spider", Enemies.ENEMY, CreatureType.SPIDER), - SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID), - ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE), - WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF), - CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER), - ENDERMAN("Enderman", Enemies.ENEMY, "", CreatureType.ENDERMAN), - SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH), - ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON), - VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER), - BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE), - MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW), - MAGMACUBE("MagmaCube", Enemies.ENEMY, CreatureType.MAGMA_CUBE), - SNOWMAN("Snowman", Enemies.FRIENDLY, "", CreatureType.SNOWMAN); + CHICKEN("Chicken", Enemies.FRIENDLY, EntityType.CHICKEN), + COW("Cow", Enemies.FRIENDLY, EntityType.COW), + CREEPER("Creeper", Enemies.ENEMY, EntityType.CREEPER), + GHAST("Ghast", Enemies.ENEMY, EntityType.GHAST), + GIANT("Giant", Enemies.ENEMY, EntityType.GIANT), + PIG("Pig", Enemies.FRIENDLY, EntityType.PIG), + PIGZOMB("PigZombie", Enemies.NEUTRAL, EntityType.PIG_ZOMBIE), + SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP), + SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON), + SLIME("Slime", Enemies.ENEMY, EntityType.SLIME), + SPIDER("Spider", Enemies.ENEMY, EntityType.SPIDER), + SQUID("Squid", Enemies.FRIENDLY, EntityType.SQUID), + ZOMBIE("Zombie", Enemies.ENEMY, EntityType.ZOMBIE), + WOLF("Wolf", Enemies.NEUTRAL, EntityType.WOLF), + CAVESPIDER("CaveSpider", Enemies.ENEMY, EntityType.CAVE_SPIDER), + ENDERMAN("Enderman", Enemies.ENEMY, "", EntityType.ENDERMAN), + SILVERFISH("Silverfish", Enemies.ENEMY, "", EntityType.SILVERFISH), + ENDERDRAGON("EnderDragon", Enemies.ENEMY, EntityType.ENDER_DRAGON), + VILLAGER("Villager", Enemies.FRIENDLY, EntityType.VILLAGER), + BLAZE("Blaze", Enemies.ENEMY, EntityType.BLAZE), + MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, EntityType.MUSHROOM_COW), + MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE), + SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN); public static final Logger logger = Logger.getLogger("Minecraft"); - private Mob(String n, Enemies en, String s, CreatureType type) + private Mob(String n, Enemies en, String s, EntityType type) { this.suffix = s; this.name = n; @@ -50,7 +50,7 @@ public enum Mob this.bukkitType = type; } - private Mob(String n, Enemies en, CreatureType type) + private Mob(String n, Enemies en, EntityType type) { this.name = n; this.type = en; @@ -59,7 +59,7 @@ public enum Mob public String suffix = "s"; final public String name; final public Enemies type; - final private CreatureType bukkitType; + final private EntityType bukkitType; private static final Map hashMap = new HashMap(); static @@ -99,7 +99,7 @@ public enum Mob final protected String type; } - public CreatureType getType() + public EntityType getType() { return bukkitType; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index d52315241..1cd65a743 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -10,6 +10,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.CreatureSpawner; +import org.bukkit.entity.EntityType; public class Commandspawner extends EssentialsCommand @@ -54,7 +55,7 @@ public class Commandspawner extends EssentialsCommand } final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); charge.isAffordableFor(user); - ((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType()); + ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType()); charge.charge(user); user.sendMessage(_("setSpawner", mob.name)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 948c82871..4971c7922 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -197,9 +197,9 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final CreatureType type, final Entity spawned, final String data, final User user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception { - if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE) + if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try { @@ -210,18 +210,18 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("slimeMalformedSize"), e); } } - if ((type == CreatureType.SHEEP - || type == CreatureType.COW - || type == CreatureType.MUSHROOM_COW - || type == CreatureType.CHICKEN - || type == CreatureType.PIG - || type == CreatureType.WOLF) + if ((type == EntityType.SHEEP + || type == EntityType.COW + || type == EntityType.MUSHROOM_COW + || type == EntityType.CHICKEN + || type == EntityType.PIG + || type == EntityType.WOLF) && data.equalsIgnoreCase("baby")) { ((Animals)spawned).setAge(-24000); return; } - if (type == CreatureType.SHEEP) + if (type == EntityType.SHEEP) { if (data.toLowerCase(Locale.ENGLISH).contains("baby")) { @@ -246,7 +246,7 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) { final Wolf wolf = ((Wolf)spawned); @@ -258,7 +258,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) { ((Wolf)spawned).setAngry(true); @@ -267,7 +267,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered")) { ((Creeper)spawned).setPowered(true); } -- cgit v1.2.3