Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • Support & Bug Reports
  • Client sided optifine like CIT implementation
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
FloweyTF

Client sided optifine like CIT implementation

By FloweyTF, January 9 in Support & Bug Reports

  • Reply to this topic
  • Start new topic

Recommended Posts

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 9

Background:
I am writing a mod for all things hypixel. When it come down to hypixel skyblock, it adds a large number of custom weapons and such.

Anyways, the main question is: How do I write a client-sided mod that changes the texture of an item given its name?

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 9

Item textures are controlled my models, which are controlled by resource packs (mods are also resource packs).

If you really just want to change the texture, there is no reason to make a mod, you can just make a resource pack. If you need custom model rendering, you need a custom model loader as well.

  • Quote

Share this post


Link to post
Share on other sites

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 9

No, its not the only reason for this mod, its just a feature. Is there any way I can code it so that it works like this?

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 9

I already told you what you need to do. Have you tried anything?

  • Quote

Share this post


Link to post
Share on other sites

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 10
7 hours ago, diesieben07 said:

I already told you what you need to do. Have you tried anything?

I dont really know what to do

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 10

Put whatever models / textures you want to override with your mod in src/main/resources and then the same path they have in vanilla Minecraft.

Tada, you have changed a vanilla texture with your mod.

  • Quote

Share this post


Link to post
Share on other sites

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 10

Well, I know that much. However, it doesn't allow the item texture to be changed dynamically based off of the item name

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 10
1 hour ago, FloweyTF said:

Well, I know that much. However, it doesn't allow the item texture to be changed dynamically based off of the item name

You need a custom model loader which changes the model based on the item name then. 

  • Quote

Share this post


Link to post
Share on other sites

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 12

Do you have some example code that I could look at?

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 12
12 minutes ago, FloweyTF said:

Do you have some example code that I could look at?

Forge has a "separate-perspective" model, which allows you to embed several models based on perspective: https://github.com/MinecraftForge/MinecraftForge/blob/1.16.x/src/main/java/net/minecraftforge/client/model/SeparatePerspectiveModel.java. You can do something similar but allow embedding models based on item name.

  • Quote

Share this post


Link to post
Share on other sites

FloweyTF    0

FloweyTF

FloweyTF    0

  • Tree Puncher
  • FloweyTF
  • Members
  • 0
  • 10 posts
Posted January 12

does it have to implement IModelGeometry?

  • Quote

Hello i am dead

Share this post


Link to post
Share on other sites

diesieben07    7614

diesieben07

diesieben07    7614

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7614
  • 55199 posts
Posted January 12

Yes, IModelGeometry is the forge version of an "unbaked" model, i.e. just the model data loaded into memory. This will then be baked into a BakedModel, which is basically just a list of quads to be uploaded to the GPU.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • AzizD
      [1.16.4] Custom item enchantability

      By AzizD · Posted 13 minutes ago

      I got it.
    • diesieben07
      [1.16.4] Custom item enchantability

      By diesieben07 · Posted 18 minutes ago

      Please don't use raw types. Store the Set in a field, don't create it every time.
    • AzizD
      [1.16.4] Custom item enchantability

      By AzizD · Posted 19 minutes ago

      It looks way better. Thanks for the advice. @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { Set e = ImmutableSet.of( Enchantments.SHARPNESS, Enchantments.LOOTING, Enchantments.FIRE_ASPECT, Enchantments.UNBREAKING, Enchantments.KNOCKBACK ); return e.contains(enchantment); }  
    • Nikibiki
      [1.16] Custom ItemGroup icon

      By Nikibiki · Posted 26 minutes ago

      I just want to say that this thread has been massively helpful to me! Thank you to all who have contributed.
    • diesieben07
      minecraft crashes as soon as I use shaders

      By diesieben07 · Posted 27 minutes ago

      That's the graphics driver
  • Topics

    • AzizD
      9
      [1.16.4] Custom item enchantability

      By AzizD
      Started 11 hours ago

    • JoieNL
      4
      [1.16] Custom ItemGroup icon

      By JoieNL
      Started September 25, 2020

    • JoehnMama
      4
      minecraft crashes as soon as I use shaders

      By JoehnMama
      Started 3 hours ago

    • MrDuck20
      1
      Error exit code 0 when i start the game.

      By MrDuck20
      Started 33 minutes ago

    • BBoi69
      1
      My modpack takes years to load

      By BBoi69
      Started 1 hour ago

  • Who's Online (See full list)

    • AzizD
    • kiou.23
    • starstorms21
    • diesieben07
    • XDKara
  • All Activity
  • Home
  • Minecraft Forge
  • Support & Bug Reports
  • Client sided optifine like CIT implementation
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community