Jump to content

Recommended Posts

Posted

Good evening,

 

I am very curious about this new thing called "Capabilitys" because I

have two questions I am asking myself all the time:

 

1.) When shall I use Capability, wehen Interfaces?

So my answer to myself is use Interface for Complex things e.g.

Chests and large Inventorys or Complex Machines. Capabilitys seem like

they are for Simple Machines and Simple Inventorys.

 

I know there are way more Capabalitys and I understand they primary

advance to Interfaces because of alle the casting.

 

2.)Is every TileEntity implementing Capabilitys or is it like a need Helper

for us Modders?

In that case I am thinking about things like conduits sending Power, Items

and Fluids. Who gurantees that a Capability is implemented and not an Interface.

 

Thanks in advance.

Pingubro

Posted

Here's the documentation on capabilities: http://mcforge.readthedocs.io/en/latest/datastorage/capabilities/. This explains capabilities, and how to use them.

 

1) You should be using capabilities if you want your mod to be able to work with other mods, e.g. have another mods pipes be able to extract and input items into your inventory. You can use interfaces if you are only gonna use it for your own mod, and no other mod has to use it to work with yours.

 

2) Forge has added capability support for the vanilla inventories, e.g. chests and furnaces. Ever modder should support capabilities. The main goal is, for inventories in this case, to say

TileEntity#hasCapability

on ANY

TileEntity

, and if it returns

true

, get it using

TileEntity#getCapabilit

and manipulate that inventory and let the

TileEntity

itself handle everything else.

 

Other people probably know how to explain it better, but this what my general idea of capabilities looks like.

  • Like 1

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.