Jump to content

Understanding difference between TileEntity vs. Blocks for energy use


systemv

Recommended Posts

I'm not sure which level of question this is, so I'll post this and hopefully get re-directed accordingly.

 

In the Forge mod development model, if I want to code a thing that consumes energy (RF, MJ, etc..) and therefore is an energy sink does the model for the object describe the behavior of a TileEntity baseclass or a Block baseclass?

 

My instinct points towads TileEntity baseclass.

 

In my general object heirarchy, what I have is objects (derived from Block or TileEntity, not sure yet) that implement an  interface that is either an IEnergySink or IEnergySource.

 

I haven't come up with the right organization yet to isolate the implementation of adapting to whatever the energy system is prevalent already in the game.  I assume that through Reflection, the objects can discover which form(s) are present and then instantiate a member that implements the appropriate interface.  (This isn't a Java question, more of a "how energy sources integrate with generic objects).

 

I've tried searching for examples of code that may instruct the right paradigm to use.  I'm coming up empty (or overwhelmed by matches) and cannot tell which direction (Block or TileEntity) to go.

 

If you have some pointers or references, just PM me directly with your suggestions.

 

For moderation of the thread, if this is too basic, then feel free to clamp it off and re-direct me as you see fit.

 

Thanks.

 

EDIT:

 

First, thanks for your help in advance.  I will try to teach myself, but I just need to get my brain wrapped around this concept of TileEntities and their interface to the Forge model.

 

The context of this work/question is 1.7.2 Forge mod development.

 

So far this site: http://greyminecraftcoder.blogspot.com/  has been the most effective in explaining the differences, but I am still shy on the specifics about which callbacks to implement.  My gut feeling is that I'll need to hunt down the API's for say ThermalExpansion for example and figure out how to adapt to that energy system. 

 

In my design, I'm trying to put some physics reality into the objects that are either energy sources/sinks and basing the flow of energy according to the models described by HeatEngines (http://en.wikipedia.org/wiki/Heat_engine) , and HeatPumps(http://en.wikipedia.org/wiki/Heat_pump). 

 

 

 

 

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.