Skip to content

Commit

Permalink
Fix distinction
Browse files Browse the repository at this point in the history
  • Loading branch information
Sefiraat committed Jul 20, 2023
1 parent f2a8ab1 commit bc22377
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>com.github.Slimefun</groupId>
<artifactId>Slimefun4</artifactId>
<version>2c4f886</version>
<version>RC-35</version>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
}
}

0 comments on commit bc22377

Please sign in to comment.