feature/d01-branch-a-bridge #6
@@ -85,9 +85,11 @@ public final class TyingInteractionHelper {
|
|||||||
|
|
||||||
TyingTask currentTask = playerState.getCurrentTyingTask();
|
TyingTask currentTask = playerState.getCurrentTyingTask();
|
||||||
if (currentTask == null
|
if (currentTask == null
|
||||||
|
|| !(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)
|
||||||
playerState.setCurrentTyingTask(newTask);
|
playerState.setCurrentTyingTask(newTask);
|
||||||
newTask.start();
|
newTask.start();
|
||||||
} else {
|
} else {
|
||||||
@@ -97,7 +99,7 @@ public final class TyingInteractionHelper {
|
|||||||
newTask.update();
|
newTask.update();
|
||||||
|
|
||||||
if (newTask.isStopped()) {
|
if (newTask.isStopped()) {
|
||||||
stack.shrink(1);
|
// Item already consumed by V2TyingPlayerTask.onComplete() — don't shrink again
|
||||||
playerState.setCurrentTyingTask(null);
|
playerState.setCurrentTyingTask(null);
|
||||||
TiedUpMod.LOGGER.info("[TyingInteraction] {} tied {}", player.getName().getString(), target.getName().getString());
|
TiedUpMod.LOGGER.info("[TyingInteraction] {} tied {}", player.getName().getString(), target.getName().getString());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user