mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Make the floaty special thingie move more awesome!
This commit is contained in:
parent
fd50e20005
commit
2610bb8699
1 changed files with 6 additions and 17 deletions
|
@ -26,7 +26,6 @@ import java.util.Calendar;
|
||||||
|
|
||||||
public class RenderSpecial{
|
public class RenderSpecial{
|
||||||
|
|
||||||
private double lastTimeForBobbing;
|
|
||||||
private ItemStack theThingToRender;
|
private ItemStack theThingToRender;
|
||||||
|
|
||||||
public RenderSpecial(ItemStack stack){
|
public RenderSpecial(ItemStack stack){
|
||||||
|
@ -46,13 +45,8 @@ public class RenderSpecial{
|
||||||
float size = isBlock ? 0.5F : 0.4F;
|
float size = isBlock ? 0.5F : 0.4F;
|
||||||
double offsetUp = isBlock ? 0D : 0.1875D;
|
double offsetUp = isBlock ? 0D : 0.1875D;
|
||||||
|
|
||||||
double bobHeight = 70;
|
double bobHeight = 0.3;
|
||||||
double theTime = Minecraft.getSystemTime();
|
double boop = Minecraft.getSystemTime()/1000D;
|
||||||
double time = theTime/50;
|
|
||||||
|
|
||||||
if(time-bobHeight >= lastTimeForBobbing){
|
|
||||||
this.lastTimeForBobbing = time;
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
@ -60,18 +54,13 @@ public class RenderSpecial{
|
||||||
Vec3 playerPos = player.getPositionEyes(partialTicks);
|
Vec3 playerPos = player.getPositionEyes(partialTicks);
|
||||||
GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord-(player.isSneaking() || Minecraft.getMinecraft().thePlayer.isSneaking() ? 0.125D : 0D), playerPos.zCoord-currentPos.zCoord);
|
GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord-(player.isSneaking() || Minecraft.getMinecraft().thePlayer.isSneaking() ? 0.125D : 0D), playerPos.zCoord-currentPos.zCoord);
|
||||||
|
|
||||||
GlStateManager.translate(0D, 2.535D+offsetUp, 0D);
|
GlStateManager.translate(0D, 2.435D+offsetUp, 0D);
|
||||||
GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F);
|
GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F);
|
||||||
GlStateManager.scale(size, size, size);
|
GlStateManager.scale(size, size, size);
|
||||||
|
|
||||||
if(time-(bobHeight/2) >= lastTimeForBobbing){
|
// Make the floaty stuff look nice using sine waves \o/
|
||||||
GlStateManager.translate(0D, (time-this.lastTimeForBobbing)/100D, 0D);
|
GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*bobHeight, 0D);
|
||||||
}
|
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0);
|
||||||
else{
|
|
||||||
GlStateManager.translate(0D, -(time-lastTimeForBobbing)/100D+bobHeight/100D, 0D);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.rotate((float)(theTime/20), 0, 1, 0);
|
|
||||||
|
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
if(this.theThingToRender != null){
|
if(this.theThingToRender != null){
|
||||||
|
|
Loading…
Reference in a new issue