Only get adjacent position if we use it later
Since the getter creates a new Vector on every invocation only call it
when we use the result.
@@ -201,8 +201,8 @@ private void push(Vector3i pos, byte value) {
Block block = world.getBlockAt(pos);
for (Side side : BLOCK_SIDES) {
byte spreadValue = rules.propagateValue(value, side, block);
- Vector3i adjPos = side.getAdjacentPos(pos);
if (rules.canSpreadOutOf(block, side)) {
+ Vector3i adjPos = side.getAdjacentPos(pos);
byte adjValue = world.getValueAt(adjPos);
if (adjValue < spreadValue && adjValue != PropagatorWorldView.UNAVAILABLE) {
Block adjBlock = world.getBlockAt(adjPos);
