diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java index 831b72d..ebbf75b 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterItem.java @@ -13,11 +13,11 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter { // INFO: Safe to store as its always cloned by bukkit ItemStack item; - public LinkedBeaconTeleporterItem(ItemStack item){ + public LinkedBeaconTeleporterItem(){ // Create a new LinkedBeaconTeleporter super(); - this.item = item; + this.item = Main.lbtManager.getItemStackFromLbtItem(this); } public LinkedBeaconTeleporterItem(String teleporterId, ItemStack item) { super(teleporterId); @@ -25,9 +25,9 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter { this.item = item; } public LinkedBeaconTeleporterItem(String teleporterId){ - this(teleporterId, - new ItemStack(Material.BEACON) - ); + super(teleporterId); + + this.item = Main.lbtManager.getItemStackFromLbtItem(this); } public ItemStack item(){ @@ -36,9 +36,6 @@ public class LinkedBeaconTeleporterItem extends LinkedBeaconTeleporter { // Conversion methods - public ItemStack toItemStack(){ - return Main.lbtManager.getItemStackFromLbtItem(this); - } public static LinkedBeaconTeleporterItem getFromItemStack(ItemStack itemStack){ return Main.lbtManager.getLbtItemFromItemStack(itemStack); } diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnPrepareItemCraftEvent.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnPrepareItemCraftEvent.java index 68ccf09..ca41cf7 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnPrepareItemCraftEvent.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnPrepareItemCraftEvent.java @@ -23,13 +23,10 @@ public class OnPrepareItemCraftEvent { if(lbtItem == null){ // If none is found, create new LinkedBeaconTeleporterItem and set as crafting-result - ItemStack item = new ItemStack(Material.BEACON); - lbtItem = new LinkedBeaconTeleporterItem(item); + lbtItem = new LinkedBeaconTeleporterItem(); } - // Generate ItemStack - ItemStack item = lbtItem.toItemStack(); - + ItemStack item = lbtItem.item(); // Exactly 2 item.setAmount(2);