-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Which instructions did you follow? The ones on the Minecraft wiki, or the ones that came with the Minecraft Forge source download?
-
[SOLVED] Throwable Entity drops twice randomly...
Draco18s replied to Bedrock_Miner's topic in Modder Support
Look at the arrow entity class. -
MORE ADVANCED TRICKIER QUESTION ASK: What if I want to limit these mob spawns to additional dimensions and only additional dimensions (i.e. not vanilla) and not during the night (i.e. I don't care about light level)? Conditions: 1) Arbitrary light level: daytime spawning should be valid--night may never actually occur, day may never actually occur, but mobs should still spawn. 2) Specific dimensions of unknown dimension ID: which dimensions are not known at mod registration time because the dimensions don't exist yet. 3) If the player leaves a valid dimension and enters a non-valid dimension, mob spawning should be disabled (and vice versa).1 4) Biome is irrelevant (some modifiers yes--such as mob A not spawning where it is cold, mob B not spawning where it is hot, etc.2--but not "oh mob B only spawns in Jungles" like ocelots). Example: Spawn the mob when "Jungles in Dimension with Non-Vanilla Property Y." Not "Jungles" nor "Dimension N." 1Through another mod's API I have a class that has two functions--onChunkPopulate and tick--that get called for each chunk in a valid dimension (the first one being chunk creation the second being chunk update) and access to a few events for when the player changes dimension via this mod's methods,3 though I am unsure if I can determine from the world object if it is a valid spawning dimension or not: I do not appear to have access to the custom WorldSavedData class that would hold those properties. At the moment I am using this class to manually spawn mobs by checking each chunk as it ticks for existing mobs and distance from the nearest player, although this is imperfect. 2Due to additional biome mods, like Biomes o' Plenty, I want my mob to spawn even in those biomes. I know there's a BiomeEvent...event and I could catch and store the additional IDs based on various parameters that I chose, but that's not the issue. It's figuring out when and where to register the spawning and then invalidate it! 3And there are other mods that permit dimensional travel that I do not (necessarily) have access to! IC2's teleporter, vanilla nether portal, end portal, twilight forest portal...
-
Awesome, thanks! And yeah, there's a function in the entity class that says how many can spawn per chunk. Couldn't figure out how it was used (because I was lacking the EntityRegistry part) but I did at least alter the numbers to what I'd like.
-
You can't. There's a reason why they're called Axis Aligned bounding boxes.
-
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.
-
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(...);
-
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.
-
Buildcraft would be a better source than I. I haven't messed with energy systems at all.
-
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).
-
Take a look at Buildcraft's code on GitHub, it might give you a starting point.
-
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
Draco18s replied to Mew's topic in Modder Support
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); ... -
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
Draco18s replied to Mew's topic in Modder Support
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 -
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)
-
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).
-
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.
-
Sweet, that worked (after I added a constructor that took only a world as a parameter). Thanks!
-
If you could look that up, that'd be great.
-
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?
-
Because getItem is for items! D:
-
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)
-
Because every time it loads the ID it increases it by 256.
-
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?