-
Posts
878 -
Joined
-
Last visited
Everything posted by Elix_x
-
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)
-
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?
-
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...
-
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...
-
[1.7.10] [UNSOLVED] Problems with rendering item inside an Item???
Elix_x replied to Elix_x's topic in Modder Support
I'll try so... And what about multiple render passes??? -
[1.7.10] [UNSOLVED] Problems with rendering item inside an Item???
Elix_x replied to Elix_x's topic in Modder Support
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??? -
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!
-
How to make a dimension teleporter in 1.8?! NEED HELP.
Elix_x replied to MacDue's topic in Modder Support
Which code you were trying to use? Can you post it with error messages that you get? -
Soo... give other name to your "main" texture method... AND LEARN JAVA!!!
-
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));
-
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!
-
When you write ALWAYS GIVE/WRITE/PASTE THE ERROR!
-
yes in super() constructor
-
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...
-
Why Render.class??? for entities renderer extend RenderLiving...
-
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...
-
show your RenderUndead class please.
-
White empty model???????????????????????????????????????????????????????????? How about overriding getEntityTexture(Entity entity)????????????????????????????????????????????????
-
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...
-
Okay, now check that EntityUndead.class is Entity superclass and RenderUndead is Render superclass.
-
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 ()
-
[1.7.10] Loop through all registered items and blocks and their recipies
Elix_x replied to nike4613's topic in Modder Support
There is list of all items in Item.class (itemRegistry).