Everything posted by Draco18s
-
How can I make my own hunger-style bar?
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.
-
Custom Tile Entity Renderer Issue
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(...);
-
Running and making commands in code.
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.
-
MODDING ENERGY/DATA TRANSFER
Buildcraft would be a better source than I. I haven't messed with energy systems at all.
-
Spawning Custom Mobs at Night (or whenever)
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).
-
MODDING ENERGY/DATA TRANSFER
Take a look at Buildcraft's code on GitHub, it might give you a starting point.
-
How to make a new experience bar
Two draw calls: gui.drawTexturedModalRect(122, 209, 0, 0, full_width, h); gui.drawTexturedModalRect(122, 209, 0, h, width_of_partial_fill, h);
-
How to make a number increment by 1 at the same speed the player heals at
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); ...
-
How do I get an infinite repair item?
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
-
How to make a number increment by 1 at the same speed the player heals at
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
-
How to make a new experience bar
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)
-
[1.5.1] Rendering Thrown Entities
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).
-
Lighting Types and Inventory Rendering
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.
-
[1.5.1] Rendering Thrown Entities
Sweet, that worked (after I added a constructor that took only a world as a parameter). Thanks!
-
[1.5.1] Rendering Thrown Entities
If you could look that up, that'd be great.
-
[1.5.1] Rendering Thrown Entities
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?
-
[1.5.2]Configuration Files
Because getItem is for items! D:
-
[1.5.2]Configuration Files
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)
-
[1.5.2]Configuration Files
Because every time it loads the ID it increases it by 256.
-
[1.5.2]Configuration Files
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?
-
[1.5.2]Configuration Files
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?
-
[Solved] Last Metadata Block Resorts to First
Metadata is a byte. Bytes are 4 bits. 4 bits gives 16 variations. You're going to need tile entities.
-
Drawing a new bar.
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).
-
Drawing a new bar.
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.
-
Infinite potion effect?
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.
IPS spam blocked by CleanTalk.