chore/final-polish #19

Merged
NotEvil merged 2 commits from chore/final-polish into develop 2026-04-17 02:08:27 +00:00
44 changed files with 126 additions and 223 deletions

View File

@@ -134,7 +134,7 @@ public class ProgressOverlay {
*/ */
private static ProgressInfo getActiveProgress(PlayerBindState state) { private static ProgressInfo getActiveProgress(PlayerBindState state) {
// Check client tying task // Check client tying task
PlayerStateTask tyingTask = state.getClientTyingTask(); PlayerStateTask tyingTask = state.tasks().getClientTyingTask();
if (tyingTask != null && !tyingTask.isOutdated()) { if (tyingTask != null && !tyingTask.isOutdated()) {
float progress = tyingTask.getProgress(); float progress = tyingTask.getProgress();
Component text = getTyingText(tyingTask); Component text = getTyingText(tyingTask);
@@ -142,7 +142,7 @@ public class ProgressOverlay {
} }
// Check client untying task // Check client untying task
PlayerStateTask untyingTask = state.getClientUntyingTask(); PlayerStateTask untyingTask = state.tasks().getClientUntyingTask();
if (untyingTask != null && !untyingTask.isOutdated()) { if (untyingTask != null && !untyingTask.isOutdated()) {
float progress = untyingTask.getProgress(); float progress = untyingTask.getProgress();
Component text = getUntyingText(untyingTask); Component text = getUntyingText(untyingTask);
@@ -150,7 +150,7 @@ public class ProgressOverlay {
} }
// Check client feeding task // Check client feeding task
PlayerStateTask feedingTask = state.getClientFeedingTask(); PlayerStateTask feedingTask = state.tasks().getClientFeedingTask();
if (feedingTask != null && !feedingTask.isOutdated()) { if (feedingTask != null && !feedingTask.isOutdated()) {
float progress = feedingTask.getProgress(); float progress = feedingTask.getProgress();
Component text = getFeedingText(feedingTask); Component text = getFeedingText(feedingTask);

View File

@@ -21,7 +21,7 @@ import org.joml.Matrix4f;
*/ */
public class NpcFishingBobberRenderer extends EntityRenderer<NpcFishingBobber> { public class NpcFishingBobberRenderer extends EntityRenderer<NpcFishingBobber> {
private static final ResourceLocation TEXTURE = new ResourceLocation( private static final ResourceLocation TEXTURE = ResourceLocation.parse(
"textures/entity/fishing_hook.png" "textures/entity/fishing_hook.png"
); );
private static final RenderType RENDER_TYPE = RenderType.entityCutout( private static final RenderType RENDER_TYPE = RenderType.entityCutout(

View File

@@ -96,15 +96,15 @@ public class KidnapSetCommand {
// Collars (data-driven) // Collars (data-driven)
ItemStack classicCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack classicCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "classic_collar")); net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar"));
classicCollars.setCount(4); classicCollars.setCount(4);
given += giveItem(player, classicCollars); given += giveItem(player, classicCollars);
ItemStack shockCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack shockCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "shock_collar")); net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "shock_collar"));
shockCollars.setCount(2); shockCollars.setCount(2);
given += giveItem(player, shockCollars); given += giveItem(player, shockCollars);
ItemStack gpsCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack gpsCollars = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "gps_collar")); net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "gps_collar"));
gpsCollars.setCount(2); gpsCollars.setCount(2);
given += giveItem(player, gpsCollars); given += giveItem(player, gpsCollars);
@@ -160,7 +160,7 @@ public class KidnapSetCommand {
private static int giveDataDrivenItems(ServerPlayer player, String itemName, int count) { private static int giveDataDrivenItems(ServerPlayer player, String itemName, int count) {
int given = 0; int given = 0;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
ItemStack stack = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", itemName)); ItemStack stack = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", itemName));
if (!stack.isEmpty()) { if (!stack.isEmpty()) {
giveItem(player, stack); giveItem(player, stack);
given++; given++;

View File

@@ -499,7 +499,7 @@ public class NPCCommand {
npc.equip( npc.equip(
BodyRegionV2.ARMS, BodyRegionV2.ARMS,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"))
); );
context context
.getSource() .getSource()
@@ -530,7 +530,7 @@ public class NPCCommand {
npc.equip( npc.equip(
BodyRegionV2.MOUTH, BodyRegionV2.MOUTH,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "cloth_gag")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag"))
); );
context context
.getSource() .getSource()
@@ -563,7 +563,7 @@ public class NPCCommand {
npc.equip( npc.equip(
BodyRegionV2.EYES, BodyRegionV2.EYES,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_blindfold")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold"))
); );
context context
.getSource() .getSource()
@@ -596,7 +596,7 @@ public class NPCCommand {
npc.equip( npc.equip(
BodyRegionV2.NECK, BodyRegionV2.NECK,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_collar")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar"))
); );
context context
.getSource() .getSource()
@@ -647,11 +647,11 @@ public class NPCCommand {
com.tiedup.remake.entities.AbstractTiedUpNpc npcEntity com.tiedup.remake.entities.AbstractTiedUpNpc npcEntity
) { ) {
npcEntity.applyBondage( npcEntity.applyBondage(
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")), DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes")),
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "cloth_gag")), DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag")),
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_blindfold")), DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold")),
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_earplugs")), DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_earplugs")),
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_collar")), DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar")),
ItemStack.EMPTY // No clothes ItemStack.EMPTY // No clothes
); );
} }

View File

@@ -128,7 +128,7 @@ public class AccessoryCommands {
return 0; return 0;
} }
ItemStack earplugs = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_earplugs")); ItemStack earplugs = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_earplugs"));
state.putEarplugsOn(earplugs); state.putEarplugsOn(earplugs);
CommandHelper.syncPlayerState(targetPlayer, state); CommandHelper.syncPlayerState(targetPlayer, state);
@@ -298,25 +298,25 @@ public class AccessoryCommands {
int applied = 0; int applied = 0;
if (!state.isTiedUp()) { if (!state.isTiedUp()) {
ItemStack ropes = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")); ItemStack ropes = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"));
state.putBindOn(ropes); state.putBindOn(ropes);
applied++; applied++;
} }
if (!state.isGagged()) { if (!state.isGagged()) {
ItemStack gag = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "cloth_gag")); ItemStack gag = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag"));
state.putGagOn(gag); state.putGagOn(gag);
applied++; applied++;
} }
if (!state.isBlindfolded()) { if (!state.isBlindfolded()) {
ItemStack blindfold = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_blindfold")); ItemStack blindfold = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold"));
state.putBlindfoldOn(blindfold); state.putBlindfoldOn(blindfold);
applied++; applied++;
} }
if (!state.hasCollar()) { if (!state.hasCollar()) {
ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(new net.minecraft.resources.ResourceLocation("tiedup", "classic_collar")); ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar"));
if ( if (
context.getSource().getEntity() instanceof ServerPlayer executor context.getSource().getEntity() instanceof ServerPlayer executor
) { ) {
@@ -327,7 +327,7 @@ public class AccessoryCommands {
} }
if (!state.hasEarplugs()) { if (!state.hasEarplugs()) {
ItemStack earplugs = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_earplugs")); ItemStack earplugs = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_earplugs"));
state.putEarplugsOn(earplugs); state.putEarplugsOn(earplugs);
applied++; applied++;
} }

View File

@@ -68,7 +68,7 @@ public class BindCommands {
return 0; return 0;
} }
ItemStack ropes = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")); ItemStack ropes = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"));
state.putBindOn(ropes); state.putBindOn(ropes);
CommandHelper.syncPlayerState(targetPlayer, state); CommandHelper.syncPlayerState(targetPlayer, state);

View File

@@ -68,7 +68,7 @@ public class BlindfoldCommands {
return 0; return 0;
} }
ItemStack blindfold = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_blindfold")); ItemStack blindfold = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold"));
state.putBlindfoldOn(blindfold); state.putBlindfoldOn(blindfold);
CommandHelper.syncPlayerState(targetPlayer, state); CommandHelper.syncPlayerState(targetPlayer, state);

View File

@@ -93,7 +93,7 @@ public class CollarCommands {
return 0; return 0;
} }
ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(new net.minecraft.resources.ResourceLocation("tiedup", "classic_collar")); ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar"));
if (context.getSource().getEntity() instanceof ServerPlayer executor) { if (context.getSource().getEntity() instanceof ServerPlayer executor) {
CollarHelper.addOwner(collar, executor); CollarHelper.addOwner(collar, executor);
@@ -182,19 +182,19 @@ public class CollarCommands {
// First fully restrain // First fully restrain
if (!state.isTiedUp()) { if (!state.isTiedUp()) {
ItemStack ropes = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")); ItemStack ropes = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"));
state.putBindOn(ropes); state.putBindOn(ropes);
} }
if (!state.isGagged()) { if (!state.isGagged()) {
ItemStack gag = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "cloth_gag")); ItemStack gag = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag"));
state.putGagOn(gag); state.putGagOn(gag);
} }
if (!state.isBlindfolded()) { if (!state.isBlindfolded()) {
ItemStack blindfold = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_blindfold")); ItemStack blindfold = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold"));
state.putBlindfoldOn(blindfold); state.putBlindfoldOn(blindfold);
} }
if (!state.hasCollar()) { if (!state.hasCollar()) {
ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(new net.minecraft.resources.ResourceLocation("tiedup", "classic_collar")); ItemStack collar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "classic_collar"));
if ( if (
context.getSource().getEntity() instanceof ServerPlayer executor context.getSource().getEntity() instanceof ServerPlayer executor
) { ) {
@@ -203,7 +203,7 @@ public class CollarCommands {
state.putCollarOn(collar); state.putCollarOn(collar);
} }
if (!state.hasEarplugs()) { if (!state.hasEarplugs()) {
ItemStack earplugs = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "classic_earplugs")); ItemStack earplugs = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "classic_earplugs"));
state.putEarplugsOn(earplugs); state.putEarplugsOn(earplugs);
} }

View File

@@ -68,7 +68,7 @@ public class GagCommands {
return 0; return 0;
} }
ItemStack gag = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "cloth_gag")); ItemStack gag = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag"));
state.putGagOn(gag); state.putGagOn(gag);
CommandHelper.syncPlayerState(targetPlayer, state); CommandHelper.syncPlayerState(targetPlayer, state);

View File

@@ -171,7 +171,7 @@ public class PetRequestManager {
// Put dogbind on player (if not already tied) // Put dogbind on player (if not already tied)
if (!state.isTiedUp()) { if (!state.isTiedUp()) {
ItemStack dogbind = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "dogbinder")); ItemStack dogbind = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "dogbinder"));
state.equip(BodyRegionV2.ARMS, dogbind); state.equip(BodyRegionV2.ARMS, dogbind);
TiedUpMod.LOGGER.debug( TiedUpMod.LOGGER.debug(
"[PetRequestManager] Equipped dogbind on {} for walk", "[PetRequestManager] Equipped dogbind on {} for walk",
@@ -226,7 +226,7 @@ public class PetRequestManager {
} }
// Master equips armbinder on pet (classic pet play restraint) // Master equips armbinder on pet (classic pet play restraint)
ItemStack bind = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "armbinder")); ItemStack bind = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "armbinder"));
state.equip(BodyRegionV2.ARMS, bind); state.equip(BodyRegionV2.ARMS, bind);
DialogueBridge.talkTo(master, pet, "petplay.tie_accept"); DialogueBridge.talkTo(master, pet, "petplay.tie_accept");

View File

@@ -143,11 +143,11 @@ public class BondageServiceHandler {
// Apply bondage // Apply bondage
state.equip( state.equip(
BodyRegionV2.ARMS, BodyRegionV2.ARMS,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"))
); );
state.equip( state.equip(
BodyRegionV2.MOUTH, BodyRegionV2.MOUTH,
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ball_gag")) DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ball_gag"))
); );
// Teleport to cell // Teleport to cell

View File

@@ -95,7 +95,7 @@ public class EntityRopeArrow extends AbstractArrow {
if (roll <= bindChance) { if (roll <= bindChance) {
// Success! Bind the target // Success! Bind the target
ItemStack ropeItem = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack ropeItem = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "ropes") net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "ropes")
); );
targetState.equip(BodyRegionV2.ARMS, ropeItem); targetState.equip(BodyRegionV2.ARMS, ropeItem);

View File

@@ -47,7 +47,7 @@ public class KidnapperCaptureEquipment {
) { ) {
return mainHand; return mainHand;
} }
return DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "ropes")); return DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"));
} }
/** /**
@@ -116,7 +116,7 @@ public class KidnapperCaptureEquipment {
public ItemStack getCollarItem() { public ItemStack getCollarItem() {
// Kidnappers always have a shock collar to mark their captives // Kidnappers always have a shock collar to mark their captives
return com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( return com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "shock_collar")); net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "shock_collar"));
} }
// HELD ITEM MANAGEMENT // HELD ITEM MANAGEMENT

View File

@@ -184,7 +184,7 @@ public class KidnapperItemSelector {
*/ */
public static ItemStack createItemById(String id, @Nullable ItemColor color) { public static ItemStack createItemById(String id, @Nullable ItemColor color) {
ItemStack stack = DataDrivenBondageItem.createStack( ItemStack stack = DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", id) ResourceLocation.fromNamespaceAndPath("tiedup", id)
); );
if (color != null) { if (color != null) {
applyColor(stack, color); applyColor(stack, color);
@@ -197,7 +197,7 @@ public class KidnapperItemSelector {
*/ */
public static ItemStack createMittens() { public static ItemStack createMittens() {
return DataDrivenBondageItem.createStack( return DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "leather_mittens") ResourceLocation.fromNamespaceAndPath("tiedup", "leather_mittens")
); );
} }
@@ -206,7 +206,7 @@ public class KidnapperItemSelector {
*/ */
public static ItemStack createEarplugs() { public static ItemStack createEarplugs() {
return DataDrivenBondageItem.createStack( return DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "classic_earplugs") ResourceLocation.fromNamespaceAndPath("tiedup", "classic_earplugs")
); );
} }

View File

@@ -162,7 +162,7 @@ public class KidnapperJobManager {
// Put a shock collar on the worker AFTER untie/free // Put a shock collar on the worker AFTER untie/free
ItemStack shockCollar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack shockCollar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "shock_collar_auto")); net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "shock_collar_auto"));
// Add kidnapper as owner so the collar is linked // Add kidnapper as owner so the collar is linked
CollarHelper.addOwner( CollarHelper.addOwner(
shockCollar, shockCollar,

View File

@@ -547,7 +547,7 @@ public class KidnapperWalkPrisonerGoal extends Goal {
); );
// 3. Change bind to DOGBINDER // 3. Change bind to DOGBINDER
ItemStack dogBinder = DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "dogbinder")); ItemStack dogBinder = DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "dogbinder"));
this.walkedPrisoner.equip(BodyRegionV2.ARMS, dogBinder); this.walkedPrisoner.equip(BodyRegionV2.ARMS, dogBinder);
TiedUpMod.LOGGER.debug( TiedUpMod.LOGGER.debug(
@@ -736,7 +736,7 @@ public class KidnapperWalkPrisonerGoal extends Goal {
if (currentBind.isEmpty() || !prisoner.isTiedUp()) { if (currentBind.isEmpty() || !prisoner.isTiedUp()) {
// They freed themselves - put dogbinder back on // They freed themselves - put dogbinder back on
ItemStack dogBinder = new ItemStack( ItemStack dogBinder = new ItemStack(
DataDrivenBondageItem.createStack(new ResourceLocation("tiedup", "dogbinder")).getItem() DataDrivenBondageItem.createStack(ResourceLocation.fromNamespaceAndPath("tiedup", "dogbinder")).getItem()
); );
prisoner.equip(BodyRegionV2.ARMS, dogBinder); prisoner.equip(BodyRegionV2.ARMS, dogBinder);
} }

View File

@@ -339,7 +339,7 @@ public class MaidReturnGoal extends Goal {
cap.equip( cap.equip(
BodyRegionV2.ARMS, BodyRegionV2.ARMS,
com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "ropes") net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "ropes")
) )
); );
} }

View File

@@ -395,7 +395,7 @@ public class MasterHumanChairGoal extends Goal {
// Apply invisible dogbind for the pose animation // Apply invisible dogbind for the pose animation
if (!bindState.isTiedUp()) { if (!bindState.isTiedUp()) {
ItemStack dogbind = DataDrivenBondageItem.createStack( ItemStack dogbind = DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "dogbinder") ResourceLocation.fromNamespaceAndPath("tiedup", "dogbinder")
); );
CompoundTag tag = dogbind.getOrCreateTag(); CompoundTag tag = dogbind.getOrCreateTag();
tag.putBoolean(NBT_HUMAN_CHAIR_BIND, true); tag.putBoolean(NBT_HUMAN_CHAIR_BIND, true);

View File

@@ -455,13 +455,13 @@ public class MasterPunishGoal extends Goal {
private ItemStack createAccessory(BodyRegionV2 region) { private ItemStack createAccessory(BodyRegionV2 region) {
return switch (region) { return switch (region) {
case EYES -> DataDrivenBondageItem.createStack( case EYES -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "classic_blindfold") ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold")
); );
case MOUTH -> DataDrivenBondageItem.createStack( case MOUTH -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "ball_gag") ResourceLocation.fromNamespaceAndPath("tiedup", "ball_gag")
); );
case HANDS -> DataDrivenBondageItem.createStack( case HANDS -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "leather_mittens") ResourceLocation.fromNamespaceAndPath("tiedup", "leather_mittens")
); );
default -> ItemStack.EMPTY; default -> ItemStack.EMPTY;
}; };
@@ -472,7 +472,7 @@ public class MasterPunishGoal extends Goal {
*/ */
private void applyTighten(ServerPlayer pet) { private void applyTighten(ServerPlayer pet) {
ItemStack armbinder = DataDrivenBondageItem.createStack( ItemStack armbinder = DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "armbinder") ResourceLocation.fromNamespaceAndPath("tiedup", "armbinder")
); );
// Mark as temporary // Mark as temporary

View File

@@ -247,13 +247,13 @@ public class MasterRandomEventGoal extends Goal {
private ItemStack createRandomAccessory(BodyRegionV2 region) { private ItemStack createRandomAccessory(BodyRegionV2 region) {
return switch (region) { return switch (region) {
case EYES -> DataDrivenBondageItem.createStack( case EYES -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "classic_blindfold") ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold")
); );
case MOUTH -> DataDrivenBondageItem.createStack( case MOUTH -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "ball_gag") ResourceLocation.fromNamespaceAndPath("tiedup", "ball_gag")
); );
case HANDS -> DataDrivenBondageItem.createStack( case HANDS -> DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "leather_mittens") ResourceLocation.fromNamespaceAndPath("tiedup", "leather_mittens")
); );
default -> ItemStack.EMPTY; default -> ItemStack.EMPTY;
}; };
@@ -304,7 +304,7 @@ public class MasterRandomEventGoal extends Goal {
PlayerBindState bindState = PlayerBindState.getInstance(pet); PlayerBindState bindState = PlayerBindState.getInstance(pet);
if (bindState != null && !bindState.isTiedUp()) { if (bindState != null && !bindState.isTiedUp()) {
ItemStack dogbind = DataDrivenBondageItem.createStack( ItemStack dogbind = DataDrivenBondageItem.createStack(
new ResourceLocation("tiedup", "dogbinder") ResourceLocation.fromNamespaceAndPath("tiedup", "dogbinder")
); );
bindState.equip(BodyRegionV2.ARMS, dogbind); bindState.equip(BodyRegionV2.ARMS, dogbind);
} }

View File

@@ -120,7 +120,7 @@ public class MasterPetManager {
// Create a choke collar for pet play // Create a choke collar for pet play
ItemStack chokeCollar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack( ItemStack chokeCollar = com.tiedup.remake.v2.bondage.datadriven.DataDrivenBondageItem.createStack(
new net.minecraft.resources.ResourceLocation("tiedup", "choke_collar") net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("tiedup", "choke_collar")
); );
// Configure for pet play BEFORE equipping // Configure for pet play BEFORE equipping

View File

@@ -74,7 +74,7 @@ public class RestraintTaskTickHandler {
if (mgr.getContinuousStruggleSession(player.getUUID()) == null) { if (mgr.getContinuousStruggleSession(player.getUUID()) == null) {
// Legacy behavior: stop after 80 ticks (no active continuous session) // Legacy behavior: stop after 80 ticks (no active continuous session)
if ( if (
playerState.shouldStopStruggling( playerState.getStruggle().shouldStopStruggling(
player.level().getGameTime() player.level().getGameTime()
) )
) { ) {
@@ -91,7 +91,7 @@ public class RestraintTaskTickHandler {
// sendProgressPackets() updates the UI for both players // sendProgressPackets() updates the UI for both players
if (playerState != null) { if (playerState != null) {
com.tiedup.remake.tasks.UntyingTask currentUntyingTask = com.tiedup.remake.tasks.UntyingTask currentUntyingTask =
playerState.getCurrentUntyingTask(); playerState.tasks().getCurrentUntyingTask();
if (currentUntyingTask != null && !currentUntyingTask.isStopped()) { if (currentUntyingTask != null && !currentUntyingTask.isStopped()) {
// AUTO-UPDATE: Check if player is still targeting the same entity // AUTO-UPDATE: Check if player is still targeting the same entity
// This allows "hold click" behavior without needing repeated interactLivingEntity calls // This allows "hold click" behavior without needing repeated interactLivingEntity calls
@@ -128,7 +128,7 @@ public class RestraintTaskTickHandler {
// Check if task stopped (completed or cancelled due to no progress) // Check if task stopped (completed or cancelled due to no progress)
if (currentUntyingTask.isStopped()) { if (currentUntyingTask.isStopped()) {
playerState.setCurrentUntyingTask(null); playerState.tasks().setCurrentUntyingTask(null);
TiedUpMod.LOGGER.debug( TiedUpMod.LOGGER.debug(
"[RESTRAINT] {} untying task ended (tick update)", "[RESTRAINT] {} untying task ended (tick update)",
player.getName().getString() player.getName().getString()
@@ -138,7 +138,7 @@ public class RestraintTaskTickHandler {
// Process tying task tick (same progress-based system) // Process tying task tick (same progress-based system)
com.tiedup.remake.tasks.TyingTask currentTyingTask = com.tiedup.remake.tasks.TyingTask currentTyingTask =
playerState.getCurrentTyingTask(); playerState.tasks().getCurrentTyingTask();
if (currentTyingTask != null && !currentTyingTask.isStopped()) { if (currentTyingTask != null && !currentTyingTask.isStopped()) {
// AUTO-UPDATE: Check if player is still targeting the same entity // AUTO-UPDATE: Check if player is still targeting the same entity
// This allows "hold click" behavior without needing repeated interactLivingEntity calls // This allows "hold click" behavior without needing repeated interactLivingEntity calls
@@ -181,7 +181,7 @@ public class RestraintTaskTickHandler {
// Check if task stopped (completed or cancelled due to no progress) // Check if task stopped (completed or cancelled due to no progress)
if (currentTyingTask.isStopped()) { if (currentTyingTask.isStopped()) {
playerState.setCurrentTyingTask(null); playerState.tasks().setCurrentTyingTask(null);
TiedUpMod.LOGGER.debug( TiedUpMod.LOGGER.debug(
"[RESTRAINT] {} tying task ended (tick update)", "[RESTRAINT] {} tying task ended (tick update)",
player.getName().getString() player.getName().getString()
@@ -190,7 +190,7 @@ public class RestraintTaskTickHandler {
} }
// Process force feeding task tick // Process force feeding task tick
TimedInteractTask feedingTask = playerState.getCurrentFeedingTask(); TimedInteractTask feedingTask = playerState.tasks().getCurrentFeedingTask();
if (feedingTask != null && !feedingTask.isStopped()) { if (feedingTask != null && !feedingTask.isStopped()) {
LivingEntity target = feedingTask.getTargetEntity(); LivingEntity target = feedingTask.getTargetEntity();
if (target != null && target.isAlive()) { if (target != null && target.isAlive()) {
@@ -214,7 +214,7 @@ public class RestraintTaskTickHandler {
feedingTask.sendProgressPackets(); feedingTask.sendProgressPackets();
if (feedingTask.isStopped()) { if (feedingTask.isStopped()) {
playerState.setCurrentFeedingTask(null); playerState.tasks().setCurrentFeedingTask(null);
TiedUpMod.LOGGER.debug( TiedUpMod.LOGGER.debug(
"[RESTRAINT] {} feeding task ended (tick update)", "[RESTRAINT] {} feeding task ended (tick update)",
player.getName().getString() player.getName().getString()
@@ -405,7 +405,7 @@ public class RestraintTaskTickHandler {
} }
// Block untying while force feeding // Block untying while force feeding
TimedInteractTask activeFeedTask = helperState.getCurrentFeedingTask(); TimedInteractTask activeFeedTask = helperState.tasks().getCurrentFeedingTask();
if (activeFeedTask != null && !activeFeedTask.isStopped()) { if (activeFeedTask != null && !activeFeedTask.isStopped()) {
return; return;
} }
@@ -435,7 +435,7 @@ public class RestraintTaskTickHandler {
} }
// Get current untying task (if any) // Get current untying task (if any)
UntyingTask currentTask = helperState.getCurrentUntyingTask(); UntyingTask currentTask = helperState.tasks().getCurrentUntyingTask();
// Check if we should start a new task or continue existing one // Check if we should start a new task or continue existing one
if ( if (
@@ -453,7 +453,7 @@ public class RestraintTaskTickHandler {
); );
// Start new task // Start new task
helperState.setCurrentUntyingTask(newTask); helperState.tasks().setCurrentUntyingTask(newTask);
newTask.setUpTargetState(); // Initialize target's restraint state newTask.setUpTargetState(); // Initialize target's restraint state
newTask.start(); newTask.start();
currentTask = newTask; currentTask = newTask;
@@ -581,13 +581,13 @@ public class RestraintTaskTickHandler {
} }
// Block feeding while untying // Block feeding while untying
UntyingTask activeUntieTask = feederBindState.getCurrentUntyingTask(); UntyingTask activeUntieTask = feederBindState.tasks().getCurrentUntyingTask();
if (activeUntieTask != null && !activeUntieTask.isStopped()) { if (activeUntieTask != null && !activeUntieTask.isStopped()) {
return; return;
} }
// Get current feeding task (if any) // Get current feeding task (if any)
TimedInteractTask currentTask = feederBindState.getCurrentFeedingTask(); TimedInteractTask currentTask = feederBindState.tasks().getCurrentFeedingTask();
if ( if (
currentTask == null || currentTask == null ||
@@ -605,7 +605,7 @@ public class RestraintTaskTickHandler {
feeder.getInventory().selected feeder.getInventory().selected
); );
feederBindState.setCurrentFeedingTask(newTask); feederBindState.tasks().setCurrentFeedingTask(newTask);
newTask.setUpTargetState(); newTask.setUpTargetState();
newTask.start(); newTask.start();
currentTask = newTask; currentTask = newTask;

View File

@@ -319,7 +319,7 @@ public class GenericKnife extends Item implements IKnife {
// Check if escaped // Check if escaped
if (newRes <= 0) { if (newRes <= 0) {
state.getStruggleBinds().successActionExternal(state); state.getStruggle().getStruggleBinds().successActionExternal(state);
player.stopUsingItem(); player.stopUsingItem();
TiedUpMod.LOGGER.info( TiedUpMod.LOGGER.info(
"[GenericKnife] {} escaped by cutting bind!", "[GenericKnife] {} escaped by cutting bind!",

View File

@@ -286,10 +286,18 @@ public class NetworkEventHandler {
return; return;
} }
// Resolve the dimension // Resolve the dimension (guard against corrupted NBT)
ResourceLocation dimLoc;
try {
dimLoc = ResourceLocation.parse(dimStr);
} catch (net.minecraft.ResourceLocationException e) {
TiedUpMod.LOGGER.warn("Invalid dimension in furniture reconnect NBT: '{}', clearing", dimStr);
persistentData.remove("tiedup_locked_furniture");
return;
}
ResourceKey<Level> dimKey = ResourceKey.create( ResourceKey<Level> dimKey = ResourceKey.create(
net.minecraft.core.registries.Registries.DIMENSION, net.minecraft.core.registries.Registries.DIMENSION,
new ResourceLocation(dimStr) dimLoc
); );
var server = player.getServer(); var server = player.getServer();

View File

@@ -37,11 +37,11 @@ public class PacketForceFeeding extends AbstractProgressPacketWithRole {
@Override @Override
protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() { protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() {
return PlayerBindState::getClientFeedingTask; return state -> state.tasks().getClientFeedingTask();
} }
@Override @Override
protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() { protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() {
return PlayerBindState::setClientFeedingTask; return (state, task) -> state.tasks().setClientFeedingTask(task);
} }
} }

View File

@@ -93,6 +93,6 @@ public class PacketStruggle {
} }
// Call struggle // Call struggle
state.struggle(); state.getStruggle().struggle();
} }
} }

View File

@@ -48,11 +48,11 @@ public class PacketTying extends AbstractProgressPacketWithRole {
@Override @Override
protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() { protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() {
return PlayerBindState::getClientTyingTask; return state -> state.tasks().getClientTyingTask();
} }
@Override @Override
protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() { protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() {
return PlayerBindState::setClientTyingTask; return (state, task) -> state.tasks().setClientTyingTask(task);
} }
} }

View File

@@ -48,11 +48,11 @@ public class PacketUntying extends AbstractProgressPacketWithRole {
@Override @Override
protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() { protected Function<PlayerBindState, PlayerStateTask> getTaskGetter() {
return PlayerBindState::getClientUntyingTask; return state -> state.tasks().getClientUntyingTask();
} }
@Override @Override
protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() { protected BiConsumer<PlayerBindState, PlayerStateTask> getTaskSetter() {
return PlayerBindState::setClientUntyingTask; return (state, task) -> state.tasks().setClientUntyingTask(task);
} }
} }

View File

@@ -149,25 +149,25 @@ public class PacketSelfBondage {
stack.copy(), stack, state, player, tyingSeconds, player.level(), player stack.copy(), stack, state, player, tyingSeconds, player.level(), player
); );
TyingTask currentTask = playerState.getCurrentTyingTask(); TyingTask currentTask = playerState.tasks().getCurrentTyingTask();
if (currentTask == null if (currentTask == null
|| !currentTask.isSameTarget(player) || !currentTask.isSameTarget(player)
|| currentTask.isOutdated() || currentTask.isOutdated()
|| !ItemStack.matches(currentTask.getBind(), stack)) { || !ItemStack.matches(currentTask.getBind(), stack)) {
playerState.setCurrentTyingTask(newTask); playerState.tasks().setCurrentTyingTask(newTask);
newTask.start(); newTask.start();
} else { } else {
currentTask.update(); currentTask.update();
} }
if (playerState.getCurrentTyingTask() == newTask) { if (playerState.tasks().getCurrentTyingTask() == newTask) {
newTask.update(); newTask.update();
} }
// Clear completed task to prevent blocking future tying interactions // Clear completed task to prevent blocking future tying interactions
TyingTask activeTask = playerState.getCurrentTyingTask(); TyingTask activeTask = playerState.tasks().getCurrentTyingTask();
if (activeTask != null && activeTask.isStopped()) { if (activeTask != null && activeTask.isStopped()) {
playerState.setCurrentTyingTask(null); playerState.tasks().setCurrentTyingTask(null);
} }
} }

View File

@@ -1,10 +1,8 @@
package com.tiedup.remake.state; package com.tiedup.remake.state;
import com.tiedup.remake.core.ModSounds;
import com.tiedup.remake.core.TiedUpMod; import com.tiedup.remake.core.TiedUpMod;
import com.tiedup.remake.entities.LeashProxyEntity; import com.tiedup.remake.entities.LeashProxyEntity;
import com.tiedup.remake.items.base.ILockable; import com.tiedup.remake.items.base.ILockable;
import com.tiedup.remake.v2.bondage.CollarHelper;
import com.tiedup.remake.network.sync.SyncManager; import com.tiedup.remake.network.sync.SyncManager;
import com.tiedup.remake.state.components.PlayerCaptivity; import com.tiedup.remake.state.components.PlayerCaptivity;
import com.tiedup.remake.state.components.PlayerClothesPermission; import com.tiedup.remake.state.components.PlayerClothesPermission;
@@ -19,16 +17,10 @@ import com.tiedup.remake.state.components.PlayerStateQuery;
import com.tiedup.remake.state.components.PlayerStruggle; import com.tiedup.remake.state.components.PlayerStruggle;
import com.tiedup.remake.state.components.PlayerTaskManagement; import com.tiedup.remake.state.components.PlayerTaskManagement;
import com.tiedup.remake.state.hosts.IPlayerBindStateHost; import com.tiedup.remake.state.hosts.IPlayerBindStateHost;
import com.tiedup.remake.state.struggle.StruggleBinds;
import com.tiedup.remake.tasks.PlayerStateTask;
import com.tiedup.remake.tasks.TimedInteractTask;
import com.tiedup.remake.tasks.TyingTask;
import com.tiedup.remake.tasks.UntyingTask;
import com.tiedup.remake.util.RestraintEffectUtils; import com.tiedup.remake.util.RestraintEffectUtils;
import com.tiedup.remake.util.teleport.Position; import com.tiedup.remake.util.teleport.Position;
import com.tiedup.remake.v2.BodyRegionV2; import com.tiedup.remake.v2.BodyRegionV2;
import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper; import com.tiedup.remake.v2.bondage.capability.V2EquipmentHelper;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@@ -156,6 +148,16 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
return movement; return movement;
} }
/** Access task management component (tying, untying, feeding tasks). */
public PlayerTaskManagement tasks() {
return taskManagement;
}
/** Access struggle component (struggle, tighten, cooldowns). */
public PlayerStruggle getStruggle() {
return struggle;
}
/** /**
* Resets all movement style state to defaults. * Resets all movement style state to defaults.
* Called on death, logout, and dimension change to ensure clean re-activation. * Called on death, logout, and dimension change to ensure clean re-activation.
@@ -385,112 +387,15 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
// Note: getCaptor(), getCaptorManager(), setStruggling(), setStrugglingClient(), // Note: getCaptor(), getCaptorManager(), setStruggling(), setStrugglingClient(),
// isStruggling(), getStruggleStartTick() are implemented elsewhere in the class // isStruggling(), getStruggleStartTick() are implemented elsewhere in the class
// ========== Tying/Untying Task Methods ==========
// Delegated to PlayerTaskManagement component
public TyingTask getCurrentTyingTask() {
return taskManagement.getCurrentTyingTask();
}
public void setCurrentTyingTask(TyingTask task) {
taskManagement.setCurrentTyingTask(task);
}
public UntyingTask getCurrentUntyingTask() {
return taskManagement.getCurrentUntyingTask();
}
public void setCurrentUntyingTask(UntyingTask task) {
taskManagement.setCurrentUntyingTask(task);
}
public PlayerStateTask getClientTyingTask() {
return taskManagement.getClientTyingTask();
}
public void setClientTyingTask(PlayerStateTask task) {
taskManagement.setClientTyingTask(task);
}
public PlayerStateTask getClientUntyingTask() {
return taskManagement.getClientUntyingTask();
}
public void setClientUntyingTask(PlayerStateTask task) {
taskManagement.setClientUntyingTask(task);
}
public TimedInteractTask getCurrentFeedingTask() {
return taskManagement.getCurrentFeedingTask();
}
public void setCurrentFeedingTask(TimedInteractTask task) {
taskManagement.setCurrentFeedingTask(task);
}
public PlayerStateTask getClientFeedingTask() {
return taskManagement.getClientFeedingTask();
}
public void setClientFeedingTask(PlayerStateTask task) {
taskManagement.setClientFeedingTask(task);
}
public PlayerStateTask getRestrainedState() {
return taskManagement.getRestrainedState();
}
public void setRestrainedState(PlayerStateTask state) {
taskManagement.setRestrainedState(state);
}
// ========== Struggle & Resistance Methods ========== // ========== Struggle & Resistance Methods ==========
// Delegated to PlayerStruggle component // Non-delegation methods only — delegation removed, use getStruggle() accessor.
// tighten(Player) is interface-mandated by ICoercible — cannot be removed.
/**
* Entry point for the Struggle logic (Key R).
* Distributes effort between Binds and Collar.
*/
public void struggle() {
struggle.struggle();
}
/** Restores resistance to base values when a master tightens the ties. */ /** Restores resistance to base values when a master tightens the ties. */
public void tighten(Player tightener) { public void tighten(Player tightener) {
struggle.tighten(tightener); struggle.tighten(tightener);
} }
/**
* Get the StruggleBinds instance for external access (mini-game system).
*/
public StruggleBinds getStruggleBinds() {
return struggle.getStruggleBinds();
}
/**
* Set a cooldown on struggle attempts (used after mini-game exhaustion).
* @param seconds Cooldown duration in seconds
*/
public void setStruggleCooldown(int seconds) {
struggle.setStruggleCooldown(seconds);
}
/**
* v2.5: Check if struggle cooldown is active.
* @return true if cooldown is active (cannot struggle yet)
*/
public boolean isStruggleCooldownActive() {
return struggle.isStruggleCooldownActive();
}
/**
* v2.5: Get remaining struggle cooldown in seconds.
* @return Remaining seconds, or 0 if no cooldown
*/
public int getStruggleCooldownRemaining() {
return struggle.getStruggleCooldownRemaining();
}
// ========== v2.5: Knife Cut Target Methods ========== // ========== v2.5: Knife Cut Target Methods ==========
// Delegated to PlayerSpecialActions component // Delegated to PlayerSpecialActions component
@@ -560,16 +465,6 @@ public class PlayerBindState implements IRestrainable, IPlayerBindStateHost {
this.struggleState = new StruggleSnapshot(struggling, current.startTick()); this.struggleState = new StruggleSnapshot(struggling, current.startTick());
} }
/**
* Check if struggle animation should stop (duration expired).
* Delegated to PlayerStruggle component.
* @param currentTick Current game time tick
* @return True if animation has been playing for >= 80 ticks
*/
public boolean shouldStopStruggling(long currentTick) {
return struggle.shouldStopStruggling(currentTick);
}
/** /**
* Delegated to PlayerEquipment component * Delegated to PlayerEquipment component
*/ */

View File

@@ -297,7 +297,7 @@ public class TyingPlayerTask extends TyingTask {
serverPlayer serverPlayer
); );
if (playerState != null) { if (playerState != null) {
playerState.setRestrainedState(null); playerState.tasks().setRestrainedState(null);
} }
} }
} else { } else {
@@ -314,7 +314,7 @@ public class TyingPlayerTask extends TyingTask {
serverTarget serverTarget
); );
if (playerState != null) { if (playerState != null) {
playerState.setRestrainedState(null); playerState.tasks().setRestrainedState(null);
} }
} }

View File

@@ -210,7 +210,7 @@ public class UntyingPlayerTask extends UntyingTask {
serverTarget serverTarget
); );
if (playerState != null) { if (playerState != null) {
playerState.setRestrainedState(null); playerState.tasks().setRestrainedState(null);
} }
} }

View File

@@ -97,14 +97,14 @@ public final class TyingInteractionHelper {
player player
); );
TyingTask currentTask = playerState.getCurrentTyingTask(); TyingTask currentTask = playerState.tasks().getCurrentTyingTask();
if (currentTask == null if (currentTask == null
|| !(currentTask instanceof V2TyingPlayerTask) || !(currentTask instanceof V2TyingPlayerTask)
|| !currentTask.isSameTarget(target) || !currentTask.isSameTarget(target)
|| currentTask.isOutdated() || currentTask.isOutdated()
|| !ItemStack.matches(currentTask.getBind(), stack)) { || !ItemStack.matches(currentTask.getBind(), stack)) {
// Start new task (also handles case where existing task is V1 TyingPlayerTask) // Start new task (also handles case where existing task is V1 TyingPlayerTask)
playerState.setCurrentTyingTask(newTask); playerState.tasks().setCurrentTyingTask(newTask);
newTask.start(); newTask.start();
} else { } else {
newTask = (V2TyingPlayerTask) currentTask; newTask = (V2TyingPlayerTask) currentTask;
@@ -114,7 +114,7 @@ public final class TyingInteractionHelper {
if (newTask.isStopped()) { if (newTask.isStopped()) {
// Item already consumed by V2TyingPlayerTask.onComplete() — don't shrink again // Item already consumed by V2TyingPlayerTask.onComplete() — don't shrink again
playerState.setCurrentTyingTask(null); playerState.tasks().setCurrentTyingTask(null);
TiedUpMod.LOGGER.info("[TyingInteraction] {} tied {}", player.getName().getString(), target.getName().getString()); TiedUpMod.LOGGER.info("[TyingInteraction] {} tied {}", player.getName().getString(), target.getName().getString());
} }

View File

@@ -307,7 +307,7 @@ public class V2BondageEquipment implements IV2BondageEquipment {
savedPolePosition = BlockPos.of(tag.getLong("pole_position")); savedPolePosition = BlockPos.of(tag.getLong("pole_position"));
savedPoleDimension = ResourceKey.create( savedPoleDimension = ResourceKey.create(
Registries.DIMENSION, Registries.DIMENSION,
new ResourceLocation(tag.getString("pole_dimension")) ResourceLocation.parse(tag.getString("pole_dimension"))
); );
} catch (net.minecraft.ResourceLocationException e) { } catch (net.minecraft.ResourceLocationException e) {
com.tiedup.remake.core.TiedUpMod.LOGGER.warn( com.tiedup.remake.core.TiedUpMod.LOGGER.warn(

View File

@@ -329,7 +329,7 @@ public final class DataDrivenItemParser {
if (idPath.endsWith(".json")) { if (idPath.endsWith(".json")) {
idPath = idPath.substring(0, idPath.length() - 5); idPath = idPath.substring(0, idPath.length() - 5);
} }
ResourceLocation id = new ResourceLocation( ResourceLocation id = ResourceLocation.fromNamespaceAndPath(
fileId.getNamespace(), fileId.getNamespace(),
idPath idPath
); );

View File

@@ -19,7 +19,7 @@ public class V2Handcuffs extends AbstractV2BondageItem {
private static final Set<BodyRegionV2> REGIONS = private static final Set<BodyRegionV2> REGIONS =
Collections.unmodifiableSet(EnumSet.of(BodyRegionV2.ARMS)); Collections.unmodifiableSet(EnumSet.of(BodyRegionV2.ARMS));
private static final ResourceLocation MODEL = new ResourceLocation( private static final ResourceLocation MODEL = ResourceLocation.fromNamespaceAndPath(
TiedUpMod.MOD_ID, TiedUpMod.MOD_ID,
"models/gltf/v2/handcuffs/cuffs_prototype.glb" "models/gltf/v2/handcuffs/cuffs_prototype.glb"
); );

View File

@@ -184,7 +184,7 @@ public class DataDrivenIconOverrides extends ItemOverrides {
if (path.startsWith("item/")) { if (path.startsWith("item/")) {
String itemPath = path.substring("item/".length()); String itemPath = path.substring("item/".length());
ModelResourceLocation mrl = new ModelResourceLocation( ModelResourceLocation mrl = new ModelResourceLocation(
new ResourceLocation(iconRL.getNamespace(), itemPath), ResourceLocation.fromNamespaceAndPath(iconRL.getNamespace(), itemPath),
"inventory" "inventory"
); );
model = mc.getModelManager().getModel(mrl); model = mc.getModelManager().getModel(mrl);

View File

@@ -126,7 +126,7 @@ public class V2ClientSetup {
DataDrivenIconOverrides.Mode mode DataDrivenIconOverrides.Mode mode
) { ) {
ModelResourceLocation itemModelLoc = new ModelResourceLocation( ModelResourceLocation itemModelLoc = new ModelResourceLocation(
new ResourceLocation(TiedUpMod.MOD_ID, itemName), ResourceLocation.fromNamespaceAndPath(TiedUpMod.MOD_ID, itemName),
"inventory" "inventory"
); );

View File

@@ -521,16 +521,16 @@ public class HangingCagePiece extends StructurePiece {
// Fallback item IDs for worldgen when DataDrivenItemRegistry is empty (race with reload) // Fallback item IDs for worldgen when DataDrivenItemRegistry is empty (race with reload)
private static final ResourceLocation[] FALLBACK_BINDS = { private static final ResourceLocation[] FALLBACK_BINDS = {
new ResourceLocation("tiedup", "ropes"), ResourceLocation.fromNamespaceAndPath("tiedup", "ropes"),
new ResourceLocation("tiedup", "chain"), ResourceLocation.fromNamespaceAndPath("tiedup", "chain"),
new ResourceLocation("tiedup", "armbinder") ResourceLocation.fromNamespaceAndPath("tiedup", "armbinder")
}; };
private static final ResourceLocation[] FALLBACK_GAGS = { private static final ResourceLocation[] FALLBACK_GAGS = {
new ResourceLocation("tiedup", "cloth_gag"), ResourceLocation.fromNamespaceAndPath("tiedup", "cloth_gag"),
new ResourceLocation("tiedup", "ball_gag") ResourceLocation.fromNamespaceAndPath("tiedup", "ball_gag")
}; };
private static final ResourceLocation[] FALLBACK_BLINDFOLDS = { private static final ResourceLocation[] FALLBACK_BLINDFOLDS = {
new ResourceLocation("tiedup", "classic_blindfold") ResourceLocation.fromNamespaceAndPath("tiedup", "classic_blindfold")
}; };
private static ItemStack randomItemForRegion(RandomSource random, BodyRegionV2 region, ResourceLocation[] fallbacks) { private static ItemStack randomItemForRegion(RandomSource random, BodyRegionV2 region, ResourceLocation[] fallbacks) {

View File

@@ -125,7 +125,7 @@ public final class RoomThemeRegistry {
Map.of("default", List.of(new BlockPalette.WeightedEntry(stone, 1.0f))) Map.of("default", List.of(new BlockPalette.WeightedEntry(stone, 1.0f)))
); );
return new RoomThemeDefinition( return new RoomThemeDefinition(
new ResourceLocation("tiedup", "fallback"), ResourceLocation.fromNamespaceAndPath("tiedup", "fallback"),
1, 1,
single, // wall single, // wall
single, // floor single, // floor

View File

@@ -65,7 +65,7 @@ public class RoomThemeReloadListener
if (cleanPath.endsWith(".json")) { if (cleanPath.endsWith(".json")) {
cleanPath = cleanPath.substring(0, cleanPath.length() - 5); cleanPath = cleanPath.substring(0, cleanPath.length() - 5);
} }
ResourceLocation cleanId = new ResourceLocation(fileId.getNamespace(), cleanPath); ResourceLocation cleanId = ResourceLocation.fromNamespaceAndPath(fileId.getNamespace(), cleanPath);
try (InputStream input = resource.open()) { try (InputStream input = resource.open()) {
RoomThemeDefinition def = RoomThemeParser.parse(input, cleanId); RoomThemeDefinition def = RoomThemeParser.parse(input, cleanId);

View File

@@ -1,5 +1,5 @@
{ {
"weight": 10, "weight": 7,
"wall_palette": { "wall_palette": {
"default": [ "default": [
{ "block": "minecraft:ice", "weight": 0.10 }, { "block": "minecraft:ice", "weight": 0.10 },

View File

@@ -1,5 +1,5 @@
{ {
"weight": 10, "weight": 7,
"wall_palette": { "wall_palette": {
"default": [ "default": [
{ "block": "minecraft:cracked_nether_bricks", "weight": 0.20 }, { "block": "minecraft:cracked_nether_bricks", "weight": 0.20 },

View File

@@ -1,5 +1,5 @@
{ {
"weight": 10, "weight": 4,
"wall_palette": { "wall_palette": {
"default": [ "default": [
{ "block": "minecraft:cracked_deepslate_bricks", "weight": 0.10 }, { "block": "minecraft:cracked_deepslate_bricks", "weight": 0.10 },