mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fix #1.
Fix custom machine crashing clients/invalidating packets due to buffer underflow.
This commit is contained in:
parent
5746a90cb7
commit
3882b9b82c
@ -231,6 +231,8 @@ public class TileEntityCustomMachine extends TileEntityMachinePolluting implemen
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
|
||||
BufferUtil.writeString(buf, this.machineType);
|
||||
|
||||
buf.writeLong(power);
|
||||
buf.writeInt(progress);
|
||||
buf.writeInt(flux);
|
||||
@ -596,13 +598,13 @@ public class TileEntityCustomMachine extends TileEntityMachinePolluting implemen
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getReceiverSpeed() {
|
||||
if(this.config != null && !this.config.generatorMode) return this.getMaxPower();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getProviderSpeed() {
|
||||
if(this.config != null && this.config.generatorMode) return this.getMaxPower();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user