mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 07:28:19 +01:00
Guardian target fix (#791)
This commit is contained in:
parent
71b6e8df90
commit
81b4c3158d
@ -3,6 +3,7 @@ package net.minestom.server.entity.metadata.monster;
|
||||
import net.minestom.server.entity.Entity;
|
||||
import net.minestom.server.entity.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class GuardianMeta extends MonsterMeta {
|
||||
public static final byte OFFSET = MonsterMeta.MAX_OFFSET;
|
||||
@ -26,9 +27,9 @@ public class GuardianMeta extends MonsterMeta {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
public void setTarget(@NotNull Entity target) {
|
||||
public void setTarget(@Nullable Entity target) {
|
||||
this.target = target;
|
||||
super.metadata.setIndex(OFFSET + 1, Metadata.VarInt(target.getEntityId()));
|
||||
super.metadata.setIndex(OFFSET + 1, Metadata.VarInt(target == null ? 0 : target.getEntityId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user