diff --git a/src/itemdrop.zig b/src/itemdrop.zig index b2541e6d..fdf7cc9d 100644 --- a/src/itemdrop.zig +++ b/src/itemdrop.zig @@ -553,7 +553,7 @@ pub const ItemDropRenderer = struct { // MARK: ItemDropRenderer fn getSlot(len: u31) u31 { for(freeSlots.items, 0..) |potentialSlot, i| { - if(std.meta.eql(len, potentialSlot.len)) { + if(len == potentialSlot.len) { _ = freeSlots.swapRemove(i); const result = potentialSlot.index; main.globalAllocator.destroy(potentialSlot); diff --git a/src/models.zig b/src/models.zig index 98466714..4360a4d6 100644 --- a/src/models.zig +++ b/src/models.zig @@ -166,7 +166,7 @@ pub const Model = struct { fn addVert(vert: Vec3f, vertList: *main.List(Vec3f)) usize { const ind = for(vertList.*.items, 0..) |vertex, index| { - if(std.meta.eql(vertex, vert)) break index; + if(vertex == vert) break index; } else vertList.*.items.len; if(ind == vertList.*.items.len) { diff --git a/src/renderer.zig b/src/renderer.zig index a6400b06..5e3e0aec 100644 --- a/src/renderer.zig +++ b/src/renderer.zig @@ -902,7 +902,7 @@ pub const MeshSelection = struct { // MARK: MeshSelection block.mode().onBlockBreaking(inventory.getStack(slot).item, relPos, lastDir, &newBlock); main.items.Inventory.Sync.ClientSide.mutex.unlock(); - if(!std.meta.eql(newBlock, block)) { + if(newBlock != block) { updateBlockAndSendUpdate(inventory, slot, selectedPos[0], selectedPos[1], selectedPos[2], block, newBlock); } } diff --git a/src/renderer/chunk_meshing.zig b/src/renderer/chunk_meshing.zig index de05d732..530e1df4 100644 --- a/src/renderer/chunk_meshing.zig +++ b/src/renderer/chunk_meshing.zig @@ -821,7 +821,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh const rotatedModel = blocks.meshes.model(block); const model = &models.models.items[rotatedModel]; _ = model; // TODO: Check if the neighbor model occludes this one. (maybe not that relevant) - return block.typ != 0 and (other.typ == 0 or (!std.meta.eql(block, other) and other.viewThrough()) or other.alwaysViewThrough() or !models.models.items[blocks.meshes.model(other)].isNeighborOccluded[neighbor.reverse().toInt()]); + return block.typ != 0 and (other.typ == 0 or (block != other and other.viewThrough()) or other.alwaysViewThrough() or !models.models.items[blocks.meshes.model(other)].isNeighborOccluded[neighbor.reverse().toInt()]); } fn initLight(self: *ChunkMesh, lightRefreshList: *main.List(*ChunkMesh)) void { @@ -1051,7 +1051,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x - 1), @intCast(y), z)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1078,7 +1078,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x + 1), @intCast(y), z)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1105,7 +1105,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x), @intCast(y - 1), z)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1132,7 +1132,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x), @intCast(y + 1), z)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1159,7 +1159,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x), @intCast(y), z - 1)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1186,7 +1186,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh if(depthFilteredViewThroughMask[x][y] & setBit != 0) block.typ = block.opaqueVariant(); if(block.viewThrough() and !block.alwaysViewThrough()) { // Needs to check the neighbor block const neighborBlock = self.chunk.data.getValue(chunk.getIndex(@intCast(x), @intCast(y), z + 1)); - if(std.meta.eql(block, neighborBlock)) continue; + if(block == neighborBlock) continue; } if(block.transparent()) { if(block.hasBackFace()) { @@ -1223,7 +1223,7 @@ pub const ChunkMesh = struct { // MARK: ChunkMesh const z: u5 = @intCast(_z & chunk.chunkMask); var newBlock = _newBlock; self.mutex.lock(); - if(std.meta.eql(self.chunk.data.getValue(chunk.getIndex(x, y, z)), newBlock)) { + if(self.chunk.data.getValue(chunk.getIndex(x, y, z)) == newBlock) { self.mutex.unlock(); return; } diff --git a/src/rotation.zig b/src/rotation.zig index e8ece715..d6809795 100644 --- a/src/rotation.zig +++ b/src/rotation.zig @@ -66,7 +66,7 @@ pub const RotationMode = struct { // MARK: RotationMode } fn canBeChangedInto(oldBlock: Block, newBlock: Block, item: main.items.ItemStack, shouldDropSourceBlockOnSuccess: *bool) CanBeChangedInto { shouldDropSourceBlockOnSuccess.* = true; - if(std.meta.eql(oldBlock, newBlock)) return .no; + if(oldBlock == newBlock) return .no; if(oldBlock.typ == newBlock.typ) return .yes; if(oldBlock.solid()) { var damage: f32 = 1; @@ -1143,7 +1143,7 @@ pub const RotationModes = struct { } pub fn canBeChangedInto(oldBlock: Block, newBlock: Block, _: main.items.ItemStack, shouldDropSourceBlockOnSuccess: *bool) RotationMode.CanBeChangedInto { - if(std.meta.eql(oldBlock, newBlock)) return .no; + if(oldBlock == newBlock) return .no; if(oldBlock.transparent() or oldBlock.viewThrough()) return .no; if(!main.models.models.items[main.blocks.meshes.modelIndexStart(oldBlock)].allNeighborsOccluded) return .no; if(oldBlock.data != 0) return .no; diff --git a/src/server/world.zig b/src/server/world.zig index e3130398..32e101f0 100644 --- a/src/server/world.zig +++ b/src/server/world.zig @@ -1030,7 +1030,7 @@ pub const ServerWorld = struct { // MARK: ServerWorld baseChunk.mutex.lock(); const currentBlock = baseChunk.getBlock(x, y, z); if(oldBlock != null) { - if(!std.meta.eql(oldBlock.?, currentBlock)) { + if(oldBlock.? != currentBlock) { baseChunk.mutex.unlock(); return currentBlock; }