Everything posted by Draco18s
-
[1.11] How can I rotate a model in-code?
You mean animate?
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Then why does said non-existent instance need to know? Probably.
-
API for custom mob interaction with chest or any item/tile.
Entity AI tasks have access to the Entity they're acting on. Entities have a World object and a Position. World object + Position -> Get block, tile entity, and capabilities.
-
[UNSOLVED][1.10.2]Need help with TESR and tileentity item
Your TE class shouldn't even be instanced for inventory render.
-
Block#getDrops
There should never be any reason (that I know of) for a ChunkCache to be passed to that method.
-
Loading textures, models, and translations on the fly....
What did you expect this to do?
-
Block#getDrops
You probably can't, then. What are you trying to do?
-
Block#getDrops
1) Not in vanilla and not in most mods. 2) Always do an instanceof check before casting. 3) There is no other way than the IBlockAccess passed to the method.
-
[1.10] Draw lines in GUI like in thaumcraft
They're either bezier curves or splines. You'd likely have to write the math for them yourself
-
[1.8.9] Multi-Block Structures
...Only override it if your block has a tile entity. Overriding to return false/null is stupid because Block already does that.
-
The use of proxies
That said, I personally prefer the "ClientProxy extends CommonProxy" (where Common == Server, just all the methods are blank) setup over the IProxy method (where I'd still need a server side implementation to avoid NPE, where all the methods are, again, blank). The thing that I really hate is the Main Mod hands off the init event to the Proxy which then hands off the init event to ModBlocks and everything is done there (and the event object goes untouched). Like, seriously, WHY DID YOU BOTHER PASSING IT ALONG.
-
[1.11.2] Adjusting item stackability
Get a rubber duck.
-
GetBoundingBox from TileEntity State
What Choonster said.
-
[1.8.9] Multi-Block Structures
You don't need a TE, ITickable, or even a custom block. You just need to check on block placement if there's a valid structure. For vanilla blocks, you'll need to use events. For your own blocks you can use Block#onPlacedByPlayer (If I remember the method name correctly).
-
[1.11.2] Adjusting item stackability
if the stack size is greater than one, split off the extra, shove them into the player's inventory, then open the gui.
-
[1.11] Get neighbor block from EnumFacing
Something like that. I was tired.
-
GetBoundingBox from TileEntity State
How about you check for null instead? Try...catch is actually pretty CPU intensive.
-
[1.8.9] Multi-Block Structures
ITileEntityProvider is the Mojang way. Forge patches things so that it's not needed and uses the newer, better, IBlockState parameter rather than the old metadata parameter. So yes, not using BlockContainer is better in all the ways. Don't use it.
-
Block with blockstates don't render as item models
Having to repeatedly ask everybody the same stupid question is why I don't have any patience. There's a reason the "Frequently Asked Questions" thread is actually called the "Excessively Asked Questions" thread. Asking "I overrode the method, but didn't put anything in it, nothing changed" is pretty freaking dumb. Of course nothing changed, the default behavior is an empty method. Right click -> Find all references.
-
[1.8.9] Multi-Block Structures
Everything. It's based on an interface that isn't needed, overrides several methods that you have to override again to get back the (desired) default behavior...
-
Block with blockstates don't render as item models
More like the basics of Java. Method overriding isn't that hard, looking at examples in vanilla isn't that hard either, and intuiting what the method should do based on the parameter names, return type, and javadoc isn't super complicated.
-
Block with blockstates don't render as item models
Seriously, what? https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/item/ItemRawOre.java#L52 Fuck. Yes you are. You have Minecraft.getMinecraft() in your ModBlocks class and it's not marked Side Only: Client. Your ModBlocks class is common code. Therefor you have client-only code in a common location. THIS WILL CRASH THE DEDICATED SERVER. Don't believe me? Hit the little ▼ next to the Run button and click "Server"
-
[1.11] Get neighbor block from EnumFacing
EnumFacing#offset
-
[1.8.9] Multi-Block Structures
WRONG SIR. All you need to do is override the hasTileEntity and getTileEntity methods in the Block class. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/block/BlockMillstone.java#L36 https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/block/BlockMillstone.java#L63-L71
-
Block with blockstates don't render as item models
So, a couple things. 1) You can't register the renderer in common code. 2) If a subtype isn't showing up in the creative menu, that's because you haven't overriden getSubItemsin your Item class.
IPS spam blocked by CleanTalk.