mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Changes
This commit is contained in:
parent
31f82b899f
commit
581c2fc65d
@ -35,6 +35,7 @@ import me.mrCookieSlime.Slimefun.api.energy.EnergyNetComponent;
|
||||
import me.mrCookieSlime.Slimefun.api.energy.EnergyTicker;
|
||||
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
|
||||
import me.mrCookieSlime.Slimefun.utils.Constants;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class SlimefunItem {
|
||||
|
||||
@ -104,8 +105,6 @@ public class SlimefunItem {
|
||||
this.recipeOutput = recipeOutput;
|
||||
this.keys = keys;
|
||||
this.values = values;
|
||||
|
||||
PersistentDataAPI.setString(this.item.getItemMeta(), Constants.SF_ITEM, this.id);
|
||||
}
|
||||
|
||||
public SlimefunItem(Category category, ItemStack item, String id, RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput, String[] keys, Object[] values) {
|
||||
@ -117,8 +116,6 @@ public class SlimefunItem {
|
||||
this.recipeOutput = recipeOutput;
|
||||
this.keys = keys;
|
||||
this.values = values;
|
||||
|
||||
PersistentDataAPI.setString(this.item.getItemMeta(), Constants.SF_ITEM, this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -315,10 +312,9 @@ public class SlimefunItem {
|
||||
public boolean isItem(ItemStack item) {
|
||||
if (item == null) return false;
|
||||
|
||||
if (item.getItemMeta() != null && this.item.getItemMeta() != null) {
|
||||
String thisId = PersistentDataAPI.getString(this.item.getItemMeta(), Constants.SF_ITEM);
|
||||
if (item.getItemMeta() != null) {
|
||||
String comparingId = PersistentDataAPI.getString(item.getItemMeta(), Constants.SF_ITEM);
|
||||
if (thisId != null && comparingId != null) return thisId.equals(comparingId);
|
||||
if (comparingId != null) return getID().equals(comparingId);
|
||||
}
|
||||
|
||||
if (this instanceof ChargableItem && SlimefunManager.isItemSimiliar(item, this.item, false)) return true;
|
||||
|
@ -55,7 +55,9 @@ public class SlimefunItemStack extends CustomItem {
|
||||
|
||||
private void setId(String id) {
|
||||
this.id = id;
|
||||
PersistentDataAPI.setString(getItemMeta(), Constants.SF_ITEM, id);
|
||||
ItemMeta im = getItemMeta();
|
||||
PersistentDataAPI.setString(im, Constants.SF_ITEM, id);
|
||||
setItemMeta(im);
|
||||
}
|
||||
|
||||
private static ItemStack getSkull(String texture) {
|
||||
|
Loading…
Reference in New Issue
Block a user