1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-21 20:25:54 +00:00
Slimefun4/src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/SlimefunItem.java

537 lines
18 KiB
Java
Raw Normal View History

2016-04-14 16:24:03 +00:00
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
2019-06-20 07:50:59 +00:00
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
2016-04-14 16:24:03 +00:00
import me.mrCookieSlime.Slimefun.SlimefunStartup;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
2016-04-14 16:24:03 +00:00
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.Research;
import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler;
2019-08-27 19:46:50 +00:00
import me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker;
import me.mrCookieSlime.Slimefun.Objects.handlers.ItemHandler;
2016-04-14 16:24:03 +00:00
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.ancient_altar.AltarRecipe;
2016-04-14 16:24:03 +00:00
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.Slimefun;
import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import me.mrCookieSlime.Slimefun.api.energy.EnergyNet;
import me.mrCookieSlime.Slimefun.api.energy.EnergyNet.NetworkComponent;
import me.mrCookieSlime.Slimefun.api.energy.EnergyTicker;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
public class SlimefunItem {
2019-06-20 07:50:59 +00:00
public static List<SlimefunItem> items = new ArrayList<>();
public static Map<String, SlimefunItem> mapID = new HashMap<>();
2019-06-20 07:50:59 +00:00
public static List<ItemStack> radioactive = new ArrayList<>();
public static Set<String> tickers = new HashSet<>();
2019-06-20 07:50:59 +00:00
public static List<SlimefunItem> all = new ArrayList<>();
public static Map<String, Set<ItemHandler>> handlers = new HashMap<>();
public static Map<String, SlimefunBlockHandler> blockhandler = new HashMap<>();
private String id;
private String hash;
private State state;
2017-10-13 13:56:48 +00:00
private ItemStack item;
private Category category;
private ItemStack[] recipe;
private RecipeType recipeType;
protected ItemStack recipeOutput = null;
2017-10-13 13:56:48 +00:00
private Research research;
private int month = -1;
2019-08-29 20:46:03 +00:00
private boolean enchantable = true;
private boolean disenchantable = true;
private boolean hidden = false;
private boolean replacing = false;
private boolean addon = false;
private String permission = "";
2019-08-27 21:24:43 +00:00
private Set<ItemHandler> itemhandlers = new HashSet<>();
2017-10-13 13:56:48 +00:00
private boolean ticking = false;
private BlockTicker blockTicker;
private EnergyTicker energyTicker;
private String[] keys = null;
private Object[] values = null;
2017-08-14 22:06:48 +00:00
/**
* Defines whether a SlimefunItem is enabled, disabled or fall-back to its vanilla behavior.
*
* @since 4.1.10
*/
2019-08-29 13:13:40 +00:00
public static enum State {
2017-08-14 22:06:48 +00:00
/**
* This SlimefunItem is enabled.
*/
ENABLED,
2017-08-14 22:06:48 +00:00
/**
* This SlimefunItem is disabled and is not a {@link VanillaItem}.
*/
DISABLED,
2017-08-14 22:06:48 +00:00
/**
* This SlimefunItem is fall-back to its vanilla behavior, because it is disabled and is a {@link VanillaItem}.
*/
VANILLA
}
2017-10-13 14:34:38 +00:00
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe) {
2016-04-14 16:24:03 +00:00
this.item = item;
this.category = category;
2017-10-13 14:34:38 +00:00
this.id = id;
2016-04-14 16:24:03 +00:00
this.recipeType = recipeType;
this.recipe = recipe;
}
2017-10-13 14:34:38 +00:00
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) {
2016-04-14 16:24:03 +00:00
this.item = item;
this.category = category;
2017-10-13 14:34:38 +00:00
this.id = id;
2016-04-14 16:24:03 +00:00
this.recipeType = recipeType;
this.recipe = recipe;
this.recipeOutput = recipeOutput;
}
2017-10-13 14:34:38 +00:00
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput, String[] keys, Object[] values) {
2016-04-14 16:24:03 +00:00
this.item = item;
this.category = category;
2017-10-13 14:34:38 +00:00
this.id = id;
2016-04-14 16:24:03 +00:00
this.recipeType = recipeType;
this.recipe = recipe;
this.recipeOutput = recipeOutput;
this.keys = keys;
this.values = values;
}
2017-10-13 14:34:38 +00:00
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, String[] keys, Object[] values) {
2016-04-14 16:24:03 +00:00
this.item = item;
this.category = category;
2017-10-13 14:34:38 +00:00
this.id = id;
2016-04-14 16:24:03 +00:00
this.recipeType = recipeType;
this.recipe = recipe;
this.keys = keys;
this.values = values;
}
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, boolean hidden) {
2016-04-14 16:24:03 +00:00
this.item = item;
this.category = category;
2017-10-13 14:34:38 +00:00
this.id = id;
2016-04-14 16:24:03 +00:00
this.recipeType = recipeType;
this.recipe = recipe;
this.hidden = hidden;
2016-04-14 16:24:03 +00:00
}
/**
* Returns the identifier of this SlimefunItem.
*
* @return the identifier of this SlimefunItem
*
* @since 4.0
* @deprecated As of 4.1.11, renamed to {@link #getID()} for better name convenience.
*/
@Deprecated
2017-11-23 21:21:02 +00:00
public String getName() { return id; }
/**
* Returns the identifier of this SlimefunItem.
*
* @return the identifier of this SlimefunItem
*
* @since 4.1.11, rename of {@link #getName()}.
*/
2017-11-23 21:21:02 +00:00
public String getID() { return id; }
public String getHash() { return hash; }
public State getState() { return state; }
public ItemStack getItem() { return item; }
2017-11-23 21:21:02 +00:00
public Category getCategory() { return category; }
public ItemStack[] getRecipe() { return recipe; }
public RecipeType getRecipeType() { return recipeType; }
/**
* @since 4.0
* @deprecated As of 4.1.11, renamed to {@link #getRecipeOutput()} for better name convenience.
*/
@Deprecated
2017-11-23 21:21:02 +00:00
public ItemStack getCustomOutput() { return recipeOutput; }
/**
* @since 4.1.11, rename of {@link #getCustomOutput()}.
*/
2017-11-23 21:21:02 +00:00
public ItemStack getRecipeOutput() { return recipeOutput; }
public Research getResearch() { return research; }
public int getMonth() { return month; }
2017-11-23 21:21:02 +00:00
public boolean isEnchantable() { return enchantable; }
public boolean isDisenchantable() { return disenchantable; }
/**
* @since 4.1.11
*/
public boolean isHidden() { return hidden; }
2017-11-23 21:21:02 +00:00
public boolean isReplacing() { return replacing; }
public boolean isAddonItem() { return addon; }
/**
* @since 4.1.11
*/
2017-11-23 21:21:02 +00:00
public String getPermission() { return permission; }
public Set<ItemHandler> getHandlers() { return itemhandlers; }
public boolean isTicking() { return ticking; }
/**
* @since 4.0
* @deprecated As of 4.1.11, renamed to {@link #getBlockTicker()} for better name convenience.
*/
@Deprecated
2017-11-23 21:21:02 +00:00
public BlockTicker getTicker() { return blockTicker; }
/**
* @since 4.1.11, rename of {@link #getTicker()}.
*/
2017-11-23 21:21:02 +00:00
public BlockTicker getBlockTicker() { return blockTicker; }
public EnergyTicker getEnergyTicker() { return energyTicker; }
public String[] listKeys() { return keys; }
2017-11-23 21:21:02 +00:00
public Object[] listValues() { return values; }
public boolean isDisabled() { return state != State.ENABLED; }
2016-04-14 16:24:03 +00:00
public void register() {
register(false);
}
2016-04-14 16:24:03 +00:00
public void register(boolean slimefun) {
this.addon = !slimefun;
2016-04-14 16:24:03 +00:00
try {
if (mapID.containsKey(this.id)) throw new IllegalArgumentException("ID \"" + this.id + "\" already exists");
if (this.recipe.length < 9) this.recipe = new ItemStack[] {null, null, null, null, null, null, null, null, null};
2016-04-14 16:24:03 +00:00
all.add(this);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".enabled", true);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".can-be-used-in-workbenches", this.replacing);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".hide-in-guide", this.hidden);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".allow-enchanting", this.enchantable);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".allow-disenchanting", this.disenchantable);
SlimefunStartup.getItemCfg().setDefaultValue(this.id + ".required-permission", this.permission);
if (this.keys != null && this.values != null) {
for (int i = 0; i < this.keys.length; i++) {
SlimefunStartup.getItemCfg().setDefaultValue(this.id + "." + this.keys[i], this.values[i]);
2016-04-14 16:24:03 +00:00
}
}
2016-04-14 16:24:03 +00:00
for (World world: Bukkit.getWorlds()) {
SlimefunStartup.getWhitelist().setDefaultValue(world.getName() + ".enabled", true);
SlimefunStartup.getWhitelist().setDefaultValue(world.getName() + ".enabled-items." + this.id, true);
2016-04-14 16:24:03 +00:00
}
if (this.ticking && !SlimefunStartup.getCfg().getBoolean("URID.enable-tickers")) {
this.state = State.DISABLED;
return;
2016-04-14 16:24:03 +00:00
}
if (SlimefunStartup.getItemCfg().getBoolean(id + ".enabled")) {
2016-04-14 16:24:03 +00:00
if (!Category.list().contains(category)) category.register();
this.state = State.ENABLED;
this.replacing = SlimefunStartup.getItemCfg().getBoolean(this.id + ".can-be-used-in-workbenches");
this.hidden = SlimefunStartup.getItemCfg().getBoolean(this.id + ".hide-in-guide");
this.enchantable = SlimefunStartup.getItemCfg().getBoolean(this.id + ".allow-enchanting");
this.disenchantable = SlimefunStartup.getItemCfg().getBoolean(this.id + ".allow-disenchanting");
this.permission = SlimefunStartup.getItemCfg().getString(this.id + ".required-permission");
2016-04-14 16:24:03 +00:00
items.add(this);
2019-08-30 10:47:22 +00:00
if (slimefun) SlimefunStartup.instance.getUtilities().vanillaItems++;
mapID.put(this.id, this);
this.create();
2016-04-14 16:24:03 +00:00
for (ItemHandler handler: itemhandlers) {
Set<ItemHandler> handlerset = getHandlers(handler.toCodename());
handlerset.add(handler);
handlers.put(handler.toCodename(), handlerset);
}
if (SlimefunStartup.getCfg().getBoolean("options.print-out-loading")) System.out.println("[Slimefun] Loaded Item \"" + this.id + "\"");
}
else {
if (this instanceof VanillaItem) this.state = State.VANILLA;
else this.state = State.DISABLED;
2016-04-14 16:24:03 +00:00
}
} catch(Exception x) {
System.err.println("[Slimefun] Item Registration failed: " + this.id);
x.printStackTrace();
2016-04-14 16:24:03 +00:00
}
}
2016-04-14 16:24:03 +00:00
public static List<SlimefunItem> list() {
return items;
}
2016-04-14 16:24:03 +00:00
public void bindToResearch(Research r) {
if (r != null) r.getAffectedItems().add(this);
2016-04-14 16:24:03 +00:00
this.research = r;
}
public void setHash(String hash) {
this.hash = hash;
}
2016-04-14 16:24:03 +00:00
public void setRecipe(ItemStack[] recipe) {
this.recipe = recipe;
}
2016-04-14 16:24:03 +00:00
public void setRecipeType(RecipeType type) {
this.recipeType = type;
}
2016-04-14 16:24:03 +00:00
public void setCategory(Category category) {
this.category = category;
}
2016-04-14 16:24:03 +00:00
public void setRecipeOutput(ItemStack output) {
this.recipeOutput = output;
}
2017-10-13 14:34:38 +00:00
public void setReplacing(boolean replacing) {
this.replacing = replacing;
}
2017-10-13 14:34:38 +00:00
/**
* @since 4.0
* @deprecated As of 4.1.11, renamed to {@link #getByID(String)} for better name convenience.
*/
@Deprecated
2016-04-14 16:24:03 +00:00
public static SlimefunItem getByName(String name) {
return mapID.get(name);
2017-10-13 14:34:38 +00:00
}
/**
* @since 4.1.11, rename of {@link #getByName(String)}.
*/
public static SlimefunItem getByID(String id) {
return mapID.get(id);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public static SlimefunItem getByItem(ItemStack item) {
if (item == null) return null;
2016-04-14 16:24:03 +00:00
for (SlimefunItem sfi: items) {
if (sfi instanceof ChargableItem && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
else if (sfi instanceof DamagableChargableItem && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
else if (sfi instanceof ChargedItem && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
2018-04-22 16:11:51 +00:00
else if (sfi instanceof SlimefunBackpack && SlimefunManager.isItemSimiliar(item, sfi.getItem(), false)) return sfi;
else if (SlimefunManager.isItemSimiliar(item, sfi.getItem(), true)) return sfi;
2016-04-14 16:24:03 +00:00
}
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.BROKEN_SPAWNER, false)) return getByID("BROKEN_SPAWNER");
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.REPAIRED_SPAWNER, false)) return getByID("REINFORCED_SPAWNER");
2016-04-14 16:24:03 +00:00
return null;
}
2016-04-14 16:24:03 +00:00
public boolean isItem(ItemStack item) {
if (item == null) return false;
if (this instanceof ChargableItem && SlimefunManager.isItemSimiliar(item, this.item, false)) return true;
else if (this instanceof DamagableChargableItem && SlimefunManager.isItemSimiliar(item, this.item, false)) return true;
else if (this instanceof ChargedItem && SlimefunManager.isItemSimiliar(item, this.item, false)) return true;
else return SlimefunManager.isItemSimiliar(item, this.item, true);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void load() {
try {
if (!hidden) category.add(this);
ItemStack output = item.clone();
if (recipeOutput != null) output = recipeOutput.clone();
2017-10-13 14:34:38 +00:00
if (recipeType.toItem().isSimilar(RecipeType.MOB_DROP.toItem())) {
2016-04-14 16:24:03 +00:00
try {
EntityType entity = EntityType.valueOf(ChatColor.stripColor(recipe[4].getItemMeta().getDisplayName()).toUpperCase().replace(" ", "_"));
2019-08-28 08:59:20 +00:00
List<ItemStack> dropping = new ArrayList<>();
2016-04-14 16:24:03 +00:00
if (SlimefunManager.drops.containsKey(entity)) dropping = SlimefunManager.drops.get(entity);
dropping.add(output);
SlimefunManager.drops.put(entity, dropping);
} catch(Exception x) {
}
}
else if (recipeType.toItem().isSimilar(RecipeType.ANCIENT_ALTAR.toItem())) {
new AltarRecipe(Arrays.asList(recipe), output);
2016-04-14 16:24:03 +00:00
}
else if (recipeType.getMachine() != null && getByID(recipeType.getMachine().getID()) instanceof SlimefunMachine) {
((SlimefunMachine) getByID(recipeType.getMachine().getID())).addRecipe(recipe, output);
2016-04-14 16:24:03 +00:00
}
install();
2016-04-14 16:24:03 +00:00
} catch(Exception x) {
System.err.println("[Slimefun] Item Initialization failed: " + id);
2016-04-14 16:24:03 +00:00
}
}
public static State getState(ItemStack item) {
for (SlimefunItem i: all) {
if (i.isItem(item)) {
return i.getState();
}
}
return State.ENABLED;
}
2016-04-14 16:24:03 +00:00
public static boolean isDisabled(ItemStack item) {
for (SlimefunItem i: all) {
2016-04-14 16:24:03 +00:00
if (i.isItem(item)) {
return i.isDisabled();
2016-04-14 16:24:03 +00:00
}
}
return false;
}
2016-04-14 16:24:03 +00:00
public void install() {}
public void create() {}
2017-10-13 19:12:33 +00:00
2019-08-27 21:24:43 +00:00
@Deprecated
public void addItemHandler(me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.ItemHandler... handler) {
2019-08-27 21:48:41 +00:00
addItemHandler((ItemHandler[]) handler);
2019-08-27 21:24:43 +00:00
}
2016-04-14 16:24:03 +00:00
public void addItemHandler(ItemHandler... handler) {
this.itemhandlers.addAll(Arrays.asList(handler));
2016-04-14 16:24:03 +00:00
for (ItemHandler h: handler) {
if (h instanceof BlockTicker) {
this.ticking = true;
2017-10-13 14:34:38 +00:00
tickers.add(getID());
this.blockTicker = (BlockTicker) h;
2016-04-14 16:24:03 +00:00
}
else if (h instanceof EnergyTicker) {
this.energyTicker = (EnergyTicker) h;
2017-10-13 14:34:38 +00:00
EnergyNet.registerComponent(getID(), NetworkComponent.SOURCE);
2016-04-14 16:24:03 +00:00
}
}
}
2016-04-14 16:24:03 +00:00
public void register(boolean vanilla, ItemHandler... handlers) {
addItemHandler(handlers);
register(vanilla);
}
2016-04-14 16:24:03 +00:00
public void register(ItemHandler... handlers) {
addItemHandler(handlers);
2019-08-27 21:24:43 +00:00
register(false);
}
2019-08-27 22:09:23 +00:00
@Deprecated
public void register(boolean vanilla, me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.ItemHandler... handlers) {
addItemHandler(handlers);
register(vanilla);
}
2019-08-27 21:24:43 +00:00
@Deprecated
public void register(me.mrCookieSlime.Slimefun.Objects.SlimefunItem.handlers.ItemHandler... handlers) {
2019-08-27 21:48:41 +00:00
register((ItemHandler[]) handlers);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void register(boolean vanilla, SlimefunBlockHandler handler) {
2017-10-13 14:34:38 +00:00
blockhandler.put(getID(), handler);
2016-04-14 16:24:03 +00:00
register(vanilla);
}
2016-04-14 16:24:03 +00:00
public void register(SlimefunBlockHandler handler) {
2017-10-13 14:34:38 +00:00
blockhandler.put(getID(), handler);
2016-04-14 16:24:03 +00:00
register(false);
}
2017-10-13 14:34:38 +00:00
public static Set<ItemHandler> getHandlers(String codeid) {
if (handlers.containsKey(codeid)) return handlers.get(codeid);
else return new HashSet<>();
2016-04-14 16:24:03 +00:00
}
public static void setRadioactive(ItemStack item) {
radioactive.add(item);
}
2016-04-14 16:24:03 +00:00
public static ItemStack getItem(String id) {
2017-10-13 14:34:38 +00:00
SlimefunItem item = getByID(id);
2016-04-14 16:24:03 +00:00
return item != null ? item.getItem(): null;
}
2016-04-14 16:24:03 +00:00
public static void patchExistingItem(String id, ItemStack stack) {
2017-10-13 14:34:38 +00:00
SlimefunItem item = getByID(id);
2016-04-14 16:24:03 +00:00
if (item != null) {
System.out.println("[Slimefun] WARNING - Patching existing Item - " + id);
System.out.println("[Slimefun] This might take a while");
2016-04-14 16:24:03 +00:00
final ItemStack old = item.getItem();
item.setItem(stack);
for (SlimefunItem sfi: list()) {
ItemStack[] recipe = sfi.getRecipe();
for (int i = 0; i < 9; i++) {
if (SlimefunManager.isItemSimiliar(recipe[i], old, true)) recipe[i] = stack;
}
sfi.setRecipe(recipe);
}
}
}
2016-04-14 16:24:03 +00:00
public void registerChargeableBlock(int capacity) {
this.registerChargeableBlock(false, capacity);
}
2016-04-14 16:24:03 +00:00
public void registerChargeableBlock(boolean slimefun, int capacity) {
this.register(slimefun);
2017-10-13 14:34:38 +00:00
ChargableBlock.registerChargableBlock(id, capacity, true);
EnergyNet.registerComponent(id, NetworkComponent.CONSUMER);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void registerUnrechargeableBlock(boolean slimefun, int capacity) {
this.register(slimefun);
2017-10-13 14:34:38 +00:00
ChargableBlock.registerChargableBlock(id, capacity, false);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void registerBlockCapacitor(boolean slimefun, int capacity) {
this.register(slimefun);
2017-10-13 14:34:38 +00:00
ChargableBlock.registerCapacitor(id, capacity);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void registerEnergyDistributor(boolean slimefun) {
this.register(slimefun);
2017-10-13 14:34:38 +00:00
EnergyNet.registerComponent(id, NetworkComponent.DISTRIBUTOR);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
public void registerDistibutingCapacitor(boolean slimefun, final int capacity) {
this.register(slimefun);
2017-10-13 14:34:38 +00:00
EnergyNet.registerComponent(id, NetworkComponent.DISTRIBUTOR);
ChargableBlock.registerCapacitor(id, capacity);
2016-04-14 16:24:03 +00:00
}
2016-04-14 16:24:03 +00:00
protected void setItem(ItemStack stack) {
this.item = stack;
}
2016-04-14 16:24:03 +00:00
public static boolean isTicking(String item) {
return tickers.contains(item);
}
2016-04-14 16:24:03 +00:00
public static void registerBlockHandler(String id, SlimefunBlockHandler handler) {
blockhandler.put(id, handler);
}
public void registerChargeableBlock(boolean vanilla, int capacity, ItemHandler... handlers) {
addItemHandler(handlers);
registerChargeableBlock(vanilla, capacity);
}
2016-04-14 16:24:03 +00:00
public BlockMenu getBlockMenu(Block b) {
return BlockStorage.getInventory(b);
}
2016-04-14 16:24:03 +00:00
public void addWikipage(String page) {
Slimefun.addWikiPage(this.getID(), "https://github.com/TheBusyBiscuit/Slimefun4/wiki/" + page);
2016-04-14 16:24:03 +00:00
}
@Override
public String toString() {
return "SlimefunItem: " + id + " (" + state + ", vanilla=" + !addon + ")";
}
2016-04-14 16:24:03 +00:00
}