Posted April 9, 20205 yr I got my block class for the plant extending FlowerBlock package com.lethalmap.stardewmod.common.blocks; import com.lethalmap.stardewmod.Constants; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.potion.Effects; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; public class Worms extends FlowerBlock { protected static final VoxelShape SHAPE = Block.makeCuboidShape(5.0D, 0.0D, 5.0D, 11.0D, 5.0D, 11.0D); public Worms() { super(Effects.WEAKNESS,9,Block.Properties.create(Material.PLANTS).doesNotBlockMovement().hardnessAndResistance(0).sound(SoundType.PLANT)); setRegistryName(Constants.MODID,Constants.WORMS); } /** * Get the OffsetType for this Block. Determines if the model is rendered slightly offset. */ public Block.OffsetType getOffsetType() { return Block.OffsetType.XZ; } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { Vec3d vec3d = state.getOffset(worldIn, pos); return this.SHAPE.withOffset(vec3d.x, vec3d.y, vec3d.z); } } And got a class to generate things over the world, but I dont know how to generate this flower package com.lethalmap.stardewmod.common.world; import com.lethalmap.stardewmod.common.blocks.BlockList; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; import net.minecraft.world.gen.feature.*; import net.minecraftforge.registries.ForgeRegistries; public class WormGeneration { public void WormGeneration(){ for(Biome biome : ForgeRegistries.BIOMES) { biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, new DecoratedFeature(Feature.DECORATED_FLOWER, new SimpleBlockStateProvider(BlockList.worms)); } } } I don´t know what to do to generate this, Im quite noob modding
April 9, 20205 yr Check out vanilla code, it's super helpful net.minecraft.world.biome.DefaultBiomeFeatures is where it's at
April 9, 20205 yr Author 1 hour ago, Ugdhar said: Check out vanilla code, it's super helpful net.minecraft.world.biome.DefaultBiomeFeatures is where it's at Im looking at it, but I don´t know what to do with that
April 9, 20205 yr 3 minutes ago, BurstSword said: Im looking at it, but I don´t know what to do with that Well, you should have a basic-intermediate grasp of Java before starting modding, so you should be able to follow the code paths and see how features are set up. Think of what already happens in Minecraft that is similar to what you want to do, and look at the code for it. So find where, say, the flowers are setup in the plains biome or something like that.
April 9, 20205 yr Author I know how to program in Java, but there is 0 documentation, and sry if i dont understand a parameter called a_45437624_az
April 9, 20205 yr Ok, I think I see what you need to do, you need to put that in your FMLCommonSetupEvent , I believe using DeferredWorkQueue, because the biome stuff isn't threadsafe. If you search these forums for DeferredWorkQueue, I believe there's an example of how it's used. And the FMLCommonSetupEvent I believe is demonstrated in the examplemod that comes with the MDK. Edited April 9, 20205 yr by Ugdhar
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.