Search In
• More options...
Find results that contain...
Find results in...

# ryanshah

Members

19

0 Neutral

• Rank
Tree Puncher

## Converted

• Gender
Undisclosed
• Personal Text
I am new!
1. ## Render texture from entity angle

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. ## Rendering ring of particles around entity that faces direction of entity travel

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. ## Rendering ring of particles around entity that faces direction of entity travel

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. ## Rendering ring of particles around entity that faces direction of entity travel

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. ## Rendering ring of particles around entity that faces direction of entity travel

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. ## Rendering ring of particles around entity that faces direction of entity travel

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. ## [1.8] Entity Model and/or Texture Not Rendering Correctly

Does anyone know how I can solve this?
8. ## [1.8] Entity Model and/or Texture Not Rendering Correctly

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
9. ## Open GUI on new world creation

What do you mean @diesieben07 ?
10. ## Open GUI on new world creation

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
11. ## Open GUI on new world creation

@diesieben07 Even when creating a container and stuff, It still doesn't show... so thats not the problem
12. ## Open GUI on new world creation

How do I add a container? lol
13. ## Open GUI on new world creation

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; } }
14. ## Open GUI on new world creation

Its still not opening, it just goes straight to the game
15. ## Open GUI on new world creation

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
×

• #### Activity

×
• Create New...