mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +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
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user