Jump to content

[1.10.2] Loading custom gui for custom block


Messorix

Recommended Posts

Fuel also doesn't respond to shift-click (tested with coal and bucket of lava)

 

 

[13:07:24] [Client thread/INFO] [sTDOUT]: [com.messorix.moleculecraft.base.crafting.FluxGrinderRecipes:<init>:29]: Flux Grinder Recipes is called

 

 

Line 29:    System.out.println("Flux Grinder Recipes is called");

 

Also... I made an irc-channel so if you are willing that might be a lot quicker :P

Go to https://esper.net/publicirc.php and then /join MoleculeCraft

Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This is in your ModTileEntity

 

public boolean isItemValidForFuelSlot(ItemStack stack) {
	return false;
}

public boolean isItemValidForInputSlot(ItemStack stack) {
	return false;
}

public boolean isItemValidForOutputSlot(ItemStack stack) {
	return false;
}

 

And this is in your TileEntityFluxGrinder

 


 

And this is the isItemValid in your Slot classes

 

	@Override
	public boolean isItemValid(ItemStack stack)
	{
		return tileEntity.isItemValidForFuelSlot(stack);
	}

	@Override
	public boolean isItemValid(ItemStack stack)
	{
		return tileEntity.isItemValidForInputSlot(stack);
	}

	@Override
	public boolean isItemValid(ItemStack stack)
	{
		return tileEntity.isItemValidForOutputSlot(stack);
	}

 

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

Has it occurred to anyone in this thread to use Capabilities instead?

Why would he want to use capabilities, he is using a TileEntity, not saving data to the player.

Note to self capabilities can be tied to TileEntities.

 

Yes, Caps can be on TileEntities.  ItemStacks too.

The hard part about doing the GUI was this line:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/GuiHandler.java#L37

 

Because Capabilities aren't inherently IInventory, so it's a little wonky getting the GuiContainer set up correctly.

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

It is okay Draco18 I went into a Discord "call" and settled this, in his code there were many errors, caused by not properly Overriding and slot index's were set up incorrrecy, but thank you for the example I will look at it when I get some rest.

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

Cool beans. I was just providing an alternative and the "stuck point" I had when doing it that way (I had almost create a thread because I was pulling my hair out when I found the solution).

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.




×
×
  • Create New...

Important Information

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