mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 20:42:35 +00:00
First 1.8.9 Version
This commit is contained in:
1 parent
d35cc1df09
commit
5a3850c264
1657 files changed
+26844
-13269
No files matched your search
@@ -13,10 +13,13 @@ package forestry.farming.logic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
public class FarmableGenericCrop implements IFarmable {
|
||||
@@ -34,20 +37,20 @@ public class FarmableGenericCrop implements IFarmable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSaplingAt(World world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z) == block;
|
||||
public boolean isSaplingAt(World world, BlockPos pos) {
|
||||
return BlockUtil.getBlock(world, pos) == block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICrop getCropAt(World world, int x, int y, int z) {
|
||||
if (world.getBlock(x, y, z) != block) {
|
||||
public ICrop getCropAt(World world, BlockPos pos) {
|
||||
if (BlockUtil.getBlock(world, pos) != block) {
|
||||
return null;
|
||||
}
|
||||
if (world.getBlockMetadata(x, y, z) != mature) {
|
||||
if (BlockUtil.getBlockMetadata(world, pos) != mature) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new CropBlock(world, block, mature, new Vect(x, y, z));
|
||||
return new CropBlock(world, block, mature, new Vect(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,8 +67,8 @@ public class FarmableGenericCrop implements IFarmable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
|
||||
return germling.copy().tryPlaceItemIntoWorld(player, world, x, y - 1, z, 1, 0, 0, 0);
|
||||
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) {
|
||||
return germling.copy().onItemUse(player, world, pos.add(0, -1, 0), EnumFacing.UP, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user