Carrot is not fruit (#27)

* Carrot is not fruit

* updateBuildScript & spotlessApply
This commit is contained in:
miozune authored and GitHub committed 2022-08-25 14:10:35 +02:00
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.config.Constants;
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.config.Constants;
import forestry.core.proxy.Proxies;
import forestry.core.utils.vect.Vect;
public class CropBasicFruit extends Crop {
private final Block block;
private final int meta;
private final Block block;
private final int meta;
public CropBasicFruit(World world, Block block, int meta, Vect position) {
super(world, position);
this.block = block;
this.meta = meta;
}
public CropBasicFruit(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);
world.setBlock(pos.x, pos.y, pos.z, block, 0, Constants.FLAG_BLOCK_SYNCH);
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);
world.setBlock(pos.x, pos.y, pos.z, block, 0, Constants.FLAG_BLOCK_SYNCH);
return harvested;
}
@Override
public String toString() {
return String.format("CropBasicFruit [ position: [ %s ]; block: %s; meta: %s ]", position.toString(), block.getUnlocalizedName(), meta);
}
@Override
public String toString() {
return String.format(
"CropBasicFruit [ position: [ %s ]; block: %s; meta: %s ]",
position.toString(), block.getUnlocalizedName(), meta);
}
}