Jump to content

Thalmias

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Thalmias's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Most certainly. It just needed a few bits and pieces to handle ENTITY rendering in the shouldUseRenderHelper() and renderItem() functions, and a new function that rendered it in the case of ENTITY for those interested, here's a snippet of the code that I needed to add: for those interested in the finished product, here's some screenies (I used a 32x32 texture for the Greatswords so when they scaled up, the size of the pixels would be the same size as the pixels on any other item):
  2. Oh wow, love your code. Efficient, clean, and I would have never thought to multiply the scale by values inside of the translate to offset the scaling. Seriously, thanks for your help ^^
  3. Eureka! That was the problem. Now I have to muck with translates, since I have an awkwardly large sword slanted sideways, but still. Figures that I've been running around trying to make something work that couldn't work because I didn't call the proxy.registerRenderers() function in the public void preInit(FMLPreInitializationEvent e) function inside of Main. Sheesh! Anywho, for those interested, I am going to copy-pasta my code here for anyone experiencing similar issues. Thanks a lot for your help, coolAlias, definitely pointed me in the right direction! Main: CommonProxy: ClientProxy: ItemModGreatsword: GreatswordRenderer
  4. The only registerRenderers() calls functions (whoops :3) that I have (I assume you are talking about these) are from the public void registerRenderers() functions in the Common and ClientProxy, which are here: ClientProxy: CommonProxy: There is a good chance that I am mucking something up somewhere, most of my coding for this particular endeavor has been pretty hectic and piecemeal at best, so I'm pretty sure there's a bunch of pieces I'm missing. Are there any additional places you are supposed to use registerRenderers(), or perhaps anything else you are supposed to put into those functions? I just know that registerRenderers() shouldn't be done server side since it uses Minecraft game code. EDIT: Oh wait, I wouldn't happen to have to make a call to the registerRenderers() function inside of Main? my Main doesn't have one, so I guess it wouldn't hurt to try it out. Main:
  5. Thanks, that simplifies identifying the Greatswords by quite a bit! I was planning on getting the held item, then translating the localized name to the unlocalized name and getting the material through a series of ifs and elses, but this just lets me identify each new Greatsword to render by simply registering each Greatsword in the ClientProxy! Unfortunately, the Greatsword still does not scale in size so I probably have a few mistakes elsewhere that I cannot find, or I am missing some key components for rendering. My new code is as follows: GreatswordRenderer: I removed the public GreatswordRenderer() method, changed the public void renderItem() method to use your Tessellator, and removed a lot of now-unnecessary imports. ItemModGreatsword: Here the only thing that changed was getting rid of that unnecessary public void render() method and a few imports. All of my other code has remained the same. Right now I'm messing around with the Tessalator and looking up more information on it, as well as trying to figure out what else I need to put where. I think I''m also going to try and see if I can get it to work on something that isn't a Greatsword (IE: a Sword). Again, thanks! I feel like I'm right on the edge of having this done. EDIT: Just tried setting the public void registerRenderers() method in the ClientProxy to handle a regular Sword instead of a Greatsword, but nothing changed. There's probably still something missing in my GreatswordRenderer class somewhere. EDIT2: I have found some people both registering an Icon and getting the IconIndex in some of their custom items, so I changed my ItemModGreatsword to this: I know that the public void registerIcons() and public IIcon getIconIndex() are working properly because giving them garbage data causes the texture on the Greatsword to become the null purple and black texture. However, this has produced no change and it feels like I'm manually implementing something that is done automatically. EDIT3: Last edit for this post, methinks. Anywho, I have implemented a TextureManager in my GreatswordRenderer's public void renderItem() function to bind the Texture of any Greatsword passed to it. I have also encased the entire class in a @SideOnly(Side.CLIENT) for extra measure. The changes can be seen here: I also encased the functions that register the icons inside of @SideOnly(Side.CLIENT) in the ItemModGreatsword class, which can be seen here: Unfortunately no results, and I can't tell if I am making progress or not, but it at least seems to be adding a few layers of redundancy checking to these two classes.
  6. I am having an issue with a custom IItemRenderer I have made. There are no errors thrown and the game runs fine, but the IItemRenderer simply does not appear to work. The sole purpose of the IItemRenderer is to scale the size of the texture of any items that are considered a Greatsword. I have tried searching around for the past few days with queries such as "minecraft 1.7.10 how to scale items", but no no avail. I am simply trying to scale the texture of items, nothing more, and I am seeking to accomplish this within the code itself, and not external sources such as model creators. Since there are no errors, I believe I am either not passing something properly, or I am possibly calling or defining the wrong things. Here is my IItemRenderer, "GreatswordRenderer": If there is a problem here, I believe it is in this section of the code, since I am trying to call my "ItemModGreatsword" constructor in order to create an instance that my GreatswordRenderer will use: public GreatswordRenderer(){ this.greatsword = new ItemModGreatsword(null, null); this.mc = Minecraft.getMinecraft(); } This is my "ItemModGreatsword", it is simply a new class of tool (specifically, extending ItemSword) that I am using to identify passed items as Greatswords: If there is a problem in this code, I believe it is in the "public void render . . .". I have found remarkably little documentation on what should go where when dealing with the IItemRenderer, so I put that there because a function in my "GreatswordRenderer" called for it. It is commented out because "render" is undefined in minecraft's "ItemSword". I am not sure what I would need to put in there, I just know that the Fs handle animation (f0-f4 are generally blank for static items) and f5 is used for the thickness of the render. Just for reference, I am calling a "registerRenderers" function inside of my "ClientProxy", which can be seen here: Just for additional measure, though I don't think it is needed, here is the file (ModItems) that has all of my items inside of it (note that I am specifically trying to handle the "obsidianGreatsword" texture in my "GreatswordRenderer"): If anyone can help with this, it would be greatly appreciated. This has been bugging me for the past 4 days and is starting to drive me mad. Such simple concepts make such big problems, eh?
×
×
  • Create New...

Important Information

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