Posted September 17, 20187 yr I've added the onRender event to my code but I cannot figure out how to render a different texture and change the player size. The official YouTuber Spaceboy Ross
September 18, 20187 yr Ummm...bind a different texture and use GL11 scaling methods? Check out my tutorials here: http://jabelarminecraft.blogspot.com/
September 18, 20187 yr Author It crashed for me. GitHub: https://github.com/SpaceboyRoss01/MSGundamMod. @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Post event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); ResourceLocation texture = new ResourceLocation(ms.getBaseResourceLocation()+".png"); event.getRenderer().bindTexture(texture); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); } } Edited September 18, 20187 yr by Spaceboy Ross The official YouTuber Spaceboy Ross
September 18, 20187 yr 17 minutes ago, Spaceboy Ross said: It crashed for me. GitHub: https://github.com/SpaceboyRoss01/MSGundamMod. @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Post event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); ResourceLocation texture = new ResourceLocation(ms.getBaseResourceLocation()+".png"); event.getRenderer().bindTexture(texture); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); } } Something is null on this line. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author Ok, it's no longer null but the player is still the same size and still has the same skin. How do I render the new skin and entity size? The official YouTuber Spaceboy Ross
September 18, 20187 yr 6 minutes ago, Spaceboy Ross said: Ok, it's no longer null but the player is still the same size and still has the same skin. How do I render the new skin and entity size? You have to use the Pre event render it yourself and then cancel the actual rendering from happening. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author Ok, got the scaling to work but I cannot get the custom skin to work. The official YouTuber Spaceboy Ross
September 18, 20187 yr 6 minutes ago, Spaceboy Ross said: Ok, got the scaling to work but I cannot get the custom skin to work. *doesn't see code* Cool VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); event.getRenderer().bindTexture(new ResourceLocation(ms.getBaseResourceLocation()+".png")); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); event.setCanceled(true); } } The official YouTuber Spaceboy Ross
September 18, 20187 yr 15 minutes ago, Spaceboy Ross said: @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); event.getRenderer().bindTexture(new ResourceLocation(ms.getBaseResourceLocation()+".png")); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); event.setCanceled(true); } } You did one of the three things I said. 31 minutes ago, Animefan8888 said: You have to use the Pre event render it yourself and then cancel the actual rendering from happening. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author It's still not working. @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); event.getRenderer().bindTexture(new ResourceLocation(ms.getBaseResourceLocation()+".png")); event.getRenderer().doRender((AbstractClientPlayer)player,event.getX(),event.getY(),event.getZ(),player.cameraYaw,event.getPartialRenderTick()); event.setCanceled(true); } } The official YouTuber Spaceboy Ross
September 18, 20187 yr 1 hour ago, Spaceboy Ross said: It's still not working. Define not working. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr 9 minutes ago, Spaceboy Ross said: How do I make it work? Define not working VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author 11 minutes ago, Animefan8888 said: Define not working Provide me with a fix!! The official YouTuber Spaceboy Ross
September 18, 20187 yr A fix to what? What's broken? You haven't given us any information about how to diagnose what's wrong. All you've said is "doctor, it hurts." Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 18, 20187 yr Author The game freezes when my code runs. @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); GL11.glScalef(msmob.scale,msmob.scale,msmob.scale); event.getRenderer().bindTexture(new ResourceLocation(ms.getBaseResourceLocation()+".png")); event.getRenderer().doRender((AbstractClientPlayer)player,event.getX(),event.getY(),event.getZ(),player.cameraYaw,event.getPartialRenderTick()); event.setCanceled(true); } } The official YouTuber Spaceboy Ross
September 18, 20187 yr 5 minutes ago, Spaceboy Ross said: The game freezes when my code runs. You're causing an infinite loop of code by calling event.getRenderer().doRender. Edited September 18, 20187 yr by Animefan8888 Typo VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author Well, how do I actually render the player? The official YouTuber Spaceboy Ross
September 18, 20187 yr Just now, Spaceboy Ross said: Well, how do I actually render the player? 2 hours ago, Animefan8888 said: You have to use the Pre event render it yourself and then cancel the actual rendering from happening. Write the code. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr Author What does rendering it mean? I've canceled the game from rendering the player. The official YouTuber Spaceboy Ross
September 18, 20187 yr 1 minute ago, Spaceboy Ross said: What does rendering it mean? I've canceled the game from rendering the player. You want to change the texture for the player and edit the scale. Ok. Editing the scale is easy enough as you already found out. But you cant bind the texture you want because it is bound in the vanilla code you dont have access to. So you have to cancel the vanilla rendering which you have done and then render the player yourself with your own code, using your texture. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 18, 20187 yr From what I can see and understand, you are trying to use the default Minecraft player model as your base model, but you are using the default renderer to do it. You can use the MC player model, but you would need to copy it and change the relevant parts, such as what texture is bound to the gl, scale etc. And then render that instead. The renderer is connected to the default mc model which also hard codes it's texture. That's the easy way, or you can just code the model in yourself. Edited September 18, 20187 yr by ZDoctor Added
September 18, 20187 yr Author It doesn't render correctly and it renders upsidedown. GitHub: https://github.com/SpaceboyRoss01/MSGundamMod To recreate the bug, right click on an entity called RX-78-2 Gundam. @SubscribeEvent public static void onRenderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); IHumanCapability nt = Human.getHuman(player); MobileSuit.MSMob msmob = nt.getMS(); if(msmob != null) { MobileSuit ms = msmob.getMSRegistryEntry(); event.getRenderer().bindTexture(new ResourceLocation(ms.getBaseResourceLocation()+".png")); event.setCanceled(true); GlStateManager.pushMatrix(); event.getRenderer().getMainModel().bipedHead.render(0.0625F*msmob.scale); event.getRenderer().getMainModel().bipedBody.render(0.0625F*msmob.scale); event.getRenderer().getMainModel().bipedLeftLeg.render(0.0625F*msmob.scale); event.getRenderer().getMainModel().bipedRightLeg.render(0.0625F*msmob.scale); event.getRenderer().getMainModel().bipedLeftArm.render(0.0625F*msmob.scale); event.getRenderer().getMainModel().bipedRightArm.render(0.0625F*msmob.scale); GlStateManager.popMatrix(); } } The official YouTuber Spaceboy Ross
September 19, 20187 yr That's something I never understood as to why (but never bothered to look into it too hard) it happens, but what I do is just Rotate the gl 180 and that should fix it. I assume somewhere in the vanilla code something does that, but I haven't found it. Edited September 19, 20187 yr by ZDoctor
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.