you are no longer being poisoned by a toxic cloud

This commit is contained in:
Leijurv
2018-10-30 15:31:00 -07:00
parent 3d03f15749
commit 473f872d2f
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -22,13 +22,11 @@ import java.util.List;
public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProvider { public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProvider {
final CraftingTask parent; final CraftingTask parent;
final QuantizedToQuantizedTaskRelationship parentRelationship;
public AquireCraftingItems(CraftingTask parent) { public AquireCraftingItems(CraftingTask parent) {
super(DependencyType.PARALLEL_ALL); super(DependencyType.PARALLEL_ALL);
this.parent = parent; this.parent = parent;
this.parentRelationship = createRelationshipToParent(parent); addParent(parent);
addParent(parentRelationship);
} }
@Override @Override
@@ -45,7 +43,7 @@ public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProv
@Override @Override
public IQuantityRelationship priority() { public IQuantityRelationship priority() {
return parentRelationship::allocatedPriority; // gamer style return parentTasks().get(0)::allocatedPriority;
} }
@Override @Override
@@ -72,7 +70,7 @@ public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProv
@Override @Override
public int quantityCompletedForParent(IQuantizedChildTaskRelationship relationship) { public int quantityCompletedForParent(IQuantizedChildTaskRelationship relationship) {
if (relationship != parentRelationship) { if (relationship != parentTasks().get(0)) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
// our only parent is the crafting task // our only parent is the crafting task
+1 -1
View File
@@ -35,7 +35,7 @@ public class AquireItemTask extends QuantizedTaskNode implements IClaimProvider,
} }
public void reallocate() { public void reallocate() {
List<IQuantizedChildTaskRelationship> parents = (List<IQuantizedChildTaskRelationship>) (Object) parentTasks(); List<IQuantizedChildTaskRelationship> parents = parentTasks();
allocation.clear(); allocation.clear();
int amountToAllocate = getCurrentQuantityInInventory(); int amountToAllocate = getCurrentQuantityInInventory();