Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ryanshah

Members
  • Content Count

    19
  • Joined

  • Last visited

Everything posted by ryanshah

  1. I am currently drawing a compass to my ingame gui as follows: private static void renderCompass(MatrixStack matrixStack, int width, int height) { TextureDrawer.drawGuiTexture(matrixStack, width / 2 - 110, 10, 0, 37, 221, 14); int rot; boolean f0 = mc.player.yRot < 0.0f; if(f0) rot = -MathHelper.floor(mc.player.yRot % 360); else rot = MathHelper.floor(mc.player.yRot % 360); boolean f1 = rot > 0 && rot < 180; boolean f2 = rot <= 270 && rot >= 90; boolean f3 = rot <= 180 && rot >
  2. Thanks for the help so far, I think I'm nearly there.. float radius = 2f; // Get origins double u = this.getPosX() - vec3d.x; double v = this.getPosY() - vec3d.y; double w = this.getPosZ() - vec3d.z; Vector3d facing = new Vector3d(getPosX(), getPosY(), getPosZ()); for(double angle = 0.0D; angle < 2 * Math.PI; angle += 4d / 180d * (2 * Math.PI)) { double c = (u * facing.x) + (v * facing.y) + (w * facing.z); // constant double vx = u * c * (1d - MathHelper.cos((float)angle)) + facing.x * MathHelper.cos((float)angle) + (-w * facing.y + v*facing.z) * MathHelper.sin((float)angle); do
  3. I'll do some constant refactoring later. For now, I have the current code: double radius = 1.25D; double u = this.getPosX() - vec3d.x; double v = this.getPosY() - vec3d.y; double w = this.getPosZ() - vec3d.z; for(double angle = 0.0D; angle < 2 * Math.PI; angle += 4d / 180d * (2 * Math.PI)) { double mod = (u * getPosX()) + (v * getPosY()) + (w * getPosZ()); double vx = u * mod * (1d - MathHelper.cos((float)angle)) + getPosX() * MathHelper.cos((float)angle) + (-w * getPosY() + v*getPosZ()) * MathHelper.sin((float)angle); double vy = v * mod * (1d - MathHelper.cos((float)angl
  4. I am adding to Y instead of Z for the angle to have my ring appear upwards infront of the player, otherwise it just appears flat.
  5. I'm still not sure I totally understand. For reference I have updated the OP to contain the tick method so you can what posX etc. I am referencing in this question.
  6. I currently spawn a ring of particles around my entity when it is spawned, however depending on how the player is facing to cast the entity the particle ring does not always appear in front of the player. I know this is something to do with the z position (vz), but I dont 100% understand how to set it in this case. For example in some directions it appears fine, but in some the ring is effectively flipped 90 degrees so all I can see is a line of particles instead of the ring. @Override public void tick() { if (this.world.isRemote || (this.shootingEntity == null || !this.shootingEntity.
  7. Hey everyone! I'm currently creating a new entity based off a biped entity (2 legged entity), however the texture doesnt seem to be rendering on it correctly or the model isn't working.. Here is the code: RenderJonSnow: package net.madcrazydrumma.got.entity.render; import net.madcrazydrumma.got.entity.model.ModelJonSnow; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.rendere
  8. Here is how I instantiate my gui in my GuiHandler: @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == 0) { return new GuiSelectHouse(new ContainerSelectHouse()); } return null; } Here is my GuiSelectHouse: package io.ryanshah.got.gui; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; public class GuiSelectHouse extends GuiContainer { public GuiSelectHouse(Container par1Container) { super(par1Container); } public void updateScreen() { s
  9. @diesieben07 Even when creating a container and stuff, It still doesn't show... so thats not the problem
  10. package io.ryanshah.got.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { /*if(ID == 0) { return new GuiSelectHouse(); } else { return null; }*/ return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == 0) { return new GuiSelectHouse(); } else { return null; } }
  11. Its still not opening, it just goes straight to the game
  12. Using player.openGui(params);... now getting this error: java.lang.ClassCastException: io.ryanshah.got.gui.GuiSelectHouse cannot be cast to net.minecraft.inventory.Container at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:241) ~[NetworkRegistry.class:?] at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75) ~[FMLNetworkHandler.class:?] at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2510) ~[EntityPlayer.class:?] at io.ryanshah.got.event.GOTEventHandler.playerLoggedIn(GOTEventHandler.ja
  13. It is printing the message, but it is not opening my GUI Here is what I'm doing: Minecraft mc = Minecraft.getMinecraft(); mc.displayGuiScreen(new GuiSelectHouse());
  14. Do I have to create any external files for the entity data stuff? Or will that code work on its own?
  15. What do you mean by more unique key?
  16. Hey guys! The title says it all, I am trying to create a GUI where the user will choose his/her race and that choice will be embedded into their player data. I've done the GUI etc... Just trying to figure out how to do what I want on new world creation, any idea?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.