use of buildcraft.core.StackAtPosition in project BuildCraft by BuildCraft.
the class BuildingItem method initialize.
public void initialize() {
if (!initialized) {
Vec3d vec = destination.subtract(origin);
double size = vec.lengthVector();
maxLifetime = (float) size * 4;
maxHeight = size / 2;
// The below computation is a much simpler version of the long commented out code. Hopefully it works :P
velocity = Utils.multiply(vec, 1 / maxLifetime);
if (stacksToDisplay.size() == 0) {
StackAtPosition sPos = new StackAtPosition();
sPos.stack = new ItemStack(BuildCraftCore.decoratedBlock);
stacksToDisplay.add(sPos);
}
initialized = true;
}
}
use of buildcraft.core.StackAtPosition in project BuildCraft by BuildCraft.
the class BuildingItem method setStacksToDisplay.
public void setStacksToDisplay(List<ItemStack> stacks) {
if (stacks != null) {
for (ItemStack s : stacks) {
for (int i = 0; i < s.stackSize; ++i) {
StackAtPosition sPos = new StackAtPosition();
sPos.stack = s.copy();
sPos.stack.stackSize = 1;
stacksToDisplay.add(sPos);
}
}
}
}
use of buildcraft.core.StackAtPosition in project BuildCraft by BuildCraft.
the class BuildingItem method getStacks.
public LinkedList<StackAtPosition> getStacks() {
int d = 0;
for (StackAtPosition s : stacksToDisplay) {
float stackLife = lifetimeDisplay - d;
if (stackLife <= maxLifetime && stackLife > 0) {
s.pos = getDisplayPosition(stackLife);
s.display = true;
} else {
s.display = false;
}
d += ITEMS_SPACE;
}
return stacksToDisplay;
}
Aggregations