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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • @Tsuk1 Also, new note, you can use blockbench to make the custom item model for when it is not on the head.   EDIT: Funny story, I am making a mod similar to yours! Mine is called NorseMC.
    • @Nood_dev Could you send a screenshot of your weapon code? Here is the one I made (for a dagger): The specific UUID does not matter, just that it is the same every time, which is why UUID#randomUUID does not work public class DaggerItem extends TieredItem implements Vanishable { protected static final double REACH_MODIFIER = -1.5D; protected final Multimap<Attribute, AttributeModifier> defaultModifiers; protected final UUID BASE_ATTACK_REACH_UUID = UUID.fromString("6fe75b5c-9d1b-4e83-9eea-a1d5a94e8dd5") public DaggerItem(Tier pTier, int pAttackDamageModifier, float pAttackSpeedModifier, Properties pProperties) { super(pTier, pAttackDamageModifier, pAttackSpeedModifier, pProperties); this.attackDamage = (float) pAttackDamageModifier + pTier.getAttackDamageBonus(); ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder(); builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", this.attackDamage, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", pAttackSpeedModifier, AttributeModifier.Operation.ADDITION)); // THE ONE YOU WANT: builder.put(ForgeMod.ENTITY_REACH.get(), new AttributeModifier(BASE_ATTACK_REACH_UUID, "Weapon modifier", REACH_MODIFIER, AttributeModifier.Operation.ADDITION)); this.defaultModifiers = builder.build(); } @Override public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot pEquipmentSlot) { return pEquipmentSlot == EquipmentSlot.MAINHAND ? this.defaultModifiers : super.getDefaultAttributeModifiers(pEquipmentSlot); } }
    • https://images.app.goo.gl/1PxFKdxByTgkxvSu6
    • That's what we'll try out. I could never figure out how to recreate the crash, so I'll just have to wait and see.
    • Ok, I updated to the latest version and now the models are visible, the problem now is that the glowing eyes are not rendered nor any texture I render there when using shaders, even using the default Minecraft eyes RenderType, I use entityTranslucent and entityCutout, but it still won't render. Something I noticed when using shaders is that a texture, instead of appearing at the world position, would appear somewhere on the screen, following a curved path, it was strange, I haven't been able to reproduce it again. I thought it could be that since I render the texture in the AFTER ENTITIES stage which is posted after the batches used for entity rendering are finished, maybe that was the reason why the render types were not being drawn correctly, so I tried injecting code before finishing the batches but it still didn't work, plus the model was invisible when using shaders, there was a bug where if I look at the model from above it is visible but if I look at it from below it is invisible. So in summary, models are now visible but glowing eyes and textures are not rendered, that hasn't changed.
  • Topics

×
×
  • Create New...

Important Information

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