First 1.8.9 Version

This commit is contained in:
Nedelosk committed 2016-01-22 19:33:35 +01:00
1 parent d35cc1df09
commit 5a3850c264
1657 files changed
+26844 -13269

No files matched your search

@@ -12,11 +12,13 @@ package forestry.farming.logic;
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;
@@ -33,29 +35,29 @@ public class FarmableGourd implements IFarmable {
}
@Override
public boolean isSaplingAt(World world, int x, int y, int z) {
if (world.isAirBlock(x, y, z)) {
public boolean isSaplingAt(World world, BlockPos pos) {
if (world.isAirBlock(pos)) {
return false;
}
return ItemStackUtil.equals(world.getBlock(x, y, z), stem);
return ItemStackUtil.equals(BlockUtil.getBlock(world, pos), stem);
}
@Override
public ICrop getCropAt(World world, int x, int y, int z) {
if (world.isAirBlock(x, y, z)) {
public ICrop getCropAt(World world, BlockPos pos) {
if (world.isAirBlock(pos)) {
return null;
}
if (!ItemStackUtil.equals(world.getBlock(x, y, z), fruit)) {
if (!ItemStackUtil.equals(BlockUtil.getBlock(world, pos), fruit)) {
return null;
}
if (world.getBlockMetadata(x, y, z) != fruit.getItemDamage()) {
if (BlockUtil.getBlockMetadata(world, pos) != fruit.getItemDamage()) {
return null;
}
return new CropBlock(world, ItemStackUtil.getBlock(fruit), fruit.getItemDamage(), new Vect(x, y, z));
return new CropBlock(world, ItemStackUtil.getBlock(fruit), fruit.getItemDamage(), new Vect(pos));
}
@Override
@@ -69,8 +71,8 @@ public class FarmableGourd implements IFarmable {
}
@Override
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
return world.setBlock(x, y, z, ItemStackUtil.getBlock(stem), 0, Constants.FLAG_BLOCK_SYNCH);
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) {
return world.setBlockState(pos, ItemStackUtil.getBlock(stem).getStateFromMeta(0), Constants.FLAG_BLOCK_SYNCH);
}
}