Everything posted by Draco18s
-
How to save a set of random variables on world creation?
My guess is that the BiomeGenBase island = ... code is running prior to the readFromNBT method.
-
[1.6.4] [SOLVED] How To Detect If Entity Is In Wal
world.getBlock(x, y, z).isOpaqueCube()
-
[1.7.10] Prevent item frame from death by projectile
Item Frames aren't living entities (which is why they have no health) so you're kind of SOL.
-
Timer
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).
-
[1.8] Modelling: moving a 1x1 square
Change the rotation point.
-
[1.7.10]Set Block and Item name based on metadata
Touche.
-
[1.7.10] Getting total day duration
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.
-
Timer
Which only works in a multithreaded application, which most applications are not. That's what gets me.
-
[1.7.10]Block update?
A TileEntity is still supplied by the block. You can set the TE's block's metadata and use that to change the lighting.
-
[1.8] Getting the players GameMode
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.
-
How to save a set of random variables on world creation?
worldSaveData
-
[1.7.10]Set Block and Item name based on metadata
You could also call translate more than once. private String[] names={"color.black","color.white", /*...*/}; translate("wool.name") + translate(names [item.getItemDamage ()]);
-
Generic solution to the 16 states per block problem
Mmm, code tags...
-
Timer
Why does everyone think that pausing an application is the same thing as a timer?
- Scattershot projectiles
-
Rotating a custom model.
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."
-
Rotating a custom model.
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.
-
Rotating a custom model.
The renderer has access to the TileEntity, so store whatever data you need there.
-
Rotating a custom model.
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(...)
-
[Solved][1.7.10]Why is this check for armor always returning true?
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).
-
[Solved][1.7.10]Why is this check for armor always returning true?
I agree and so does (at least one of) my friends.
-
[Solved][1.7.10]Why is this check for armor always returning true?
I see the typo i had a similar problem a few weeks ago.
-
[1.7.2]Custom Arrow
Tada. There was no way we could have figured that out from the code you posted. And now you know how to debug.
-
Using NBT in a KeyHandler
You shouldn't need to check sides. A packet handler is already sided and the client can't send a packet to itself (SSP exception, but its still threaded).
-
[1.7.10] Mob Drop Handling
5% -> Random(20) == 0. 5% * Looting -> Random(20) <= Looting Mathemagic
IPS spam blocked by CleanTalk.