forked from github-mirror/CoreProtect
Fixed NotSerializableException when sacrificing entities (fixes #666)
This commit is contained in:
1 parent
ad4b0ddf24
commit
2780a9af27
2 files changed
+8
-2
No files matched your search
@@ -289,7 +289,7 @@ public final class EntityDeathListener extends Queue implements Listener {
|
||||
if (attributeInstance != null) {
|
||||
List<Object> attributeData = new ArrayList<>();
|
||||
List<Object> attributeModifiers = new ArrayList<>();
|
||||
attributeData.add(attributeInstance.getAttribute());
|
||||
attributeData.add(BukkitAdapter.ADAPTER.getRegistryKey(attributeInstance.getAttribute()));
|
||||
attributeData.add(attributeInstance.getBaseValue());
|
||||
|
||||
for (AttributeModifier modifier : attributeInstance.getModifiers()) {
|
||||
|
||||
@@ -166,7 +166,13 @@ public class EntityUtil {
|
||||
for (Object value : attributes) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> attributeData = (List<Object>) value;
|
||||
Attribute attribute = (Attribute) attributeData.get(0);
|
||||
Attribute attribute = null;
|
||||
if (attributeData.get(0) instanceof Attribute) {
|
||||
attribute = (Attribute) attributeData.get(0);
|
||||
}
|
||||
else {
|
||||
attribute = (Attribute) BukkitAdapter.ADAPTER.getRegistryValue((String) attributeData.get(0), Attribute.class);
|
||||
}
|
||||
Double baseValue = (Double) attributeData.get(1);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Object> attributeModifiers = (List<Object>) attributeData.get(2);
|
||||
|
||||
Reference in new issue
Block a user