diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java index aa3b119377..919691681b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java @@ -149,7 +149,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.getDelegate(), im -> { + menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.item(), im -> { im.setDisplayName(ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters")); im.setLore(null); })); @@ -157,7 +157,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) { menu.addMenuClickHandler(2, ChestMenuUtils.getEmptyClickHandler()); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL.getDelegate(), "&7Network Info", "", "&8\u21E8 &7Status: " + getStatusText(p, complexity), "&8\u21E8 &7Complexity: &f" + complexity)); + menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL.item(), "&7Network Info", "", "&8\u21E8 &7Status: " + getStatusText(p, complexity), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); @@ -177,7 +177,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) { if (sfi instanceof GPSTransmitter transmitter) { int slot = inventory[index]; - menu.addItem(slot, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.getDelegate(), "&bGPS Transmitter", "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &f" + transmitter.getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms")); + menu.addItem(slot, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.item(), "&bGPS Transmitter", "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &f" + transmitter.getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms")); menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler()); index++; @@ -232,14 +232,14 @@ public void openWaypointControlPanel(@Nonnull Player p) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.getDelegate(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); + menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER.item(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); menu.addMenuClickHandler(2, (pl, slot, item, action) -> { openTransmitterControlPanel(pl); return false; }); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL.getDelegate(), "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); + menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL.item(), "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index 6bb890beb4..ac1ee2b2bf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -153,7 +153,7 @@ public SlimefunItem(ItemGroup itemGroup, SlimefunItemStack item, RecipeType reci Validate.notNull(recipeType, "'recipeType' is not allowed to be null!"); this.itemGroup = itemGroup; - this.itemStackTemplate = item.getDelegate(); + this.itemStackTemplate = item.item(); this.id = item.getItemId(); this.recipeType = recipeType; this.recipe = recipe; @@ -1190,7 +1190,7 @@ public final int hashCode() { return null; } - var delegate = slimefunItemStack.getDelegate(); + var delegate = slimefunItemStack.item(); if (delegate.getType() == Material.AIR) { return null; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java index 6cc2e71a43..7e205d4991 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java @@ -170,7 +170,7 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull Color color, @Nonnull Poti } public SlimefunItemStack(@Nonnull SlimefunItemStack item, int amount) { - this(item.getItemId(), item.getDelegate()); + this(item.getItemId(), item.item()); setAmount(amount); } @@ -337,7 +337,7 @@ public final int hashCode() { /** * @return underlying ItemStack used */ - public @Nonnull ItemStack getDelegate() { + public @Nonnull ItemStack item() { return delegate; } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index 571b44cfae..49d8ff6e5d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -47,7 +47,7 @@ public class RecipeType implements Keyed { public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(new NamespacedKey(Slimefun.instance(), "enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); public static final RecipeType JUICER = new RecipeType(new NamespacedKey(Slimefun.instance(), "juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); - public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(Slimefun.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR.getDelegate(), (recipe, output) -> { + public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(Slimefun.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR.item(), (recipe, output) -> { AltarRecipe altarRecipe = new AltarRecipe(Arrays.asList(recipe), output); AncientAltar altar = ((AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem()); altar.getRecipes().add(altarRecipe); @@ -91,7 +91,7 @@ public RecipeType(ItemStack item, String machine) { } public RecipeType(NamespacedKey key, SlimefunItemStack slimefunItem, String... lore) { - this(key, slimefunItem.getDelegate(), null, lore); + this(key, slimefunItem.item(), null, lore); } public RecipeType(NamespacedKey key, ItemStack item, BiConsumer callback, String... lore) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index 5f0b10ab8b..837f2c3fc1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -69,7 +69,7 @@ public void onExecute(CommandSender sender, String[] args) { } Slimefun.runSync(() -> { - ItemStack item = SlimefunItems.RESTORED_BACKPACK.clone().getDelegate(); + ItemStack item = SlimefunItems.RESTORED_BACKPACK.clone().item(); Slimefun.getBackpackListener().setBackpackId(backpackOwner, item, 2, id); player.getInventory().addItem(item); Slimefun.getLocalization().sendMessage(sender, "commands.backpack.restored-backpack-given"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java index a97e1f28aa..92fe8b1526 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java @@ -20,7 +20,7 @@ class DebugFishCommand extends SubCommand { @Override public void onExecute(CommandSender sender, String[] args) { if (sender instanceof Player player && sender.hasPermission("slimefun.debugging")) { - player.getInventory().addItem(SlimefunItems.DEBUG_FISH.clone().getDelegate()); + player.getInventory().addItem(SlimefunItems.DEBUG_FISH.clone().item()); } else { Slimefun.getLocalization().sendMessage(sender, "messages.no-permission", true); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index ef23e26e8c..c9cd289dec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -69,7 +69,7 @@ protected void registerDefaultFuelTypes() { registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT))); registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS))); registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS))); - registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO.getDelegate())); + registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO.item())); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java index 513ba48c84..eb69dc5718 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java @@ -22,8 +22,8 @@ public CombustionGenerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeTy @Override protected void registerDefaultFuelTypes() { - registerFuel(new MachineFuel(30, SlimefunItems.OIL_BUCKET.getDelegate())); - registerFuel(new MachineFuel(90, SlimefunItems.FUEL_BUCKET.getDelegate())); + registerFuel(new MachineFuel(30, SlimefunItems.OIL_BUCKET.item())); + registerFuel(new MachineFuel(90, SlimefunItems.FUEL_BUCKET.item())); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java index 85fbaf79ac..20b5a12d40 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java @@ -49,7 +49,7 @@ protected MachineRecipe findNextRecipe(BlockMenu menu) { ItemStack item = menu.getItemInSlot(slot); if (item != null && item.getType().getMaxDurability() > 0 && ((Damageable) item.getItemMeta()).getDamage() > 0) { - if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE.getDelegate(), true, false)) { + if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE.item(), true, false)) { ItemStack repairedItem = repair(item); if (!menu.fits(repairedItem, getOutputSlots())) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java index c618405f1c..e7245f5992 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java @@ -62,25 +62,25 @@ protected void registerDefaultRecipes() { recipeList.add(new ItemStack(Material.BUCKET)); recipeList.add(new ItemStack(Material.COOKED_BEEF)); - recipeList.add(SlimefunItems.BEEF_JERKY.getDelegate()); + recipeList.add(SlimefunItems.BEEF_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_PORKCHOP)); - recipeList.add(SlimefunItems.PORK_JERKY.getDelegate()); + recipeList.add(SlimefunItems.PORK_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_CHICKEN)); - recipeList.add(SlimefunItems.CHICKEN_JERKY.getDelegate()); + recipeList.add(SlimefunItems.CHICKEN_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_MUTTON)); - recipeList.add(SlimefunItems.MUTTON_JERKY.getDelegate()); + recipeList.add(SlimefunItems.MUTTON_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_RABBIT)); - recipeList.add(SlimefunItems.RABBIT_JERKY.getDelegate()); + recipeList.add(SlimefunItems.RABBIT_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_COD)); - recipeList.add(SlimefunItems.FISH_JERKY.getDelegate()); + recipeList.add(SlimefunItems.FISH_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_SALMON)); - recipeList.add(SlimefunItems.FISH_JERKY.getDelegate()); + recipeList.add(SlimefunItems.FISH_JERKY.item()); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_19)) { recipeList.add(new ItemStack(Material.MUD)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java index 677184c044..300134c7f3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java @@ -24,12 +24,12 @@ public CarbonPress(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recip @Override protected void registerDefaultRecipes() { registerRecipe(15, new ItemStack[] { new ItemStack(Material.CHARCOAL, 4) }, new ItemStack[] { new ItemStack(Material.COAL) }); - registerRecipe(20, new ItemStack[] { new ItemStack(Material.COAL, 8) }, new ItemStack[] { SlimefunItems.CARBON.getDelegate() }); - registerRecipe(180, new ItemStack[] { new ItemStack(Material.COAL_BLOCK, 8) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARBON, 9).getDelegate() }); - registerRecipe(30, new ItemStack[] { new CustomItemStack(SlimefunItems.CARBON.getDelegate(), 4) }, new ItemStack[] { SlimefunItems.COMPRESSED_CARBON.getDelegate() }); - registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.getDelegate(), SlimefunItems.SYNTHETIC_DIAMOND.getDelegate() }, new ItemStack[] { SlimefunItems.RAW_CARBONADO.getDelegate() }); - registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.getDelegate() }, new ItemStack[] { SlimefunItems.SYNTHETIC_DIAMOND.getDelegate() }); - registerRecipe(90, new ItemStack[] { SlimefunItems.RAW_CARBONADO.getDelegate() }, new ItemStack[] { SlimefunItems.CARBONADO.getDelegate() }); + registerRecipe(20, new ItemStack[] { new ItemStack(Material.COAL, 8) }, new ItemStack[] { SlimefunItems.CARBON.item() }); + registerRecipe(180, new ItemStack[] { new ItemStack(Material.COAL_BLOCK, 8) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARBON, 9).item() }); + registerRecipe(30, new ItemStack[] { new CustomItemStack(SlimefunItems.CARBON.item(), 4) }, new ItemStack[] { SlimefunItems.COMPRESSED_CARBON.item() }); + registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.item(), SlimefunItems.SYNTHETIC_DIAMOND.item() }, new ItemStack[] { SlimefunItems.RAW_CARBONADO.item() }); + registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.item() }, new ItemStack[] { SlimefunItems.SYNTHETIC_DIAMOND.item() }); + registerRecipe(90, new ItemStack[] { SlimefunItems.RAW_CARBONADO.item() }, new ItemStack[] { SlimefunItems.CARBONADO.item() }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java index 949c9cd9fe..d640571f2f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java @@ -48,21 +48,21 @@ protected MachineRecipe findNextRecipe(BlockMenu menu) { for (int slot : getInputSlots()) { ItemStack input = menu.getItemInSlot(slot); MachineRecipe recipe = null; - if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE.getDelegate(), true, false)) { + if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE.item(), true, false)) { if (!legacyMode && !hasFreeSlot(menu)) { return null; } - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE.getDelegate() }, new ItemStack[] { oreWasher.getRandomDust() }); + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE.item() }, new ItemStack[] { oreWasher.getRandomDust() }); if (!legacyMode || menu.fits(recipe.getOutput()[0], getOutputSlots())) { menu.consumeItem(slot); return recipe; } - } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE.getDelegate(), true)) { - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE.getDelegate() }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER.getDelegate() }); + } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE.item(), true)) { + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE.item() }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER.item() }); } else if (SlimefunUtils.isItemSimilar(input, new ItemStack(Material.SAND), true)) { - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT.getDelegate() }); + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT.item() }); } if (recipe != null && menu.fits(recipe.getOutput()[0], getOutputSlots())) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java index b5c8cb4824..12a93cb07b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java @@ -54,10 +54,10 @@ public List getDisplayRecipes() { protected void registerDefaultRecipes() { // this is an extra recipe on top of PostSetup.loadSmelteryRecipes() for converting // Vanilla Gold Ingot to Slimefun gold dust and Vanilla Copper Ingot into Slimefun copper dust - registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST.getDelegate()); + registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST.item()); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - registerRecipe(3, new ItemStack(Material.COPPER_INGOT), SlimefunItems.COPPER_DUST.getDelegate()); + registerRecipe(3, new ItemStack(Material.COPPER_INGOT), SlimefunItems.COPPER_DUST.item()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java index 4b2b727a70..225d233629 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java @@ -32,7 +32,7 @@ public ElectricPress(ItemGroup itemGroup, SlimefunItemStack item, RecipeType rec @Override protected void registerDefaultRecipes() { - addRecipe(4, new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 3).getDelegate(), new ItemStack(Material.COBBLESTONE)); + addRecipe(4, new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 3).item(), new ItemStack(Material.COBBLESTONE)); addRecipe(4, new ItemStack(Material.FLINT, 6), new ItemStack(Material.COBBLESTONE)); addRecipe(5, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE, 3)); addRecipe(4, new ItemStack(Material.SNOWBALL, 4), new ItemStack(Material.SNOW_BLOCK)); @@ -44,15 +44,15 @@ protected void registerDefaultRecipes() { addRecipe(3, new ItemStack(Material.CLAY_BALL, 4), new ItemStack(Material.CLAY)); addRecipe(3, new ItemStack(Material.BRICK, 4), new ItemStack(Material.BRICKS)); - addRecipe(6, SlimefunItems.COPPER_INGOT.getDelegate(), new CustomItemStack(SlimefunItems.COPPER_WIRE.getDelegate(), 3)); + addRecipe(6, SlimefunItems.COPPER_INGOT.item(), new CustomItemStack(SlimefunItems.COPPER_WIRE.item(), 3)); addRecipe(16, new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), SlimefunItems.STEEL_PLATE); addRecipe(18, new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), SlimefunItems.REINFORCED_PLATE); - addRecipe(8, new ItemStack(Material.NETHER_WART), new CustomItemStack(SlimefunItems.MAGIC_LUMP_1.getDelegate(), 2)); + addRecipe(8, new ItemStack(Material.NETHER_WART), new CustomItemStack(SlimefunItems.MAGIC_LUMP_1.item(), 2)); addRecipe(10, new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4), SlimefunItems.MAGIC_LUMP_2); addRecipe(12, new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_2, 4), SlimefunItems.MAGIC_LUMP_3); - addRecipe(10, new ItemStack(Material.ENDER_EYE), new CustomItemStack(SlimefunItems.ENDER_LUMP_1.getDelegate(), 2)); + addRecipe(10, new ItemStack(Material.ENDER_EYE), new CustomItemStack(SlimefunItems.ENDER_LUMP_1.item(), 2)); addRecipe(12, new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 4), SlimefunItems.ENDER_LUMP_2); addRecipe(14, new SlimefunItemStack(SlimefunItems.ENDER_LUMP_2, 4), SlimefunItems.ENDER_LUMP_3); @@ -94,7 +94,7 @@ private void addRecipe(int seconds, ItemStack input, ItemStack output) { @ParametersAreNonnullByDefault private void addRecipe(int seconds, SlimefunItemStack sfItem1, SlimefunItemStack sfItem2) { - registerRecipe(seconds, sfItem1.getDelegate(), sfItem2.getDelegate()); + registerRecipe(seconds, sfItem1.item(), sfItem2.item()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java index 702f5bfe91..b03e81cc3e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java @@ -19,17 +19,17 @@ public FoodFabricator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType re @Override protected void registerDefaultRecipes() { - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.WHEAT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.CARROT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.POTATO) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.WHEAT_SEEDS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.BEETROOT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.MELON_SLICE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.getDelegate(), new ItemStack(Material.SEAGRASS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEAGRASS_ORGANIC_FOOD, OrganicFood.OUTPUT).getDelegate() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.WHEAT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.CARROT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.POTATO) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.WHEAT_SEEDS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.BEETROOT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.MELON_SLICE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.SEAGRASS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEAGRASS_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java index a373974026..966ab0e534 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java @@ -85,13 +85,13 @@ private Comparator compareSlots(DirtyChestMenu menu) { @Override protected void registerDefaultRecipes() { - registerRecipe(45, new ItemStack[] { SlimefunItems.OIL_BUCKET.getDelegate() }, new ItemStack[] { new CustomItemStack(SlimefunItems.PLASTIC_SHEET.getDelegate(), 8) }); + registerRecipe(45, new ItemStack[] { SlimefunItems.OIL_BUCKET.item() }, new ItemStack[] { new CustomItemStack(SlimefunItems.PLASTIC_SHEET.item(), 8) }); registerRecipe(30, new SlimefunItemStack[] { SlimefunItems.GOLD_24K, SlimefunItems.URANIUM }, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT }); registerRecipe(30, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO }, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT_2 }); - registerRecipe(60, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_2.getDelegate(), new ItemStack(Material.NETHER_STAR) }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_3.getDelegate() }); + registerRecipe(60, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_2.item(), new ItemStack(Material.NETHER_STAR) }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_3.item() }); registerRecipe(90, new SlimefunItemStack[] { SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM }, new SlimefunItemStack[] { SlimefunItems.BOOSTED_URANIUM }); - registerRecipe(60, new ItemStack[] { SlimefunItems.NETHER_ICE.getDelegate(), SlimefunItems.PLUTONIUM.getDelegate() }, new ItemStack[] { new CustomItemStack(SlimefunItems.ENRICHED_NETHER_ICE.getDelegate(), 4) }); - registerRecipe(45, new ItemStack[] { SlimefunItems.ENRICHED_NETHER_ICE.getDelegate() }, new ItemStack[] { new CustomItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL.getDelegate(), 8) }); + registerRecipe(60, new ItemStack[] { SlimefunItems.NETHER_ICE.item(), SlimefunItems.PLUTONIUM.item() }, new ItemStack[] { new CustomItemStack(SlimefunItems.ENRICHED_NETHER_ICE.item(), 4) }); + registerRecipe(45, new ItemStack[] { SlimefunItems.ENRICHED_NETHER_ICE.item() }, new ItemStack[] { new CustomItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL.item(), 8) }); registerRecipe(8, new SlimefunItemStack[] { SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT }, new SlimefunItemStack[] { SlimefunItems.MAGNESIUM_SALT }); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java index cafd7e800c..b5d032f459 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java @@ -19,7 +19,7 @@ public abstract class CropGrowthAccelerator extends AbstractGrowthAccelerator { // We wanna strip the Slimefun Item id here - private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER.getDelegate()); + private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER.item()); protected CropGrowthAccelerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java index d5f741b3bc..0ef1535a38 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java @@ -159,7 +159,7 @@ private void produceFlasks(@Nonnull Location location, int experiencePoints) { for (int level = 0; level < getStoredExperience(location); level = level + 10) { if (menu.fits(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, getOutputSlots())) { withdrawn = withdrawn + 10; - menu.pushItem(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.getDelegate(), getOutputSlots()); + menu.pushItem(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), getOutputSlots()); } else { // There is no room for more bottles, so lets stop checking if more will fit. break; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java index 54bd28fb3a..20c63fde24 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java @@ -145,7 +145,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { switch (mode) { case GENERATOR: - menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.NUCLEAR_REACTOR.getDelegate(), "&7Focus: &eElectricity", "", "&6Your Reactor will focus on Power Generation", "&6If your Energy Network doesn't need Power", "&6it will not produce any either", "", "&7\u21E8 Click to change the Focus to &eProduction")); + menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.NUCLEAR_REACTOR.item(), "&7Focus: &eElectricity", "", "&6Your Reactor will focus on Power Generation", "&6If your Energy Network doesn't need Power", "&6it will not produce any either", "", "&7\u21E8 Click to change the Focus to &eProduction")); menu.addMenuClickHandler(4, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, MODE, ReactorMode.PRODUCTION.toString()); updateInventory(menu, b); @@ -153,7 +153,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { }); break; case PRODUCTION: - menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.PLUTONIUM.getDelegate(), "&7Focus: &eProduction", "", "&6Your Reactor will focus on producing goods", "&6If your Energy Network doesn't need Power", "&6it will continue to run and simply will", "&6not generate any Power in the mean time", "", "&7\u21E8 Click to change the Focus to &ePower Generation")); + menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.PLUTONIUM.item(), "&7Focus: &eProduction", "", "&6Your Reactor will focus on producing goods", "&6If your Energy Network doesn't need Power", "&6it will continue to run and simply will", "&6not generate any Power in the mean time", "", "&7\u21E8 Click to change the Focus to &ePower Generation")); menu.addMenuClickHandler(4, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, MODE, ReactorMode.GENERATOR.toString()); updateInventory(menu, b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java index b06645d753..6efdebe787 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java @@ -39,7 +39,7 @@ public KnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType re if (p.getLevel() >= 1 && (e.getClickedBlock().isEmpty() || !(e.getClickedBlock().get().getType().isInteractable()))) { p.setLevel(p.getLevel() - 1); - ItemStack item = SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.getDelegate(); + ItemStack item = SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(); if (!p.getInventory().addItem(item).isEmpty()) { // The Item could not be added, let's drop it to the ground (fixes #2728) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java index 2f015ced5c..4574c59eaa 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java @@ -21,11 +21,11 @@ */ class EnderTalisman extends Talisman { - private static final LockedItemGroup ENDER_TALISMANS_ITEMGROUP = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "ender_talismans"), new CustomItemStack(SlimefunItems.ENDER_TALISMAN.getDelegate(), "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_ITEMGROUP.getKey()); + private static final LockedItemGroup ENDER_TALISMANS_ITEMGROUP = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "ender_talismans"), new CustomItemStack(SlimefunItems.ENDER_TALISMAN.item(), "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_ITEMGROUP.getKey()); @ParametersAreNonnullByDefault public EnderTalisman(Talisman parent, SlimefunItemStack item) { - super(ENDER_TALISMANS_ITEMGROUP, item, new ItemStack[] { SlimefunItems.ENDER_LUMP_3.getDelegate(), null, SlimefunItems.ENDER_LUMP_3.getDelegate(), null, parent.getItem(), null, SlimefunItems.ENDER_LUMP_3.getDelegate(), null, SlimefunItems.ENDER_LUMP_3.getDelegate() }, parent.isConsumable(), parent.isEventCancelled(), parent.getMessageSuffix(), parent.getChance(), parent.getEffects()); + super(ENDER_TALISMANS_ITEMGROUP, item, new ItemStack[] { SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item(), null, parent.getItem(), null, SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item() }, parent.isConsumable(), parent.isEventCancelled(), parent.getMessageSuffix(), parent.getChance(), parent.getEffects()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java index 23923d95ca..daa277b9b6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java @@ -40,7 +40,7 @@ public class Talisman extends SlimefunItem { - protected static final ItemGroup TALISMANS_ITEMGROUP = new ItemGroup(new NamespacedKey(Slimefun.instance(), "talismans"), new CustomItemStack(SlimefunItems.COMMON_TALISMAN.getDelegate(), "&7Talismans - &aTier I"), 2); + protected static final ItemGroup TALISMANS_ITEMGROUP = new ItemGroup(new NamespacedKey(Slimefun.instance(), "talismans"), new CustomItemStack(SlimefunItems.COMMON_TALISMAN.item(), "&7Talismans - &aTier I"), 2); private static final String WIKI_PAGE = "Talismans"; private final SlimefunItemStack enderTalisman; @@ -68,7 +68,7 @@ public Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, @ParametersAreNonnullByDefault protected Talisman(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, @Nullable String messageSuffix, int chance, PotionEffect... effects) { - super(itemGroup, item, RecipeType.MAGIC_WORKBENCH, recipe, new CustomItemStack(item.getDelegate(), consumable ? 4 : 1)); + super(itemGroup, item, RecipeType.MAGIC_WORKBENCH, recipe, new CustomItemStack(item.item(), consumable ? 4 : 1)); this.consumable = consumable; this.cancel = cancelEvent; @@ -194,9 +194,9 @@ public static boolean trigger(Event e, SlimefunItem item, boolean sendMessage) { } EnderTalisman enderTalisman = enderTalismanItem.getItem(EnderTalisman.class); - if (enderTalisman != null && SlimefunUtils.containsSimilarItem(p.getEnderChest(), enderTalismanItem.getDelegate(), true)) { + if (enderTalisman != null && SlimefunUtils.containsSimilarItem(p.getEnderChest(), enderTalismanItem.item(), true)) { if (talisman.canUse(p, true)) { - activateTalisman(e, p, p.getEnderChest(), enderTalisman, enderTalismanItem.getDelegate(), sendMessage); + activateTalisman(e, p, p.getEnderChest(), enderTalisman, enderTalismanItem.item(), sendMessage); return true; } else { return false; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java index 9a7b31527d..13aac08291 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java @@ -35,7 +35,7 @@ public Arrow getArrow() { public void drop(@Nonnull Location l) { // If a grappling hook was consumed, drop one grappling hook on the floor if (dropItem && wasConsumed) { - Item item = l.getWorld().dropItem(l, SlimefunItems.GRAPPLING_HOOK.getDelegate()); + Item item = l.getWorld().dropItem(l, SlimefunItems.GRAPPLING_HOOK.item()); item.setPickupDelay(16); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java index cc02fdb3ef..ebadc2e90c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java @@ -28,22 +28,22 @@ public final class ChestMenuUtils { private ChestMenuUtils() {} - private static final ItemStack UI_BACKGROUND = new SlimefunItemStack("_UI_BACKGROUND", Material.GRAY_STAINED_GLASS_PANE, " ").getDelegate(); - private static final ItemStack INPUT_SLOT = new SlimefunItemStack("_UI_INPUT_SLOT", Material.CYAN_STAINED_GLASS_PANE, " ").getDelegate(); - private static final ItemStack OUTPUT_SLOT = new SlimefunItemStack("_UI_OUTPUT_SLOT", Material.ORANGE_STAINED_GLASS_PANE, " ").getDelegate(); - - private static final ItemStack NO_PERMISSION = new SlimefunItemStack("_UI_NO_PERMISSION", Material.BARRIER, "No Permission").getDelegate(); - private static final ItemStack NOT_RESEARCHED = new SlimefunItemStack("_UI_NOT_RESEARCHED", Material.BARRIER, "Not researched").getDelegate(); - - private static final ItemStack BACK_BUTTON = new SlimefunItemStack("_UI_BACK", Material.ENCHANTED_BOOK, "&7\u21E6 Back", meta -> meta.addItemFlags(ItemFlag.HIDE_ENCHANTS)).getDelegate(); - private static final ItemStack MENU_BUTTON = new SlimefunItemStack("_UI_MENU", Material.COMPARATOR, "&eSettings / Info", "", "&7\u21E8 Click to see more").getDelegate(); - private static final ItemStack SEARCH_BUTTON = new SlimefunItemStack("_UI_SEARCH", Material.NAME_TAG, "&bSearch").getDelegate(); - private static final ItemStack WIKI_BUTTON = new SlimefunItemStack("_UI_WIKI", Material.KNOWLEDGE_BOOK, "&3Slimefun Wiki").getDelegate(); - - private static final ItemStack PREV_BUTTON_ACTIVE = new SlimefunItemStack("_UI_PREVIOUS_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&r\u21E6 Previous Page").getDelegate(); - private static final ItemStack NEXT_BUTTON_ACTIVE = new SlimefunItemStack("_UI_NEXT_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&rNext Page \u21E8").getDelegate(); - private static final ItemStack PREV_BUTTON_INACTIVE = new SlimefunItemStack("_UI_PREVIOUS_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8\u21E6 Previous Page").getDelegate(); - private static final ItemStack NEXT_BUTTON_INACTIVE = new SlimefunItemStack("_UI_NEXT_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8Next Page \u21E8").getDelegate(); + private static final ItemStack UI_BACKGROUND = new SlimefunItemStack("_UI_BACKGROUND", Material.GRAY_STAINED_GLASS_PANE, " ").item(); + private static final ItemStack INPUT_SLOT = new SlimefunItemStack("_UI_INPUT_SLOT", Material.CYAN_STAINED_GLASS_PANE, " ").item(); + private static final ItemStack OUTPUT_SLOT = new SlimefunItemStack("_UI_OUTPUT_SLOT", Material.ORANGE_STAINED_GLASS_PANE, " ").item(); + + private static final ItemStack NO_PERMISSION = new SlimefunItemStack("_UI_NO_PERMISSION", Material.BARRIER, "No Permission").item(); + private static final ItemStack NOT_RESEARCHED = new SlimefunItemStack("_UI_NOT_RESEARCHED", Material.BARRIER, "Not researched").item(); + + private static final ItemStack BACK_BUTTON = new SlimefunItemStack("_UI_BACK", Material.ENCHANTED_BOOK, "&7\u21E6 Back", meta -> meta.addItemFlags(ItemFlag.HIDE_ENCHANTS)).item(); + private static final ItemStack MENU_BUTTON = new SlimefunItemStack("_UI_MENU", Material.COMPARATOR, "&eSettings / Info", "", "&7\u21E8 Click to see more").item(); + private static final ItemStack SEARCH_BUTTON = new SlimefunItemStack("_UI_SEARCH", Material.NAME_TAG, "&bSearch").item(); + private static final ItemStack WIKI_BUTTON = new SlimefunItemStack("_UI_WIKI", Material.KNOWLEDGE_BOOK, "&3Slimefun Wiki").item(); + + private static final ItemStack PREV_BUTTON_ACTIVE = new SlimefunItemStack("_UI_PREVIOUS_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&r\u21E6 Previous Page").item(); + private static final ItemStack NEXT_BUTTON_ACTIVE = new SlimefunItemStack("_UI_NEXT_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&rNext Page \u21E8").item(); + private static final ItemStack PREV_BUTTON_INACTIVE = new SlimefunItemStack("_UI_PREVIOUS_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8\u21E6 Previous Page").item(); + private static final ItemStack NEXT_BUTTON_INACTIVE = new SlimefunItemStack("_UI_NEXT_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8Next Page \u21E8").item(); private static final ChestMenu.AdvancedMenuClickHandler OUTPUT_HANDLER = new ChestMenu.AdvancedMenuClickHandler() { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java index fd544c0df4..54b9078434 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java @@ -319,16 +319,16 @@ public void registerRecipe(int seconds, ItemStack input, ItemStack output) { } public void registerRecipe(int seconds, SlimefunItemStack input, SlimefunItemStack output) { - registerRecipe(seconds, input.getDelegate(), output.getDelegate()); + registerRecipe(seconds, input.item(), output.item()); } public void registerRecipe(int seconds, SlimefunItemStack[] input, SlimefunItemStack[] output) { var inputAsItemStack = Arrays.stream(input) - .map(SlimefunItemStack::getDelegate) + .map(SlimefunItemStack::item) .toArray(ItemStack[]::new); var outputAsItemStack = Arrays.stream(output) - .map(SlimefunItemStack::getDelegate) + .map(SlimefunItemStack::item) .toArray(ItemStack[]::new); registerRecipe(seconds, inputAsItemStack, outputAsItemStack); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java index b60a046880..88d54a7a8e 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java @@ -191,7 +191,7 @@ private boolean isBucket(@Nullable ItemStack item) { } ItemStackWrapper wrapper = ItemStackWrapper.wrap(item); - return item.getType() == Material.LAVA_BUCKET || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET.getDelegate(), true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET.getDelegate(), true); + return item.getType() == Material.LAVA_BUCKET || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET.item(), true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET.item(), true); } private MachineFuel findRecipe(BlockMenu menu, Map found) { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java index 4a6681b7bb..12489b2862 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java @@ -34,11 +34,11 @@ public MachineFuel(int seconds, ItemStack fuel, ItemStack output) { } public MachineFuel(int seconds, SlimefunItemStack fuel) { - this(seconds, fuel.getDelegate(), null); + this(seconds, fuel.item(), null); } public MachineFuel(int seconds, SlimefunItemStack fuel, SlimefunItemStack output) { - this(seconds, fuel.getDelegate(), output.getDelegate()); + this(seconds, fuel.item(), output.item()); } public ItemStack getInput() { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java index 58d80c975e..c47d93a9d7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java @@ -47,7 +47,7 @@ void testNoTransmitter() throws InterruptedException { void testTransmitter() throws InterruptedException { Player player = server.addPlayer(); TestUtilities.awaitProfile(player); - player.getInventory().setItem(8, SlimefunItems.GPS_EMERGENCY_TRANSMITTER.getDelegate()); + player.getInventory().setItem(8, SlimefunItems.GPS_EMERGENCY_TRANSMITTER.item()); player.setHealth(0); server.getPluginManager().assertEventFired(WaypointCreateEvent.class, event -> event.getPlayer() == player && event.isDeathpoint());