Jump to content

Beethoven92

Members
  • Posts

    687
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Beethoven92

  1. At this point, maybe just starting a new fresh project would be a good idea, and see if the problem still appears
  2. Sorry, by "setup your build.gradle" i meant, re run genEclipseRuns. Should have specified that
  3. You should also change those in your build.gradle to the values specific to your mod. If you use "exmod" as your modid, your package name also has to reflect that. So, your com.arnox.ExampleMod should become com.arnox.exmod (you should really put your package names all in lowercase). So change the 'group' and 'archivesBaseName' fields respectively with 'com.arnox.exmod' an 'exmod'. Setup your build.gradle again after changing anything inside it to refresh it with the new values
  4. Show the package explorer in your IDE please
  5. There is a "caster" field inside LightningBoltEntity which stores a ServerPlayerEntity, and you can set this field with the setCaster method. Now...when in your item class you create the bolt entity, you can set its caster to the player that is holding the item. Then you would need to retrieve the caster of the bolt in your event handler. Problem, the "caster" field is private and you would have to use access transformers to make it public. I am not sure if this would work though..
  6. You need to put your block in the block tags for campfires. ChampionAsh already gave you the answer for that
  7. Are you trying to make this work for vanilla bed or just for your custom bed? If you are trying to cancel the collision with vanilla bed thats not what Override is for. Look here for TER reference: https://mcforge.readthedocs.io/en/latest/tileentities/tesr/ Or just look at the vanilla bed block and BedTileEntityRenderer class to get and idea
  8. I see...it seems that the NetherVegetationFeature is tied to the vegetal biomes, what a surprise ๐Ÿค” ...there is another solution if you want your block to spawn also in the Nether Wastes, and thats to use the Decoration#UNDERGROUND_DECORATION (also VEGETATION is fine) stage and Feature#RANDOM_PATCH configured with a BlockClusterFeatureConfig. If you look into the NetherWastesBiome class you will see how mushrooms are generated there. Use a similar code to generate your bush adjusting the values you need. Your initial code for the BlockClusterFeatureConfig was not set up correctly and thats why it wasn't working. There is a function inside BlockClusterFeatureConfig.Builder which is func_227317_b_() which basically sets a boolean field (also not mapped for me) inside the class. I tested and it seems that you need to chain also that method to the Builder, otherwise your block won't show up. This should definitely solve your problems
  9. You already had the cycle through biomes. Just check if the biome is a nether biome, and add your feature to it. This if you want your bush to be generated in every nether biome
  10. Keep in mind though that your block extends a BushBlock. So you will be able to place you nether bush on overworld blocks too (DIRT, GRASS..). You can also do this with the vanilla nether vegetation since that also extends BushBlock. Not sure if this behaviour is intentional or if it will be changed in the future, because honestly is a bit weird
  11. I just did what i suggested you to do. So to mimic the behaviour of other vanilla nether vegetation. Override isValidGround in your block class, delete your implementation of isValidPosition. When adding the feature to your biomes use the NetherVegetationFeature, so the Feature#field_236282_M_ ...this feature requires a BlockStateProvidingFeatureConfig configuration and nothing more. So replace your BlockClusterFeatureConfig with this one (if you look into the DefaultBiomeFeatures class you will see how that config is created, look for NETHER_SPROUTS and CRIMSON_ROOTS_FEATURE_CONFIG)...you should see that your bush is now being generated on nether rack
  12. All right, i tried myself and it works, look (didn't bother to make jsons and get a texture ๐Ÿ˜›) l
  13. Gonna dig a bit more into that
  14. It shouldn't...i tried myself quickly adding an existing feature in a nether biome where it is not supposed to generate and it worked perfectly. What you have to do here in my opinion is to mimic vanilla nether sprout, roots etc generation
  15. Oh sorry, i forgot, try deleting your custom isValidPosition method. Let it be handled by the superclass. Only override isValidGround in your class
  16. Very weird indeed, this is the exact same way vanilla nether vegetals are handled...
  17. Edited out due to author's lack of knowledge ๐Ÿค”
  18. Just implement your own version of isValidGround in your nether bush class. @Override protected boolean isValidGround
  19. protected methods can be overriden by subclasses, did you try to override it in your nether bush block?
  20. Try to run "gradlew --refresh-dependencies", then "gradlew clean" and then setup your project again with the genEclipseRuns task
  21. Actually...i found this line inside Block#canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction facing, net.minecraftforge.common.IPlantable plantable): if (plantable instanceof BushBlock && ((BushBlock)plantable).isValidGround(state, world, pos)) return true; So, from what i understand, your nether bush block uses the super#isValidGround, which being it in BushBlock it checks for dirt, grass etc. So basically, when the line above is called for nether rack block it will never find that your bush block is compatible with it. So you should just override isValidGround like shown above. This is my theory, might not work but is worth a try, until someone comes out with a better idea ๐Ÿ˜›
  22. So, i am not sure what the problem is, but i see from your github that your mod also existed in a 1.15.2 version, which i guess did work fine, didn't it? First of all, now Block.Properties is AbstractBlock.Properties, you will have to change those in your blocks registration. Next, looking at how 1.16 nether vegatal decorations are generated, it seems they use this feature here: Feature<BlockStateProvidingFeatureConfig> field_236282_M_ = register("nether_forest_vegetation", new NetherVegetationFeature(BlockStateProvidingFeatureConfig.field_236453_a_)); Have you already tried to use that in your nether bush generation? Also i see that those vegetal block just implements their own version of isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos) instead of isValidPosition, which in the end may not matter because the first is called anyway by the latter...but it may be a little bit more convenient in term of code: boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos) { return state.isIn(BlockTags.NETHERRACK)); }
  23. Didn't notice the new, sorry ๐Ÿ˜›
  24. You need also to chain the #build() method to #create, so it would be like this TileEntityType#Builder#create(your stuff)#build(null) since its #build() that actually returns the TileEntityType
×
×
  • Create New...

Important Information

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