Skip to content

Commit

Permalink
1.4.0 Beta Fabric 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eth0net authored Aug 7, 2022
2 parents 0d5d18c + 3cee250 commit 68bb140
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 33 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
modImplementation("net.fabricmc", "fabric-loader", loaderVersion)
modImplementation("net.fabricmc.fabric-api", "fabric-api", fabricVersion)
modImplementation("net.fabricmc", "fabric-language-kotlin", fabricKotlinVersion)
modImplementation("com.gitlab.Lortseam.completeconfig", "gui-cloth", completeConfigVersion)
modImplementation("com.gitlab.Lortseam", "completeconfig", completeConfigVersion)
}

tasks {
Expand Down Expand Up @@ -74,7 +74,7 @@ tasks {

modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
gameVersions.set(listOf("1.19", "1.19.1", "1.19.2"))
gameVersions.set(listOf("1.18.2"))
projectId.set(base.archivesName)
versionName.set(modVersionName)
versionType.set(modVersionType)
Expand Down
6 changes: 6 additions & 0 deletions changelogs/1.4.0-beta+fabric-1.18.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Now in 1.18.2!

**Changed**:
- Backported to 1.18.2

**Full Changelog**: https://github.com/eth0net/enchant-menu/compare/v1.4.0-beta+fabric-1.19...v1.4.0-beta+fabric-1.18.2
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx1G
org.gradle.warning.mode=all
# Fabric Properties - https://fabricmc.net/develop/
minecraftVersion=1.19
yarnMappings=1.19+build.4
loaderVersion=0.14.8
minecraftVersion=1.18.2
yarnMappings=1.18.2+build.4
loaderVersion=0.14.9
# Fabric API
fabricVersion=0.58.0+1.19
fabricVersionId=3KmOcp6b
fabricVersion=0.58.0+1.18.2
fabricVersionId=4XRtXhtL
loomVersion=0.12-SNAPSHOT
# Kotlin
systemProp.kotlinVersion=1.7.0
fabricKotlinVersion=1.8.2+kotlin.1.7.10
fabricKotlinVersionId=5Aq3SFbi
# Complete Config
completeConfigVersion=2.0.0
completeConfigVersionId=zaC01d1T
completeConfigVersion=1.4.1
completeConfigVersionId=mjJMU8FD
# Mod Properties
mavenGroup=com.github.eth0net
modId=enchant-menu
modVersion=1.4.0-beta+fabric-1.19
modVersionName=1.4.0 Beta Fabric 1.19
modVersion=1.4.0-beta+fabric-1.18.2
modVersionName=1.4.0 Beta Fabric 1.18.2
modVersionType=beta
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import net.minecraft.entity.player.PlayerEntity
import net.minecraft.entity.player.PlayerInventory
import net.minecraft.item.ItemStack
import net.minecraft.text.Text
import net.minecraft.text.TranslatableText
import org.lwjgl.glfw.GLFW
import kotlin.math.roundToInt

@Environment(EnvType.CLIENT)
class EnchantMenuScreen(handler: EnchantMenuScreenHandler, playerInventory: PlayerInventory, title: Text) :
HandledScreen<EnchantMenuScreenHandler>(handler, object : PlayerInventory(playerInventory.player) {
override fun getDisplayName() = Text.empty()
override fun getDisplayName() = Text.of("")
}, title) {

private val texture = EnchantMenu.id("textures/gui/enchant_menu.png")
Expand Down Expand Up @@ -127,7 +128,7 @@ class EnchantMenuScreen(handler: EnchantMenuScreenHandler, playerInventory: Play

// level text
val level = handler.level.toString()
textRenderer.drawTrimmed(Text.literal(level), x + 23 - level.length * 3, y + 21, level.length * 6, 0xFFFFFF)
textRenderer.drawTrimmed(Text.of(level), x + 23 - level.length * 3, y + 21, level.length * 6, 0xFFFFFF)

// level change buttons
if (handler.level < EnchantMenuConfig.Levels.maximum) addDrawableChild(TexturedButtonWidget(
Expand Down Expand Up @@ -157,7 +158,7 @@ class EnchantMenuScreen(handler: EnchantMenuScreenHandler, playerInventory: Play
) { onToggleTreasureClick() })

// search box
searchBox = TextFieldWidget(textRenderer, x + 78, y + 6, 71, 9, Text.translatable("enchant-menu.title"))
searchBox = TextFieldWidget(textRenderer, x + 78, y + 6, 71, 9, TranslatableText("enchant-menu.title"))
searchBox?.setChangedListener { handler.search = it }
searchBox?.text = handler.search
addSelectableChild(searchBox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package com.github.eth0net.enchantmenu.config

import com.github.eth0net.enchantmenu.EnchantMenu
import me.lortseam.completeconfig.api.ConfigContainer
import me.lortseam.completeconfig.api.ConfigContainer.Transitive
import me.lortseam.completeconfig.api.ConfigEntries
import me.lortseam.completeconfig.api.ConfigEntry
import me.lortseam.completeconfig.api.ConfigGroup
import me.lortseam.completeconfig.data.Config
import org.spongepowered.configurate.CommentedConfigurationNode

object EnchantMenuCompleteConfig : Config(EnchantMenu.MOD_ID), ConfigContainer {
@ConfigEntry
var checkPermission = true

@ConfigContainer.Transitive
@ConfigEntries(includeAll = true)
@Transitive
@ConfigEntries
object Levels : ConfigGroup {
@ConfigEntry.BoundedInteger(min = 1, max = 100)
@ConfigEntry.Slider
Expand Down Expand Up @@ -55,16 +55,16 @@ object EnchantMenuCompleteConfig : Config(EnchantMenu.MOD_ID), ConfigContainer {
}
}

@ConfigContainer.Transitive
@ConfigEntries(includeAll = true)
@Transitive
@ConfigEntries
object AllowLimitBreaks : ConfigGroup {
var incompatible = true
var level = true
var treasure = true
}

@ConfigContainer.Transitive
@ConfigEntries(includeAll = true)
@Transitive
@ConfigEntries
object DefaultLimitBreaks : ConfigGroup {
var incompatible = false
var level = false
Expand All @@ -84,9 +84,5 @@ object EnchantMenuCompleteConfig : Config(EnchantMenu.MOD_ID), ConfigContainer {
EnchantMenuConfig.DefaultLimitBreaks.treasure = DefaultLimitBreaks.treasure
}

override fun apply(node: CommentedConfigurationNode?) {
super.apply(node)
}

override fun onConfigEntryUpdate() = applyConfig()
override fun onUpdate() = applyConfig()
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import net.minecraft.screen.ScreenHandlerContext
import net.minecraft.screen.slot.Slot
import net.minecraft.sound.SoundCategory
import net.minecraft.sound.SoundEvents
import net.minecraft.text.Text
import net.minecraft.text.TranslatableText
import net.minecraft.util.registry.Registry

class EnchantMenuScreenHandler(
Expand Down Expand Up @@ -83,7 +83,7 @@ class EnchantMenuScreenHandler(

override fun onButtonClick(player: PlayerEntity, id: Int): Boolean {
if (!player.canEnchant()) {
player.sendMessage(Text.translatable("error.enchant-menu.permission"))
player.sendMessage(TranslatableText("error.enchant-menu.permission"), false)
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import net.minecraft.entity.player.PlayerInventory
import net.minecraft.screen.NamedScreenHandlerFactory
import net.minecraft.screen.ScreenHandlerContext
import net.minecraft.text.MutableText
import net.minecraft.text.Text
import net.minecraft.text.TranslatableText

object EnchantMenuScreenHandlerFactory : NamedScreenHandlerFactory {
override fun createMenu(syncId: Int, inv: PlayerInventory, player: PlayerEntity): EnchantMenuScreenHandler {
return EnchantMenuScreenHandler(syncId, inv, ScreenHandlerContext.create(player.world, player.blockPos))
}

override fun getDisplayName(): MutableText = Text.translatable("enchant-menu.title")
override fun getDisplayName(): MutableText = TranslatableText("enchant-menu.title")
}
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"depends": {
"fabric": "*",
"fabric-language-kotlin": ">=1.8.2+kotlin.1.7.10",
"fabricloader": ">=0.14.8",
"fabricloader": ">=0.14.9",
"java": ">=17",
"minecraft": "1.19.x"
"minecraft": "1.18.2"
},
"recommends": {
"cloth-config": "*",
"completeconfig-base": "^2.0.0",
"completeconfig-base": "^1.4.1",
"modmenu": "*"
}
}

0 comments on commit 68bb140

Please sign in to comment.