Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
with:
java-version: 21
distribution: temurin
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: 25
distribution: temurin
- uses: actions/cache@v3
with:
path: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
with:
java-version: 21
distribution: temurin
- name: Set up Java 25
uses: actions/setup-java@v4
with:
java-version: 25
distribution: temurin
- uses: actions/cache@v3
with:
path: |
Expand Down
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
## Beta 1.2
## Beta 1.2.1

### What’s New
- **Supports Minecraft 1.20.1 → 1.21.8**
- **Works on NeoForge and Fabric** (Forge coming later)
- **Rewritten in Kotlin** for smoother performance and fewer bugs
- **Built‑in widget system** for better stability without extra libraries
- **Supports Minecraft 1.21.10**
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ modstitch {
"1.21.4" -> 61
"1.21.5" -> 71
"1.21.8" -> 81
"1.21.10" -> 88
else -> throw IllegalArgumentException("Please store the resource pack version for $mcVersion in build.gradle.kts! https://minecraft.wiki/w/Pack_format")
}.toString()
)
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ modDescription=Adds auto-update support for resource packs
modLicense=MIT
modAuthor=AdamCalculator, Riflusso
modGroup=com.calculatorsteam
modVersion=1.2-b
modVersion=1.2.1-b

modrinthId=IT6fZgjc
curseforgeSlug=dynamicpack
curseforgeId=1356312
githubProject=CalculatorsTeam/DynamicPack

deps.fabricLoader=0.17.2
deps.fabricLoader=0.17.3
deps.fabricLangKotlin=1.13.6+kotlin.2.2.20

org.gradle.jvmargs=-Xmx4G
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pluginManagement {
}

plugins {
id("dev.kikugie.stonecutter") version "0.7.10"
id("dev.kikugie.stonecutter") version "0.7.+"
}

stonecutter {
Expand All @@ -30,6 +30,7 @@ stonecutter {
mc("1.21.4", loaders = listOf("fabric", "neoforge"))
mc("1.21.5", loaders = listOf("fabric", "neoforge"))
mc("1.21.8", loaders = listOf("fabric", "neoforge"))
mc("1.21.10", loaders = listOf("fabric", "neoforge"))
}
}
rootProject.name = "DynamicPack"
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PackRepositoryMixin {
VersionFunctions.applyModelViewMatrix();
VersionFunctions.clearColor(0.074f + (((float)syncing.getPercentage() / 100f)), 0.04f, (float) (0.24f + (Math.sin(System.currentTimeMillis() / 300f) / 2)), 1f);
VersionFunctions.clear(16640);
GLFW.glfwSwapBuffers(client.getWindow().getWindow());
GLFW.glfwSwapBuffers(client.getWindow()/*? if >=1.21.9 {*/.handle()/*?} else {*//*.getWindow()*//*?}*/);

} catch (Exception e) {
Out.error("Error while manipulations with OpenGL", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(TransferableSelectionList.PackEntry.class)
public abstract class ResourcePackEntryMixin {
public abstract class ResourcePackEntryMixin/*? if >=1.21.9 {*/ extends net.minecraft.client.gui.components.ObjectSelectionList.Entry<TransferableSelectionList.Entry>/*?}*/ {

@Shadow
protected abstract boolean showHoverOverlay();
Expand All @@ -41,9 +41,15 @@ public abstract class ResourcePackEntryMixin {
private static final ResourcePackEntryWidget DYNAMIC_WIDGET = new DynamicPackResourcePackEntryWidget();

@Inject(at = @At("TAIL"),
method = "render(Lnet/minecraft/client/gui/GuiGraphics;IIIIIIIZF)V")
private void render(GuiGraphics context, int index, int y, int x, int entryWidth, int entryHeight,
int mouseX, int mouseY, boolean hovered, float tickDelta, CallbackInfo info) {
/*? if >=1.21.9 {*/
method = "renderContent"
/*?} else {*/
/*method = "render(Lnet/minecraft/client/gui/GuiGraphics;IIIIIIIZF)V"
*//*?}*/
)
private void render(GuiGraphics context, /*? if <1.21.9 {*//*int index, int y, int x, int entryWidth, int entryHeight,*//*?}*/ int mouseX, int mouseY, boolean hovered, float tickDelta, CallbackInfo info) {
//? if >=1.21.9
final int x = this.getX(), y = this.getY() + 2, entryWidth = this.getWidth(), entryHeight = this.getHeight();
int prevMargin = 0;
/*? if >=1.21 {*/
int deltaX = 3 + (VersionFunctions.maxScrollAmount(parent) > 0 ? 7 : 0);
Expand All @@ -63,7 +69,11 @@ private void render(GuiGraphics context, int index, int y, int x, int entryWidth
} else {
ResourcePackEntryWidget widget = DYNAMIC_WIDGET;
if (widget.isVisible(pack, selectable)) {
deltaX += Math.max(prevMargin, widget.getXMargin(pack));
/*? if >=1.21.9 {*/
deltaX = Math.max(prevMargin, widget.getXMargin(pack));
/*?} else {*/
/*deltaX += Math.max(prevMargin, widget.getXMargin(pack));
*//*?}*/
int width = widget.getWidth(pack);
int height = widget.getHeight(pack, entryHeight);
int entryX = x + entryWidth - (deltaX + width) * (maxFoldTicks - dynamicpack$foldTicks) / maxFoldTicks;
Expand All @@ -86,8 +96,13 @@ private void render(GuiGraphics context, int index, int y, int x, int entryWidth
dynamicpack$foldTicks = Math.min(dynamicpack$foldTicks + 1, maxFoldTicks);
}

@Inject(method = "mouseClicked(DDI)Z", at = @At("RETURN"), cancellable = true)
/*? if >=1.21.9 {*/
@Inject(method = "mouseClicked", at = @At("RETURN"), cancellable = true)
private void dynamicpack$afterMouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean isDoubleClick, CallbackInfoReturnable<Boolean> cir) {
/*?} else {*/
/*@Inject(method = "mouseClicked(DDI)Z", at = @At("RETURN"), cancellable = true)
private void dynamicpack$afterMouseClicked(double mouseX, double mouseY, int button, CallbackInfoReturnable<Boolean> cir) {
*//*?}*/
if (dynamicpack$selected != -1) {
cir.setReturnValue(false);
DYNAMIC_WIDGET.onClick(pack);
Expand Down
12 changes: 7 additions & 5 deletions src/main/kotlin/com/calculatorsteam/dynamicpack/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ object Constants {
const val DEBUG_ALLOW_UNSECURE: Boolean = false
@JvmField var DEBUG_LOGS: Boolean = false

const val VERSION_BUILD: Long = 50
const val VERSION_NAME_MOD: String = "1.2"
/*? if >=1.21.6 {*/
const val VERSION_NAME_BRANCH: String = "mc1.21.8"
/*?} else if >=1.21.5 {*/
const val VERSION_BUILD: Long = 51
const val VERSION_NAME_MOD: String = "1.2.1"
/*? if >=1.21.9 {*/
const val VERSION_NAME_BRANCH: String = "mc1.21.10"
/*?} else if >=1.21.6 {*/
/*const val VERSION_NAME_BRANCH: String = "mc1.21.8"
*//*?} else if >=1.21.5 {*/
/*const val VERSION_NAME_BRANCH: String = "mc1.21.5"
*//*?} else if >=1.21.4 {*/
/*const val VERSION_NAME_BRANCH: String = "mc1.21.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,21 @@ open class NoYACLScreen(private val parent: Screen) : Screen(Component.translata
/*super.render(context, mouseX, mouseY, delta)*/
}

override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
/*? if >=1.21.9 {*/
override fun mouseClicked(click: net.minecraft.client.input.MouseButtonEvent, isDoubleClick: Boolean): Boolean {
if (super.mouseClicked(click, isDoubleClick)) {
/*?} else {*/
/*override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
if (super.mouseClicked(mouseX, mouseY, button)) {
*//*?}*/
return true
}

val style = getStyle(mouseX.toInt(), mouseY.toInt()) ?: return false
/*? if >=1.21.9 {*/
val style = getStyle(click.x.toInt(), click.y.toInt()) ?: return false
/*?} else {*/
/*val style = getStyle(mouseX.toInt(), mouseY.toInt()) ?: return false
*//*?}*/

if (minecraft?.player == null) {
val click = style.clickEvent ?: return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,16 @@ class ContentsList(
return Component.translatable(key)
}

override fun render(
/*? if >=1.21.9 {*/
override fun renderContent(
context: GuiGraphics,
mouseX: Int,
mouseY: Int,
hovered: Boolean,
tickDelta: Float
)
/*?} else {*/
/*override fun render(
context: GuiGraphics,
index: Int,
y: Int,
Expand All @@ -107,11 +116,17 @@ class ContentsList(
mouseY: Int,
hovered: Boolean,
tickDelta: Float
) {
)
*//*?}*/
{
val txt = content.name ?: content.id
val text = Component.literal(txt)
context.drawString(this@ContentsList.minecraft.font, text, x - 50, y + 10, -1, false)
stateButton.x = x + entryWidth - 140
/*? if >=1.21.9 {*/
stateButton.x = x + this.width - 138
/*?} else {*/
/*stateButton.x = x + entryWidth - 140
*//*?}*/
stateButton.y = y
stateButton.render(context, mouseX, mouseY, tickDelta)
}
Expand Down Expand Up @@ -147,7 +162,16 @@ class ContentsList(
private fun currentState(): Component =
Component.literal(baseEnum.getCurrentState(parent.baseContents))

override fun render(
/*? if >=1.21.9 {*/
override fun renderContent(
context: GuiGraphics,
mouseX: Int,
mouseY: Int,
hovered: Boolean,
tickDelta: Float
)
/*?} else {*/
/*override fun render(
context: GuiGraphics,
index: Int,
y: Int,
Expand All @@ -158,11 +182,17 @@ class ContentsList(
mouseY: Int,
hovered: Boolean,
tickDelta: Float
) {
)
*//*?}*/
{
val txt = baseEnum.name ?: baseEnum.id
val text = Component.literal(txt)
context.drawString(this@ContentsList.minecraft.font, text, x - 50, y + 10, -1, false)
stateButton.x = x + entryWidth - 140
/*? if >=1.21.9 {*/
stateButton.x = x + this.width - 138
/*?} else {*/
/*stateButton.x = x + entryWidth - 140
*//*?}*/
stateButton.y = y
stateButton.render(context, mouseX, mouseY, tickDelta)
}
Expand Down
4 changes: 2 additions & 2 deletions stonecutter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {

id("dev.kikugie.stonecutter")

val modstitchVersion = "0.7.0-unstable"
val modstitchVersion = "0.7.1-unstable"
id("dev.isxander.modstitch.base") version modstitchVersion apply false
id("dev.isxander.modstitch.shadow") version modstitchVersion apply false
id("dev.isxander.modstitch.publishing") version modstitchVersion apply false
}
stonecutter active "1.21.8-fabric"
stonecutter active "1.21.10-fabric"

allprojects {
repositories {
Expand Down
12 changes: 12 additions & 0 deletions versions/1.21.10-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
modstitch.platform=loom

mcVersion=1.21.10
parchment.version=2025.10.12

deps.fabricApi=0.136.0+1.21.10
deps.modmenu=16.0.0-rc.1
deps.yacl=3.8.0+1.21.9-fabric

meta.mcDep=~1.21.9 <1.21.11

pub.stableMC=1.21.9,1.21.10
12 changes: 12 additions & 0 deletions versions/1.21.10-neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
modstitch.platform=moddevgradle

mcVersion=1.21.10
parchment.version=2025.10.12

deps.neoforge=21.10.20-beta
deps.kotlinForForge=6.0.0
deps.yacl=3.8.0+1.21.9-neoforge

meta.mcDep=[1.21.9,1.21.10]

pub.stableMC=1.21.9,1.21.10