[trunk] moved the worth-id: cost out to their own file "worth.yml" some default values will be created. If you have values in config.yml already then they need to be copied to this new file. Added a setworth command that can change / add worth values.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1203 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
ementalo 2011-04-16 00:42:43 +00:00
parent 3a18f9bf33
commit 2372be6a57
9 changed files with 248 additions and 7 deletions

View file

@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.commands.EssentialsCommand;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -25,7 +24,7 @@ public class Commandsell extends EssentialsCommand
int id = is.getTypeId();
int amount = 0;
if (args.length > 0) amount = Integer.parseInt(args[0].replaceAll("[^0-9]", ""));
int worth = parent.getConfiguration().getInt("worth-" + id, 0);
int worth = Essentials.getWorth().config.getInt("worth-" + id, 0);
boolean stack = args.length > 0 && args[0].endsWith("s");
boolean requireStack = parent.getConfiguration().getBoolean("trade-in-stacks-" + id, false);