Skip to content

Commit

Permalink
reset vcs
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Oct 19, 2024
1 parent 12c1cc9 commit 3d00768
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/dev/nyon/autodrop/config/ConfigHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal fun migrate(
archiveObject["items"]?.jsonArray?.map secMap@{ content ->
val resourceLocation = resourceLocation(content.jsonPrimitive.contentOrNull ?: return null)
return@secMap ItemIdentifier(
resourceLocation?.let { BuiltInRegistries.ITEM.get(it)/*? if >=1.21.2 {*/.getOrNull()?.value()/*?}*/ }, emptyStoredComponents, 1
resourceLocation?.let { BuiltInRegistries.ITEM.get(it)/*? if >=1.21.2 {*//*.getOrNull()?.value()*//*?}*/ }, emptyStoredComponents, 1
)
}?.toMutableList() ?: return null,
archiveObject["lockedSlots"]?.jsonArray?.map secMap@{ content ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import net.minecraft.client.gui.components.Button
import net.minecraft.client.gui.components.EditBox
import net.minecraft.client.gui.screens.Screen
//? if >=1.21.2
import net.minecraft.client.renderer.CoreShaders
/*import net.minecraft.client.renderer.CoreShaders*/
import net.minecraft.client.renderer.GameRenderer
import net.minecraft.client.renderer.RenderType
import dev.nyon.autodrop.minecraft as internalMinecraft
Expand Down Expand Up @@ -79,15 +79,15 @@ class IgnoredSlotsScreen(private val archive: Archive, private val parent: Scree
?: error("Failed to load inventory slot guide image.")
val imageSize = height / 2

RenderSystem.setShader(/*? if <1.21.2 {*//*GameRenderer::getPositionTexShader*//*?} else {*/CoreShaders.POSITION_TEX/*?}*/)
RenderSystem.setShader(/*? if <1.21.2 {*/GameRenderer::getPositionTexShader/*?} else {*//*CoreShaders.POSITION_TEX*//*?}*/)

RenderSystem.setShaderTexture(0, imageLocation)
RenderSystem.enableBlend()
RenderSystem.defaultBlendFunc()
RenderSystem.enableDepthTest()

/*? if >=1.21.2 {*/
guiGraphics.blit(
/*guiGraphics.blit(
RenderType::guiTextured,
imageLocation,
internalMinecraft.screen!!.width / 2 - imageSize / 2,
Expand All @@ -99,8 +99,8 @@ class IgnoredSlotsScreen(private val archive: Archive, private val parent: Scree
imageSize,
imageSize
)
/*?} else {*/
/*guiGraphics.blit(
*//*?} else {*/
guiGraphics.blit(
imageLocation,
internalMinecraft.screen!!.width / 2 - imageSize / 2,
OUTER_PAD + INNER_PAD * 2 + internalMinecraft.font.lineHeight + 20,
Expand All @@ -112,7 +112,7 @@ class IgnoredSlotsScreen(private val archive: Archive, private val parent: Scree
imageSize,
imageSize
)
*//*?}*/
/*?}*/
}

override fun shouldCloseOnEsc(): Boolean {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/dev/nyon/autodrop/extensions/Component.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ fun screenComponent(key: String, vararg objects: Any): MutableComponent {
val Item.narration: Component
get() {
//? if >=1.21.2
return this.name
/*return this.name*/

//? if <1.21.2
/*return Component.literal(this.description.toString())*/
return Component.literal(this.description.toString())
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object ItemSerializer : KSerializer<Item> {

override fun deserialize(decoder: Decoder): Item {
val resourceLocation = resourceLocation(decoder.decodeString())!!
return BuiltInRegistries.ITEM.get(resourceLocation)/*? if >=1.21.2 {*/.get().value()/*?}*/
return BuiltInRegistries.ITEM.get(resourceLocation)/*? if >=1.21.2 {*//*.get().value()*//*?}*/
}

override fun serialize(
Expand Down

0 comments on commit 3d00768

Please sign in to comment.