File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/main/java/net/coreprotect Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ else if (entity instanceof Player) {
289289 if (attributeInstance != null ) {
290290 List <Object > attributeData = new ArrayList <>();
291291 List <Object > attributeModifiers = new ArrayList <>();
292- attributeData .add (attributeInstance .getAttribute ());
292+ attributeData .add (BukkitAdapter . ADAPTER . getRegistryKey ( attributeInstance .getAttribute () ));
293293 attributeData .add (attributeInstance .getBaseValue ());
294294
295295 for (AttributeModifier modifier : attributeInstance .getModifiers ()) {
Original file line number Diff line number Diff line change @@ -166,7 +166,13 @@ else if (count == 1) {
166166 for (Object value : attributes ) {
167167 @ SuppressWarnings ("unchecked" )
168168 List <Object > attributeData = (List <Object >) value ;
169- Attribute attribute = (Attribute ) attributeData .get (0 );
169+ Attribute attribute = null ;
170+ if (attributeData .get (0 ) instanceof Attribute ) {
171+ attribute = (Attribute ) attributeData .get (0 );
172+ }
173+ else {
174+ attribute = (Attribute ) BukkitAdapter .ADAPTER .getRegistryValue ((String ) attributeData .get (0 ), Attribute .class );
175+ }
170176 Double baseValue = (Double ) attributeData .get (1 );
171177 @ SuppressWarnings ("unchecked" )
172178 List <Object > attributeModifiers = (List <Object >) attributeData .get (2 );
You can’t perform that action at this time.
0 commit comments