mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +01:00
Added jumping and sneaking when previewing a skin
This commit is contained in:
parent
65c8220d7a
commit
efc5d2932a
3 changed files with 32 additions and 2 deletions
|
@ -110,6 +110,26 @@ public class EntityPlayerModel extends EntityLivingBase implements IBlankSkinSup
|
||||||
}
|
}
|
||||||
|
|
||||||
swingProgress = swingProgressInt / 8F;
|
swingProgress = swingProgressInt / 8F;
|
||||||
|
|
||||||
|
motionY *= 0.98;
|
||||||
|
if (Math.abs(motionY) < 0.003) {
|
||||||
|
motionY = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (posY == 0 && isJumping) {
|
||||||
|
jump();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
motionY -= 0.08D;
|
||||||
|
motionY *= 0.9800000190734863D;
|
||||||
|
|
||||||
|
posY += motionY;
|
||||||
|
|
||||||
|
if (posY < 0) {
|
||||||
|
posY = 0;
|
||||||
|
}
|
||||||
|
onGround = posY == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,6 @@ import com.minelittlepony.gui.Button;
|
||||||
import com.minelittlepony.gui.GameGui;
|
import com.minelittlepony.gui.GameGui;
|
||||||
import com.minelittlepony.gui.IconicButton;
|
import com.minelittlepony.gui.IconicButton;
|
||||||
import com.minelittlepony.gui.Label;
|
import com.minelittlepony.gui.Label;
|
||||||
import com.minelittlepony.util.math.MathUtil;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||||
|
@ -394,6 +393,17 @@ public class GuiSkins extends GameGui {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawContents(int mouseX, int mouseY, float partialTick) {
|
protected void drawContents(int mouseX, int mouseY, float partialTick) {
|
||||||
|
|
||||||
|
|
||||||
|
boolean sneak = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||||
|
|
||||||
|
localPlayer.setSneaking(sneak);
|
||||||
|
remotePlayer.setSneaking(sneak);
|
||||||
|
|
||||||
|
boolean jump = Keyboard.isKeyDown(Keyboard.KEY_SPACE);
|
||||||
|
localPlayer.setJumping(jump);
|
||||||
|
remotePlayer.setJumping(jump);
|
||||||
|
|
||||||
float deltaTime = panorama.getDelta(partialTick);
|
float deltaTime = panorama.getDelta(partialTick);
|
||||||
panorama.render(partialTick, zLevel);
|
panorama.render(partialTick, zLevel);
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving
|
||||||
player.leftArmPose = ArmPose.EMPTY;
|
player.leftArmPose = ArmPose.EMPTY;
|
||||||
player.rightArmPose = ArmPose.EMPTY;
|
player.rightArmPose = ArmPose.EMPTY;
|
||||||
|
|
||||||
double offset = entity.getYOffset() + 0.01;
|
double offset = entity.getYOffset() + entity.posY + 0.01;
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
enableBlend();
|
enableBlend();
|
||||||
|
|
Loading…
Reference in a new issue