Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class CobblemonCardsConfig extends MidnightConfig {
@Entry
public static boolean displayPercentStatOnCards = true;

@Entry
public static boolean doesMasterBinderProvideStats = false;

// --- Binder Config Options ---

@Entry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.howlite.cobblemoncards.item.custom;

import com.howlite.cobblemoncards.CobblemonCardsConfig;
import com.howlite.cobblemoncards.component.CardStat;
import com.howlite.cobblemoncards.util.PlatformHelper;
import net.minecraft.ChatFormatting;
Expand Down Expand Up @@ -84,6 +85,14 @@ public void appendHoverText(ItemStack stack, TooltipContext context, List<Compon
// Affichage du nombre de pages
tooltipComponents.add(Component.translatable("gui.cobblemon-cards.binder.pages", tier.getPages()).withStyle(ChatFormatting.GRAY));

// Master tier binders do not provide stats due to their insane space limits.
// If you want stats from your cards, use a netherite binder
// There is a config option to allow master binders to provide stats if desired, but it is not recommended.
if (tier == BinderTier.MASTER && !CobblemonCardsConfig.doesMasterBinderProvideStats){
super.appendHoverText(stack, context, tooltipComponents, tooltipFlag);
return;
}

// Shared reader: BINDER_CONTENTS with a fallback to vanilla CONTAINER for unmigrated saves.
Map<CardStat, Float> statTotals = com.howlite.cobblemoncards.util.CardStatUtil.collectStats(stack);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CardStatUtil {
* vanilla {@link DataComponents#CONTAINER} component for saves that predate the migration.
*/
public static Iterable<ItemStack> getBinderContents(ItemStack binderStack) {
if (binderStack == null || binderStack.isEmpty()) {
if (binderStack == null) {
return Collections.emptyList();
}
List<ItemStack> binderItems = binderStack.get(ModDataComponents.BINDER_CONTENTS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.howlite.cobblemoncards.fabric.item;

import com.howlite.cobblemoncards.CobblemonCardsConfig;
import com.howlite.cobblemoncards.component.CardStat;
import com.howlite.cobblemoncards.item.custom.MasterAlbumItem;
import io.wispforest.accessories.api.Accessory;
Expand All @@ -22,6 +23,9 @@ public FabricMasterAlbumItem(Properties properties) {

@Override
public void getDynamicModifiers(ItemStack stack, SlotReference reference, AccessoryAttributeBuilder builder) {
// If configured, master tier binders do not provide stats
if (!CobblemonCardsConfig.doesMasterBinderProvideStats) return;

// Shared reader: BINDER_CONTENTS with a fallback to vanilla CONTAINER for unmigrated saves.
Map<CardStat, Float> statTotals = com.howlite.cobblemoncards.util.CardStatUtil.collectStats(stack);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.howlite.cobblemoncards.neoforge.item;

import com.howlite.cobblemoncards.CobblemonCardsConfig;
import com.howlite.cobblemoncards.item.custom.MasterAlbumItem;
import com.howlite.cobblemoncards.component.CardStat;
import io.wispforest.accessories.api.Accessory;
Expand All @@ -22,6 +23,9 @@ public NeoForgeMasterAlbumItem(Properties properties) {

@Override
public void getDynamicModifiers(ItemStack stack, SlotReference reference, AccessoryAttributeBuilder builder) {
// If configured, master tier binders do not provide stats
if (!CobblemonCardsConfig.doesMasterBinderProvideStats) return;

// Shared reader: BINDER_CONTENTS with a fallback to vanilla CONTAINER for unmigrated saves.
Map<CardStat, Float> statTotals = com.howlite.cobblemoncards.util.CardStatUtil.collectStats(stack);

Expand Down
Loading