Jump to content

Recommended Posts

Posted

Hey guys, this is my first post so please don't be harsh on me... if i commit any mistake, don't hesitate correcting me so that i improve my "posting abilities"  ;). Anyways, as the title says, i made a custom furnace by looking at the codes of the vanilla furnace and some mods's furnaces, and i got my normal furnace to work. However, when trying to add 1 more slot of each (input, fuel and output), they just do nothing. Yes, the "original" ones are working, but the additional ones are useless. I am ,in fact, able to place items in both input and fuel slots and not able to put items in the output. These aspects are working. I just want to know what do i have to do to have them working normally. Also, as I'm new to both modding and java, please be patient; and if possible, maybe even adding some examples.

 

The source code is on GitHub: https://github.com/pedromendes99/AmethystModSource/tree/master/src/main/java/com/rokuw/modding/furnaces/amethystfurnace

 

 

Thanks for your time and sorry if there are grammar errors here, english is not my native language  :)

If i helped you, please click the "thank you" button :)

Posted

Oops, sorry, i forgot to add them :S

All the classes should be there by now ^^

If i helped you, please click the "thank you" button :)

Posted

From ContainerAmethystOven.java

        this.addSlotToContainer(new Slot(par2TileEntityAmethystOven, 0, 56, 17));
        this.addSlotToContainer(new Slot(par2TileEntityAmethystOven, 1, 56, 53));
        this.addSlotToContainer(new SlotAmethystOven(par1InventoryPlayer.player, par2TileEntityAmethystOven, 2, 116, 35));
        this.addSlotToContainer(new Slot(par2TileEntityAmethystOven, 4, 26, 17));
        this.addSlotToContainer(new Slot(par2TileEntityAmethystOven, 4, 26, 53));
        this.addSlotToContainer(new SlotAmethystOven(par1InventoryPlayer.player, par2TileEntityAmethystOven, 5, 141, 35));

 

Add slots with ids 0, 1, 4 and 4 for the tileentity? And I don't know about this custom slot business but you also appear to have slot ids 2 and 5. 3 is jealous of 4 dude. Don't disrespect 3 like that.

Posted

Slots 0, 1 and 2 are the original, working ones. slots "4", 4 and 5 are the ones i added. And yes, i switched the first "4" id, it was supposed to be 3 (sorry about disrespecting you, '3' xD)... I changed '4' to '3' but they're still not working :S

If i helped you, please click the "thank you" button :)

Posted

You don't do anything with the other indexes of your tileentity's ItemStack array furnaceItemstacks.

What did you expect to happen?

Your tileentity only calls slot 0 through 2, you never used 3 through 5.

 

There is no error in your code, there just is no code for your other slots.

Posted

Okay, so i should set the furnace item stack array to 3, the original value, and the additional slots ids to their respective function, correct? (0 = input, 1 = fuel and 2 = outut, right?)

 

EDIT: i did change the ids, but as they were colliding (the originals with the addtionals) when i put an item in te furnace, obviously, the items duplicate aswell... I just want the additional slots to be "independent", like two furnaces in one block...

If i helped you, please click the "thank you" button :)

Posted
  On 5/20/2014 at 8:57 PM, Rokuw said:

Okay, so i should set the furnace item stack array to 3, the original value, and the additional slots ids to their respective function, correct? (0 = input, 1 = fuel and 2 = outut, right?)

 

EDIT: i did change the ids, but as they were colliding (the originals with the addtionals) when i put an item in te furnace, obviously, the items duplicate aswell... I just want the additional slots to be "independent", like two furnaces in one block...

 

But you're not calling anything beyond furnaceItemStacks[2];

4th slot = furnaceItemStack[3]

5th slot = furnaceItemStack[4]

6th slot = furnaceItemStack[5]

 

Nowhere in your code you're telling it to be that slot.

Heck, you're not even calling those itemstacks at all. So nothing is going to work.

If you want to have 2 furnaces in 1, you can just copy everything containing furnaceItemStack[0] (1st slot) and replace 1 with 3(4th slot) to what you've copied.

DONE!

Posted

I've changed some stuff here and now 1 fuel slot burns 2 input slots and returns the items in the 2 output slots...

 

 

Tile Entity Class:

 

  Reveal hidden contents

 

If i helped you, please click the "thank you" button :)

Posted

Let's be perfectly clear. You have essentially copy-pasted a series of methods from the furnace class which contain algorithms that make slots with ids 0, 1 and 2 work. Now you need to add additional algorithms which will be almost identical to the originals, except that they will use slots 3, 4 and 5. You already have the code in front of you so the only other things you need are 1) understand the code and 2) step by step logic.

 

Learning how to code is time consuming and we can't do it for you even if we wanted to. As someone who only started with java a year ago I can't recommend that you start learning java through Minecraft.

Posted

Okay, thank you guys, i think that i'll stick with what i know of modding and try not to compliccate things... :)

AskHow, as for the video, i really appreciate that you're trying to help me, but as i sad, i think i'll just stay with basic code, simply because i don't know java at all (thats because i'm 14 years old...) So yaeh, thats pretty much it, and again, Thanks!

If i helped you, please click the "thank you" button :)

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.