Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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). 

 

 

 

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.