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

Hello there,

 

I am on the Fossils and Archaeology Revival team, mainly doing generation. Currently I am trying to convert our current method of using Java written structures into .schematics, can anyone help with this? Like are their any open source examples? I have the NBT tags all set up but I haven't really done much work with .schematic importing. I'm not asking for all the code to be handed to me, just a few pointers to get me going  :)

 

willhew

Hi, actually kinda funny. I've been working on a mod to add .schematic support to forge called LibSchematic (github repo: https://github.com/tehbeard/LibSchematic)

 

Several things:

[*]Can load .schematic from jar/resource path (if you can get an InputStream to it, it'll load it

[*]Supports dynamic block ids (On the fly translation)

[*]~98% Certain it doesn't trigger block updates (might trip something already in world, never really tested)

[*]Mod block friendly, mods can provide a helper class for blocks to assist rotation and other actions.

 

  • Author

Ok, I may just stick with the way it currently is :), but aside from that, does anyone know how to generate items in chests inside our Java files? We have the java files and the chests spawn in there but I want to have items generating inside these chests, any thoughts?

 

Thanks,

 

Will

Ok, I may just stick with the way it currently is :), but aside from that, does anyone know how to generate items in chests inside our Java files? We have the java files and the chests spawn in there but I want to have items generating inside these chests, any thoughts?

 

Thanks,

 

Will

 

Fairly easy. When you generate the chest block, also make a new TileEntity. A TileEntityChest to be exact. Then using one of the methods in the class, add items to your generated chest. Oh, make sure the coords for the TileEntity are the EXACT SAME as the chest block. I think its something like:

tileEntityChestVariable.addItemStackToSlot(slotID, new ItemStack(Item.diamond, 1));

I think its something like that at least... Don't take my word for it

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

  • Author

Thanks for that  :) Now I may finally get this done and move onto my next project

When you generate the chest block, also make a new TileEntity.

Don't make a new TileEntity! When the chest block is generated, this already has generated the TileEntity. You'll need to retrieve the TileEntity (with world.getBlockTileEntity()).

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

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.