Skip to content

Commit

Permalink
Forgot Git files are case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
BomBardyGamer committed Jun 22, 2022
1 parent 7f73f91 commit 597aea7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ class KryptonPlayer(

fun hasCorrectTool(block: Block): Boolean = !block.requiresCorrectTool || inventory.heldItem(Hand.MAIN).type.handler().isCorrectTool(block)

/*
fun interactOn(entity: KryptonEntity, hand: Hand): InteractionResult {
if (isSpectator) {
// TODO: Open spectator menu
Expand All @@ -491,7 +490,6 @@ class KryptonPlayer(
*/
return InteractionResult.PASS
}
*/

override fun addViewer(player: KryptonPlayer): Boolean {
if (player === this) return false
Expand Down
32 changes: 32 additions & 0 deletions server/src/main/kotlin/org/kryptonmc/krypton/util/positions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This file is part of the Krypton project, licensed under the GNU General Public License v3.0
*
* Copyright (C) 2021-2022 KryptonMC and the contributors of the Krypton project
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.kryptonmc.krypton.util

import org.spongepowered.math.vector.Vector3d
import org.spongepowered.math.vector.Vector3i

fun Vector3d.chunkX(): Int = floorX().toChunk()

fun Vector3d.chunkZ(): Int = floorZ().toChunk()

fun Vector3i.chunkX(): Int = x().toChunk()

fun Vector3i.chunkZ(): Int = z().toChunk()

private fun Int.toChunk(): Int = this shr 4

0 comments on commit 597aea7

Please sign in to comment.