Fixed EntityCreeper metadata

This commit is contained in:
Felix Cravic 2020-12-02 20:35:09 +01:00
parent 181f20289c
commit 635d6f9f95
2 changed files with 6 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import java.util.function.Consumer;
public class EntityCreeper extends EntityCreature implements Monster {
private CreeperState creeperState;
private CreeperState creeperState = CreeperState.IDLE;
private boolean charged;
private boolean ignited;
@ -47,11 +47,12 @@ public class EntityCreeper extends EntityCreature implements Monster {
}
}
@NotNull
public CreeperState getCreeperState() {
return creeperState;
}
public void setCreeperState(CreeperState creeperState) {
public void setCreeperState(@NotNull CreeperState creeperState) {
this.creeperState = creeperState;
sendMetadataIndex(15);
}

View File

@ -2,6 +2,7 @@ package net.minestom.server.utils;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import net.minestom.server.MinecraftServer;
import net.minestom.server.entity.Player;
import net.minestom.server.listener.manager.PacketListenerManager;
@ -58,7 +59,8 @@ public final class PacketUtils {
final PlayerConnection playerConnection = player.getPlayerConnection();
if (playerConnection instanceof NettyPlayerConnection) {
final NettyPlayerConnection nettyPlayerConnection = (NettyPlayerConnection) playerConnection;
nettyPlayerConnection.getChannel().write(framedPacket).addListener((p) -> finalBuffer.release());
final Channel channel = nettyPlayerConnection.getChannel();
channel.write(framedPacket).addListener((p) -> finalBuffer.release());
} else {
playerConnection.sendPacket(packet);
finalBuffer.release();