Jump to content

Recommended Posts

Posted

I want for example to create a birch workbench. What do i need to do to make this work?

This i think i need:

-guihandler class

-guicontainer

-container class

-block class

I have these 4 made, but it isn't working right now. I also haven't found out where or how to add textures to the block. I guess it's not via .json blockstates!

So the block is there ingame (pink/black squared for the moment) when right clicking you see a flashing of the gui. It looks like it is opening and closing almost instantly.

 

guihandler:

  Reveal hidden contents

container:

  Reveal hidden contents

guicontainer:

  Reveal hidden contents

and the block:

  Reveal hidden contents

 

Posted (edited)
  Quote

I have these 4 made, but it isn't working right now. I also haven't found out where or how to add textures to the block. I guess it's not via .json blockstates!

Expand  

Yes it is! Take a look at the forge blockstate docs.

  On 5/9/2017 at 8:45 PM, winnetrie said:
case MOD_WORKBENCH_GUI: { 
  return new EntityWorkbench(player.inventory, world, new BlockPos(x, y, z));
}

 

Expand  

What is EntityWorkbench? You should return your Container in this method.

  On 5/9/2017 at 8:45 PM, winnetrie said:

playerIn.displayGui(new BlockWorkbench.InterfaceCraftingTable(worldIn, pos));

Expand  

This is the vanilla method which doesn't refer to your GuiHandler at all. You need to use player#openGui(Object modInstance, int guiID, World world, int x, int y, int z). That will call the appropriate-side methods from your GUI handler to get the correct container/GUI.

Edited by Jay Avery
Posted (edited)

Ah yes ofc i changed it to

playerIn.openGui(Tem.instance, ModGuiHandler.MOD_WORKBENCH_GUI, worldIn, pos.getX(), pos.getY(), pos.getZ());

Works fine now!

Where and how do i apply textures to the block now?

Edited by winnetrie
nvm i didn't find an workbench.json in the minecraft blockstates before, but it appears to be called craftingtable.....

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.