Jump to content

Kyberkreeper

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Kyberkreeper's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I've recently been following turty wurtys tutorial on tree generation; however, I'm running into several different code bits in 1.16.1 (ex. implementing the abstract getTreeFeature() in your tree class) Have things drastically changed between 1.16.1 and 1.15.2 in terms of custom tree generation, and how so? I've been trying to debunk this for a while, but if I run into too many snags, I'll just use structure generation instead (which would help since my redwood tree's trunks are unique in comparison to any other tree in vanilla Minecraft.) Also, my current mappings are version: '20200723-1.16.1' which I've heard is currently the most stable mapping, but this is just for reference
  2. My bad, I'm totally sorry, I just sorta barged in here desperate for a solution. Also thanks for the help, I will try this! Also, where is my mod ID going, and do I have to repeat the ore generation cod for iron ore, and then the hematite ore? How do I generate the iron ore? I know I sound dumb; I'm super new to modding and just started learning last week and I don't know any Java other than what I've learned so far (which isn't a lot) Also this is 1.16.1 btw
  3. I completely forgot I posted the code above, that's my bad. Memory failure on my part. Would I use the same code to generate iron ore before the hematite? I'm still majorly new to modding, so I'm not sure how certain things should be done
  4. So I made a custom hematite ore that I want to spawn inside iron ore. I made a custom Filler Block Type, but when I run the mod, the ore doesn't even generate! Any tips on how to fix this, I keep swearing the code looks right, but maybe there's something minute that I'm missing? Also on 1.16.1 btw, here's the code for reference: package com.theunknown.andraxxus.world.gen; import com.theunknown.andraxxus.AndraxxMod; import com.theunknown.andraxxus.util.RegistryHandler; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; import static net.minecraft.world.gen.feature.OreFeatureConfig.FillerBlockType.NATURAL_STONE; @Mod.EventBusSubscriber(modid = AndraxxMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class AndraxxOreGen { public static OreFeatureConfig.FillerBlockType END_STONE = OreFeatureConfig.FillerBlockType.create("END_STONE", "end_stone", new BlockMatcher(Blocks.END_STONE)); public static OreFeatureConfig.FillerBlockType IRON_ORE = OreFeatureConfig.FillerBlockType.create("IRON_ORE", "iron_ore", new BlockMatcher(Blocks.IRON_ORE)); @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { if (biome.getCategory() == Biome.Category.NETHER) { genOre(biome, 14, 22, 4, 111, OreFeatureConfig.FillerBlockType.NETHERRACK, RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 0); } else if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 14, 22, 4, 111, END_STONE, RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 0); } else { genOre(biome, 14, 22, 4, 111, IRON_ORE, RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 14); } } } private static void genOre (Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }
  5. I tried creating my own FillerBlockType and my custom ore won't generate. My plan was to have my custom ore (hematite) surrounded by iron ore. Can anyone help me? Here's my code below for the ore generation: package com.theunknown.andraxxus.world.gen; import com.theunknown.andraxxus.AndraxxMod; import com.theunknown.andraxxus.util.RegistryHandler; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.pattern.BlockMatcher; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.GenerationStage; import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.placement.ConfiguredPlacement; import net.minecraft.world.gen.placement.CountRangeConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.registries.ForgeRegistries; @Mod.EventBusSubscriber(modid = AndraxxMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class AndraxxOreGen { public static OreFeatureConfig.FillerBlockType END_STONE = OreFeatureConfig.FillerBlockType.create("END_STONE", "end_stone", new BlockMatcher(Blocks.END_STONE)); public static OreFeatureConfig.FillerBlockType IRON_ORE = OreFeatureConfig.FillerBlockType.create("IRON_ORE", "iron_ore", new BlockMatcher(Blocks.IRON_ORE)); @SubscribeEvent public static void generateOres(FMLLoadCompleteEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { if (biome.getCategory() == Biome.Category.NETHER) { genOre(biome, 14, 22, 4, 111, OreFeatureConfig.FillerBlockType.NETHERRACK, RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 0); } else if (biome.getCategory() == Biome.Category.THEEND) { genOre(biome, 14, 22, 4, 111, END_STONE, RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 0); } else { genOre(biome, 14, 22, 4, 111, OreFeatureConfig.FillerBlockType.create("IRON_ORE", "iron_ore", new BlockMatcher(Blocks.IRON_ORE)), RegistryHandler.HEMATITE_BLOCK.get().getDefaultState(), 14); } } } private static void genOre (Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); } }
×
×
  • Create New...

Important Information

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