Everything posted by Draco18s
-
How to know what side a block was broke from?
While true, it is not 100% accurate, as the player may still mine the sides of the block from this position. Or the top, from a less inclined angle.
-
How to know what side a block was broke from?
Which has its value overwritten by the if statement. Imagine looking down and mining the side of a block. Your code there days the top was mined. Anyway, you actually might want to look at World#doRaytrace() and EntityPlayer#lookVec()
-
Get all Blocks from a tree when player hits a log
Not really, no. My algorithm is the closest I came. It does very well even in the roofed forest, though it can occasionally trim the tops of a neighboring tree.
-
[UNSOLVED][1.7.10]Custom TileEntityRenderer, doesn't have any Light Opacity.
God damn function names not matching what they mean.
-
[UNSOLVED][1.7.10]Custom TileEntityRenderer, doesn't have any Light Opacity.
Cough, return false, cough.
-
Get all Blocks from a tree when player hits a log
Extend my method such that you have a log version (recurses itself and calls the leaf version) and a leaf version (recurses only itself).
-
[1.8] HELP: Block with timer
You need a TileEntity for this. Setting up a block to have a TileEntity is very easy. Once you have a TileEntity you override onUpdate and voila, that method gets called every tick.
-
How to know what side a block was broke from?
Question: What is your goal? By which I mean: what are you going to do with that information?
-
[1.7.10] My Custom GUI is crashing the server
And player.openGui(...)
-
[1.8] Pickaxe Help [SOLVED?]
If you hover over the red squiggly line it will tell you the problem.
-
16+ block metadata
I would separate out into as many blocks as make sense, depending on what your divisions are, rather than arbitrarily saying "these 16 on this block and these four on the other because there were too many."
-
Get all Blocks from a tree when player hits a log
I wrote an algorithm once. It was recursive and likely not the best, but it worked. Kill current block and every log above this one. Then recurse for every adjacent log next to this one, if the block above is air, also recurse for its neighbors.
-
Item/Blocks Meta subtypes
Ore-type-by meta isn't really worth doing unless you have a good reason. If your set on it, try and group things intelligently (eg by harvest level) just to make the coding easy (rather than having to do lookups by meta).
-
How to throw an exception that displays a helpful message to the player
If its a required mod missing, you can throw a CustomModLoadingErrorDisplayException instead. I did this myself, as I needed to detect a version of a mod that didn't report its version number to Forge. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hardlib/client/ClientProxy.java#L22-L24 (Edit: misread, you were comparing, however this might still be useful information for others)
-
[1.7.10]Item save format?
You need a bit more than just the CompressedStreamTools IIRC, but that's a good chunk of it. Its been a while since I did NBT file work (I was rendering camera views, sending them to the server for saving, and retransmitting for viewing, ), but I think the CST won't do the file IO, you'll have to handle that yourself.
-
Don't know how to convert <BlockModel> back into data.
You don't have a state -> metadata function override. I don't remember what it's called.
-
Make texture on load [1.8.9]
This might be overkill, but here's a TextureAtlasSprite class I use to smash two textures together (and allows for colorization as well). You should be able to make use of it for your ore blocks at least. Colorization is a hue alteration on the HSV spectrum (retains the desired grayscale contrast better). https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hardlib/client/TextureAtlasDynamic.java Do be aware that any loading problems don't have their errors handled nicely. Vanilla's TextureAtlasSprite class will go "I couldn't find resource x:y" this class will just vomit a stack trace.
-
[1.7.10] Rendering a texture overlay on a block
And ta da, I remembered to come back and post the code I use. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hardlib/client/TextureAtlasDynamic.java
-
[1.8.9] [SOLVED] Mob entity's id?
Also is it really that difficult to manually assign an entity ID value? You have to edit every one of those other parameters...
-
[1.8.9] [SOLVED] Mob entity's id?
Show your code
-
[SOLVED] [1.8] Custom items breaking blocks
I was unable to find that method in Item, could you give me more information about it? Per coolAlias, it probably won't help you anyway. Problem is I forget the exact name, its like shouldItemStackRefresh or something along those lines. Search the Item class for "refresh" and you'll find it. Its used to make the game realize that minor changes to an equipped item should or should not be treated as switching inventory slots (the animation and stuff).
-
What happened...?
It kind of depends. In the case of crash logs the spoiler is more important due to size (it is readable either way).
-
[1.7.10] Rendering a texture overlay on a block
I am currently mobile, so it is difficult for me to locate my previous posts. If you find them, though, I posted a class that takes in two icon reference strings (same as the iiconregister) and combines them into a single texture.
-
[SOLVED] [1.8] Custom items breaking blocks
You need to overrode the shouldRefresh() method (or similar, I don't know it's exact name).
-
What happened...?
1) learn how to read stack traces 2) learn how to Google "bbcode spoiler"
IPS spam blocked by CleanTalk.