Jump to content

Elix_x

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by Elix_x

  1. Don't. Just put a GOTO before the instructions and the corresponding Label behind. You mean that inserting GOTO before, will skip these lines??? Which kind of Node is GOTO by the way? And will it not be easier to use binary patches or replace entire class (like here)
  2. Thanks, i think i can do so... I have 2 more questions: how can i remove static field from class (not very important)? How can i add static field in class (ot is it easier to manipulate with new one in other class... BTW: in my case it's list of objects, where each object added in end of constructor...) EDIT: on more question: how can i easily remove bunch of lines from method?
  3. Hi there, let me explain why i need to use patch: I need to patch very much stuff in one mc's classes, and using asm will too long to perform it. Not only i need to patch a lot of methods, but i need also to insert bunch of loops, try cath, etc... So using asm will be a bit difficult here... Also i know that forge uses .java.patch files to patch classes, and also i found how to use them (there is very old topic for that), but not how to write them...
  4. First: why aren't you using json sound registry??? Second: Cannot make a static reference to the non-static method means that method is not static and you need obj instance (in this case of Soundregistry) to call this method...
  5. I'll try so... And what about multiple render passes???
  6. Well well... Digging a bit more i found what may cause items with model to be wrongly rendered: in forge render methods i found fncts responsible for rotation and resizing... Do i need to rewrite those in order to rnder item correctly???
  7. Well, title explains what i'm doing, now i'll explain the rest: To render item (or multiple), i'm using this code (in custom item renderer): @Override public void renderItem(ItemRenderType type, ItemStack itemstack, Object... data) { if(type == IItemRenderer.ItemRenderType.EQUIPPED || type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON){ EntityLivingBase entity = (EntityLivingBase) data[1]; if(type == IItemRenderer.ItemRenderType.EQUIPPED) GL11.glTranslated(1, 0, 0.5); if(itemstack.getItemDamage() == 0){ for(int i = 1; i < 10; i++){ ItemStack item = ItemCompressedTools.getToolFromMeta(itemstack, i); if(item != null){ if(MinecraftForgeClient.getItemRenderer(item, type) != null) ForgeHooksClient.renderEquippedItem(type, MinecraftForgeClient.getItemRenderer(item, type), (RenderBlocks) data[0], entity, item); else renderer.renderItem(entity, item, 0, type); GL11.glTranslated(-0.1, 0, 0); } } } else { ItemStack item = ItemCompressedTools.getCurrentTool(itemstack); if(item != null){ if(MinecraftForgeClient.getItemRenderer(item, type) != null) ForgeHooksClient.renderEquippedItem(type, MinecraftForgeClient.getItemRenderer(item, type), (RenderBlocks) data[0], entity, item); else renderer.renderItem(entity, item, 0, type); } } } if(type == IItemRenderer.ItemRenderType.ENTITY){ EntityItem entity = (EntityItem) data[1]; if(itemstack.getItemDamage() == 0){ for(int i = 1; i < 10; i++){ ItemStack item = ItemCompressedTools.getToolFromMeta(itemstack, i); if(item != null){ entity.setEntityItemStack(item); if(!ForgeHooksClient.renderEntityItem(entity, item, 0, 0, new Random(), FMLClientHandler.instance().getClient().renderEngine, (RenderBlocks) data[0], 1)) RenderManager.instance.renderEntitySimple(entity, 1); GL11.glTranslated(-0.1, 0, 0); } } } else { ItemStack item = ItemCompressedTools.getCurrentTool(itemstack); if(item != null){ entity.setEntityItemStack(item); if(!ForgeHooksClient.renderEntityItem(entity, item, 0, 0, new Random(), FMLClientHandler.instance().getClient().renderEngine, (RenderBlocks) data[0], 1)) RenderManager.instance.renderEntitySimple(entity, 1); } } entity.setEntityItemStack(itemstack); } if(type == IItemRenderer.ItemRenderType.INVENTORY){ EntityPlayer player = Minecraft.getMinecraft().thePlayer; GL11.glTranslated(0.5, 0, 0); if(itemstack.getItemDamage() == 0){ for(int i = 1; i < 10; i++){ ItemStack item = ItemCompressedTools.getToolFromMeta(itemstack, i); if(item != null){ if(!ForgeHooksClient.renderInventoryItem((RenderBlocks) data[0], FMLClientHandler.instance().getClient().renderEngine, item, true, 0, 0, 0)) renderer.renderItem(player, item, 0, type); GL11.glTranslated(-0.1, 0, 0); } } } else { ItemStack item = ItemCompressedTools.getCurrentTool(itemstack); if(item != null){ if(!ForgeHooksClient.renderInventoryItem((RenderBlocks) data[0], FMLClientHandler.instance().getClient().renderEngine, item, true, 0, 0, 0)) renderer.renderItem(player, item, 0, type); } } } } But here we don't need full code, we just need one part of it, the one that is responsible for rendering actual item "in item". Here is one for equipped renderer: if(MinecraftForgeClient.getItemRenderer(item, type) != null) ForgeHooksClient.renderEquippedItem(type, MinecraftForgeClient.getItemRenderer(item, type), (RenderBlocks) data[0], entity, item); else renderer.renderItem(entity, item, 0, type); One for entity: if(!ForgeHooksClient.renderEntityItem(entity, item, 0, 0, new Random(), FMLClientHandler.instance().getClient().renderEngine, (RenderBlocks) data[0], 1)) RenderManager.instance.renderEntitySimple(entity, 1); And one for inventory: if(!ForgeHooksClient.renderInventoryItem((RenderBlocks) data[0], FMLClientHandler.instance().getClient().renderEngine, item, true, 0, 0, 0)) renderer.renderItem(player, item, 0, type); An well the problem is: -items that have custom model are rendered few times bigger -items with multiple render passes, are rendered with only one -for entity renderer, item is rendered weirdly somewhere far awy from actual entity And this applies for each renderer case! Any help will be appreciated!
  8. Which code you were trying to use? Can you post it with error messages that you get?
  9. Soo... give other name to your "main" texture method... AND LEARN JAVA!!!
  10. EntityRenderer @SideOnly(Side.CLIENT) public class NewEntityHorseRenderer extends RenderLiving { public NewEntityHorseRenderer(RenderManager p_i46170_1_, NewModelHorse p_i46170_2_, float p_i46170_3_) { super(p_i46170_1_, p_i46170_2_, p_i46170_3_); } } Client proxy: RenderingRegistry.registerEntityRenderingHandler(NewEntityHorse.class, new NewEntityHorseRenderer(Minecraft.getMinecraft().getRenderManager(), new NewModelHorse(), 1.0f));
  11. Aaaaaaa, ok. In constructor you need 3 params: RenderManager, ModelBase and float. First one you can get from Minecraft.getMinecraft().getRenderManager(), but you cannot put it in super directly, so now RenderUndead constructor must also contain RenderManager param, which you can give him while constructing it in proxy... ModelBase is your model. And float is shadow size!
  12. When you write ALWAYS GIVE/WRITE/PASTE THE ERROR!
  13. yes in super() constructor
  14. Are you extending RenderLiving and passing it model ? If not, make RenderUndead extend RenderLiving, and pass it render manager as first param, model as second and shadow size as third... When done, re try. If still not working re post RenderUndead code and screen of what it looks like...
  15. Why Render.class??? for entities renderer extend RenderLiving...
  16. You can change textures of items from mс or other mods exactly, as if your mod was a resource pack. Example : src/main/resources/ create file in assets/minecraft/textures/items/nether_star.png for example, and it will change vanilla nether star texture as resource pack would... Or do you mean switch resource pack in list of packs? For that, you need to reload resource manager...
  17. show your RenderUndead class please.
  18. White empty model???????????????????????????????????????????????????????????? How about overriding getEntityTexture(Entity entity)????????????????????????????????????????????????
  19. Aaaa you know, what? About 1 year ago i had exactly the same problem, and i found nothing on forums too (but i haven't created a thread, i don't know why). So i leftmodding... After 2 moths or so, i decided to retry, but as all by workspaces were "unsetted up", i updated java, jdk and forge... AND IT WORKED!!! So... try do all this things: [*]update java to the LATEST VERSION [*]update jdk to the LATEST VERSION [*]donwload latest forge-src [*]try installing it in new space first (use commands that you want (gradlew setupDecompWorkspace/setupDevWorkspace --refresh-dependecies + gradlew eclipse) [*]now try exporting it right direcltly (yes, empty folder) [*]if it works, try copy src folder from your mod and exporting If it will not work... I just don't know what to say...
  20. Okay, now check that EntityUndead.class is Entity superclass and RenderUndead is Render superclass.
  21. WHAT IS ERROR?????? registerEntityRenderingHandler IS WHERE IS ERROR!!!! WHAT IS ERROR MEANS: WHAT ECLIPSE WRITES YOU WHEN YOU PUT YOUR MOUSE ON registerEntityRenderingHandler !!!!! FOR EXAMPLE: The method registerEntityRenderingHandler(Class<? extends Entity>, Render) in the type RenderingRegistry is not applicable for the arguments ()
  22. There is list of all items in Item.class (itemRegistry).
  23. What error???
  24. First, to paste something in code block you need to surround code with [.code] [./code] (without .) Example: to do this: some code In message, you write this: [.code]some code[./code] (without .) Second: do you have any errors in eclipse???
  25. Run with --stacktrace, and return here with full console log, pasted in code block...
×
×
  • Create New...

Important Information

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