Update version to 1.0.1.1

This commit is contained in:
Zontreck 2022-10-17 23:46:20 -07:00
parent 51043006b5
commit 4d25c900bb
6 changed files with 73 additions and 3 deletions

View file

@ -1,5 +1,7 @@
package dev.zontreck.libzontreck.vectors;
import net.minecraft.nbt.CompoundTag;
/*
* This is a non-serializable instanced Vector that is meant to slam positions down as a integer
*/
@ -15,4 +17,32 @@ public class NonAbsVector3
y = Math.round(origin.y);
z = Math.round(origin.z);
}
public CompoundTag serialize()
{
CompoundTag tag = new CompoundTag();
tag.putLong("x", x);
tag.putLong("y", y);
tag.putLong("z", z);
return tag;
}
public NonAbsVector3(CompoundTag tag) {
this.deserialize(tag);
}
public void deserialize(CompoundTag tag)
{
x=tag.getLong("x");
y=tag.getLong("y");
z=tag.getLong("z");
}
public boolean same(NonAbsVector3 other)
{
if(x == other.x && y==other.y && z==other.z)return true;
else return false;
}
}

View file

@ -1,6 +1,7 @@
package dev.zontreck.libzontreck.vectors;
import dev.zontreck.libzontreck.exceptions.InvalidDeserialization;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
@ -65,4 +66,29 @@ public class Vector2
{
return "<"+String.valueOf(x)+", "+String.valueOf(y) + ">";
}
public CompoundTag serialize()
{
CompoundTag tag = new CompoundTag();
tag.putFloat("x", x);
tag.putFloat("y", y);
return tag;
}
public Vector2(CompoundTag tag) {
this.deserialize(tag);
}
public void deserialize(CompoundTag tag)
{
x=tag.getFloat("x");
y=tag.getFloat("y");
}
public boolean same(Vector2 other)
{
if(x == other.x && y==other.y)return true;
else return false;
}
}

View file

@ -137,4 +137,11 @@ public class Vector3
y=tag.getDouble("y");
z=tag.getDouble("z");
}
public boolean same(Vector3 other)
{
if(x == other.x && y==other.y && z==other.z)return true;
else return false;
}
}

View file

@ -92,4 +92,11 @@ public class WorldPosition
return dimL;
}
public boolean same(WorldPosition other)
{
if(Position.same(other.Position) && Dimension == other.Dimension)return true;
else return false;
}
}