feat(D-01/E): BuiltInLockComponent for organic items (E2)

- New BuiltInLockComponent: blocksUnequip() returns true (permanent lock)
- ComponentType: add BUILT_IN_LOCK enum value
- 8 organic item JSONs updated (slime, vine, web, tape variants)
- DataDrivenBondageItem: add hasBuiltInLock() static helper
This commit is contained in:
NotEvil
2026-04-15 03:11:15 +02:00
parent 9f75629aea
commit 74e9450a55
19 changed files with 67 additions and 17 deletions

View File

@@ -0,0 +1,27 @@
package com.tiedup.remake.v2.bondage.component;
import com.google.gson.JsonObject;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
/**
* Component: permanent lock for organic items (slime, vine, web, tape).
*
* <p>These items cannot have a padlock attached but always require struggle
* to remove — they behave as if permanently locked.</p>
*
* <p>JSON config: {@code "built_in_lock": {}}</p>
*/
public class BuiltInLockComponent implements IItemComponent {
private BuiltInLockComponent() {}
public static IItemComponent fromJson(JsonObject config) {
return new BuiltInLockComponent();
}
@Override
public boolean blocksUnequip(ItemStack stack, LivingEntity entity) {
return true;
}
}

View File

@@ -16,7 +16,8 @@ public enum ComponentType {
GPS("gps", GpsComponent::fromJson),
CHOKING("choking", ChokingComponent::fromJson),
ADJUSTABLE("adjustable", AdjustableComponent::fromJson),
OWNERSHIP("ownership", OwnershipComponent::fromJson);
OWNERSHIP("ownership", OwnershipComponent::fromJson),
BUILT_IN_LOCK("built_in_lock", BuiltInLockComponent::fromJson);
private final String jsonKey;
private final Function<JsonObject, IItemComponent> factory;

View File

@@ -7,6 +7,7 @@ import com.tiedup.remake.v2.bondage.IV2BondageEquipment;
import com.tiedup.remake.v2.bondage.TyingInteractionHelper;
import com.tiedup.remake.v2.bondage.V2BondageItems;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
import com.tiedup.remake.v2.bondage.component.BuiltInLockComponent;
import com.tiedup.remake.v2.bondage.component.ComponentHolder;
import com.tiedup.remake.v2.bondage.component.ComponentType;
import com.tiedup.remake.v2.bondage.component.IItemComponent;
@@ -436,6 +437,11 @@ public class DataDrivenBondageItem extends AbstractV2BondageItem {
);
}
/** Check if the item has a built-in lock (organic items: slime, vine, web, tape). */
public static boolean hasBuiltInLock(ItemStack stack) {
return getComponent(stack, ComponentType.BUILT_IN_LOCK, BuiltInLockComponent.class) != null;
}
/**
* Stack-aware padlock attachment check for data-driven items.
* Returns false for organic items (slime, vine, web, tape) that have

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "tape"
}
},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "slime"
}
},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "tape"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "vine"
}
},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "web"
}
},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "tape"
}
},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "slime"
}
},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "tape"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "vine"
}
},
"built_in_lock": {}
}
}

View File

@@ -25,6 +25,7 @@
"components": {
"resistance": {
"id": "web"
}
},
"built_in_lock": {}
}
}

View File

@@ -23,6 +23,7 @@
"gagging": {
"material": "stuffed"
},
"adjustable": {}
"adjustable": {},
"built_in_lock": {}
}
}