Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/08/20 in Posts

  1. Can you please stop making your posts entirely unreadable? Thanks.
    1 point
  2. I am well aware of that. My issue is that I don't feel that I know enough about it to start explaining it to others (I haven't yet looked into how you would use RegistryObject for example). I would prefer that someone who knows how to use it write it, then I could learn from that.
    1 point
  3. After 1.14.4 became the LTS, I had to update my 1.12.2 mod to 1.14.4. I was updating my items and I had a special item that called "setFull3D" method. I searched it in the Item class, but it got removed, just like "shouldRotateAroundWhenRendering". I've seen that BONE, BLAZE ROD and STICK used "setFull3D" method in 1.12.2, but there is nothing in the new version. Can someone help?
    1 point
  4. This is new. Just had to do a search for it, as this is the first I'd heard of it. I hadn't read this thread when it was new:
    1 point
  5. This solved the problem for me First register your entity with custom client factory like this .setCustomClientFactory((spawnEntity, world) -> new ExempleEntity(world)) And then use NetworkHooks#getEntitySpawningPacket to get Entity Spawning Packet @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } that's it ?
    1 point
  6. 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.
    1 point
×
×
  • Create New...

Important Information

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