Skip to content

Commit

Permalink
Fix NbtAdapterRegistry extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauriichan committed Apr 14, 2021
1 parent 00270b2 commit 88258b4
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@
import com.syntaxphoenix.syntaxapi.data.DataAdapter;
import com.syntaxphoenix.syntaxapi.data.DataAdapterRegistry;
import com.syntaxphoenix.syntaxapi.nbt.NbtTag;
import com.syntaxphoenix.syntaxapi.nbt.NbtType;

public class NbtAdapterRegistry extends DataAdapterRegistry<NbtTag> {

public Object extract(NbtTag base) {
return extract(base.getType().getOwningClass(), base);
if (base.getType() == NbtType.END) {
return null;
}
Object value = extract(base.getValue().getClass(), base);
if (value instanceof NbtTag) {
return extract((NbtTag) value);
}
return value;
}

@Override
Expand Down

0 comments on commit 88258b4

Please sign in to comment.