Everything posted by Draco18s
-
[1.12.2] Update block after generated. [Closed]
I believe that OnBlockPlacedIntoWorld is called after its placed by worldgen.
-
Render Blocks
That's because world models are registered automatically. The block's registry name points to the blockstate file, the blockstate points to the model, everything's good. Items you have to register manually. Fortunately you're doing that with your ModelRegistryEvent. But there could still be any number of things going wrong. You have to read your log to find out what.
-
Crash
We still need the crash log. We don't know what's wrong. All you've told us is that "it crashed." Which is about as helpful as calling up your doctor and saying, "it hurts" and hanging up.
-
Render Blocks
The fek is this: https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/proxy/ClientProxy.java#L27 ForgeRegistries.BLOCKS.getKey(b)? You mean b.getRegistryName()? https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/gameObjs/ObjHandler.java#L23 Why the function? Is event.getRegistry().register(new ItemBlock(scorchedEarth).setRegistryName(scorchedEarth.getRegistryName)) insufficient somehow? https://github.com/Colton-Slayden/Solis/blob/master/src/main/java/com/royalreject/solis/gameObjs/ObjHandler.java#L18 Don't use static initializes.
-
How to handle shader exceptions for minecraft specific blocks
There is not enough information here. You have used the word "exception handling" without defining that term (because it means something very different to a programmer). However I can answer this: "Is there a way for a block to ignore the active shader?" No, no there is not.
-
My game Crashing after making an item
Caused by: java.lang.NullPointerException at net.minecraft.client.renderer.block.model.ModelResourceLocation.<init>(ModelResourceLocation.java:24) at com.DrVaristy.LeeMod.Proxy.ClientProxy.registerItemRenderer(ClientProxy.java:11) Something on line 11 of your client proxy is null. I can't tell you what because I'm not bloody psychic.
-
[1.12.2] Can't find IItemHandler isItemValid
Careful with ItemHandlerSubclasses that override insertion/extraction behavior. Sometimes you want your machine to be able to insert things and not external forces, such as the player or hoppers. If you use a subclass that prevents insertion categorically, you can't add items to it even when you want to. For such things I use a wrapper that I expose with GetCapability and have an internal regular handler that works as standard: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/api/internal/inventory/OutputItemStackHandler.java Note that all interaction is either passed to the internal wrapped handler or special logic is applied. This allows a machine to insert items into its own output slot, but nothing else can.
-
[1.12.2] Comparing ItemStack lists
So...invert the rest of your logic that deals with the field.
-
Missing block texture (should be something simple)
Yes that. That's what I meant.
-
Missing block texture (should be something simple)
...yes that's why they're different. GIF is a 256 color indexed pallet, pngs are loss-lessly compressed. It's why they're called image formats. It'd be like converting a txt file to a zip file and then complaining that you can't unzip it. Or a zip to a txt and getting gibberish and wondering why.
-
[1.12.2] Dynamic Recipes
Not directly. It was in the code I linked to, but my actual post never says anything about RecipeSorter. It might only be there as a holdover from before it was deprecated.
-
[1.12.2] Getting all Ingots from vanilla / other mods.
Closest I can think of is the ToolMold that I made. Eg. this recipe (and its siblings). The tool mold's subitems are determined based on the available recipes which I manually manage via an API hook, as item models need to be baked before recipes are ever loaded. But the code you created above could be placed into a function that creates the resulting item list, which then is referenced by both your item's getSubItems method and your ModelRegistryEvent method.
-
[SOLVED] Problem Registering Item Block Variants
Or don't. You don't have to do it. Its not a forum rule, just a thing some people do because they think its helpful.
-
[1.12.2] Dynamic Recipes
For example... https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/resources/assets/hardlib/recipes/_factories.json#L3 https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/resources/assets/expindustry/recipes/mold_bucket.json#L2
-
Help needed with coding magic spells, please help?
Start by looking at the vanilla fireball. Get that working. Figure out why it is the color it is (its probably a texture) and change it. Then look into particles. Light is going to be difficult as vanilla only calculates light from either the sky (infinite everywhere) or from blocks.
-
[1.12.2] Getting all Ingots from vanilla / other mods.
OreDictionary.getOres(name) will return all stacks with a given registered oredict name. OreDictionary.getOreNames() will return all registered oredict names. OreDictionary.getOreName(OreDictionary.getOreIDs(stack)[j]) will get the ore name(s) for a given item stack (note the array access).
-
[1.12.2] Getting all Ingots from vanilla / other mods.
OreDictionary
-
[SOLVED] Problem Registering Item Block Variants
Kill this with fire. You do not need this. All this interface does is make you implement the same code over and over and over again. ALL items need models. All of them. And none of the information necessary to register that model is private. Just loop through your block and item lists in your model registry event. Anyway, you haven't provided enough code to identify the problem.
-
Add capability to itemstack?
That won't work. The event is called when new is called, and when item stacks are new, they don't have a tag. Alright.
-
[1.12.2] Invert Explosion
when i is 0, it removes 0. [(0),1,2,3,4] when i is 1, it removes 2. [1,(2),3,4] when i is 2, it removes 4. [1,3,(4)] when i is 3, the loop terminates. [1,3].size() < 3
-
[1.12.2] Invert Explosion
The affected blocks list still contains the effected blocks, which will be broken unless you change that list. Just because you turned them into obsidian doesn't change the fact that which blocks will be affected has already been calculated.
-
How do I return based on the NBT tag of an item?
https://www.tutorialspoint.com/java/switch_statement_in_java.htm
-
Add capability to itemstack?
I want to be able to add a capability to an "existing" item stack. The reason not to apply this capability to all item stacks is because I'm going to be tracking a pretty hefty chunk of data and I don't want to attach that to everything, just the stacks that need it (applied via a machine), and narrowing by item type doesn't help much, as I'm going to want to apply this to a wide variety of item types. Is there a way to do this? If not, I may have to fall back to storing the data in its serialized format in the stack's NBT instead, which is not ideal, but workable.
-
[1.12.2] Make item replace itself
When should this happen?
-
[1.12.2] Item glint and durabilitybar prolem
It is. There is only one Item. You want per-stack data, you need to store the data in the stack (old: nbt, new: capabilities). You cheated, it broke, and no one is surprised.
IPS spam blocked by CleanTalk.