mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
Fixed serialisation of vectors.
This commit is contained in:
parent
4e4ed6c893
commit
626861aa99
@ -20,6 +20,7 @@
|
||||
package com.sk89q.util.yaml;
|
||||
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
@ -118,6 +119,25 @@ private Object prepareSerialization(Object value) {
|
||||
out.put("y", vec.getY());
|
||||
out.put("z", vec.getZ());
|
||||
return out;
|
||||
} else if (value instanceof BlockVector3) {
|
||||
Map<String, Integer> out = new LinkedHashMap<>();
|
||||
BlockVector3 vec = (BlockVector3) value;
|
||||
out.put("x", vec.getBlockX());
|
||||
out.put("y", vec.getBlockY());
|
||||
out.put("z", vec.getBlockZ());
|
||||
return out;
|
||||
} else if (value instanceof Vector2) {
|
||||
Map<String, Double> out = new LinkedHashMap<>();
|
||||
Vector2 vec = (Vector2) value;
|
||||
out.put("x", vec.getX());
|
||||
out.put("z", vec.getZ());
|
||||
return out;
|
||||
} else if (value instanceof BlockVector2) {
|
||||
Map<String, Integer> out = new LinkedHashMap<>();
|
||||
BlockVector2 vec = (BlockVector2) value;
|
||||
out.put("x", vec.getBlockX());
|
||||
out.put("z", vec.getBlockZ());
|
||||
return out;
|
||||
}
|
||||
|
||||
return value;
|
||||
|
Loading…
Reference in New Issue
Block a user