Small Fixes for the Farm (#3344)

Small Fixes for the Farm (actually one big one, too)
This commit is contained in:
Henry Loenwind authored and GitHub committed 2016-06-14 00:00:05 +02:00
1 parent d61fc2cfdb
commit 411e760ed1
2 files changed
+6 -7

No files matched your search

@@ -416,7 +416,6 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
}
bc = getNextCoord();
}
lastScanned = bc;
Block block = worldObj.getBlock(bc.x, bc.y, bc.z);
if(block == null) {
@@ -667,11 +666,11 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
nextX = loc.x - size;
nextZ += 1;
if(nextZ > loc.z + size) {
lastScanned = null;
return getNextCoord();
nextX = loc.x - size;
nextZ = loc.z - size;
}
}
return new BlockCoord(nextX, lastScanned.y, nextZ);
return lastScanned = new BlockCoord(nextX, lastScanned.y, nextZ);
}
public void toggleLockedState(int slot) {
@@ -18,9 +18,9 @@ public class MelonFarmer extends CustomSeedFarmer {
@Override
public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
int xVal = farm.getLocation().x % 2;
int zVal = farm.getLocation().z % 2;
if(bc.x % 2 != xVal || bc.z % 2 != zVal) {
int xVal = farm.getLocation().x & 1;
int zVal = farm.getLocation().z & 1;
if ((bc.x & 1) != xVal || (bc.z & 1) != zVal) {
//if we have melon seeds, we still want ot return true here so they are not planted by the default plantable
//handlers
return canPlant(farm.getSeedTypeInSuppliesFor(bc));