Everything posted by Draco18s
-
updateTick() for Blocks is Being Slow
Blocks do not update every tick. That's not how that function works. tickRate() does fuckall unless you call it yourself.
-
[SOLVED] Recipe Book not showing correctly custom recipes
IRecipe implementations do not show in the recipe book, json recipe assets do.
-
[1.12] don't use json files for textures
That was the point of my post.
-
[1.12.2] Question why placing block triggers like 50 chunk updates
Two ways: 1) lower the light brights (ie 12 instead of 15) 2) move the light block less often (eg when the player moves 4 blocks away from it)
-
Intercepting WorldServer.addWeatherEffect Argument
@diesieben07 Ran into this article recently about exceptions. May be worth linking to in the common problems list.
-
Missing items.
-
[1.12] don't use json files for textures
Forge states are good for things like Fences, which have 4 different on-off properties. Vanilla format has to list out each one (so, 16 entries) whereas with Forge you can list out 4 and Forge will do the heavy lifting. For example, this block I have: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/expindustry/blockstates/machine_foundry.json#L18-L33 With a vanilla state file I'd have to list out all 8 combinations manually: north {rotation}, lit {submodel} north {rotation}, unlit east {rotation}, lit {submodel} east {rotation}, unlit west {rotation}, lit {submodel} west {rotation}, unlit south {rotation}, lit {submodel} south {rotation}, unlit Look at how many times the {submodel} had to be retyped! And each rotation had to be specified twice as well.
-
Missing items.
1) Items starts with a capital letter. 2) You need to import net.minecraft.init.Items before you can use it. 3) The blocks' and items' fields are named in ALL CAPS.
-
Block texture not showing up
ItemBase (and BlockBase) are an antipattern. https://github.com/tamirco2003/temporary-modding/blob/master/java/my/ghost20000/first/item/ItemBase.java Do this like the block tutorial does: this.setUnlocalizedName(this.getRegistryName()) Ditto here.
-
[SOLVED] how to check the block ID's for all adjacent blocks
Every block paramter is passed a World object and a BlockPos position argument (or three ints, x, y, and z). Get the neighbors and check their blockstate against the current one. And if you're on a version that passes x,y, and z, update. Because BlockIDs are not a thing you should touch.
-
[SOLVED] [1.12.2] Metadata blocks in inventory
MARBLE.getRegistryName() + "_black", "black")); You're telling it to look for a different file every time. Drop that "_color" bit. Also, read your logs.
-
[1.12] What is @ObjectHolder?
Don't assign to a field that is marked with @ObjectHolder.
-
[1.12] Giving player items / checking for item in world
Because you can't control when it executes and Forge may not have done all the things it needs to for the Registries, so your item is missing a key bit of information and won't register correctly.
-
[1.12] Giving player items / checking for item in world
Someone's been watching Sword Art Online season 3. ?
-
[1.12.2] [Gradle] exclude files and folder from build
Its specific to my project setup. I have multiple mods in the same workspace (they all work together, so there's no reason to run them separately except to make sure that they can) so the excludes build out 4 different jar files.
-
Help Damaging Items during crafting
Those are methods provided by the Item class. Override the ones that supply an ItemStack parameter. Damage that stack and return it.
-
Help Damaging Items during crafting
hasContainerItem and getContainerItem
-
Can someone explain how/when chunk unloading occurs?
Yes, they "pause" because the chunk they are in ceases to exist (and thus, so do they). All* data is serialized and when the chunk loads again that data is deserialized and everything ends up in the same state that it was left in.* *Note: Not literally all data is serialized, eg. pathing information is not and is instead recomputed when needed again.
-
onItemUse doesn't do anything
Code Style Issue #3 You have an @Override annotation. If it was wrong, your IDE would be giving you an error. You're still doing this:
-
[1.12.2] [Gradle] exclude files and folder from build
You can also exclude multiple locations or include something as well.
-
My item texture is not loading!!
Read this:
-
[1.12.2] Missing Texture or didn't display
No, a static initializer is when you call new in a place that is static. Like this: public static final Item RED_COAL = new ItemBase("redCoal").creativeTab(CreativeTabs.MATERIALS);
-
[1.12.2] Missing Texture or didn't display
Why are you registering models in the Register<Items> event? There's a ModelRegistryEvent for a reason
-
[1.12.2] Tile entity surroundings
And your problem is..? What you're already doing is correct.
-
[1.12] Block does not load correctly from tile entity on world load.
Try calling super inside onDataPacket. Only thing I can see that might be related. You do have some other code style issues, though. Such as this entire class: https://github.com/AngheloAlf/MC_ALF_Logic_Gates/blob/bddec5d68621280db1f396e23da0f41506a74775/src/main/java/angheloalf/alf_logic_gates/blocks/base_blocks/AlfBaseBlock.java Inheritance for code reuse is an antipattern.
IPS spam blocked by CleanTalk.