mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 12:59:44 +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,11 +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.world.World;
|
||||
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
@@ -32,19 +34,19 @@ public class FarmableBasicAgricraft 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) != matureMeta) {
|
||||
if (BlockUtil.getBlockMetadata(world, pos) != matureMeta) {
|
||||
return null;
|
||||
}
|
||||
return new CropBasicAgriCraft(world, block, matureMeta, new Vect(x, y, z));
|
||||
return new CropBasicAgriCraft(world, block, matureMeta, new Vect(pos));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,8 +60,8 @@ public class FarmableBasicAgricraft implements IFarmable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
|
||||
return world.setBlock(x, y, z, block, 0, Constants.FLAG_BLOCK_SYNCH);
|
||||
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) {
|
||||
return world.setBlockState(pos, block.getStateFromMeta(0), Constants.FLAG_BLOCK_SYNCH);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user