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
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 4 additions and 6 deletions

View File

@ -22,13 +22,11 @@ import java.util.List;
public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProvider {
final CraftingTask parent;
final QuantizedToQuantizedTaskRelationship parentRelationship;
public AquireCraftingItems(CraftingTask parent) {
super(DependencyType.PARALLEL_ALL);
this.parent = parent;
this.parentRelationship = createRelationshipToParent(parent);
addParent(parentRelationship);
addParent(parent);
}
@Override
@ -45,7 +43,7 @@ public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProv
@Override
public IQuantityRelationship priority() {
return parentRelationship::allocatedPriority; // gamer style
return parentTasks().get(0)::allocatedPriority;
}
@Override
@ -72,7 +70,7 @@ public class AquireCraftingItems extends QuantizedTaskNode implements IClaimProv
@Override
public int quantityCompletedForParent(IQuantizedChildTaskRelationship relationship) {
if (relationship != parentRelationship) {
if (relationship != parentTasks().get(0)) {
throw new IllegalStateException();
}
// our only parent is the crafting task

View File

@ -35,7 +35,7 @@ public class AquireItemTask extends QuantizedTaskNode implements IClaimProvider,
}
public void reallocate() {
List<IQuantizedChildTaskRelationship> parents = (List<IQuantizedChildTaskRelationship>) (Object) parentTasks();
List<IQuantizedChildTaskRelationship> parents = parentTasks();
allocation.clear();
int amountToAllocate = getCurrentQuantityInInventory();