diff --git a/src/main/java/de/bixilon/minosoft/data/registries/item/handler/ItemInteractEntityHandler.kt b/src/main/java/de/bixilon/minosoft/data/registries/item/handler/ItemInteractEntityHandler.kt deleted file mode 100644 index 30fde5226..000000000 --- a/src/main/java/de/bixilon/minosoft/data/registries/item/handler/ItemInteractEntityHandler.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Minosoft - * Copyright (C) 2020-2022 Moritz Zwerger - * - * 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 . - * - * This software is not affiliated with Mojang AB, the original developer of Minecraft. - */ - -package de.bixilon.minosoft.data.registries.item.handler - -import de.bixilon.minosoft.camera.target.targets.EntityTarget -import de.bixilon.minosoft.data.container.stack.ItemStack -import de.bixilon.minosoft.data.entities.entities.player.Hands -import de.bixilon.minosoft.input.interaction.InteractionResults -import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection - -@Deprecated("Need? InteractAtHandler") -interface ItemInteractEntityHandler { - - fun interactEntity(connection: PlayConnection, target: EntityTarget, hand: Hands, stack: ItemStack): InteractionResults -} diff --git a/src/main/java/de/bixilon/minosoft/util/KUtil.kt b/src/main/java/de/bixilon/minosoft/util/KUtil.kt index de11d1d21..ed4740d9e 100644 --- a/src/main/java/de/bixilon/minosoft/util/KUtil.kt +++ b/src/main/java/de/bixilon/minosoft/util/KUtil.kt @@ -36,7 +36,6 @@ import de.bixilon.kutil.primitive.IntUtil.checkInt import de.bixilon.kutil.reflection.ReflectionUtil.forceInit import de.bixilon.kutil.reflection.ReflectionUtil.realName import de.bixilon.kutil.shutdown.ShutdownManager -import de.bixilon.kutil.time.Cooldown import de.bixilon.kutil.url.URLProtocolStreamHandlers import de.bixilon.minosoft.config.profile.manager.ProfileManagers import de.bixilon.minosoft.data.container.stack.ItemStack @@ -216,20 +215,13 @@ object KUtil { } fun Any?.autoType(): Any? { - if (this == null) { - return null - } - if (this is Number) { - return this - } + if (this == null) return null + if (this is Number) return this + val string = this.toString() - if (string == "true") { - return true - } - if (string == "false") { - return false - } + if (string == "true") return true + if (string == "false") return false string.checkInt()?.let { return it } @@ -292,10 +284,6 @@ object KUtil { return prefixed.toArray() } - fun Cooldown.setTicks(ticks: Int) { - set(ticks * ProtocolDefinition.TICK_TIME) - } - fun init() { Table.DEFAULT_STYLE = TableStyles.FANCY URLProtocolStreamHandlers.register("resource", ResourceURLHandler)