diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeybindingExtensions.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeyMappingExtensions.kt similarity index 81% rename from silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeybindingExtensions.kt rename to silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeyMappingExtensions.kt index 122943b1..8a41d37a 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeybindingExtensions.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/client/KeyMappingExtensions.kt @@ -6,11 +6,11 @@ import com.mojang.blaze3d.platform.InputConstants import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper import net.minecraft.client.KeyMapping -fun keybindingOf(translationKey: String, type: InputConstants.Type, code: Int, category: String): KeyMapping { +fun keyMappingOf(translationKey: String, type: InputConstants.Type, code: Int, category: String): KeyMapping { return KeyBindingHelper.registerKeyBinding(KeyMapping(translationKey, type, code, category)) } -fun keybindingOf(translationKey: String, code: Int, category: String): KeyMapping { +fun keyMappingOf(translationKey: String, code: Int, category: String): KeyMapping { return KeyBindingHelper.registerKeyBinding(KeyMapping(translationKey, code, category)) } diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/math/geometry/AABBExtensions.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/math/geometry/AABBExtensions.kt index 143ac7dd..98908f37 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/math/geometry/AABBExtensions.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/math/geometry/AABBExtensions.kt @@ -10,22 +10,15 @@ import net.silkmc.silk.core.math.vector.unaryMinus import org.joml.Vector3f fun AABB.inflate(value: Int): AABB = inflate(value.toDouble()) -fun AABB.expand(value: Int): AABB = inflate(value) // for yarn mappings (inflate is expand in yarn) fun AABB.inflate(value: Number): AABB = inflate(value.toDouble()) -fun AABB.expand(value: Number): AABB = inflate(value) // for yarn mappings (inflate is expand in yarn) fun AABB.deflate(value: Int): AABB = deflate(value.toDouble()) -fun AABB.contract(value: Int): AABB = deflate(value) // for yarn mappings (deflate is contract in yarn) fun AABB.deflate(value: Number): AABB = deflate(value.toDouble()) -fun AABB.contract(value: Number): AABB = deflate(value) // for yarn mappings (deflate is contract in yarn) fun AABB.expandTowards(x: Int, y: Int, z: Int): AABB = expandTowards(x.toDouble(), y.toDouble(), z.toDouble()) -fun AABB.stretch(x: Int, y: Int, z: Int): AABB = expandTowards(x, y, z) // for yarn mappings (expandTowards is stretch in yarn) fun AABB.expandTowards(x: Number, y: Number, z: Number): AABB = expandTowards(x.toDouble(), y.toDouble(), z.toDouble()) -fun AABB.stretch(x: Number, y: Number, z: Number): AABB = expandTowards(x, y, z) // for yarn mappings (expandTowards is stretch in yarn) infix fun AABB.minmax(aabb: AABB): AABB = minmax(aabb) -infix fun AABB.union(aabb: AABB): AABB = minmax(aabb) // for yarn mappings (minmax is union in yarn) operator fun AABB.contains(aabb: AABB) = intersects(aabb) operator fun AABB.contains(pos: Vec3i) = contains(pos.x.toDouble(), pos.y.toDouble(), pos.z.toDouble()) diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/math/vector/VectorOperations.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/math/vector/VectorOperations.kt index c0f47594..343308d6 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/math/vector/VectorOperations.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/math/vector/VectorOperations.kt @@ -29,13 +29,6 @@ fun vec3Of(vec: Vector3i): Vec3 = Vec3(vec.x.toDouble(), vec.y.toDouble(), vec.z fun vec3Of(vec: Vector3f): Vec3 = Vec3(vec) fun vec3Of(vec: Vector3d): Vec3 = Vec3(vec.x, vec.y, vec.z) -// for yarn mappings (Vec3 is Vec3d in yarn) -fun vec3dOf(x: Double, y: Double, z: Double): Vec3 = vec3Of(x, y, z) -fun vec3dOf(vec: Vec3i): Vec3 = Vec3(vec.x.toDouble(), vec.y.toDouble(), vec.z.toDouble()) -fun vec3dOf(vec: Vector3i): Vec3 = Vec3(vec.x.toDouble(), vec.y.toDouble(), vec.z.toDouble()) -fun vec3dOf(vec: Vector3f): Vec3 = Vec3(vec) -fun vec3dOf(vec: Vector3d): Vec3 = Vec3(vec.x, vec.y, vec.z) - fun vector3iOf(x: Int, y: Int, z: Int): Vector3i = Vector3i(x, y, z) fun vector3iOf(vec: Vec3i): Vector3i = Vector3i(vec.x, vec.y, vec.z) fun vector3iOf(vec: Vec3): Vector3i = Vector3i(vec.x.roundToInt(), vec.y.roundToInt(), vec.z.roundToInt()) @@ -59,7 +52,6 @@ fun vector3dOf(vec: Vector3d): Vector3d = Vector3d(vec) // copy constructor fun vec2Of(x: Float, y: Float): Vec2 = Vec2(x, y) -fun vec2dOf(x: Float, y: Float): Vec2 = vec2Of(x, y) // for yarn mappings (Vec2 is Vec2d in yarn) fun vector2iOf(x: Int, y: Int): Vector2i = Vector2i(x, y) fun vector2iOf(vec: Vec2): Vector2i = Vector2i(vec.x.roundToInt(), vec.y.roundToInt()) diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/BlockRegistry.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/BlockRegistry.kt index 7e35085e..e4397087 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/BlockRegistry.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/BlockRegistry.kt @@ -13,21 +13,10 @@ inline fun blockProperties( builder: BlockBehaviour.Properties.() -> Unit, ): BlockBehaviour.Properties = BlockBehaviour.Properties.ofFullCopy(copiedBlock).apply(builder) -// alias for yarn -inline fun blockSettings( - copiedBlock: BlockBehaviour, - builder: BlockBehaviour.Properties.() -> Unit, -): BlockBehaviour.Properties = blockProperties(copiedBlock, builder) - inline fun blockProperties( builder: BlockBehaviour.Properties.() -> Unit, ): BlockBehaviour.Properties = BlockBehaviour.Properties.of().apply(builder) -// alias for yarn -inline fun blockSettings( - builder: BlockBehaviour.Properties.() -> Unit, -): BlockBehaviour.Properties = blockProperties(builder) - fun T.register(id: ResourceLocation): T { for (blockState in stateDefinition.possibleStates) { Block.BLOCK_STATE_REGISTRY.add(blockState) diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemGroupRegistry.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemGroupRegistry.kt index dba48724..d4fb7e72 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemGroupRegistry.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemGroupRegistry.kt @@ -16,9 +16,6 @@ fun creativeModeTab(displayName: Component? = null, builder: CreativeModeTab.Bui return itemGroupBuilder.apply(builder).build() } -// alias for yarn -fun itemGroup(displayName: Component? = null, builder: CreativeModeTab.Builder.() -> Unit) = creativeModeTab(displayName, builder) - fun T.register(id: ResourceLocation): T { return BuiltInRegistries.CREATIVE_MODE_TAB.register(id, this) } diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemRegistry.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemRegistry.kt index a6a7b19e..c4251637 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemRegistry.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/registry/ItemRegistry.kt @@ -11,11 +11,6 @@ inline fun itemProperties( builder: Item.Properties.() -> Unit, ): Item.Properties = Item.Properties().apply(builder) -// alias for yarn -inline fun itemSettings( - builder: Item.Properties.() -> Unit, -): Item.Properties = itemProperties(builder) - fun T.register(id: ResourceLocation): T { return BuiltInRegistries.ITEM.register(id, this) } diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/server/ServerExtensions.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/server/ServerExtensions.kt index 5714b68b..9e0b3e6c 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/server/ServerExtensions.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/server/ServerExtensions.kt @@ -55,15 +55,6 @@ val MinecraftServer.serverPath: Path */ fun MinecraftServer.getLevel(id: ResourceLocation): ServerLevel? = getLevel(ResourceKey.create(Registries.DIMENSION, id)) -// alias for yarn -/** - * Retrieves the world for an associated with an id is present - * - * @param id The id of the world to check - * @return The world - */ -fun MinecraftServer.getWorld(id: ResourceLocation): ServerLevel? = getLevel(id) - /** * Checks if the level associated with an id is present * @@ -71,12 +62,3 @@ fun MinecraftServer.getWorld(id: ResourceLocation): ServerLevel? = getLevel(id) * @return If the level is present */ fun MinecraftServer.hasLevel(id: ResourceLocation): Boolean = getLevel(id) != null - -// alias for yarn -/** - * Checks if the world associated with an id is present - * - * @param id The id of the world to check - * @return If the world is present - */ -fun MinecraftServer.hasWorld(id: ResourceLocation): Boolean = hasLevel(id) diff --git a/silk-core/src/main/kotlin/net/silkmc/silk/core/world/pos/BasicPositions.kt b/silk-core/src/main/kotlin/net/silkmc/silk/core/world/pos/BasicPositions.kt index fe0535d1..ee3ea011 100644 --- a/silk-core/src/main/kotlin/net/silkmc/silk/core/world/pos/BasicPositions.kt +++ b/silk-core/src/main/kotlin/net/silkmc/silk/core/world/pos/BasicPositions.kt @@ -92,7 +92,6 @@ sealed interface IPos { sealed interface Pos2Dimensional : IPos { fun toMcVec2() = Vec2(x.toFloat(), z.toFloat()) - fun toMcVec2d() = toMcVec2() // for yarn mappings (Vec2 is Vec2d in yarn) operator fun component1() = x operator fun component2() = z @@ -128,7 +127,6 @@ sealed interface Pos3Dimensional : IPos { fun toMcVector3f() = Vector3f(x.toFloat(), y.toFloat(), z.toFloat()) fun toMcVec3() = Vec3(x.toDouble(), y.toDouble(), z.toDouble()) - fun toMcVec3d() = toMcVec3() // for yarn mappings (Vec3 is Vec3d in yarn) fun toMcVector3d() = Vector3d(x.toDouble(), y.toDouble(), z.toDouble()) operator fun component1() = x