From bc2237761e0c2cc388ae31e1530a0fa598f6b542 Mon Sep 17 00:00:00 2001 From: Sefiraat Date: Thu, 20 Jul 2023 18:00:58 +0100 Subject: [PATCH 1/2] Fix distinction --- pom.xml | 2 +- .../danktech2/slimefun/machines/DankCrafter.java | 2 +- .../sefiraat/danktech2/slimefun/packs/DankPack.java | 10 +++++++++- .../sefiraat/danktech2/slimefun/packs/TrashPack.java | 10 +++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 73b63e2..2f8be57 100644 --- a/pom.xml +++ b/pom.xml @@ -117,7 +117,7 @@ com.github.Slimefun Slimefun4 - 2c4f886 + RC-35 provided diff --git a/src/main/java/io/github/sefiraat/danktech2/slimefun/machines/DankCrafter.java b/src/main/java/io/github/sefiraat/danktech2/slimefun/machines/DankCrafter.java index 4fb9f0c..cb22c74 100644 --- a/src/main/java/io/github/sefiraat/danktech2/slimefun/machines/DankCrafter.java +++ b/src/main/java/io/github/sefiraat/danktech2/slimefun/machines/DankCrafter.java @@ -162,7 +162,7 @@ public void newInstance(@NotNull BlockMenu menu, @NotNull Block b) { private boolean testRecipe(ItemStack[] input, ItemStack[] recipe) { for (int test = 0; test < recipe.length; test++) { - if (!SlimefunUtils.isItemSimilar(input[test], recipe[test], true, false)) { + if (!SlimefunUtils.isItemSimilar(input[test], recipe[test], true, false, false)) { return false; } } diff --git a/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/DankPack.java b/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/DankPack.java index 3c1fcef..0305494 100644 --- a/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/DankPack.java +++ b/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/DankPack.java @@ -5,11 +5,14 @@ import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.items.settings.IntRangeSetting; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +import io.github.thebusybiscuit.slimefun4.core.attributes.DistinctiveItem; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock; import lombok.Getter; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.jetbrains.annotations.NotNull; -public class DankPack extends UnplaceableBlock { +public class DankPack extends UnplaceableBlock implements DistinctiveItem { @Getter private final int tier; @@ -25,4 +28,9 @@ public DankPack(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeTy this.capacityPerSlot = new IntRangeSetting(this, "capacity_per_slot", 1, defaultCapacity, Integer.MAX_VALUE); addItemSetting(capacityPerSlot); } + + @Override + public boolean canStack(@NotNull ItemMeta itemMeta, @NotNull ItemMeta itemMeta1) { + return itemMeta1.getPersistentDataContainer().equals(itemMeta.getPersistentDataContainer()); + } } diff --git a/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/TrashPack.java b/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/TrashPack.java index e3e06bd..2885dc2 100644 --- a/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/TrashPack.java +++ b/src/main/java/io/github/sefiraat/danktech2/slimefun/packs/TrashPack.java @@ -3,11 +3,14 @@ import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +import io.github.thebusybiscuit.slimefun4.core.attributes.DistinctiveItem; import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock; import lombok.Getter; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.jetbrains.annotations.NotNull; -public class TrashPack extends UnplaceableBlock { +public class TrashPack extends UnplaceableBlock implements DistinctiveItem { @Getter private final int tier; @@ -19,4 +22,9 @@ public TrashPack(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeT this.tier = tier; this.slots = tier * 2; } + + @Override + public boolean canStack(@NotNull ItemMeta itemMeta, @NotNull ItemMeta itemMeta1) { + return itemMeta1.getPersistentDataContainer().equals(itemMeta.getPersistentDataContainer()); + } } From 2b90f97b26fe025135b0fd2d65cd7e86fcd4931c Mon Sep 17 00:00:00 2001 From: Sefiraat Date: Thu, 20 Jul 2023 18:20:25 +0100 Subject: [PATCH 2/2] Update some dependencies --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 2f8be57..756e4fa 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ org.bstats bstats-bukkit - 3.0.0 + 3.0.2 compile @@ -136,7 +136,7 @@ org.projectlombok lombok - 1.18.24 + 1.18.28 provided @@ -150,19 +150,19 @@ com.gmail.nossr50.mcMMO mcMMO - 2.1.214 + 2.1.222 provided com.bgsoftware WildStackerAPI - 3.8.0 + 2023.2 provided dev.rosewood rosestacker - 1.4.12 + 1.5.9 provided