Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Cadiboo

Members
  • Posts

    3624
  • Joined

  • Last visited

  • Days Won

    58

Posts posted by Cadiboo

  1. On 12/23/2019 at 8:33 AM, ChampionAsh5357 said:

    RenderTypeLookup#setRenderLayer

    This means “an method called setRenderLayer in the class RenderTypeLookup”. (Usually “#” is the same as “.” but specifically means instance, however many people use “#”, “.” and “::” interchangeably which defeats their purpose).

     

    On 2/4/2020 at 8:20 AM, OrangeVillager61 said:

    This is pretty helpful for me too, but what uses the RenderTypeLookup method in FMLClientSetupEvent?

    Your code will use RenderTypeLookup#setRenderLayer from inside the FMLClientSetupEvent.

     

    RenderTypeLookup#setRenderLayer needs to be called after block registration on the client distribution so the FMLClientSetupEvent callback is the perfect place to call it. You need to be careful though as RenderTypeLookup and RenderType are client side only classes. This usually isn’t an issue as you’re using them inside a method that will only get called on the client, however, if you specify multiple RenderTypes for your via a lambda, you need to take extra precautions that your code isn’t loaded serverside because of how lambdas work. Therefore it’s best to subscribe to the FMLClientSetupEvent in a client only event subscriber (subscribed to the mod event bus obviously) rather than in your main class.

     

    Since ChampionAsh wrote their response, mappings for 1.15.1 have been released. You should have updated your mappings to the latest (or latest stable) version and therefore should be referencing the mapped names not the SRG names in your source code.

  2. The vanilla code is a bit of a mess of legacy code and Forge compatibility hacks. Vanilla’s code was never meant to be extended by Modders. I would either extend the vanilla class and write all the necessary hacks to get stuff to work the way you want or write my own implementation that will be much cleaner and uses forges systems. You can see an example of the latter here 

    • Thanks 1
  3. 1 minute ago, DJ1TJOO said:

    Does it make my mod faster or does it any thing else better?

    It makes your code simpler.

    You can still do iterative registration with DeferredRegister and unless you’re doing something very complicated (which you probably shouldn’t be) you can do complex registration too.

  4. 3 minutes ago, Drachenbauer said:

    I thaught, all, what forge does in the remaining time after such a main-update is replacing weird method and field names in the vanilla code into clear ones.

    Forge doesn’t do this, your mappings (MCP) does this. Forge provides an API on top of Minecraft’s code. This API is constantly changing and being made better.

  5. So you copied and pasted a class in an old version. Then you made some (probably small) changes to that class.

    Then you updated and are having trouble because the code that the old class depended on has changed. The class obviously also changed since the old version so you should copy + paste it again and re-apply the changes you made to the new code.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.