mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-16 03:24:31 +02:00
Added Support for Register.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1438 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
@@ -72,4 +72,13 @@
|
|||||||
nbproject/build-impl.xml file.
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
<target name="-post-jar">
|
||||||
|
<jar jarfile="${dist.dir}/Essentials.jar">
|
||||||
|
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
|
||||||
|
<zipfileset src="../lib/register.jar" excludes="META-INF/*" />
|
||||||
|
<manifest>
|
||||||
|
<attribute name="Classpath" value="Essentials.jar"/>
|
||||||
|
</manifest>
|
||||||
|
</jar>
|
||||||
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -22,20 +22,20 @@ debug.test.classpath=\
|
|||||||
${run.test.classpath}
|
${run.test.classpath}
|
||||||
# This directory is removed when the project is cleaned:
|
# This directory is removed when the project is cleaned:
|
||||||
dist.dir=dist
|
dist.dir=dist
|
||||||
dist.jar=${dist.dir}/Essentials.jar
|
dist.jar=${dist.dir}/original-Essentials.jar
|
||||||
dist.javadoc.dir=${dist.dir}/javadoc
|
dist.javadoc.dir=${dist.dir}/javadoc
|
||||||
endorsed.classpath=
|
endorsed.classpath=
|
||||||
excludes=
|
excludes=
|
||||||
file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
|
file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
|
||||||
file.reference.iConomy.jar=../lib/iConomy.jar
|
|
||||||
file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
|
file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
|
||||||
file.reference.Permissions.jar=..\\lib\\Permissions.jar
|
file.reference.Permissions.jar=..\\lib\\Permissions.jar
|
||||||
|
file.reference.Register.jar=../lib/Register.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.Permissions.jar}:\
|
${file.reference.Permissions.jar}:\
|
||||||
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
|
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
|
||||||
${file.reference.iConomy.jar}
|
${file.reference.Register.jar}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
@@ -26,6 +26,7 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||||
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
||||||
|
import com.nijikokun.register.payment.Methods;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
@@ -60,6 +61,7 @@ public class Essentials extends JavaPlugin
|
|||||||
private Map<String, User> users = new HashMap<String, User>();
|
private Map<String, User> users = new HashMap<String, User>();
|
||||||
private EssentialsTimer timer;
|
private EssentialsTimer timer;
|
||||||
private boolean iConomyFallback = true;
|
private boolean iConomyFallback = true;
|
||||||
|
private Methods paymentMethod = new Methods();
|
||||||
|
|
||||||
public Essentials()
|
public Essentials()
|
||||||
{
|
{
|
||||||
@@ -131,6 +133,12 @@ public class Essentials extends JavaPlugin
|
|||||||
logger.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
|
logger.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!paymentMethod.hasMethod() && plugin != this)
|
||||||
|
{
|
||||||
|
if (getPaymentMethod().setMethod(plugin)) {
|
||||||
|
logger.log(Level.INFO, "Payment method found (" + getPaymentMethod().getMethod().getName() + " version: " + getPaymentMethod().getMethod().getVersion() + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
|
Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
|
||||||
if (versionMatch.matches())
|
if (versionMatch.matches())
|
||||||
@@ -337,7 +345,7 @@ public class Essentials extends JavaPlugin
|
|||||||
|
|
||||||
public boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath)
|
public boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath)
|
||||||
{
|
{
|
||||||
if ("msg".equals(commandLabel.toLowerCase()) || "mail".equals(commandLabel.toLowerCase()) & sender instanceof CraftPlayer)
|
if ("msg".equals(commandLabel.toLowerCase()) || "mail".equals(commandLabel.toLowerCase()) & sender instanceof CraftPlayer)
|
||||||
{
|
{
|
||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
str.append(commandLabel + " ");
|
str.append(commandLabel + " ");
|
||||||
@@ -625,7 +633,7 @@ public class Essentials extends JavaPlugin
|
|||||||
File userFile = new File(userFolder, Util.sanitizeFileName(name) + ".yml");
|
File userFile = new File(userFolder, Util.sanitizeFileName(name) + ".yml");
|
||||||
if (userFile.exists())
|
if (userFile.exists())
|
||||||
{ //Users do not get offline changes saved without being reproccessed as Users! ~ Xeology :)
|
{ //Users do not get offline changes saved without being reproccessed as Users! ~ Xeology :)
|
||||||
return getUser((Player) new OfflinePlayer(name));
|
return getUser((Player)new OfflinePlayer(name));
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -666,7 +674,7 @@ public class Essentials extends JavaPlugin
|
|||||||
this.iConomyFallback = iConomyFallback;
|
this.iConomyFallback = iConomyFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIConomyFallbackEnabled()
|
public boolean isRegisterFallbackEnabled()
|
||||||
{
|
{
|
||||||
return iConomyFallback;
|
return iConomyFallback;
|
||||||
}
|
}
|
||||||
@@ -675,4 +683,9 @@ public class Essentials extends JavaPlugin
|
|||||||
{
|
{
|
||||||
confList.add(listener);
|
confList.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Methods getPaymentMethod()
|
||||||
|
{
|
||||||
|
return paymentMethod;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -273,11 +273,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo
|
|||||||
@Override
|
@Override
|
||||||
public double getMoney()
|
public double getMoney()
|
||||||
{
|
{
|
||||||
if (ess.isIConomyFallbackEnabled())
|
if (ess.isRegisterFallbackEnabled() && ess.getPaymentMethod().hasMethod())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return com.iConomy.iConomy.getAccount(getName()).getHoldings().balance();
|
return ess.getPaymentMethod().getMethod().getAccount(this.getName()).balance();
|
||||||
}
|
}
|
||||||
catch (Throwable ex)
|
catch (Throwable ex)
|
||||||
{
|
{
|
||||||
@@ -289,11 +289,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo
|
|||||||
@Override
|
@Override
|
||||||
public void setMoney(double value)
|
public void setMoney(double value)
|
||||||
{
|
{
|
||||||
if (ess.isIConomyFallbackEnabled())
|
if (ess.isRegisterFallbackEnabled() && ess.getPaymentMethod().hasMethod())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
com.iConomy.iConomy.getAccount(getName()).getHoldings().set(value);
|
double amount = value - ess.getPaymentMethod().getMethod().getAccount(this.getName()).balance();
|
||||||
|
ess.getPaymentMethod().getMethod().getAccount(this.getName()).add(amount);
|
||||||
}
|
}
|
||||||
catch (Throwable ex)
|
catch (Throwable ex)
|
||||||
{
|
{
|
||||||
|
@@ -6,7 +6,7 @@ version: TeamCity
|
|||||||
website: http://www.earth2me.net:8001/
|
website: http://www.earth2me.net:8001/
|
||||||
description: Provides an essential, core set of commands for Bukkit.
|
description: Provides an essential, core set of commands for Bukkit.
|
||||||
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
|
||||||
softdepend: [Permissions]
|
softdepend: [Permissions, iConomy, BOSEconomy]
|
||||||
commands:
|
commands:
|
||||||
afk:
|
afk:
|
||||||
description: Marks you as away-from-keyboard.
|
description: Marks you as away-from-keyboard.
|
||||||
|
BIN
lib/Register.jar
Normal file
BIN
lib/Register.jar
Normal file
Binary file not shown.
BIN
lib/iConomy.jar
BIN
lib/iConomy.jar
Binary file not shown.
Reference in New Issue
Block a user