-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
The code: https://github.com/Draco18s/ReasonableRealism/tree/1.14.4/src/main/java/com/draco18s/harderores/loot/function The loot table: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/loot_tables/blocks/ore_hardiron.json#L27 Registering things: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L97-L99 (Note: I haven't worked on the code in some time and registration may have changed to be done as a registry object like blocks and items)
-
And functions as well. For example I have a block that uses a blockstate to store variants (its easier to deal with changing an integer value than change to a new block for the majority of harvesting cases), but needs to drop different items (due to item variants not really being a thing any more) when silk-touched (a less common harvesting situation), so I created a function that generates the correct item. Additionally, should you have an effect that would require the HarvestDropsEvent to modify loot in some way (e.g. an enchantment that causes skeletons to drop bonemeal instead of bones), check out the Global Loot Modifiers.
-
You'd need to change the criterion to deserialize a tag. Then: https://mcforge.readthedocs.io/en/1.13.x/utilities/tags/#using-tags-in-code Names might be a little different, but that's the general idea.
-
The right-click menu is great. Find references, open type hierarchy, navigate to definition and so on.
-
Good news! I've actually written this one already. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/advancement/BreakBlockTrigger.java#L31 In general, they're pretty straight forward though. Copy an existing one, change the trigger method to do whatever you want, including taking whatever params you want, and work backwards fixing errors. I think advancement criterions can be registered as any other registry item (haven't checked in a while), but if not, this might help: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L97 Oh, and you'll need this event handler too: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/HardLib.java#L57-L62
-
You don't need a custom recipe class if you're just using mod items. Custom recipe classes are for handling things in some non-standard way. Writing NBT data to the result, migrating itemstack damage, etc
-
Mind, this is old code and does some things in ways that aren't entirely recommended, but I did use the correct systems. Anyway, here's a custom recipe class: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/recipe/RecipeTagOutput.java#L31 And an example recipe file: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/recipes/ores/gold_dust.json (The recipe produces output based on a tag, grabbing the first item present in that tag) Registration: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/HardLib.java#L51 That stores it in an arry, which then uses the registry events as normal here: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L187 Don't do this yourself, the Forge systems have evolved and this isn't necessary. Its a left-over from when 1.7.10 -> 1.10 changed how things were registered and I didn't like how it wasn't so clean to register blocks and their item forms and wrote my own wrapper (so I could to things like this).
-
[1.15.2] how to use LivingKnockbackEvent with projectiles
Draco18s replied to squidlex's topic in Modder Support
This sounds like a damage source vs. true damage source problem. -
Here's a working example for a basic block: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/harderores/loot_tables/blocks/millstone.json Note that the "data" parameter you have is obsolete, blocks don't have metadata since The Flattening (1.13).
-
Recipe serializers for custom recipes need to be registered. This is true Show what you tried.
-
What have you done so far?
-
How can i rotate models around z axis in blockstates?
Draco18s replied to Drachenbauer's topic in Modder Support
...what font are you using...no, I don't want to know. That's your problem to deal with. Use a better font. -
How can i rotate models around z axis in blockstates?
Draco18s replied to Drachenbauer's topic in Modder Support
is not "y" -
https://github.com/MinecraftForge/MinecraftForge/pull/6401
-
Fair enough, but in general, Forge fires events and doesn't listen for them.
-
All of those fields cannot be used. Items are singletons. Problematic Code #9
-
Just because you fired the event doesn't mean Forge is listening. And Forge is never listening to its own events. Events are for mods to listen to and do what they want. (read: that's not how you set the eye height)
-
You can't do this.
-
How can i rotate models around z axis in blockstates?
Draco18s replied to Drachenbauer's topic in Modder Support
You don't. You use a combination of X rotation and Y rotation. -
[1.14/1.15] Replacing repair item of vanilla armor material?
Draco18s replied to Kfir40Forge's topic in Modder Support
Here's a correct @ObjectHolder annotation. https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L243 -
Obtaining recipes is handled by advancements.
- 1 reply
-
- 1
-
https://floating-point-gui.de/
-
[1.15.2] General Texture Atlases/Stitching Question
Draco18s replied to Ugdhar's topic in Modder Support
Non-power-of-2 textures don't work great in Minecraft. See this thread: