Jump to content

[1.11] Custom Furnace buggy


SuperHB

Recommended Posts

I'm currently working on a custom furnace with 2 inputs and 3 outputs and 1 fuel slot. I've got the furnace to smelt but it creates a lot of weird bugs. Which are:

 

1. When I try to put say 40 coal into the fuel slot, it puts a full stack of 64 coal. That same effect is on every slot that I place items in. It doesn't take the items either, It creates a whole new stack of 64.

 

Sometime it takes the stack, puts it in, but when I try and take it back out, gone. (This seems to only happen when there isn't any inputs and only for the fuel, but if there is an input bug 1 still happens to the fuel)

 

2. When I try to take the items out of the furnace like the fuel or input or output, it just disappears when I click on it.

 

3. When both inputs are full, it takes two out of the first input instead of one from both

 

Here is my code:

Block

 

TileEntity

 

Container

 

Gui

 

I've been looking at the code inside the container, do I need to override detectAndSendChanges and other functions inside Container to possibly get this to work?

Link to comment
Share on other sites

Why do you have multiple GuiHandlers?

 

Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery.

Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers?

item.getMetadata(1) // Doesn't work the way you think it does.

"// TODO: Figure out difference between simulate = true and simulate = false"

If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change.

Also quick question did you follow a tutorial?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Why do you have multiple GuiHandlers?

 

Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery.

Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers?

item.getMetadata(1) // Doesn't work the way you think it does.

"// TODO: Figure out difference between simulate = true and simulate = false"

If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change.

Also quick question did you follow a tutorial?

 

I originally followed TheGreyGhost's code here but I'm trying to switch it to Forge's capability system. Also, checked getMetadata, thought it just returned the int I put in, but I switched it to getMetadata(ItemStack) now.

 

For that todo I originally had insertItem, but I switched it to setStackInSlot. I'm guessing it would be better to use insertItem? Thank you for explaining it though.

Link to comment
Share on other sites

Why do you have multiple GuiHandlers?

 

Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery.

Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers?

item.getMetadata(1) // Doesn't work the way you think it does.

"// TODO: Figure out difference between simulate = true and simulate = false"

If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change.

Also quick question did you follow a tutorial?

 

I originally followed TheGreyGhost's code here but I'm trying to switch it to Forge's capability system. Also, checked getMetadata, thought it just returned the int I put in, but I switched it to getMetadata(ItemStack) now.

 

For that todo I originally had insertItem, but I switched it to setStackInSlot. I'm guessing it would be better to use insertItem? Thank you for explaining it though.

Yes it would be better to use insertItem and extractItem because it already handles the current slot being null. And you are going to need to create your own implementation of insertItem and possibly extract item. Also...

3. When both inputs are full, it takes two out of the first input instead of one from both

That is not what you told it to do. Edit: Also that is not what TGG did.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.