mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 19:18:12 +01:00
Fixed EntityCreeper metadata
This commit is contained in:
parent
181f20289c
commit
635d6f9f95
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user