gthub pls

This commit is contained in:
Shadows_of_Fire 2019-02-06 15:32:03 -05:00
parent 289c1de017
commit 1ef95a76c9

View file

@ -20,8 +20,10 @@ import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
import de.ellpeck.actuallyadditions.api.internal.IFarmer; import de.ellpeck.actuallyadditions.api.internal.IFarmer;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IRemover;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues;
import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@ -80,21 +82,22 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer
this.waitTime--; this.waitTime--;
if (this.waitTime <= 0) { if (this.waitTime <= 0) {
int radiusAroundCenter = 4; int area = ConfigIntValues.FARMER_AREA.getValue();
if (area % 2 == 0) area++;
int radius = area / 2;
IBlockState state = this.world.getBlockState(this.pos); IBlockState state = this.world.getBlockState(this.pos);
int meta = state.getBlock().getMetaFromState(state); BlockPos center = this.pos.offset(state.getValue(BlockHorizontal.FACING), radius + 1);
BlockPos center = this.pos.offset(EnumFacing.byHorizontalIndex(meta), radiusAroundCenter + 1);
BlockPos query = center.add(this.checkX, 0, this.checkY); BlockPos query = center.add(this.checkX, 0, this.checkY);
this.checkBehaviors(query); this.checkBehaviors(query);
this.checkX++; this.checkX++;
if (this.checkX > radiusAroundCenter) { if (this.checkX > radius) {
this.checkX = -radiusAroundCenter; this.checkX = -radius;
this.checkY++; this.checkY++;
if (this.checkY > radiusAroundCenter) { if (this.checkY > radius) {
this.checkY = -radiusAroundCenter; this.checkY = -radius;
} }
} }
} }