Jump to content

Recommended Posts

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

Posted

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.

 

Posted

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

Posted

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

Posted

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

  • Like 1

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

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