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

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Best I can offer is the code I made when I added my own bar. I think it was this thread. If it wasn't I linked to it in this thread. And all my code is on github, because I'm awesome like that, even if it took me a few days to figure out how to use it (and towards the end of my development cycle*). As far as I know, there's no way to disable the vanilla bars outside of base class editing. I am not aware of any kind of render order controls, but if you find some, let me know! My bar renders on top of the chat, which is annoying (there's 2 pixels of coverage on the last line). *I wanted to archive the project when I was done, rather than keep a version history.
  2. Try this: ISimpleBlockRenderingHandler handle = new TileEntityFirePitRenderer(); int rT = RenderingRegistry.getNextAvailableRenderId(); BlockFirepit.renderType = rT; //set the block's render ID to the ID we're going to use RenderingRegistry.registerBlockHandler(rT, handle); Instead of ClientRegistry.bindTileEntitySpecialRenderer(...);
  3. 1) No one understands what you're asking about 2) Don't bump your post when it's still as new as it is. The forums are highly inactive right now because the site keeps going down.
  4. Buildcraft would be a better source than I. I haven't messed with energy systems at all.
  5. How would I go about registering a mob to be spawned under certain conditions (typically at night, but for the mob I have in mind, I probably want them to spawn during the day)? Right now I have them showing up on chunk generation (because that I know where it occurs) but I'm not sure how to go about spawning mobs over time and maintaining a reasonable count (given that individually my mob is fairly tough, spawning one in a chunk that already has one--or in an adjacent chunk--might be a little unfair on the player).
  6. Take a look at Buildcraft's code on GitHub, it might give you a starting point.
  7. Two draw calls: gui.drawTexturedModalRect(122, 209, 0, 0, full_width, h); gui.drawTexturedModalRect(122, 209, 0, h, width_of_partial_fill, h);
  8. Sorry, with the forums as upity as they've been lately I've been more focused on short answers. In any case, same process, but you're looking at using delays of 80 ticks. Edit: I mean in the entity update handler: public void EntityUpdate(LivingEvent event){ EntityLiving ent = event.entityLiving; NBTTagCompound nbt = ent.getEntityData(); int mana = nbt.getInteger("Mana"); int maxmana = nbt.getInteger("MaxMana"); if(mana < maxmana) { int timer = nbt.getInteger("ManaTimer"); timer++; if (timer > 80) { mana++; } nbt.setInteger("Mana",mana); ...
  9. DivineRPG overrides the tool action function, which is what causes damage to the item, and has it not do that. As for infinitely repairing other (vanilla) tools at the anvil: Not without base-class-editing the anvil
  10. I believe its possible to pull back the player's food level (public property or method of the EntityPlayer class). From there it's a matter of following a similar set of instructions I've posted/trying to post/will post in this thread: http://www.minecraftforge.net/forum/index.php/board,73.0.html
  11. Having built my own HP bar recently, you'll need a few things. 1) empty bar 2) full bar (you can use the same png and sprite-sheet it) 3) Event Handler 4) Packet Handler 5) Gui script Your event handler you can register like any other, but the event you'll be interested in is the public void EntityUpdate(LivingEvent event){ } Check for if(event.entityLiving instanceof EntityPlayer) and store your data in the player NBT. There are two ways to go about it, I use ent.getEntityData() but there's also IExtendedProperties. When the value changes, send a new packet to the player, packet handler intercepts, passes the value to the gui script, the gui script then does the drawing: GuiIngame gui = this.mc.ingameGUI; GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.mc.renderEngine.getTexture("/mods/DecayingWorld/textures/gui/gui.png")); //I stored my texture along with my other textures int u = [current exp] / [max exp]; //remember to use floating point division and finish with an integer gui.drawTexturedModalRect(122, 209, 0, 0, w, h); //w here is the width we need from the empty bar, in pixels, h is the height gui.drawTexturedModalRect(122, 209, 0, h, u, h); //u here is the width from the full bar //122, 209 are approximate locations of the exp bar at the default window size. I haven't done any gui scaling yet //0,0 and 0,h assume the upper left corner of your png and height of your bar (full stacked under the empty one with 0 pixel spacing)
  12. The entity is simple, just copy the EntitySnowball, there's really nothing special about it. You just have to make the item spawn it (see ItemSnowball) and register it correctly (see this thread).
  13. 1) Yes. Write your own lighting engine. (Never said it would be an easy job!) 2) Not that I'm aware of, outside figuring out how to write your own renderer for inventory blocks.
  14. Sweet, that worked (after I added a constructor that took only a world as a parameter). Thanks!
  15. If you could look that up, that'd be great.
  16. I've got these lines in my main mod class RenderingRegistry.registerEntityRenderingHandler(EntitySolidifier.class, new RenderSolidifier(solidifier)); RenderingRegistry.registerEntityRenderingHandler(EntityLifeBomb.class, new RenderLifebomb(lifebomb)); And I've got render classes (they're both the same, really): Nothing renders. I've even tried using the vanilla snowball renderer (which would work for my item). What gives? What am I missing?
  17. Because getItem is for items! D:
  18. So it saves 778, then it loads, adds 256... (Although I do admit that it shouldn't be doing that, but that would give the observed behavior. All of your blocks which are using getBlock are fine, but all of your blocks using getItem are not)
  19. Because every time it loads the ID it increases it by 256.
  20. No, thats an actual block mate I am pretty sure that if he calls the variable "WhiteBlockID" and the little notation that goes next to the id in the config is "snow_block". Yes. Now what FUNCTION is being called?
  21. I know what the problem is. WhiteBlockID = config.getItem(config.CATEGORY_BLOCK, "snow_block", 702).getInt(); This is one of the lines causing the issue. This item is a BLOCK item, what kind of ID are you requesting from config?
  22. Metadata is a byte. Bytes are 4 bits. 4 bits gives 16 variations. You're going to need tile entities.
  23. You certainly can! I just don't have an example of it, because it requires a newer Forge than I can work with. (Specifically because my mod is a plugin to another mod which doesn't work past 664).
  24. Having recently done this... *Digs out code* I actually added in an additional HP bar to act as "overflow healing" from a particular source (potions don't touch it, at least not without base class edits) Here's the main bulk of what you need: 1) A ITickHandler 2) PacketHandler 3) EventHandler 4) Registering it all And the result: I overlayed mine on top of the exp bar because: a) I didn't want it above the armor bar b) Covering a portion of the exp bar was not critical (there are still a few pixels visible for that section). The only problem is that it renders on top of the chat. :\ Also, it goes away if another gui screen (chest, inventory, etc.) is open, but that's not a big deal.
  25. It might be because the duration is stored as an integer, and 27:20ish is right around the signed integer max value (32767). A negative duration is likely interpreted as being infinite.

Important Information

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

Account

Navigation

Search

Search

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.