
JelloMOO
Members-
Posts
58 -
Joined
-
Last visited
Everything posted by JelloMOO
-
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
Could you give me an example of what you mean? It seems to be vague on step 4
-
Could you give me an example of what you mean? It seems to be vague on step 4
-
Alright, new issue. When I put down the chicken, it creates a copy of the chicken, making two chickens, and they walk in sync with each other. What on earth is happening? It appears that when I kill the chickens, the original will die, but the copy will stay. However, this is where it gets creepy. The copy doesn't stay alive. You know when you kill an animal and it turns over and it's color becomes red right before it disappears? Well, the chicken copy does that, except it doesn't disappear. It stays there. Forever. Seriously, what dimension did I just walk into? Whats happening?
-
Alright, new issue. When I put down the chicken, it creates a copy of the chicken, making two chickens, and they walk in sync with each other. What on earth is happening? It appears that when I kill the chickens, the original will die, but the copy will stay. However, this is where it gets creepy. The copy doesn't stay alive. You know when you kill an animal and it turns over and it's color becomes red right before it disappears? Well, the chicken copy does that, except it doesn't disappear. It stays there. Forever. Seriously, what dimension did I just walk into? Whats happening?
-
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
acne. i mean, bump. -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
acne. i mean, bump. -
public static class Handler implements IMessageHandler<MessageEntityMove, IMessage> { @Override public IMessage onMessage(final MessageEntityMove message, final MessageContext ctx) { // Know it will be on the server so make it thread-safe IThreadListener mainThread = (IThreadListener) ctx.getServerHandler().playerEntity.worldObj; // or Minecraft.getMinecraft() on the client mainThread.addScheduledTask(new Runnable() { final EntityPlayerMP thePlayer = (EntityPlayerMP) blessup.proxy. getPlayerEntityFromContext(ctx); final Entity theEntity = thePlayer.worldObj.getEntityByID(message.entityId); final WeakReference<Entity> ent1 = new WeakReference<Entity>(theEntity); So I did this. It didn't quite fix my issue unfortunately. What am I doing wrong? EDIT: Using the weak reference really gave me the entity position and I found that the problem was in how I was mounting the entity on the bat. I didnt mount it in the packet like I should have. So now the entity is truly mounted. There seems to be some server lag. Is that normal with this? I'll do some more testing and report back here before setting this to solved.
-
public static class Handler implements IMessageHandler<MessageEntityMove, IMessage> { @Override public IMessage onMessage(final MessageEntityMove message, final MessageContext ctx) { // Know it will be on the server so make it thread-safe IThreadListener mainThread = (IThreadListener) ctx.getServerHandler().playerEntity.worldObj; // or Minecraft.getMinecraft() on the client mainThread.addScheduledTask(new Runnable() { final EntityPlayerMP thePlayer = (EntityPlayerMP) blessup.proxy. getPlayerEntityFromContext(ctx); final Entity theEntity = thePlayer.worldObj.getEntityByID(message.entityId); final WeakReference<Entity> ent1 = new WeakReference<Entity>(theEntity); So I did this. It didn't quite fix my issue unfortunately. What am I doing wrong? EDIT: Using the weak reference really gave me the entity position and I found that the problem was in how I was mounting the entity on the bat. I didnt mount it in the packet like I should have. So now the entity is truly mounted. There seems to be some server lag. Is that normal with this? I'll do some more testing and report back here before setting this to solved.
-
OH MY GOD. I just found out.. IT NEVER MOVED THE ENTITY. It appears I never picked up the entity at all. What does this mean?
-
OH MY GOD. I just found out.. IT NEVER MOVED THE ENTITY. It appears I never picked up the entity at all. What does this mean?
-
I mount the entity in another class, inside of a @SideOnly(Side.CLIENT) @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(MouseEvent event) event. using this .network.sendToServer(new MessageEntityPacket(ent.getEntityId())); I successfully get the entity's ID and send it to the server, but only temporarily. It seems like it forgets after a while and teleports the entity back.
-
I mount the entity in another class, inside of a @SideOnly(Side.CLIENT) @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(MouseEvent event) event. using this .network.sendToServer(new MessageEntityPacket(ent.getEntityId())); I successfully get the entity's ID and send it to the server, but only temporarily. It seems like it forgets after a while and teleports the entity back.
-
public static class Handler implements IMessageHandler<MessageEntityMove, IMessage> { @Override public IMessage onMessage(final MessageEntityMove message, MessageContext ctx) { IThreadListener mainThread = (IThreadListener) ctx.getServerHandler().playerEntity.worldObj; final EntityPlayerMP thePlayer = (EntityPlayerMP) YouLoyal.proxy. getPlayerEntityFromContext(ctx); final Entity theEntity = thePlayer.worldObj. getEntityByID(message.entityId); mainThread.addScheduledTask(new Runnable() { @Override public void run() { This code is taken from a simple packet i made. See what I'm trying to do is pick up a chicken and hold it in my hand. I use a packet to send the chicken's ID to the server so that I can mount the chicken on a bat that i'm constantly teleporting to the player's hand. However, after a while, the server loses the entity, and the chicken goes back to the position it's in before I picked it up. I checked the coords for the bat and the chicken, and I found that the bat isnt the problem. The server will say that the chicken is in it's last position before it teleported back to its original position. So I'm seeing that the server lost the chicken's entity ID. Would this be attributed to a problem with the piece of the packet I showed above? If not, what would be causing this issue, and how do I fix it?
-
public static class Handler implements IMessageHandler<MessageEntityMove, IMessage> { @Override public IMessage onMessage(final MessageEntityMove message, MessageContext ctx) { IThreadListener mainThread = (IThreadListener) ctx.getServerHandler().playerEntity.worldObj; final EntityPlayerMP thePlayer = (EntityPlayerMP) YouLoyal.proxy. getPlayerEntityFromContext(ctx); final Entity theEntity = thePlayer.worldObj. getEntityByID(message.entityId); mainThread.addScheduledTask(new Runnable() { @Override public void run() { This code is taken from a simple packet i made. See what I'm trying to do is pick up a chicken and hold it in my hand. I use a packet to send the chicken's ID to the server so that I can mount the chicken on a bat that i'm constantly teleporting to the player's hand. However, after a while, the server loses the entity, and the chicken goes back to the position it's in before I picked it up. I checked the coords for the bat and the chicken, and I found that the bat isnt the problem. The server will say that the chicken is in it's last position before it teleported back to its original position. So I'm seeing that the server lost the chicken's entity ID. Would this be attributed to a problem with the piece of the packet I showed above? If not, what would be causing this issue, and how do I fix it?
-
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
chicken.posY = player.posY; chicken.posZ = (playerArmLength * (MathHelper.sin(-player.rotationYaw + angOffset))) + (playerArmLength * (MathHelper.cos(-player.rotationYaw + angOffset))) + player.posZ; chicken.posX = (playerArmLength * (MathHelper.cos(-player.rotationYaw + angOffset))) - (playerArmLength * (MathHelper.sin(-player.rotationYaw + angOffset))) + player.posX; Hey gummy! The code above didn't really help, maybe I did it wrong. It works but only for when you move your head. My problem is that I need to be able to account for sudden movements/jerks in the player's body. Like if the player, instead of moving their head, moves their body with W, A, S, D. It would put the chicken out of place. public void moveHitBoxes(EntityDragonPart part, double FrontToBack, double SideToSide, double TopToBot) { float f3 = this.rotationYaw * (float) Math.PI / 180.0F; float f11 = MathHelper.sin(f3); float f4 = MathHelper.cos(f3); part.setLocationAndAngles(this.posX + (double) (f11 * -FrontToBack) + (double) (f4 * SideToSide), this.posY + TopToBot, this.posZ + (double) (f4 * FrontToBack) + (double) (f11 * SideToSide), 0.0F, 0.0F); part.onUpdate(); } The code above didn't seem to work either, I dont know why. I think i did it wrong. -
I think he means just generally getting a player's name from the server or getting a player's name to another player. Would you use a packet for that?
-
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
Yes. It needs to be able to cluck and move around while in my hand. -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
Anyone else know how to do this? If youre having trouble picturing what I mean, think of it as holding an item. In minecraft, when you hold an item, and you turn around and move your body, it constantly stays in your hand, it doesnt begin to float in the middle of no where around your body. I want to recreate that effect with a chicken. Anyone? -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump -
[1.8.9] [UNSOLVED] Constantly get player's hand position
JelloMOO replied to JelloMOO's topic in Modder Support
bump