- Fixed not checking whether Material is null before getting durability from String
- Moved Register classes, should work with other plugins now - Cleaned the code a bit
This commit is contained in:
parent
247b65c9e1
commit
d919818bb6
|
@ -12,7 +12,7 @@ public interface ChestObject {
|
|||
|
||||
public void clearSlot(int slot);
|
||||
|
||||
public void addItem(ItemStack item, short durability, int amount);
|
||||
public void addItem(ItemStack item, int amount);
|
||||
|
||||
public void removeItem(ItemStack item, short durability, int amount);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class MinecraftChest implements ChestObject {
|
|||
}
|
||||
}
|
||||
|
||||
public void addItem(ItemStack item, short durability, int amount) {
|
||||
public void addItem(ItemStack item, int amount) {
|
||||
int left = addItem(item, amount, main);
|
||||
if (neighbor != null) {
|
||||
addItem(item, left, neighbor);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.Acrobot.ChestShop.Config;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
*/
|
||||
|
@ -21,13 +18,9 @@ public enum Property {
|
|||
PROTECT_SIGN_WITH_LWC(false, "Do you want to protect shop signs with LWC?");
|
||||
|
||||
|
||||
|
||||
|
||||
private Object value;
|
||||
private String comment;
|
||||
|
||||
private static final Map<String, Property> names = new HashMap<String, Property>();
|
||||
|
||||
private Property(Object value, String comment) {
|
||||
this.value = value;
|
||||
this.comment = comment;
|
||||
|
@ -44,14 +37,4 @@ public enum Property {
|
|||
public String toString() {
|
||||
return name();
|
||||
}
|
||||
|
||||
public static Property lookup(String name) {
|
||||
return names.get(name);
|
||||
}
|
||||
|
||||
static {
|
||||
for (Property def : values()) {
|
||||
names.put(def.name(), def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.Acrobot.ChestShop;
|
||||
|
||||
import com.nijikokun.register.payment.Method;
|
||||
import com.nijikokun.register.payment.forChestShop.Method;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
|
|
|
@ -11,6 +11,10 @@ import org.bukkit.material.*;
|
|||
*/
|
||||
public class DataValue {
|
||||
public static byte get(String arg, Material material){
|
||||
if(material == null){
|
||||
return 0;
|
||||
}
|
||||
|
||||
arg = arg.toUpperCase().replace(" ", "_");
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.Acrobot.ChestShop.Protection.LockettePlugin;
|
|||
import com.Acrobot.ChestShop.Protection.Security;
|
||||
import com.griefcraft.lwc.LWCPlugin;
|
||||
import com.nijikokun.bukkit.Permissions.Permissions;
|
||||
import com.nijikokun.register.payment.Methods;
|
||||
import com.nijikokun.register.payment.forChestShop.Methods;
|
||||
import info.somethingodd.bukkit.OddItem.OddItem;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerListener;
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Shop {
|
|||
}
|
||||
|
||||
if (!isAdminShop()) {
|
||||
chest.addItem(stock, stock.getDurability(), stockAmount);
|
||||
chest.addItem(stock, stockAmount);
|
||||
}
|
||||
|
||||
Economy.add(player.getName(), sellPrice);
|
||||
|
|
|
@ -78,6 +78,10 @@ public class InventoryUtil {
|
|||
|
||||
public static int amount(Inventory inv, ItemStack item, short durability) {
|
||||
int amount = 0;
|
||||
if(!inv.contains(item.getType())){
|
||||
return amount;
|
||||
}
|
||||
|
||||
ItemStack[] contents = inv.getContents();
|
||||
for (ItemStack i : contents) {
|
||||
if (i != null) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.nijikokun.register.payment;
|
||||
package com.nijikokun.register.payment.forChestShop;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.nijikokun.register.payment;
|
||||
package com.nijikokun.register.payment.forChestShop;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
@ -40,10 +40,10 @@ public class Methods {
|
|||
}
|
||||
|
||||
private void _init() {
|
||||
this.addMethod("iConomy", new com.nijikokun.register.payment.methods.iCo4());
|
||||
this.addMethod("iConomy", new com.nijikokun.register.payment.methods.iCo5());
|
||||
this.addMethod("BOSEconomy", new com.nijikokun.register.payment.methods.BOSE());
|
||||
this.addMethod("Essentials", new com.nijikokun.register.payment.methods.EE17());
|
||||
this.addMethod("iConomy", new com.nijikokun.register.payment.forChestShop.methods.iCo4());
|
||||
this.addMethod("iConomy", new com.nijikokun.register.payment.forChestShop.methods.iCo5());
|
||||
this.addMethod("BOSEconomy", new com.nijikokun.register.payment.forChestShop.methods.BOSE());
|
||||
this.addMethod("Essentials", new com.nijikokun.register.payment.forChestShop.methods.EE17());
|
||||
}
|
||||
|
||||
public Set<String> getDependencies() {
|
|
@ -1,6 +1,6 @@
|
|||
package com.nijikokun.register.payment.methods;
|
||||
package com.nijikokun.register.payment.forChestShop.methods;
|
||||
|
||||
import com.nijikokun.register.payment.Method;
|
||||
import com.nijikokun.register.payment.forChestShop.Method;
|
||||
import cosine.boseconomy.BOSEconomy;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package com.nijikokun.register.payment.methods;
|
||||
package com.nijikokun.register.payment.forChestShop.methods;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.api.Economy;
|
||||
import com.earth2me.essentials.api.NoLoanPermittedException;
|
||||
import com.earth2me.essentials.api.UserDoesNotExistException;
|
||||
import com.nijikokun.register.payment.Method;
|
||||
import com.nijikokun.register.payment.forChestShop.Method;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class EE17 implements Method {
|
|
@ -1,8 +1,8 @@
|
|||
package com.nijikokun.register.payment.methods;
|
||||
package com.nijikokun.register.payment.forChestShop.methods;
|
||||
|
||||
import com.nijiko.coelho.iConomy.iConomy;
|
||||
import com.nijiko.coelho.iConomy.system.Account;
|
||||
import com.nijikokun.register.payment.Method;
|
||||
import com.nijikokun.register.payment.forChestShop.Method;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class iCo4 implements Method {
|
|
@ -1,11 +1,11 @@
|
|||
package com.nijikokun.register.payment.methods;
|
||||
package com.nijikokun.register.payment.forChestShop.methods;
|
||||
|
||||
import com.iConomy.iConomy;
|
||||
import com.iConomy.system.Account;
|
||||
import com.iConomy.system.BankAccount;
|
||||
import com.iConomy.system.Holdings;
|
||||
import com.iConomy.util.Constants;
|
||||
import com.nijikokun.register.payment.Method;
|
||||
import com.nijikokun.register.payment.forChestShop.Method;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class iCo5 implements Method {
|
|
@ -3,7 +3,7 @@ name: ChestShop
|
|||
main: com.Acrobot.ChestShop.ChestShop
|
||||
|
||||
database: true
|
||||
version: 3.00 BETA 2
|
||||
version: 3.00 BETA 3
|
||||
|
||||
|
||||
author: Acrobot
|
||||
|
|
Loading…
Reference in New Issue