Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Handle effects with infinite duration (#3834)
Dieser Commit ist enthalten in:
Ursprung
231e9a1cc6
Commit
6791acd215
@ -45,9 +45,15 @@ public class JavaUpdateMobEffectTranslator extends PacketTranslator<ClientboundU
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
int duration = packet.getDuration();
|
||||
if (duration < 0) {
|
||||
// java edition uses -1 for infinite, but bedrock doesn't have infinite
|
||||
duration = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
MobEffectPacket mobEffectPacket = new MobEffectPacket();
|
||||
mobEffectPacket.setAmplifier(packet.getAmplifier());
|
||||
mobEffectPacket.setDuration(packet.getDuration());
|
||||
mobEffectPacket.setDuration(duration);
|
||||
mobEffectPacket.setEvent(MobEffectPacket.Event.ADD);
|
||||
mobEffectPacket.setRuntimeEntityId(entity.getGeyserId());
|
||||
mobEffectPacket.setParticles(packet.isShowParticles());
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren