When duration is set to 0, use the maximum possible duration for serialization

This commit is contained in:
Marcel Konrad
2020-07-01 23:22:35 +02:00
parent b94ae1d1ed
commit 981d74f213

View File

@@ -104,9 +104,10 @@ public class EffectNBT implements INBTWritable
public CompoundNBT serialize()
{
CompoundNBT compound = new CompoundNBT();
int ticks = this.toTicks();
compound.putByte("Amplifier", (byte) (this.amplifier - 1));
compound.putInt("Duration", Math.min(this.toTicks(), 1000000));
compound.putInt("Duration", ticks > 0 ? ticks : 1000000);
compound.putBoolean("Ambient", this.ambient);
compound.putBoolean("ShowParticles", this.showParticles);