mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2026-10-28 09:44:56 +00:00
Skip a null tamed owner name when restoring an entity (#1012)
A tamed animal whose owner has no known name is stored with a null owner, and restoring it throws a NullPointerException at the owner step, which drops the rest of the restore. A null owner name is now skipped like an empty one.
This commit is contained in:
1 parent
72d5655ee9
commit
335fec2036
1 file changed
+2
-1
@@ -195,7 +195,8 @@ public class EntityUtil {
|
||||
}
|
||||
else if (count == 1) {
|
||||
String set = (String) value;
|
||||
if (set.length() > 0) {
|
||||
// An owner whose name the server never learned was stored as null
|
||||
if (set != null && set.length() > 0) {
|
||||
Player owner = Bukkit.getServer().getPlayer(set);
|
||||
if (owner == null) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getServer().getOfflinePlayer(set);
|
||||
|
||||
Reference in new issue
Block a user