Jump to content

[1.16.1] Custom Furnace container class


GamingTiger101

Recommended Posts

So I am trying to make a furnace that smelts 4X as fast as normal, but I can't figure out how to insert it into my registry handler. Here is my code for my registry handler right now, I believe I have everything except for the end:

package com.gamingtiger.infiniteores.util;

import com.gamingtiger.infiniteores.InfiniteOresMod;
import com.gamingtiger.infiniteores.armor.ModArmorMaterial;
import com.gamingtiger.infiniteores.blocks.*;
import com.gamingtiger.infiniteores.items.ItemBase;
import com.gamingtiger.infiniteores.inventory.*;
import com.gamingtiger.infiniteores.tools.*;
import net.minecraft.block.Block;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.inventory.container.FurnaceContainer;
import net.minecraft.item.*;
import net.minecraft.tileentity.FurnaceTileEntity;
import net.minecraft.tileentity.SteelFurnaceTileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class RegistryHandler {

    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, InfiniteOresMod.MOD_ID);
    public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, InfiniteOresMod.MOD_ID);
    public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY_DEFERRED_REGISTER = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, InfiniteOresMod.MOD_ID);

    public static void init() {
        ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
    }

    public static final RegistryObject<TileEntityType<?>> STEEL_FURNACE_BLOCK = TILE_ENTITY_DEFERRED_REGISTER.register("steel_furnace_block", FurnaceContainer::new);

Here is my code for my SteelFurnaceContainer:

package net.minecraft.inventory.container;

import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.IIntArray;

public class SteelFurnaceContainer extends AbstractFurnaceContainer {
    public SteelFurnaceContainer(int id, PlayerInventory playerInventoryIn) {
        super(ContainerType.FURNACE, IRecipeType.SMELTING, id, playerInventoryIn);
    }

    public SteelFurnaceContainer(int id, PlayerInventory playerInventoryIn, IInventory furnaceInventoryIn, IIntArray p_i50083_4_) {
        super(ContainerType.FURNACE, IRecipeType.SMELTING, id, playerInventoryIn, furnaceInventoryIn, p_i50083_4_);
    }
}


Here is my code for my SteelFurnaceTileEntity:

package net.minecraft.inventory.container;

import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.IIntArray;

public class SteelFurnaceContainer extends AbstractFurnaceContainer {
    public SteelFurnaceContainer(int id, PlayerInventory playerInventoryIn) {
        super(ContainerType.FURNACE, IRecipeType.SMELTING, id, playerInventoryIn);
    }

    public SteelFurnaceContainer(int id, PlayerInventory playerInventoryIn, IInventory furnaceInventoryIn, IIntArray p_i50083_4_) {
        super(ContainerType.FURNACE, IRecipeType.SMELTING, id, playerInventoryIn, furnaceInventoryIn, p_i50083_4_);
    }
}

Here is my code for the gui:

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.gamingtiger.infiniteores.gui.screen.inventory;
import net.minecraft.client.gui.recipebook.FurnaceRecipeGui;
import net.minecraft.client.gui.screen.inventory.AbstractFurnaceScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.FurnaceContainer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class SteelFurnaceScreen extends AbstractFurnaceScreen<FurnaceContainer> {
    private static final ResourceLocation FURNACE_GUI_TEXTURES = new ResourceLocation("textures/gui/container/steel_furnace.png");

    public SteelFurnaceScreen(FurnaceContainer container, PlayerInventory playerInventory, ITextComponent title) {
        super(container, new FurnaceRecipeGui(), playerInventory, title, FURNACE_GUI_TEXTURES);
    }
}


I am not sure what the problem is.

Edited by diesieben07
code formatting
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.