Posted November 17, 20214 yr I am trying to add a custom tree trunk decorator to my custom tree which would put blocks around the trunk of the tree like cocoa beans. Edited November 19, 20214 yr by the_lizard_king
November 18, 20214 yr Author I copied the cocoa placer but I'm not sure what to return here protected TreeDecoratorType<?> type() { return null; } I tried just TreeDecoratorType.COCOA but that didn't work
November 18, 20214 yr it's the TreeDecoratorType minecraft use it for Registry look how minecraft register/create them and copy the logic for your TrunkPlacer Edited November 18, 20214 yr by Luis_ST
November 18, 20214 yr Author I copied the TreeDecoratorType now it just crashes when I try to create a world with the message "Can not register to a locked registry. Modder should use Forge Register methods." here's my tree decorator type code public class ModTreeDecoratorType<P extends TreeDecorator> extends ForgeRegistryEntry<ModTreeDecoratorType<?>> { public static final TreeDecoratorType<MushroomTrunkDecorator> TRUNK_MUSHROOM = register("trunk_mushroom", MushroomTrunkDecorator.CODEC); private final Codec<P> codec; @SuppressWarnings("deprecation") private static <P extends TreeDecorator> TreeDecoratorType<P> register(String p_70053_, Codec<P> p_70054_) { return Registry.register(Registry.TREE_DECORATOR_TYPES, p_70053_, new TreeDecoratorType<>(p_70054_)); } public ModTreeDecoratorType(Codec<P> p_70050_) { this.codec = p_70050_; } public Codec<P> codec() { return this.codec; } }
November 19, 20214 yr ups sorry, i forgot that TreeDecoratorType use now the Forge Registry system you could simply extends TreeDecoratorType and register it like Block or Items via DeferredRegister or the RegistryEvents Edited November 19, 20214 yr by Luis_ST
November 19, 20214 yr Author 13 hours ago, Luis_ST said: ups sorry, i forgot that TreeDecoratorType use now the Forge Registry system you could simply extends TreeDecoratorType and register it like Block or Items via DeferredRegister or the RegistryEvents thanks so much, that worked
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.