mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +00:00
Carrot is not fruit (#27)
* Carrot is not fruit * updateBuildScript & spotlessApply
This commit is contained in:
1 parent
6973dbc80d
commit
c5c3aee2fb
1345 files changed
+92079
-90006
No files matched your search
@@ -10,42 +10,42 @@
|
||||
******************************************************************************/
|
||||
package forestry.farming.logic;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
|
||||
public class CropBlock extends Crop {
|
||||
|
||||
protected final Block block;
|
||||
protected final int meta;
|
||||
protected final Block block;
|
||||
protected final int meta;
|
||||
|
||||
public CropBlock(World world, Block block, int meta, Vect position) {
|
||||
super(world, position);
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
}
|
||||
public CropBlock(World world, Block block, int meta, Vect position) {
|
||||
super(world, position);
|
||||
this.block = block;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isCrop(Vect pos) {
|
||||
return getBlock(pos) == block && getBlockMeta(pos) == meta;
|
||||
}
|
||||
@Override
|
||||
protected boolean isCrop(Vect pos) {
|
||||
return getBlock(pos) == block && getBlockMeta(pos) == meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Collection<ItemStack> harvestBlock(Vect pos) {
|
||||
Collection<ItemStack> harvested = block.getDrops(world, pos.x, pos.y, pos.z, meta, 0);
|
||||
Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, block, 0);
|
||||
// Block.breakBlock() is called by vanilla itself, removing TEs.
|
||||
world.setBlockToAir(pos.x, pos.y, pos.z);
|
||||
return harvested;
|
||||
}
|
||||
@Override
|
||||
protected Collection<ItemStack> harvestBlock(Vect pos) {
|
||||
Collection<ItemStack> harvested = block.getDrops(world, pos.x, pos.y, pos.z, meta, 0);
|
||||
Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, block, 0);
|
||||
// Block.breakBlock() is called by vanilla itself, removing TEs.
|
||||
world.setBlockToAir(pos.x, pos.y, pos.z);
|
||||
return harvested;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("CropBlock [ position: [ %s ]; block: %s; meta: %s ]", position.toString(), block.getUnlocalizedName(), meta);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
"CropBlock [ position: [ %s ]; block: %s; meta: %s ]",
|
||||
position.toString(), block.getUnlocalizedName(), meta);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user