use of com.infinityraider.agricraft.content.core.BlockCropPlant in project AgriCraft by AgriCraft.
the class AgriProbeCropBlockDisplayOverride method overrideStandardInfo.
@Override
public boolean overrideStandardInfo(ProbeMode mode, IProbeInfo info, PlayerEntity playerEntity, World world, BlockState state, IProbeHitData hitData) {
if (state.getBlock() instanceof BlockCropPlant) {
TileEntity tile = world.getTileEntity(hitData.getPos());
if (tile instanceof TileEntityCropPlant) {
TileEntityCropPlant crop = (TileEntityCropPlant) tile;
IAgriPlant plant = crop.getPlant();
if (plant.isPlant()) {
this.addData(info, plant);
return true;
}
}
}
return false;
}
use of com.infinityraider.agricraft.content.core.BlockCropPlant in project AgriCraft by AgriCraft.
the class AgriWailaCropBlockInfoProvider method getStack.
@Override
public ItemStack getStack(IDataAccessor accessor, IPluginConfig config) {
if (accessor.getBlock() instanceof BlockCropPlant) {
TileEntity tile = accessor.getTileEntity();
if (tile instanceof TileEntityCropPlant) {
TileEntityCropPlant crop = (TileEntityCropPlant) tile;
IAgriPlant plant = crop.getPlant();
if (plant.isPlant()) {
return plant.toItemStack();
}
}
}
return ItemStack.EMPTY;
}
Aggregations