Jump to content

Wurmatron

Members
  • Posts

    34
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Wurmatron's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. Not sure what you are planning on doing with this event but its possible. This event is client side so you can just call "Minecraft.getMinecraft().player" to get the client side player (EntityPlayerSP) and if for some reason you need it on the server side you can always just use "ServerChatEvent " or even send a packet to the server with the players username to lookup via UserNameCache and get the EntityPlayer MP via "FMLCommonHandler.instance ().getMinecraftServerInstance ().getPlayerList ().getPlayerByUUID ()" PS: Sorry about the formatting
  2. What i am trying to do is create a GUI that allows the player to place "cubes" onto the rendered player model, but i am having issues getting where the player has clicked on the screen in relation to the players model.Too make it easier i would like to have the blocks aligned to a grid that goes around the selected body part. The player's model will not be rendered with the same rotations. I also need to know what part was clicked and translate it into where a cube should be rendered on the player's model. The GUI looks like Gui Class: https://github.com/Wurmatron/VoidRPG/blob/master/src/main/java/wurmatron/voidrpg/client/gui/GuiArmorCustomization.java Full Src: https://github.com/Wurmatron/VoidRPG/
  3. I am having issues with using ray casting into the player model that i render onto my GUI via ModelRenderer. I am trying to get from the mouse click on the model rendered on the GUI. Any idea would be helpful. Src: http://pastebin.com/DJG3Bm0A EDIT: See http://www.minecraftforge.net/forum/index.php/topic,38068.0.html for more details
  4. super.drawScreen() calls the initGui method so.... code update?
  5. are you still calling the super in both the initGui and drawScreen?
  6. I have never had that issue but it may be because you are forcing the buttons to render and skipping initGui() [/size][/font][/color] [color=#333333][font=consolas, liberation mono, menlo, courier, monospace][size=12px]nextWallpaper.drawButton(mc, posX + 7, posY + 10); [/size][/font][/color] [color=#333333][font=consolas, liberation mono, menlo, courier, monospace][size=12px]prevWallpaper.drawButton(mc, posX - 3, posY + 10);[/size][/font][/color] [color=#333333][font=consolas, liberation mono, menlo, courier, monospace][size=12px][/Code][/size][/font][/color]
  7. initGui(); should automatically be called. How my gui class is setup https://github.com/Wurmatron/VoidRPG/blob/master/src/main/java/wurmatron/voidrpg/client/gui/GuiArmorCustomization.java
  8. Not sure exactly what you mean by "constantly selected" but you will want to check your button ids they are both 0 and you need to call the super method in drawScreen (use just have it commented out)
  9. Thank you so much. I got it working [/img] https://gist.github.com/Wurmatron/e26104c41aff30965f545416b3bda0b4
  10. I need to be able to control which parts of the player is rendered so.... Any other suggestions?
  11. i am trying to render the player's model into my gui, But there is something wrong and i cannot find out what it is. It looks like this. [/img] The Code for this is https://gist.github.com/Wurmatron/f7f66fbca7d93b79361cb60030b5686a Any ideas would be helpful.
  12. I am trying to get the location of where the mouse clicked on my the players model when the mouse has clicked. I know i need to use the mouseRelease method but i how no idea other than that. Any ideas on how to proceed about this would be helpful. int xPos = (this.width) / 2; int yPos = (this.height) / 2; GL11.glPushMatrix(); GL11.glColor3f(1F, 1F, 1F); GL11.glEnable(32826); GL11.glEnable(2903); GL11.glPushMatrix(); GL11.glTranslatef(xPos + 40, yPos + 98, 50F); // Makes the scaling easier gui GL11.glScalef(-75, 75, 75); GL11.glRotatef(180F, 0.0F, 0.0F, 1F); GL11.glRotatef(135F, 0.0F, 1F, 0.0F); RenderHelper.enableStandardItemLighting(); GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(0.0F, 1.0F, 0.0F, 0.0F); playerSP.renderYawOffset = playerSP.rotationYaw = playerSP.prevRotationYaw = playerSP.prevRotationYawHead = playerSP.rotationYawHead; playerSP.rotationPitch = 0.0F; GL11.glTranslatef(0.0F, playerSP.renderOffsetY, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // scale by default is 1f GlStateManager.scale(scale, scale, scale); GL11.glRotatef(yaw, 0, 1, 0); // Used to render the player to the gui along with rotations Minecraft.getMinecraft().getRenderManager().doRenderEntity(playerSP, 0.0D, 0.0D, 0.0D, yaw, 1f, false); GL11.glRotatef(pitch, 0, 0, 1); GL11.glPopMatrix(); RenderHelper.disableStandardItemLighting(); GL11.glDisable(32826); GL11.glTranslatef(0F, 0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(32826); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(32826); RenderHelper.disableStandardItemLighting(); GL11.glDisable(2896); GL11.glDisable(2929); GL11.glPopMatrix(); [/Code] Full Source: [font=verdana][size=78%]https://gist.github.com/Wurmatron/9c66c89489b4d5204f91c76e5dbb7fae[/size][/font]
  13. I am having issues with getting my Ears to follow the players head. I have it following it from right to left (Yaw) but i am having issues with the pitch because it requires me to translate the model by some amount. I have no idea how to even start. Any suggestions for ways of doing this? This is called before rendering the model GlStateManager.pushMatrix(); GlStateManager.rotate(180 - player.rotationYawHead, 0, 1, 0); if(!player.isSneaking()) { GlStateManager.translate(0.2f, player.getEyeHeight(), 0.06f); } else { GlStateManager.translate(0.2f, player.getEyeHeight() - 0.1f, 0.06f); } GlStateManager.rotate(-player.rotationPitch, 1, 0, 0); GlStateManager.rotate(180 , 1, 0, 0); This is called after GlStateManager.popMatrix(); if you need the full classes just ask there are lots of extra stuff thats not needed just for rendering
  14. I am having issues after i change the player's hitbox. Once i set the hitbox using EntityPlayer setEntityBoundingBox() the hitbox is set correctly and is shown correctly using f3 + b, But when i try going under a block if pushes me out like i was 2 blocks tall. If i sprint under i can manage to get though the issue, But if i get near the edge of the 1 block high area i get sucked out as though i was 2 blocks tall. Note i can move fine not near the edge of the 1 block high area. For those wondering i have also tried reflection to use the setSize Method but it doesn't even change the player's hitbox (I may be doing it incorrectly). Anyone have any Fixes or Suggestions? @SubscribeEvent public void onPlayerTick(TickEvent.PlayerTickEvent e) { EntityPlayer player = e.player; float height = 0.9f; float width = 0.3f; player.height = height; player.width = width; player.eyeHeight = 0.8f; player.setEntityBoundingBox(new AxisAlignedBB(player.getEntityBoundingBox().minX, player.getEntityBoundingBox().minY, player.getEntityBoundingBox().minZ, player.getEntityBoundingBox().minX + width, player.getEntityBoundingBox().minY + height, player.getEntityBoundingBox().minZ + width)); if (getBlockAbove(player) != null && !(getBlockAbove(player) instanceof BlockAir && RaceManager.getPlayerRace(player).Height() <= 0.9f)) { // Player is 1 block high and a block is above } } private static Block getBlockAbove(Entity entity) { World world = entity.worldObj; return world.getBlockState(new BlockPos(entity.posX, entity.posY+1,entity.posZ)).getBlock(); } private static final String setSizeObf = "func_177725_a"; private static final String setSizeDeobf = "setSize"; public static Method setSizeMethod; public static void setSize(Entity entity, float width, float height) { try { Method m = EntityLivingBase.class.getDeclaredMethod(isObfuscation() ? setSizeObf : setSizeDeobf, float.class, float.class); setSizeMethod = m; } catch(NoSuchMethodException e) { entity.width = width; entity.height = height; } catch(Exception e) { e.printStackTrace(); } if(setSizeMethod != null) { try { setSizeMethod.setAccessible(true); setSizeMethod.invoke(entity, width, height); } catch(Exception e) { e.printStackTrace(); } } } public static boolean isObfuscation() { boolean obfuscation = true; try { Field[] fields = Class.forName("net.minecraft.world.World").getDeclaredFields(); for(Field f : fields) { f.setAccessible(true); if(f.getName().equalsIgnoreCase("loadedEntityList")) { obfuscation = false; } } } catch (Exception e) {} return obfuscation; }
  15. To Anyone that Has failed like i just have. Here is some advice. [1] Check Your Dependencies and if they are at that location [2] Make sure to add sub dependencies like if you have Thermal Expansion to add Thermal foundation and Cofh Core Thanks to everyone that helped especially diesieben07
×
×
  • Create New...

Important Information

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