feature/d01-branch-e-resistance #10

Merged
NotEvil merged 3 commits from feature/d01-branch-e-resistance into develop 2026-04-15 01:45:59 +00:00
19 changed files with 67 additions and 17 deletions
Showing only changes of commit 74e9450a55 - Show all commits

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), GPS("gps", GpsComponent::fromJson),
CHOKING("choking", ChokingComponent::fromJson), CHOKING("choking", ChokingComponent::fromJson),
ADJUSTABLE("adjustable", AdjustableComponent::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 String jsonKey;
private final Function<JsonObject, IItemComponent> factory; 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.TyingInteractionHelper;
import com.tiedup.remake.v2.bondage.V2BondageItems; import com.tiedup.remake.v2.bondage.V2BondageItems;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper; 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.ComponentHolder;
import com.tiedup.remake.v2.bondage.component.ComponentType; import com.tiedup.remake.v2.bondage.component.ComponentType;
import com.tiedup.remake.v2.bondage.component.IItemComponent; 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. * Stack-aware padlock attachment check for data-driven items.
* Returns false for organic items (slime, vine, web, tape) that have * Returns false for organic items (slime, vine, web, tape) that have

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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