mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Holy SHIT! i think i fixed it
This commit is contained in:
parent
4d489bc938
commit
ccebbbca24
@ -272,6 +272,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
@Override
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
super.deserialize(buf);
|
super.deserialize(buf);
|
||||||
|
this.turnProgress = 2;
|
||||||
this.tPos = BufferUtil.readVec3(buf);
|
this.tPos = BufferUtil.readVec3(buf);
|
||||||
this.rotationPitch = buf.readDouble();
|
this.rotationPitch = buf.readDouble();
|
||||||
this.rotationYaw = buf.readDouble();
|
this.rotationYaw = buf.readDouble();
|
||||||
|
|||||||
@ -262,19 +262,30 @@ public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT implements I
|
|||||||
|
|
||||||
this.power -= demand;
|
this.power -= demand;
|
||||||
|
|
||||||
|
this.shot = true;
|
||||||
this.networkPackNT(250);
|
this.networkPackNT(250);
|
||||||
|
this.shot = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shot = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void serialize(ByteBuf buf) {
|
public void serialize(ByteBuf buf) {
|
||||||
buf.writeBoolean(true);
|
if (this.shot)
|
||||||
|
buf.writeBoolean(true);
|
||||||
|
else {
|
||||||
|
buf.writeBoolean(false);
|
||||||
|
super.serialize(buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
if(buf.readBoolean())
|
if(buf.readBoolean())
|
||||||
this.beam = 5;
|
this.beam = 5;
|
||||||
else
|
else
|
||||||
this.beam = 0;
|
super.deserialize(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -105,20 +105,32 @@ public class TileEntityTurretRichard extends TileEntityTurretBaseNT {
|
|||||||
this.loaded = 0;
|
this.loaded = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.isTurretPacket = true;
|
||||||
this.networkPackNT(250);
|
this.networkPackNT(250);
|
||||||
|
this.isTurretPacket = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// wow so descriptive, i dont wanna hear it; it solves the problem
|
||||||
|
private boolean isTurretPacket = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(ByteBuf buf) {
|
||||||
|
if (this.isTurretPacket) {
|
||||||
|
buf.writeBoolean(true);
|
||||||
|
buf.writeInt(this.loaded);
|
||||||
|
} else {
|
||||||
|
buf.writeBoolean(false);
|
||||||
|
super.serialize(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void serialize(ByteBuf buf) {
|
|
||||||
super.serialize(buf);
|
|
||||||
buf.writeInt(this.loaded);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
super.deserialize(buf);
|
if(buf.readBoolean()) {
|
||||||
this.loaded = buf.readInt();
|
this.loaded = buf.readInt();
|
||||||
|
} else
|
||||||
|
super.deserialize(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -131,7 +131,9 @@ public class TileEntityTurretTauon extends TileEntityTurretBaseNT {
|
|||||||
this.conusmeAmmo(conf.ammo);
|
this.conusmeAmmo(conf.ammo);
|
||||||
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:weapon.tauShoot", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
|
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:weapon.tauShoot", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
|
||||||
|
|
||||||
|
this.shot = true;
|
||||||
this.networkPackNT(250);
|
this.networkPackNT(250);
|
||||||
|
this.shot = false;
|
||||||
|
|
||||||
Vec3 pos = this.getTurretPos();
|
Vec3 pos = this.getTurretPos();
|
||||||
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
|
||||||
@ -146,16 +148,24 @@ public class TileEntityTurretTauon extends TileEntityTurretBaseNT {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean shot = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(ByteBuf buf) {
|
public void serialize(ByteBuf buf) {
|
||||||
super.serialize(buf);
|
if (this.shot)
|
||||||
buf.writeBoolean(true);
|
buf.writeBoolean(true);
|
||||||
|
else {
|
||||||
|
buf.writeBoolean(false);
|
||||||
|
super.serialize(buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
super.deserialize(buf);
|
if(buf.readBoolean())
|
||||||
this.beam = buf.readBoolean() ? 3 : 0;
|
this.beam = 3;
|
||||||
|
else
|
||||||
|
super.deserialize(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user