Jump to content

Change player height !


Yuri6037

Recommended Posts

Hi all !

I've done (enough) the player sitting system. But like StoneLine there is a bug : The player is sitting in air !

In effect, actually the render of legs are ok, but for the update void the player's position is always standing up !

 

So how i can make for letting the update void of the player that he is sitting not standing up ?

Link to comment
Share on other sites

I am not a magician, nobody here is.

 

Well.  I am.

 

But I'm not psychic.

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.

Link to comment
Share on other sites

I told you that i have no codes about the player height !

Here is the code to render the player as sitting :

 

I'm using the Render Player API :

    public void afterRender(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) {
        if (var1 instanceof EntityPlayer){
            EntityExtendedPlayer extendedPlayer = EntityExtendedPlayer.get((EntityPlayer)var1);
            if (extendedPlayer.isSitting){
                modelPlayer.onGround = 0.99999F;
                //GL11.glScalef(0.7F, 0.7F, 0.7F);
                modelPlayer.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
                modelPlayer.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
                modelPlayer.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2.5F / 5F);
                modelPlayer.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2.5F / 5F);
                modelPlayer.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
                modelPlayer.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
            }
        }
    }

    public void afterSetRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) {
        if (var7 instanceof EntityPlayer){
            EntityExtendedPlayer extendedPlayer = EntityExtendedPlayer.get((EntityPlayer)var7);
            if (extendedPlayer.isSitting){
                modelPlayer.onGround = 0.99999F;
                //GL11.glScalef(0.7F, 0.7F, 0.7F);
                modelPlayer.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
                modelPlayer.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
                modelPlayer.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2.5F / 5F);
                modelPlayer.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2.5F / 5F);
                modelPlayer.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
                modelPlayer.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
            }
        }
    }

This code is in my ModelExtendedPlayer wich extends the ModelPlayerBase from Render Player API !

 

These two functions are forcing Minecraft to rotate player's legs to make the player sitting ! But like you can see in the photo the player is on the air... This code only rotate the player's members, but not rotate the colision bounding boxes ! The problem is that player colision bounding boxes are same as if the player is standing up ; i need the colision bounding boxes to be scaled by report to my rendering code... Can you do that ?

Link to comment
Share on other sites

I told you that i have no codes about the player height !

 

Is, or is not, your thread titled "change player height"?

 

If it is, what the fuck do you mean by that?

If it isn't it sure looks like it to me!

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.

Link to comment
Share on other sites

Guys, I know you are coders and shit and need specific data, but take a guess what he means, and also to you sir, stop "!!!" every sentence here.

Have you even looked at freaking minecraft code? I mean - boat, pig, horse? It's like given on a plate. Just type "boat" in search and you will get goddamn method!

/**
     * Returns the Y offset from the entity's position for any entity riding this one.
     */
    public double getMountedYOffset()
    {
        return (double)this.height * 0.75D;
    }

 

So HARD?!?!?

Normal: (0.75D)

http://midstcraft.com/75.jpg

Changed: (2.00D)

http://midstcraft.com/200.jpg

 

P.S - this is not a solution, this is just hint :o

Btw. they are kinda right: We don't even know how is your sitDown() function called, it might me Forge event, it might be command, maybe riding/embarking on something :o

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

@Ernio :

The sitting system is using a plan that i've done :

- Client send packet for sit key pressed

- Server recieve data and set the extended player is sitting boolean to true (extended player is an extention of the player)

- For every tick on server, if the current parsing extended player is sitting, then server is sending to client an update for forcing Minecraft client to be in sitting mode

- The at least a class that is binded by Render Player API will check all extended players and render the player as sitting if nessessary.

 

This plan is like that because in old StoneLine, players was able to sit down like they want in multiplayer, so i needed to find a way doing the same in Minecraft Forge 1.6.4 ! Don't think it's heavy, because i already tested that on Pentium 4 (yay a big shit i know), and it runs perfectly, the only problem is that it's lagging if make far render distance...

 

About your code (Entity.height), well, i already tried that and not working it change nothing on the player !

 

@Draco18s :

Well i'm sorry for your last post but i did not understand your two last italic sentences :

If it is, what the fuck do you mean by that?

If it isn't it sure looks like it to me!

Maybe it's english humour...

 

And sorry if my english is bad, because, well, I'm not English or American, but I'm French... And if came here, that's because i'm so loving your language, i found that it's the most cool language i've ever learned... In plus i love Developpement too ; i already made a 2D game using LWJGL OpenGL !

 

 

 

Yuri6037

Link to comment
Share on other sites

No longer need help with that ! I just used the render player API again, that's all ! This is now working :

-Singleplayer

-Multiplayer LAN

-Multiplayer MCPC+ Server

-Multiplayer Minecraft Forge Server !

 

No mods breaks the StoneLineMod ! In plus Smart moving is completely working with the sit system of StoneLine ! As long as I know the only mod that breaks is The Aether 2 !

Strangely SG-Craft is not crashing when make a Stargate in the StoneLine Dimension (and you can use it without crash)...

The only thing that is buggy is some plugins :

- Multiverse is simply ignoring the StoneLine Dimension Generator...

- WorldEdit does not reconize any mod Id...

- Essantials + /spawnmob herobrine only throw a good huge stack trace...

- NoCheat seams to not be friend with the jump boost... Same with the speed boost...

- NoCheat loves so much the sitsit ability of the player : it is banning the poor sitting player for noclip hack, so lol !

- Multiverse inventories not reconize the StoneLine Extended Player Inventory...

- Lockette and LWC seams both hating the StoneLine Roleplay Engine (Secured door with Lockette or LWC throw a class cast exception it tries to cast the Roleplay engine with a chest)...

But WorldGuard seams to love protecting the StoneLineMod containers (no problems !), so yay !

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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