Help with Registering a Foliage Placer Type #2428
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The constructor of Option 1 is creating a public Mixin invoker for the Option 2 is using Fabric's access wideners to change the access modifier of the constructor.
This is fine as long as you have prior programming experience. Otherwise it's better to learn Java first, Minecraft modding is a difficult learning environment. |
Beta Was this translation helpful? Give feedback.
The constructor of
FoliagerPlacerType
is private, making it inaccessible to any code outside ofFoliagerPlacerType.java
.There are 2 ways to get around this. Both are Fabric or Minecraft specific, so it's unsurprising you couldn't find them, search engines don't give great results for Minecraft modding.
Option 1 is creating a public Mixin invoker for the
FoliagerPlacerType
constructor.https://fabricmc.net/wiki/tutorial:mixin_accessors
https://jenkins.liteloader.com/view/Other/job/Mixin/javadoc/org/spongepowered/asm/mixin/gen/Invoker.html
Option 2 is using Fabric's access wideners to change the access modifier of the constructor.
https://www.fabricmc.net/wiki/tutorial:accesswideners