Полёт.

Версия Minecraft
1.7.10
57
2
2
Здравствуйте.

Вопрос такой: как сделать нагрудник со свойством элитр? Но что бы можно было лететь как в низ так и вверх.

Пыталась вставить код из элитр, но не выходит.
 
Последнее редактирование:
Код элитры посмотри, убери зависимость ускорения от вектора взгляда игрока
 
Как, покажи?
По идее вот этот кусок отвечает за ускорение вверх/вниз
Java:
//EntityLivingBase

float f = this.rotationPitch * 0.017453292F;// тут
double d6 = Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z);
double d8 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d1 = vec3d.lengthVector();
float f4 = MathHelper.cos(f);
f4 = (float)((double)f4 * (double)f4 * Math.min(1.0D, d1 / 0.4D));
this.motionY += -0.08D + (double)f4 * 0.06D;// и тут
 

Я покажу завтра когда за комп сяду.






По идее вот этот кусок отвечает за ускорение вверх/вниз
Java:
//EntityLivingBase

float f = this.rotationPitch * 0.017453292F;// тут
double d6 = Math.sqrt(vec3d.x * vec3d.x + vec3d.z * vec3d.z);
double d8 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d1 = vec3d.lengthVector();
float f4 = MathHelper.cos(f);
f4 = (float)((double)f4 * (double)f4 * Math.min(1.0D, d1 / 0.4D));
this.motionY += -0.08D + (double)f4 * 0.06D;// и тут

Я чуть ли ни пол кода из элитр взяла, и он не работет, а вы хотите сказать что вот этот маленький кусочек отвечает за полёт?
 

Вот этот код в броню вставляла
Java:
if (this.motionY > -0.5D)
{
this.fallDistance = 1.0F;
}

Vec3d vec3d = this.getLookVec();
float f = this.rotationPitch * 0.017453292F;
double d6 = Math.sqrt(vec3d.xCoord * vec3d.xCoord + vec3d.zCoord * vec3d.zCoord);
double d8 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d1 = vec3d.lengthVector();
float f4 = MathHelper.cos(f);
f4 = (float)((double)f4 * (double)f4 * Math.min(1.0D, d1 / 0.4D));
this.motionY += -0.08D + (double)f4 * 0.06D;

if (this.motionY < 0.0D && d6 > 0.0D)
{
double d2 = this.motionY * -0.1D * (double)f4;
this.motionY += d2;
this.motionX += vec3d.xCoord * d2 / d6;
this.motionZ += vec3d.zCoord * d2 / d6;
}

if (f < 0.0F)
{
double d9 = d8 * (double)(-MathHelper.sin(f)) * 0.04D;
this.motionY += d9 * 3.2D;
this.motionX -= vec3d.xCoord * d9 / d6;
this.motionZ -= vec3d.zCoord * d9 / d6;
}

if (d6 > 0.0D)
{
this.motionX += (vec3d.xCoord / d6 * d8 - this.motionX) * 0.1D;
this.motionZ += (vec3d.zCoord / d6 * d8 - this.motionZ) * 0.1D;
}

this.motionX *= 0.9900000095367432D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9900000095367432D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);

if (this.isCollidedHorizontally && !this.worldObj.isRemote)
{
double d10 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d3 = d8 - d10;
float f5 = (float)(d3 * 10.0D - 3.0D);

if (f5 > 0.0F)
{
this.playSound(this.getFallSound((int)f5), 1.0F, 1.0F);
this.attackEntityFrom(DamageSource.flyIntoWall, f5);
}
}

if (this.onGround && !this.worldObj.isRemote)
{
this.setFlag(7, false); //Disables elytra flight
}
 
@hohserg1, я пробовала, не выходит.

@Rebel Penguin, я пыталась посмотреть мод "fisk superheroes" и backelytra. Проблема в том что мод после компиляции "скрывает" большую часть кодов. И когда я их открываю то ничего от туда невозможно взять.
плохо декомпелируешь.
сначала можно бы BON'ом пройтись, а потом JD.
 
Вот этот код в броню вставляла
Java:
if (this.motionY > -0.5D)
{
this.fallDistance = 1.0F;
}

Vec3d vec3d = this.getLookVec();
float f = this.rotationPitch * 0.017453292F;
double d6 = Math.sqrt(vec3d.xCoord * vec3d.xCoord + vec3d.zCoord * vec3d.zCoord);
double d8 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d1 = vec3d.lengthVector();
float f4 = MathHelper.cos(f);
f4 = (float)((double)f4 * (double)f4 * Math.min(1.0D, d1 / 0.4D));
this.motionY += -0.08D + (double)f4 * 0.06D;

if (this.motionY < 0.0D && d6 > 0.0D)
{
double d2 = this.motionY * -0.1D * (double)f4;
this.motionY += d2;
this.motionX += vec3d.xCoord * d2 / d6;
this.motionZ += vec3d.zCoord * d2 / d6;
}

if (f < 0.0F)
{
double d9 = d8 * (double)(-MathHelper.sin(f)) * 0.04D;
this.motionY += d9 * 3.2D;
this.motionX -= vec3d.xCoord * d9 / d6;
this.motionZ -= vec3d.zCoord * d9 / d6;
}

if (d6 > 0.0D)
{
this.motionX += (vec3d.xCoord / d6 * d8 - this.motionX) * 0.1D;
this.motionZ += (vec3d.zCoord / d6 * d8 - this.motionZ) * 0.1D;
}

this.motionX *= 0.9900000095367432D;
this.motionY *= 0.9800000190734863D;
this.motionZ *= 0.9900000095367432D;
this.moveEntity(this.motionX, this.motionY, this.motionZ);

if (this.isCollidedHorizontally && !this.worldObj.isRemote)
{
double d10 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double d3 = d8 - d10;
float f5 = (float)(d3 * 10.0D - 3.0D);

if (f5 > 0.0F)
{
this.playSound(this.getFallSound((int)f5), 1.0F, 1.0F);
this.attackEntityFrom(DamageSource.flyIntoWall, f5);
}
}

if (this.onGround && !this.worldObj.isRemote)
{
this.setFlag(7, false); //Disables elytra flight
}
Непонятно, в каком методе это
 
float f = rotationPitch * 0.017453292F;
Вместо rotationPitch поставь желаемое фиксированное значение rotationPitch
 
Назад
Сверху