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 am looking into making some large multiblock machines and storage, like say many of the machines and the iron tank from Railcraft.

 

My idea is to have one main TileEntity that deals with all the logic, and I can make code when a block is placed or destroyed to see if the structure is complete. For smaller structures I could also encode the blocks relative position in the meta data (so can get the centre block / main TileEntity quickly without having to do a search). For larger structures I am not entirely sure.

 

The problem though is in order for things like hoppers, Buildcraft pipes, etc. to work, I need a fully functional IInventory etc. TileEntity for each of the blocks that these things need to interact with. I can make the "proxy" TileEntity reference the main one, but what do I do if it is a chunk border and the main entity isn't loaded?

 

I looked at TileEntityChest, but from what I can tell it relies on other entities like the hopper giving it special treatment.

 

Also while the examples I can think of are from closed source mods, is there a standard way to do this? Perhaps an open source example?

Hi

 

An idea - you could perhaps store the information in custom objects that your code maintains separate from the vanilla.  Your TileEntities would be used like references to the object, so that your code loads the object whenever one of the TileEntities needs it, and when the player has moved away and there are no more of those TileEntities loaded, you unload the Object.

 

There are a couple of places you can store your own objects to make them persistent - world.perWorldStorage in particular, used by vanilla for villages, but can be hijacked for your own purposes relatively easily.

 

-TGG

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.