potion cleanup

This commit is contained in:
Sen 2025-03-26 21:07:23 +01:00
parent 460a58e062
commit e108650cd4
30 changed files with 644 additions and 968 deletions

View file

@ -5,12 +5,13 @@ import java.io.IOException;
import game.network.ClientPlayer;
import game.network.Packet;
import game.network.PacketBuffer;
import game.potion.Potion;
import game.potion.PotionEffect;
public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
{
private int entityId;
private int effectId;
private Potion effectId;
public S1EPacketRemoveEntityEffect()
{
@ -19,7 +20,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
public S1EPacketRemoveEntityEffect(int entityIdIn, PotionEffect effect)
{
this.entityId = entityIdIn;
this.effectId = effect.getPotionID();
this.effectId = effect.getPotion();
}
/**
@ -28,7 +29,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
public void readPacketData(PacketBuffer buf) throws IOException
{
this.entityId = buf.readVarIntFromBuffer();
this.effectId = buf.readUnsignedByte();
this.effectId = buf.readEnumValue(Potion.class);
}
/**
@ -37,7 +38,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeVarIntToBuffer(this.entityId);
buf.writeByte(this.effectId);
buf.writeEnumValue(this.effectId);
}
/**
@ -53,7 +54,7 @@ public class S1EPacketRemoveEntityEffect implements Packet<ClientPlayer>
return this.entityId;
}
public int getEffectId()
public Potion getEffectId()
{
return this.effectId;
}