Skip to content

Commit

Permalink
feat(CraftingBluePrint): 合成蓝图堆叠检测
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed May 13, 2024
1 parent 2360ef7 commit 6d00e2c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import io.github.sefiraat.networks.network.stackcaches.BlueprintInstance;
import io.github.sefiraat.networks.utils.Keys;
import io.github.sefiraat.networks.utils.StringUtils;
import io.github.sefiraat.networks.utils.Theme;
import io.github.sefiraat.networks.utils.datatypes.DataTypeMethods;
import io.github.sefiraat.networks.utils.datatypes.PersistentCraftingBlueprintType;
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 net.guizhanss.guizhanlib.minecraft.helper.inventory.ItemStackHelper;
import org.bukkit.ChatColor;
Expand All @@ -19,7 +19,7 @@
import java.util.ArrayList;
import java.util.List;

public class CraftingBlueprint extends UnplaceableBlock {
public class CraftingBlueprint extends UnplaceableBlock implements DistinctiveItem {

public CraftingBlueprint(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);
Expand Down Expand Up @@ -51,4 +51,8 @@ public static void setBlueprint(ItemStack blueprint, ItemStack[] recipe, ItemSta
blueprint.setItemMeta(itemMeta);
}

@Override
public boolean canStack(ItemMeta meta1, ItemMeta meta2) {
return meta1.getPersistentDataContainer().equals(meta2.getPersistentDataContainer());
}
}

0 comments on commit 6d00e2c

Please sign in to comment.