Jump to content

vortigon7

Members
  • Posts

    1
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    https://andrasalkor.com/
  • Location
    Hungary

vortigon7's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I have a problem (or problems?) with creating the Container for my custom furnace. I'm new to Minecraft modding, relatively new to Java, but not new to writing stuff for my own enjoyment, whether it's Godot, some simple C# apps, or Unity. Anyways, I'm working on a Roman styled mod, and those guys had stuff made out of bronze. I created ores and ingots for copper and tin, have them generate in the world, all is well, but I somehow need to combine them. Now, I could add a simple recipe to put two ingots next to each other and get a third, but that doesn't really make sense. I opted to create a new Alloy Furnace, which works just like the vanilla furnace, but has two slots for items instead of one. This lead to my discovery of Tile Entities, Containers, etc. I made a new block for the furnace (and a new block item as well), then I proceeded to write the functionality for it. Oops. Wasn't nearly as easy as placing a new block in the world. I tried to follow a tutorial on YouTube for 1.15, but it was about creating a new chest, then I found another one about creating a new furnace (hurray!), but for 1.12 (not hurray). I also figured out how to open vanilla Minecraft files, so I looked at the original furnace to figure out the way to do it. The end result is a Tile Entity, which is basically a vanilla furnace but with an added slot. (It has mostly the same code duplicated to a new AlloyFurnaceTileEntity file, changing some functions to be able to have two slots instead of one.) Then, I figured, I needed a Container as well. Then I did all the overrides the same way AbstractFurnaceContainer.class does. The problem is, I don't know how to register it properly. I have one big RegistryHandler.java file, which handles everything that has to do with the registry. The following is a snippet from my RegistryHandler. The last line I have no idea about, it's from a video I saw. I honestly don't know how to register a ContainerType, but I can't test the furnace until I do. public static final DeferredRegister<ContainerType<?>> CONTAINER_TYPES = new DeferredRegister<>(ForgeRegistries.CONTAINERS, ImperiumRomanum.MOD_ID); public static void init() { CONTAINER_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final RegistryObject<ContainerType<AlloyFurnaceContainer>> ALLOY_FURNACE_CONTAINER = CONTAINER_TYPES.register("alloy_furnace", () -> IForgeContainerType.create(AlloyFurnaceContainer::new); I know that AlloyFurnaceContainer::new won't work but I don't know what to put here. Here's the whole AlloyFurnaceContainer: If anyone at least can point me in the right direction, I'd be the happiest person on the planet. I've been going at this single furnace for about 18-20 hours now.
×
×
  • Create New...

Important Information

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