feat(D-01/E): resistance & lock system rework (E1-E7)
E1: Initialize currentResistance in NBT at equip time from
ResistanceComponent — eliminates MAX-scan fallback bug
E2: BuiltInLockComponent for organic items (already committed)
E3: canStruggle refactor — new model:
- ARMS: always struggle-able (no lock gating)
- Non-ARMS: only if locked OR built-in lock
- Removed dead isItemLocked() from StruggleState + overrides
E4: canUnequip already handled by BuiltInLockComponent.blocksUnequip()
via ComponentHolder delegation
E5: Help/assist mechanic deferred (needs UI design)
E6: Removed lock resistance from ILockable (5 methods + NBT key deleted)
- GenericKnife: new knifeCutProgress NBT for cutting locks
- StruggleAccessory: accessoryStruggleResistance NBT replaces lock resistance
- PacketV2StruggleStart: uses config-based padlock resistance
- All lock/unlock packets cleaned of initializeLockResistance/clearLockResistance
E7: Fixed 3 pre-existing bugs:
- B2: DataDrivenItemRegistry.clear() synchronized on RELOAD_LOCK
- B3: V2TyingPlayerTask validates heldStack before equip (prevents duplication)
- B5: EntityKidnapperMerchant.remove() cleans playerToMerchant map (memory leak)
This commit is contained in:
@@ -394,7 +394,6 @@ public class GenericClothes extends Item implements ILockable, IV2BondageItem {
|
||||
stack.getOrCreateTag().putBoolean(NBT_LOCKED, state);
|
||||
if (!state) {
|
||||
// When unlocking, clear lock-related data
|
||||
clearLockResistance(stack);
|
||||
setJammed(stack, false);
|
||||
}
|
||||
return stack;
|
||||
@@ -439,7 +438,6 @@ public class GenericClothes extends Item implements ILockable, IV2BondageItem {
|
||||
if (keyUUID != null) {
|
||||
tag.putUUID(NBT_LOCKED_BY_KEY_UUID, keyUUID);
|
||||
setLocked(stack, true);
|
||||
initializeLockResistance(stack);
|
||||
} else {
|
||||
tag.remove(NBT_LOCKED_BY_KEY_UUID);
|
||||
setLocked(stack, false);
|
||||
|
||||
Reference in New Issue
Block a user