feat(D-01): implement ResistanceComponent, improve stack-aware resistance lookup
This commit is contained in:
@@ -7,6 +7,7 @@ import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
|
||||
import com.tiedup.remake.v2.bondage.component.ComponentHolder;
|
||||
import com.tiedup.remake.v2.bondage.component.ComponentType;
|
||||
import com.tiedup.remake.v2.bondage.component.IItemComponent;
|
||||
import com.tiedup.remake.v2.bondage.component.ResistanceComponent;
|
||||
import com.tiedup.remake.v2.bondage.items.AbstractV2BondageItem;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -150,6 +151,21 @@ public class DataDrivenBondageItem extends AbstractV2BondageItem {
|
||||
.entrySet()) {
|
||||
ItemStack stack = entry.getValue();
|
||||
if (stack.getItem() == this) {
|
||||
// Try component first (stack-aware, fixes I-03)
|
||||
ResistanceComponent comp = DataDrivenBondageItem
|
||||
.getComponent(
|
||||
stack,
|
||||
ComponentType.RESISTANCE,
|
||||
ResistanceComponent.class
|
||||
);
|
||||
if (comp != null) {
|
||||
maxDifficulty = Math.max(
|
||||
maxDifficulty,
|
||||
comp.getBaseResistance()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
// Fallback: read from definition directly
|
||||
DataDrivenItemDefinition def =
|
||||
DataDrivenItemRegistry.get(stack);
|
||||
if (def != null) {
|
||||
|
||||
Reference in New Issue
Block a user