Jump to content

[1.12.2] Can't smelt custom block


Bertrahm

Recommended Posts

I'm trying to add a smelting recipe for Rutile Ore of my mod, but I've ran into a problem:

GameRegistry.addSmelting(input, output, xp)

doesn't work with blocks, even though a method with a block input exists... Items/ItemStacks work perfectly, but it wont smelt or even shift-click into the furnace If I use a block as the input.
Here's my registration code:
 

package com.linesix.akhaten.common.blocks.ores;

import com.linesix.akhaten.common.blocks.registries.Ores;
import com.linesix.akhaten.common.items.registries.Materials;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class SmeltingHandler {
	
	public static void registerSmeltingRecipes() {
		GameRegistry.addSmelting(Materials.silicate_clump, new ItemStack(Materials.silicate_ingot), 2);
		GameRegistry.addSmelting(Ores.rutile_ore, new ItemStack(Materials.raw_titanium), 3); // This smelting recipe doesn't work (Rutile Ore Block)
		GameRegistry.addSmelting(Materials.raw_titanium, new ItemStack(Materials.titanium_ingot), 3);
	}

}

EDIT: The method "registerSmeltingRecipes" is called in the preInit methods (FMLPreInitializationEvent)

Edited by Bertrahm
Forgot important info
Link to comment
Share on other sites

29 minutes ago, Bertrahm said:

FMLPreInitializationEvent

This is too early, your items don't exist yet (probably).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Show more of your code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

My main class:

 

package com.linesix.akhaten;

import com.linesix.akhaten.common.blocks.ores.SmeltingHandler;
import com.linesix.akhaten.common.blocks.registries.BuildingBlocks;
import com.linesix.akhaten.common.blocks.registries.DimBlocks;
import com.linesix.akhaten.common.blocks.registries.MachineBlocks;
import com.linesix.akhaten.common.blocks.registries.Ores;
import com.linesix.akhaten.common.items.registries.Materials;
import com.linesix.akhaten.server.commands.Commands;
import com.linesix.akhaten.common.dimensions.Dimensions;
import com.linesix.akhaten.common.items.registries.Gadgets;
import com.linesix.akhaten.proxy.CommonProxy;
import com.linesix.akhaten.common.sound.SoundRegistry;
import com.linesix.akhaten.common.worldgen.OreGen;
import com.linesix.akhaten.common.Reference;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

import java.util.Random;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Akhaten {



   /*
    * Akhaten Public Beta (Version 0.5.2)
    * Copyright (C) 2019 Linesix Studios, Licensed under the ISC license
    *
    * Author: Felix Eckert (TheBertrahmPlays / Angry German)
    *
    */

    public static Random random = new Random();

    @Mod.Instance(Reference.MODID)
    public static Akhaten instance; // Create an instance of the main class

    @SidedProxy(clientSide = "com.linesix.akhaten.proxy.ClientProxy", serverSide = "com.linesix.akahten.proxy.CommonProxy")
    public static CommonProxy proxy; // Create a CommonProxy

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {

        Reference.logger.info("Entering PreInit phase...");

        //OBJLoader.INSTANCE.addDomain(Reference.MODID);

        // Register Items Blocks and Sounds Below
        SoundRegistry.init();
        DimBlocks.init();
        MachineBlocks.init();
        BuildingBlocks.init();
        Gadgets.init();
        Materials.init();
        Ores.init();
        SmeltingHandler.registerSmeltingRecipes();

    }
    
    @Mod.EventHandler
    public void init(FMLInitializationEvent event) {

        Reference.logger.info("Entering Init phase...");

        // Register Dimensions below
        Dimensions.registerDimensions();
        GameRegistry.registerWorldGenerator(new OreGen(), 0);

    }

    @Mod.EventHandler
    public void serverStarting(FMLServerStartingEvent event) { // This method just exists for registering commands

        // Register Commands Below
        Commands.register(event);

    }

    @Mod.EventHandler
    public void postInit(FMLPostInitializationEvent event) {

        Reference.logger.info("Entering PostInit phase...");

    }

}

  

 

Link to comment
Share on other sites

You should be using the RegistryEvents to register your items, blocks, and so on.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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