Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. cpw.mods.fml.common.MissingModsException You're missing a mod. One of your installed mods has a parent mod that is not installed. Install it.
  2. To put it simply: Find the method involved, insert an INVOKE call to a class you control, and handle it there. For example, here is where I'm inserting a call inside EntityAnimal#func_146082_f and handling it here, so I can interrupt animals going into love mode only when the player feeds them (I have an AI task that causes it to happen at random intervals as well and I don't want to cancel those). The inserted call only fires off an event, which is handled elsewhere. ASM is a right pain and will likely drive you insane, but sometimes its the only way to do what you need. Oh, and this class may be helpful. shieldbug1 originally wrote it. I've modified it a bit to help figure out what stuff is and does; line 255 should be commented prior to releasing due to unintelligent detection of programmer errors (that is: if looking for an overloaded function, it will spit out output even if a valid method is located, but it did help me find typos). Note: repository is out of date and is not 100% functional, but should provide at least a baseline for good ASM.
  3. You should never need to call readFromNBT or writeToNBT yourself. Remember that a TileEntity has a block in the world, and if you know how to make a block change its light value, you do the same thing for TileEntities.
  4. My guess is that the BiomeGenBase island = ... code is running prior to the readFromNBT method.
  5. Item Frames aren't living entities (which is why they have no health) so you're kind of SOL.
  6. OK, fair; I've seen it in Unity3D. But the command actually spawns a thread and you can't call it from within certain functions (such as the update function) and will throw a compile error if you try. I used it a few times, but I've done my best to avoid it (can't recall an instance off-hand to remember why I needed it).
  7. Mystcraft has dimensions with multiple suns that can move anywhere from "so fast it strobes" to "half as fast as the overworld." Its possible to go slower, but not with the symbols that currently exist. So Mystcraft would be a good test case, though you'd have to ask XCompWiz if there's a way to get the duration of a "day" for his dimensions.
  8. Which only works in a multithreaded application, which most applications are not. That's what gets me.
  9. A TileEntity is still supplied by the block. You can set the TE's block's metadata and use that to change the lighting.
  10. Step 1) Find a way to store data about the player somewhere, probably on the player (left as an exercise to the reader) Step 2) If the player is not wearing the equipment, disable the capability of flying and save "I have turned flying off" to the data in step 1 Step 3) Next tick, if "I have turned flying off" is true, set it to false, if capability of flying is still false, turn off isFlying Step 4) Technically optional, save a "I attempted to disable flying" value in step 1 to true, and don't change it to false until your mod enables flying again (ignore checking if flying is not allowed while this value is flagged; it saves some CPU cycles) That way if another mod is allowing flight, your mod only disables the capability for 1 tick and doesn't make the player fall (which gives another mod the opportunity to turn the capability back on) and you don't constantly re-check.
  11. You could also call translate more than once. private String[] names={"color.black","color.white", /*...*/}; translate("wool.name") + translate(names [item.getItemDamage ()]);
  12. Why does everyone think that pausing an application is the same thing as a timer?
  13. Ah! This is easy then. Techne automatically gives names to each cuboid which is the variable names when it exports the model as a Java file. You can take the resulting code and modify it to only render those parts when conditions are true. I actually did this recently myself. https://github.com/Draco18s/HarderStuff/blob/master/main/java/com/draco18s/ores/client/ModelAxel.java#L143-145 The block actually uses two different models in total, but that's only because one position is radically different than the others (normally speaking it'd be a separate block, but as I'm not doing a full tech mod I left things abstract). Base look: http://binarymage.com/wiki/lib/exe/fetch.php?cache=&w=854&h=480&media=hardores:2014-11-28_16.20.15.png[/img] And the final look. You can see the result of line 144 towards the left (second, separate, model to the right): http://binarymage.com/wiki/lib/exe/fetch.php?cache=&w=854&h=480&media=hardores:2014-11-28_16.20.43.png[/img] The gearbox model ended up looking flimsy, it it was also a huge pain to try and fix, due to the rotations involved and I said "screw it."
  14. How are you creating the model in the first place? The answer is "yes" but in order to help I'd have to know what object type you're using.
  15. The renderer has access to the TileEntity, so store whatever data you need there.
  16. Well....you obviously know how to set the block metadata for a regular block and make the facing change. Now in your renderer you need to read that data and call GL11.gl_rotate(...)
  17. CUDDLE THOSE BRACES! *Shakes a fist* Then again, the place I had it happen had the semi-colon hiding next to the curly brace anyway. Took a while to find. ^..^; Fortunately I knew where the code was going wrong, so it made the problem easier to locate (specifically, I knew a loop was running forever because the content was never executing and if it did, even once, it was guaranteed to cause an exit condition).
×
×
  • Create New...

Important Information

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