mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
Fix #725 Allow multifarm to break any type of soil again
This commit is contained in:
1 parent
fb966143f9
commit
66da45f5bf
4 files changed
+3
-26
No files matched your search
@@ -62,7 +62,7 @@ public class FarmTarget {
|
||||
for (extent = 0; extent < limit; extent++) {
|
||||
Block platform = VectUtil.getBlock(world, position);
|
||||
Vect soilPosition = new Vect(position.x, position.y + 1, position.z);
|
||||
if (!StructureLogicFarm.bricks.contains(platform) || !FarmLogic.canBreakSoil(world, soilPosition)) {
|
||||
if (!StructureLogicFarm.bricks.contains(platform)) {
|
||||
break;
|
||||
}
|
||||
position.add(getDirection());
|
||||
|
||||
@@ -256,7 +256,7 @@ public class TileFarmPlain extends TileFarm implements IFarmHousing, ISocketable
|
||||
|
||||
Block platform = VectUtil.getBlock(world, groundLocation);
|
||||
Vect soilPosition = new Vect(groundLocation.x, groundLocation.y + 1, groundLocation.z);
|
||||
if (!StructureLogicFarm.bricks.contains(platform) || !FarmLogic.canBreakSoil(world, soilPosition)) {
|
||||
if (!StructureLogicFarm.bricks.contains(platform)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.farming.logic;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -23,10 +21,8 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmLogic;
|
||||
import forestry.core.config.Defaults;
|
||||
import forestry.core.config.ForestryBlock;
|
||||
import forestry.core.render.SpriteSheet;
|
||||
import forestry.core.vect.Vect;
|
||||
import forestry.core.vect.VectUtil;
|
||||
|
||||
public abstract class FarmLogic implements IFarmLogic {
|
||||
|
||||
@@ -34,20 +30,6 @@ public abstract class FarmLogic implements IFarmLogic {
|
||||
|
||||
protected boolean isManual;
|
||||
|
||||
private static final ImmutableSet<Block> breakableSoil = ImmutableSet.of(
|
||||
Blocks.air,
|
||||
Blocks.dirt,
|
||||
Blocks.grass,
|
||||
Blocks.sand,
|
||||
Blocks.farmland,
|
||||
Blocks.mycelium,
|
||||
Blocks.soul_sand,
|
||||
Blocks.water,
|
||||
Blocks.flowing_water,
|
||||
Blocks.end_stone,
|
||||
ForestryBlock.soil.block()
|
||||
);
|
||||
|
||||
public FarmLogic(IFarmHousing housing) {
|
||||
this.housing = housing;
|
||||
}
|
||||
@@ -57,11 +39,6 @@ public abstract class FarmLogic implements IFarmLogic {
|
||||
return this;
|
||||
}
|
||||
|
||||
public static boolean canBreakSoil(World world, Vect position) {
|
||||
Block block = VectUtil.getBlock(world, position);
|
||||
return breakableSoil.contains(block) || block.isReplaceable(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
|
||||
protected World getWorld() {
|
||||
return housing.getWorld();
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public abstract class FarmLogicHomogeneous extends FarmLogic {
|
||||
}
|
||||
|
||||
ItemStack soilStack = VectUtil.getAsItemStack(world, position);
|
||||
if (isAcceptedSoil(soilStack) || !canBreakSoil(world, position)) {
|
||||
if (isAcceptedSoil(soilStack)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user