Everything posted by Draco18s
-
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"
-
[1.7.10] Rendering a texture overlay on a block
You likely will want a custom TextureAtlasSprite class with a custom load method. I've posted about them here a couple of times.
-
[1.8.8] How to make the player's hunger drain faster?
See: http://minecraft.gamepedia.com/Hunger#Mechanics
-
[1.8] Save NBT-Tags for Item
NBTdata is easy. However, you are using a gui which means that the data you are setting is on the client which means you need packets.
-
Where is the time the last tick took, avg tick took etc.?
Its not 50,000 nanos. It's 50,000,000. Mili, micro, nano. https://en.wikipedia.org/wiki/Nanosecond
-
Looking for tutorial on "version": "${version}"
I handle multiple sub-projects (core library + child mods) so here's how I've handled things. It's litterally all in my gradle file, does a bit more than what you want, but here it is: def releaseVersion = "12" def majorVersion = "20" def minorVersion = "0" //bugpatch or testing versions def libVersion = "a" def oresVersion = "c" def hazardsVersion = "a" def wildlifeVersion = "a" def industryVersion = "b" def prePend = "1.7.10-" def packageVersion = releaseVersion+"."+majorVersion+"."+minorVersion+libVersion+oresVersion+hazardsVersion+wildlifeVersion+industryVersion libVersion = releaseVersion+"."+majorVersion+"."+minorVersion+libVersion oresVersion = releaseVersion+"."+majorVersion+"."+minorVersion+oresVersion hazardsVersion = releaseVersion+"."+majorVersion+"."+minorVersion+hazardsVersion wildlifeVersion = releaseVersion+"."+majorVersion+"."+minorVersion+wildlifeVersion industryVersion = releaseVersion+"."+majorVersion+"."+minorVersion+industryVersion version = "" group= "com.draco18s.harderores" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "1.7.10-HardStuff"+packageVersion minecraft { version = "1.7.10-10.13.2.1291" runDir = "eclipse" assetDir = "eclipse/assets" replace "{@version:lib}":libVersion,"{@version:ore}":oresVersion,"{@version:haz}":hazardsVersion,"{@version:wld}":wildlifeVersion,"{@version:ind}":industryVersion,"required-after:HardLib""required-after:HardLib@["+releaseVersion+"."+majorVersion+",]"),"/*{uncomment}":"","{uncomment}*/":"" } The "replace" directive looks for each "search" string and replaces it with the string specified after the : So"{@version:lib}":libVersion means "find '{@version:lib}' and replace it with (the value stored in the variable) libVersion. Each is comma separated. I've got a few extras that just version numbers, for instance, I have a "require-after" marker that inserts the core library version number required (which only uses the "a.b" portion of the "a.b.cx" version number) as well as chunks of code that I literally cannot run in dev (Intellisense says its OK, but the linked jars don't actually work in a deobf environment) so they're just commented out with a {uncomment} marker to enable them during the build process. (If anyone cares, it was for Reika's API, which I actually don't use any more because he can't be arsed to make his API backwards compatible when he updates it and the bug reports come to me because it crashes with a "MethodNotFoundException").
IPS spam blocked by CleanTalk.