diff --git a/pom.xml b/pom.xml
index 985fff42f..e6c6328aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -334,7 +334,7 @@
com.github.kotlin-graphics
glm
- 1.0.1
+ 0.9.9.1-build-3
com.github.oshi
diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/SectionArrayMesh.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/SectionArrayMesh.kt
index 171bfe171..0b6685044 100644
--- a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/SectionArrayMesh.kt
+++ b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/SectionArrayMesh.kt
@@ -17,7 +17,6 @@ import de.bixilon.minosoft.data.text.ChatColors
import de.bixilon.minosoft.data.text.RGBColor
import de.bixilon.minosoft.gui.rendering.textures.Texture
import de.bixilon.minosoft.gui.rendering.util.Mesh
-import glm_.BYTES
import glm_.vec2.Vec2
import glm_.vec3.Vec3
import org.lwjgl.opengl.GL11.GL_FLOAT
@@ -51,19 +50,19 @@ class SectionArrayMesh : Mesh(initialCacheSize = 100000) {
override fun load() {
super.initializeBuffers(FLOATS_PER_VERTEX)
var index = 0
- glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, 0L)
+ glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, 0L)
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 2, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (3 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 2, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (3 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (5 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (5 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (6 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (6 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (7 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (7 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
super.unbind()
diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/models/AABB.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/models/AABB.kt
index 93339fac7..105d44ced 100644
--- a/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/models/AABB.kt
+++ b/src/main/java/de/bixilon/minosoft/gui/rendering/chunk/models/AABB.kt
@@ -5,6 +5,7 @@ import com.google.gson.JsonElement
import com.google.gson.JsonObject
import de.bixilon.minosoft.data.Axes
import de.bixilon.minosoft.gui.rendering.util.VecUtil
+import de.bixilon.minosoft.gui.rendering.util.VecUtil.plus
import de.bixilon.minosoft.gui.rendering.util.VecUtil.toVec3
import glm_.Java.Companion.glm
import glm_.vec3.Vec3
@@ -32,7 +33,7 @@ class AABB {
}
fun intersect(other: AABB): Boolean {
- return (min.x <= other.max.x && max.x >= other.min.x) &&
+ return (min.x <= other.max.x && max.x >= other.min.x) &&
(min.y <= other.max.y && max.y >= other.min.y) &&
(min.z <= other.max.z && max.z >= other.min.z)
}
@@ -42,7 +43,7 @@ class AABB {
}
operator fun plus(vec3i: Vec3i): AABB {
- return AABB(min + vec3i, max + vec3i)
+ return AABB(vec3i plus min, vec3i plus max)
}
operator fun plus(other: AABB): AABB {
diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDMesh.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDMesh.kt
index 899a305f0..3762937dd 100644
--- a/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDMesh.kt
+++ b/src/main/java/de/bixilon/minosoft/gui/rendering/hud/HUDMesh.kt
@@ -14,7 +14,6 @@
package de.bixilon.minosoft.gui.rendering.hud
import de.bixilon.minosoft.gui.rendering.util.Mesh
-import glm_.BYTES
import org.lwjgl.opengl.GL11.GL_FLOAT
import org.lwjgl.opengl.GL20.glEnableVertexAttribArray
import org.lwjgl.opengl.GL20.glVertexAttribPointer
@@ -24,13 +23,13 @@ class HUDMesh : Mesh() {
override fun load() {
super.initializeBuffers(FLOATS_PER_VERTEX)
var index = 0
- glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, 0L)
+ glVertexAttribPointer(index, 3, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, 0L)
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 2, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (3 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 2, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (3 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (5 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (5 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
- glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.BYTES, (6 * Float.BYTES).toLong())
+ glVertexAttribPointer(index, 1, GL_FLOAT, false, FLOATS_PER_VERTEX * Float.SIZE_BYTES, (6 * Float.SIZE_BYTES).toLong())
glEnableVertexAttribArray(index++)
super.unbind()
}
diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/util/VecUtil.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/util/VecUtil.kt
index b9d4562b4..9328152c8 100644
--- a/src/main/java/de/bixilon/minosoft/gui/rendering/util/VecUtil.kt
+++ b/src/main/java/de/bixilon/minosoft/gui/rendering/util/VecUtil.kt
@@ -153,15 +153,15 @@ object VecUtil {
return this + direction?.directionVector
}
- infix fun Vec3i.plus(input: Vec3): Vec3 {
+ infix operator fun Vec3i.plus(input: Vec3): Vec3 {
return Vec3(input.x + x, input.y + y, input.z + z)
}
- operator fun Vec2i.plus(vec3: Vec3i): Vec2i {
+ infix operator fun Vec2i.plus(vec3: Vec3i): Vec2i {
return Vec2i(x + vec3.x, y + vec3.z)
}
- operator fun Vec2i.plus(direction: Directions): Vec2i {
+ infix operator fun Vec2i.plus(direction: Directions): Vec2i {
return this + direction.directionVector
}
}
diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketExplosion.java b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketExplosion.java
index 0f039eeca..0bf812933 100644
--- a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketExplosion.java
+++ b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketExplosion.java
@@ -55,9 +55,9 @@ public class PacketExplosion extends ClientboundPacket {
public void handle(Connection connection) {
// remove all blocks set by explosion
for (byte[] record : getRecords()) {
- int x = getPosition().x + record[0];
- int y = getPosition().y + record[1];
- int z = getPosition().z + record[2];
+ int x = getPosition().getX() + record[0];
+ int y = getPosition().getY() + record[1];
+ int z = getPosition().getZ() + record[2];
Vec3i blockPosition = new Vec3i(x, (short) y, z);
connection.getWorld().setBlock(blockPosition, null);
}
diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketInteractEntity.java b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketInteractEntity.java
index 055aa13e4..8b27eb6f3 100644
--- a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketInteractEntity.java
+++ b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketInteractEntity.java
@@ -64,9 +64,9 @@ public class PacketInteractEntity implements ServerboundPacket {
if (buffer.getVersionId() >= V_14W32A) {
if (this.click == EntityInteractionClicks.INTERACT_AT) {
// position
- buffer.writeFloat(this.position.x);
- buffer.writeFloat(this.position.y);
- buffer.writeFloat(this.position.z);
+ buffer.writeFloat(this.position.getX());
+ buffer.writeFloat(this.position.getY());
+ buffer.writeFloat(this.position.getZ());
}
if (this.click == EntityInteractionClicks.INTERACT_AT || this.click == EntityInteractionClicks.INTERACT) {
diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionAndRotationSending.java b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionAndRotationSending.java
index dad3e12b0..b8ef2180e 100644
--- a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionAndRotationSending.java
+++ b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionAndRotationSending.java
@@ -37,12 +37,12 @@ public class PacketPlayerPositionAndRotationSending implements ServerboundPacket
@Override
public OutPacketBuffer write(Connection connection) {
OutPacketBuffer buffer = new OutPacketBuffer(connection, PacketTypes.Serverbound.PLAY_PLAYER_POSITION_AND_ROTATION);
- buffer.writeDouble(this.position.x);
- buffer.writeDouble(this.position.y);
+ buffer.writeDouble(this.position.getX());
+ buffer.writeDouble(this.position.getY());
if (buffer.getVersionId() < V_14W06B) {
- buffer.writeDouble(this.position.y - 1.62);
+ buffer.writeDouble(this.position.getY() - 1.62);
}
- buffer.writeDouble(this.position.z);
+ buffer.writeDouble(this.position.getZ());
buffer.writeFloat(this.rotation.getYaw());
buffer.writeFloat(this.rotation.getPitch());
buffer.writeBoolean(this.onGround);
diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionSending.java b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionSending.java
index 634f91cbe..491407120 100644
--- a/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionSending.java
+++ b/src/main/java/de/bixilon/minosoft/protocol/packets/serverbound/play/PacketPlayerPositionSending.java
@@ -34,12 +34,12 @@ public class PacketPlayerPositionSending implements ServerboundPacket {
@Override
public OutPacketBuffer write(Connection connection) {
OutPacketBuffer buffer = new OutPacketBuffer(connection, PacketTypes.Serverbound.PLAY_PLAYER_POSITION);
- buffer.writeDouble(this.position.x);
- buffer.writeDouble(this.position.y);
+ buffer.writeDouble(this.position.getX());
+ buffer.writeDouble(this.position.getY());
if (buffer.getVersionId() < V_14W06B) {
buffer.writeDouble(0.0); // ToDo
}
- buffer.writeDouble(this.position.z);
+ buffer.writeDouble(this.position.getZ());
buffer.writeBoolean(this.onGround);
return buffer;
}
diff --git a/src/main/java/de/bixilon/minosoft/protocol/protocol/OutByteBuffer.java b/src/main/java/de/bixilon/minosoft/protocol/protocol/OutByteBuffer.java
index 819a20474..72677ecf9 100644
--- a/src/main/java/de/bixilon/minosoft/protocol/protocol/OutByteBuffer.java
+++ b/src/main/java/de/bixilon/minosoft/protocol/protocol/OutByteBuffer.java
@@ -150,10 +150,10 @@ public class OutByteBuffer {
return;
}
if (this.versionId < V_18W43A) {
- writeLong((((long) position.x & 0x3FFFFFF) << 38) | (((long) position.z & 0x3FFFFFF)) | ((long) position.y & 0xFFF) << 26);
+ writeLong((((long) position.getX() & 0x3FFFFFF) << 38) | (((long) position.getZ() & 0x3FFFFFF)) | ((long) position.getY() & 0xFFF) << 26);
return;
}
- writeLong((((long) (position.x & 0x3FFFFFF) << 38) | ((long) (position.z & 0x3FFFFFF) << 12) | (long) (position.y & 0xFFF)));
+ writeLong((((long) (position.getX() & 0x3FFFFFF) << 38) | ((long) (position.getZ() & 0x3FFFFFF) << 12) | (long) (position.getY() & 0xFFF)));
}
public void writeVarInt(int value) {
@@ -215,9 +215,9 @@ public class OutByteBuffer {
}
public void writeVec3iByte(Vec3i position) {
- writeInt(position.x);
- writeByte((byte) (int) position.y);
- writeInt(position.z);
+ writeInt(position.getX());
+ writeByte((byte) (int) position.getY());
+ writeInt(position.getZ());
}
public byte[] toByteArray() {
diff --git a/src/main/java/de/bixilon/minosoft/util/nbt/tag/CompoundTag.java b/src/main/java/de/bixilon/minosoft/util/nbt/tag/CompoundTag.java
index 4ba52d272..19632d96b 100644
--- a/src/main/java/de/bixilon/minosoft/util/nbt/tag/CompoundTag.java
+++ b/src/main/java/de/bixilon/minosoft/util/nbt/tag/CompoundTag.java
@@ -170,9 +170,9 @@ public class CompoundTag extends NBTTag {
if (this.isFinal) {
throw new IllegalArgumentException("This tag is marked as final!");
}
- this.data.put("x", new IntTag(position.x));
- this.data.put("y", new IntTag(position.y));
- this.data.put("z", new IntTag(position.z));
+ this.data.put("x", new IntTag(position.getX()));
+ this.data.put("y", new IntTag(position.getY()));
+ this.data.put("z", new IntTag(position.getZ()));
}
public CompoundTag removeKey(String key) {