@@ -0,0 +1,1967 @@
+package net.engin33r.luaspigot.lua.type;%0A%0Aimport net.engin33r.luaspigot.lua.LinkedField;%0Aimport net.engin33r.luaspigot.lua.WeakType;%0Aimport org.bukkit.util.Vector;%0Aimport org.luaj.vm2.LuaValue;%0A%0A/**%0A * Utility type describing a vector.%0A */%0Apublic class LuaVector extends WeakType %7B%0A    private Vector vec;%0A    private static LuaValue typeMetatable = LuaValue.tableOf();%0A%0A    public LuaVector(Vector vec) %7B%0A        this.vec = vec;%0A%0A        registerLinkedField(%22x%22, new LuaVector.XField(this));%0A        registerLinkedField(%22y%22, new LuaVector.YField(this));%0A        registerLinkedField(%22z%22, new LuaVector.ZField(this));%0A    %7D%0A%0A    public LuaVector(double x, double y, double z) %7B%0A        this(new Vector(x, y, z));%0A    %7D%0A%0A    @Override%0A    protected LuaValue getMetatable() %7B%0A        return typeMetatable;%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return %22vector%22;%0A    %7D%0A%0A    private class XField extends LinkedField%3CLuaVector%3E %7B%0A        public XField(LuaVector self) %7B super(self); %7D%0A%0A        @Override%0A        public void update(LuaValue val) %7B%0A            vec.setX(val.checkdouble());%0A        %7D%0A%0A        @Override%0A        public LuaValue query() %7B%0A            return LuaValue.valueOf(LuaVector.this.vec.getX());%0A        %7D%0A    %7D%0A%0A    private class YField extends LinkedField%3CLuaVector%3E %7B%0A        public YField(LuaVector self) %7B super(self); %7D%0A%0A        @Override%0A        public void update(LuaValue val) %7B%0A            vec.setY(val.checkdouble());%0A        %7D%0A%0A        @Override%0A        public LuaValue query() %7B%0A            return LuaValue.valueOf(LuaVector.this.vec.getY());%0A        %7D%0A    %7D%0A%0A    private class ZField extends LinkedField%3CLuaVector%3E %7B%0A        public ZField(LuaVector self) %7B super(self); %7D%0A%0A        @Override%0A        public void update(LuaValue val) %7B%0A            vec.setZ(val.checkdouble());%0A        %7D%0A%0A        @Override%0A        public LuaValue query() %7B%0A            return LuaValue.valueOf(LuaVector.this.vec.getZ());%0A        %7D%0A    %7D%0A%7D%0A

Add utility class for vectors