willhew Posted July 28, 2013 Posted July 28, 2013 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 Quote
tehbeard Posted July 28, 2013 Posted July 28, 2013 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. Quote
willhew Posted July 29, 2013 Author Posted July 29, 2013 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 Quote
Mew Posted July 29, 2013 Posted July 29, 2013 On 7/29/2013 at 5:34 AM, willhew said: 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 Quote 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
willhew Posted July 29, 2013 Author Posted July 29, 2013 Thanks for that Now I may finally get this done and move onto my next project Quote
MineMaarten Posted July 30, 2013 Posted July 30, 2013 On 7/29/2013 at 5:54 AM, Mew said: 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()). 1 Quote Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.
Recommended Posts
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.