mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 04:52:26 +00:00
Fix planting in wrong dimension (#20)
* Update buildscript * Pass the world object directly to avoid using the wrong dimension
This commit is contained in:
1 parent
b58e4c57c7
commit
14f61b5917
3 files changed
+50
-33
No files matched your search
@@ -789,7 +789,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen
|
||||
@Override
|
||||
public boolean plantGermling(IFarmable germling, World world, int x, int y, int z) {
|
||||
EntityPlayer player = PlayerUtil.getPlayer(world, getAccessHandler().getOwner());
|
||||
return inventory.plantGermling(germling, player, x, y, z);
|
||||
return inventory.plantGermling(germling, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import forestry.api.farming.FarmDirection;
|
||||
@@ -170,14 +171,14 @@ public class InventoryFarm extends InventoryAdapterRestricted implements IFarmIn
|
||||
FluidHelper.drainContainers(tankManager, this, SLOT_CAN);
|
||||
}
|
||||
|
||||
public boolean plantGermling(IFarmable germling, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean plantGermling(IFarmable germling, EntityPlayer player, World world, int x, int y, int z) {
|
||||
for (int i = 0; i < germlingsInventory.getSizeInventory(); i++) {
|
||||
ItemStack germlingStack = germlingsInventory.getStackInSlot(i);
|
||||
if (germlingStack == null || !germling.isGermling(germlingStack)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (germling.plantSaplingAt(player, germlingStack, player.worldObj, x, y, z)) {
|
||||
if (germling.plantSaplingAt(player, germlingStack, world, x, y, z)) {
|
||||
germlingsInventory.decrStackSize(i, 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user