Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/07/21 in all areas

  1. You had this in your class constructor: public WaywardCraft() { MinecraftForge.EVENT_BUS.register(this); RegistryHandler.init(); MinecraftForge.EVENT_BUS.register(new OreGen()); } With the third line you are registering the OreGen class to the Forge bus, this means that loadBiomes will correctly listen to the BiomeLoadingEvent (FORGE bus). With the first line you are instead registering the main mod class (this) to the Forge bus, so any event handler in the main class will listen only to Forge bus events, but FMLCommonSetupEvent is fired on the MOD bus. So you need to register you main class to the MOD bus, which you can get from: FMLJavaModLoadingContext.get().getModEventBus(); Instead of subscribing your whole class, you can also add listeners to the Mod bus with: FMLJavaModLoadingContext.get().getModEventBus().addListener(your_listener_method)
    1 point
  2. Did you change the bus on which loadBiomes is registered on? It was correct before. FML setup events fire on Mod bus, BiomeLoadingEvent fires on the forge bus
    1 point
  3. FMLCommonSetupEvent is fired on the Mod bus, not the forge bus
    1 point
  4. So, if the list is empty it means that maybe the features aren't actually added to that list...so the last thing to check is if the OreGen.register method is called
    1 point
  5. Well, if the for loop is never executed, make sure that there is actually something inside the list you are looping through
    1 point
  6. What happens if you run the jar file manually?
    1 point
  7. Have you checked if this: @SubscribeEvent public void loadBiomes(BiomeLoadingEvent event) { for(ConfiguredFeature<?,?> feature : ORE_GENERATORS) { event.getGeneration().withFeature(GenerationStage.Decoration.UNDERGROUND_ORES,feature); } } is actually fired or not?
    1 point
  8. The forge read the docs wiki is a little out of date. It is a lot easier now. I learnt how to do this from reverse engineering minecraft's and forge's code. I use blender to create my model. A fantastic tutorial on how to create pixel art based models in blender can be found here: To export: go to File>Export->Wavefront (.obj) Your settings should reflect this. This will convert the Blender coordinate system into Minecraft's. When you export your model you will get two files, an obj and a mtl. e.g. block_name.obj and block_name.mtl. The obj file describes the shape of the model while mtl file describes how it looks. Keep both files next to each other. Go into your mod resource directory and place these two files where you want them, e.g. assets/modid/models/block/path Within block_name.obj, make sure the mtllib points to the mtl file. Remember, your obj and mtl file should be next to each other. It should read: mtllib block_name.mtl Still within block_name.obj, make sure the correct material library is being loaded (Ill show you where this is declared in a sec.) (Just scroll down until you find the line, don't write your own) usemtl block_name_mat Your block_name.mtl file should look like something like this when you export it. If it doesn't have all of these lines, don't worry, Minecraft doesn't care too much about these numbers. # Blender MTL File: 'bloomery.blend' # Material Count: 1 newmtl block_name_mat Ns 323.999994 Ka 1.000000 1.000000 1.000000 Kd 0.800000 0.800000 0.800000 Ks 0.500000 0.500000 0.500000 Ke 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 illum 2 Pretty much everything here can stay as is. "newmtl" is where we declare the material the obj loads with "usemtl". Make sure these match. Next we need to let Minecraft know where to find out texture. Still within block_name.mtl add a map_Kd line below newmtl. If you forget this line, Forge will still load your model, but it will be all white. newmtl block_name_mat map_Kd modid:block/path/block_name Ns 323.999994 Ka 1.000000 1.000000 1.000000 Kd 0.800000 0.800000 0.800000 Ks 0.500000 0.500000 0.500000 Ke 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 illum 2 Place your texture within assets/modid/textures/block/path. The map_Kd should point to this location. Next, create a blockstate file for your block as normal. [block_name.json]. This will load a json model file. This has to be next to your obj and mtl files. { "variants": { "": { "model": "modid:block/path/block_name" } } } Block Model [block_name.json] { "loader": "forge:obj", "model": "modid:models/block/path/block_name.obj", "flip-v": true } Enabling flip-v will depend your model file. This just flips the way the texture is applied. If your texture looks upside down, change this to false. Your assets folder structure should look like this now: assets/modid/ blockstates/ block_name.json models/block/path/ block_name.json block_name.obj block_name.mtl textures/block/path/ block_name.png
    1 point
  9. If you have a custom class for your item, make it extend ItemSimpleFoiled instead of Item . If you don't have a custom class for it, use ItemSimpleFoiled instead of Item when creating the item. The key here is making public boolean hasEffect(ItemStack stack) return true with your item.
    1 point
×
×
  • Create New...

Important Information

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