Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Braydongem

Members
  • Joined

  • Last visited

Everything posted by Braydongem

  1. This is how I fixed this issue.
  2. Could this have anything to do with it?
  3. Hello, I've been trying to make my custom crop and I got stuck. The crop can be planted on farmland and growth can be sped up with bone meal but it doesn't want to grow by itself. Any help is appreciated! Custom crop class: package mariot7.xlfoodmod.blocks; import java.util.Random; import mariot7.xlfoodmod.XLFoodMod; import mariot7.xlfoodmod.init.ItemListXL; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.CropsBlock; import net.minecraft.block.FarmlandBlock; import net.minecraft.block.IGrowable; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.state.IntegerProperty; import net.minecraft.state.StateContainer; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorldReader; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; public class TomatoPlant extends CropsBlock implements IGrowable { public static final IntegerProperty TOMATO_PLANT_AGE = BlockStateProperties.AGE_0_7; public TomatoPlant(String name) { super(Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT)); this.setRegistryName(XLFoodMod.MOD_ID, name); this.setDefaultState(this.stateContainer.getBaseState().with(this.getAgeProperty(), Integer.valueOf(0))); } @OnlyIn(Dist.CLIENT) protected IItemProvider getSeedsItem() { return ItemListXL.TOMATO_SEEDS; } @OnlyIn(Dist.CLIENT) public ItemStack getItem(IBlockReader worldIn, BlockPos pos, BlockState state) { return new ItemStack(this.getSeedsItem()); } protected boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos) { return state.getBlock() instanceof FarmlandBlock; } public IntegerProperty getAgeProperty() { return TOMATO_PLANT_AGE; } public int getMaxAge() { return 7; } public boolean canGrow(IBlockReader worldIn, BlockPos pos, BlockState state, boolean isClient) { return !this.isMaxAge(state); } public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, BlockState state) { return true; } public void grow(World worldIn, Random rand, BlockPos pos, BlockState state) { this.grow(worldIn, pos, state); } protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(TOMATO_PLANT_AGE); } } Edit: fixed. I forgot to add .tickRandomly() in properties.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.