Jump to content

Recommended Posts

Posted (edited)

 

New to modding. My registry argument within my ClientSetupEvent isnt working. Ive already tried a couple things and i cant get it to work. I guess im not sure whats its asking for.

Quote

@Mod("progressionmod")
@Mod.EventBusSubscriber(modid = ProgressionMod.MOD_ID, bus = Bus.MOD)
public class ProgressionMod
{

    ...

    private void doClientStuff(final FMLClientSetupEvent event) {

        ...

        TileEntityRenderer<ProCampfireTileEntity>  h = new ProCampfireTileEntityRenderer(TileEntityRendererDispatcher.instance);
        ClientRegistry.bindTileEntityRenderer(ModTileEntityTypes.CAMPFIRE, h);                                  

        // ^^^Clearly this doesnt work, but what exactly does it expect me to do here.

        // I guess im asking for an example of what a functioning  ClientRegistry.bindTileEntityRenderer() call would look like.

        //Also tried >>> TileEntityRendererDispatcher.instance.setSpecialRendererInternal(TileEntityType.CAMPFIRE, h );   
    }

    ...
}

 

 

Other stuff that might be relevant

Quote

public class ProCampfireTileEntity extends TileEntity implements IClearable, ITickableTileEntity {
       ...

       public ProCampfireTileEntity(final TileEntityType<?> tileEntityTypeIn) {
          super(tileEntityTypeIn);
       }
       public ProCampfireTileEntity() {
          this(ModTileEntityTypes.CAMPFIRE.get());       
       }

       ...
}

 

 

Quote

public class ProCampfireTileEntityRenderer extends TileEntityRenderer<ProCampfireTileEntity> {

    public ProCampfireTileEntityRenderer(TileEntityRendererDispatcher rendererDispatcherIn) {
        super(rendererDispatcherIn);
    }

    ...
}

 

 

Quote

public class ModTileEntityTypes {
    public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY_TYPES = new DeferredRegister<>(ForgeRegistries.TILE_ENTITIES,ProgressionMod.MOD_ID);
    
    public static final RegistryObject<TileEntityType<ProCampfireTileEntity>> CAMPFIRE = TILE_ENTITY_TYPES.register("progressioncampfire",() -> TileEntityType.Builder.create(ProCampfireTileEntity::new, BlockInit.campfire).build(null));
}

 

Edited by greetthemoth
Posted
TileEntityRenderer<ProCampfireTileEntity>  h = new ProCampfireTileEntityRenderer(TileEntityRendererDispatcher.instance);
ClientRegistry.bindTileEntityRenderer(ModTileEntityTypes.CAMPFIRE, h);   

You don't need the first line..in fact it would be a mistake.

Just use ProCampfireTileEntityRenderer::new in the bindTileEntityRenderer

  • Like 1

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

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.