Skip to content
Permalink
Browse files

Fix #2367 Farm Directions are off by one

  • Loading branch information
Nedelosk committed Sep 29, 2019
1 parent f761221 commit f6b6d46658ae8f185785b0f25cbad017e84c160a
@@ -23,6 +23,7 @@
import forestry.core.utils.InventoryUtil;
import forestry.core.utils.SlotUtil;
import forestry.cultivation.tiles.TilePlanter;
import forestry.farming.FarmHelper;
import forestry.farming.multiblock.IFarmInventoryInternal;

public class InventoryPlanter extends InventoryAdapterRestricted implements IFarmInventoryInternal {
@@ -154,7 +155,7 @@ public boolean plantGermling(IFarmable germling, EntityPlayer player, BlockPos p
}

public boolean plantGermling(IFarmable germling, EntityPlayer player, BlockPos pos, FarmDirection direction) {
int index = direction.ordinal();
int index = FarmHelper.getReversedLayoutDirection(direction).ordinal();
ItemStack germlingStack = germlingsInventory.getStackInSlot(index);
if (germlingStack.isEmpty() || !germling.isGermling(germlingStack)) {
return false;
@@ -68,6 +68,20 @@ private static FarmDirection getLayoutDirection(FarmDirection farmSide) {
return null;
}

public static FarmDirection getReversedLayoutDirection(FarmDirection farmSide) {
switch (farmSide) {
case NORTH:
return FarmDirection.EAST;
case WEST:
return FarmDirection.NORTH;
case SOUTH:
return FarmDirection.WEST;
case EAST:
return FarmDirection.SOUTH;
}
return null;
}

public static final ImmutableSet<Block> bricks = ImmutableSet.of(
Blocks.BRICK_BLOCK,
Blocks.STONEBRICK,

0 comments on commit f6b6d46

Please sign in to comment.
You can’t perform that action at this time.