Jump to content

[SOLVED][1.17.1]how do i make a custom tree decorator


the_lizard_king

Recommended Posts

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;
	   }
}

 

Link to comment
Share on other sites

  • the_lizard_king changed the title to [SOLVED][1.17.1]how do i make a custom tree decorator

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.