diff --git a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java index 70084eb..c9e70ca 100644 --- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java +++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java @@ -158,7 +158,7 @@ public class CraterConfigScreen extends Screen { return new TextConfigOption<>(Objects::toString, BigDecimal::new); } if (value instanceof ResourceLocation) { - return new TextConfigOption<>(Objects::toString, ResourceLocation::new); + return new TextConfigOption<>(Objects::toString, ResourceLocation::parse); } if (isSubConfig) { return new SubConfigWidget<>(config, this, value); @@ -216,24 +216,23 @@ public class CraterConfigScreen extends Screen { int maxY = this.height - BOTTOM; //RenderSystem.disableTexture(); Tesselator tesselator = Tesselator.getInstance(); - BufferBuilder buffer = tesselator.getBuilder(); + BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); RenderSystem.setShader(GameRenderer::getPositionColorShader); - buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR); - buffer.vertex(scrollbarPositionMinX, maxY, 0.0D).color(0, 0, 0, 255).endVertex(); - buffer.vertex(scrollbarPositionMaxX, maxY, 0.0D).color(0, 0, 0, 255).endVertex(); - buffer.vertex(scrollbarPositionMaxX, TOP, 0.0D).color(0, 0, 0, 255).endVertex(); - buffer.vertex(scrollbarPositionMinX, TOP, 0.0D).color(0, 0, 0, 255).endVertex(); + buffer.addVertex(scrollbarPositionMinX, maxY, 0.0f).setColor(0, 0, 0, 255); + buffer.addVertex(scrollbarPositionMaxX, maxY, 0.0f).setColor(0, 0, 0, 255); + buffer.addVertex(scrollbarPositionMaxX, TOP, 0.0f).setColor(0, 0, 0, 255); + buffer.addVertex(scrollbarPositionMinX, TOP, 0.0f).setColor(0, 0, 0, 255); - buffer.vertex(scrollbarPositionMinX, minY + height, 0.0D).color(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1).endVertex(); - buffer.vertex(scrollbarPositionMaxX, minY + height, 0.0D).color(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1).endVertex(); - buffer.vertex(scrollbarPositionMaxX, minY, 0.0D).color(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1).endVertex(); - buffer.vertex(scrollbarPositionMinX, minY, 0.0D).color(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1).endVertex(); - buffer.vertex(scrollbarPositionMinX, (minY + height - 1), 0.0D).color(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1).endVertex(); - buffer.vertex((scrollbarPositionMaxX - 1), (minY + height - 1), 0.0D).color(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1).endVertex(); - buffer.vertex((scrollbarPositionMaxX - 1), minY, 0.0D).color(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1).endVertex(); - buffer.vertex(scrollbarPositionMinX, minY, 0.0D).color(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1).endVertex(); - tesselator.end(); + buffer.addVertex(scrollbarPositionMinX, minY + height, 0.0f).setColor(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1); + buffer.addVertex(scrollbarPositionMaxX, minY + height, 0.0f).setColor(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1); + buffer.addVertex(scrollbarPositionMaxX, minY, 0.0f).setColor(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1); + buffer.addVertex(scrollbarPositionMinX, minY, 0.0f).setColor(SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, SCROLLBAR_BOTTOM_COLOR, 1); + buffer.addVertex(scrollbarPositionMinX, (minY + height - 1), 0.0f).setColor(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1); + buffer.addVertex((scrollbarPositionMaxX - 1), (minY + height - 1), 0.0f).setColor(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1); + buffer.addVertex((scrollbarPositionMaxX - 1), minY, 0.0f).setColor(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1); + buffer.addVertex(scrollbarPositionMinX, minY, 0.0f).setColor(SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, SCROLLBAR_TOP_COLOR, 1); + BufferUploader.drawWithShader(buffer.buildOrThrow()); RenderSystem.disableBlend(); //RenderSystem.enableTexture(); } @@ -241,22 +240,21 @@ public class CraterConfigScreen extends Screen { private void renderShadow(PoseStack matrices) { Tesselator tesselator = Tesselator.getInstance(); - BufferBuilder buffer = tesselator.getBuilder(); + BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR); RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(770, 771, 0, 1); //RenderSystem.disableTexture(); RenderSystem.setShader(GameRenderer::getPositionTexColorShader); Matrix4f matrix = matrices.last().pose(); - buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR); - buffer.vertex(matrix, 0, TOP + 4, 0.0F).uv(0, 1).color(0, 0, 0, 0).endVertex(); - buffer.vertex(matrix, width, TOP + 4, 0.0F).uv(1, 1).color(0, 0, 0, 0).endVertex(); - buffer.vertex(matrix, width, TOP, 0.0F).uv(1, 0).color(0, 0, 0, 185).endVertex(); - buffer.vertex(matrix, 0, TOP, 0.0F).uv(0, 0).color(0, 0, 0, 185).endVertex(); - buffer.vertex(matrix, 0, height - BOTTOM, 0.0F).uv(0, 1).color(0, 0, 0, 185).endVertex(); - buffer.vertex(matrix, width, height - BOTTOM, 0.0F).uv(1, 1).color(0, 0, 0, 185).endVertex(); - buffer.vertex(matrix, width, height - BOTTOM - 4, 0.0F).uv(1, 0).color(0, 0, 0, 0).endVertex(); - buffer.vertex(matrix, 0, height - BOTTOM - 4, 0.0F).uv(0, 0).color(0, 0, 0, 0).endVertex(); - tesselator.end(); + buffer.addVertex(matrix, 0, TOP + 4, 0.0F).setUv(0, 1).setColor(0, 0, 0, 0); + buffer.addVertex(matrix, width, TOP + 4, 0.0F).setUv(1, 1).setColor(0, 0, 0, 0); + buffer.addVertex(matrix, width, TOP, 0.0F).setUv(1, 0).setColor(0, 0, 0, 185); + buffer.addVertex(matrix, 0, TOP, 0.0F).setUv(0, 0).setColor(0, 0, 0, 185); + buffer.addVertex(matrix, 0, height - BOTTOM, 0.0F).setUv(0, 1).setColor(0, 0, 0, 185); + buffer.addVertex(matrix, width, height - BOTTOM, 0.0F).setUv(1, 1).setColor(0, 0, 0, 185); + buffer.addVertex(matrix, width, height - BOTTOM - 4, 0.0F).setUv(1, 0).setColor(0, 0, 0, 0); + buffer.addVertex(matrix, 0, height - BOTTOM - 4, 0.0F).setUv(0, 0).setColor(0, 0, 0, 0); + BufferUploader.drawWithShader(buffer.buildOrThrow()); //RenderSystem.enableTexture(); RenderSystem.disableBlend(); } @@ -267,16 +265,15 @@ public class CraterConfigScreen extends Screen { protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) { Tesselator tesselator = Tesselator.getInstance(); - BufferBuilder buffer = tesselator.getBuilder(); + BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR); RenderSystem.setShader(GameRenderer::getPositionTexColorShader); RenderSystem.setShaderTexture(0, Screen.MENU_BACKGROUND); RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f); - buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR); - buffer.vertex(matrix, minX, maxY, 0.0F).uv(minX / 32.0F, maxY / 32.0F).color(red, green, blue, endAlpha).endVertex(); - buffer.vertex(matrix, maxX, maxY, 0.0F).uv(maxX / 32.0F, maxY / 32.0F).color(red, green, blue, endAlpha).endVertex(); - buffer.vertex(matrix, maxX, minY, 0.0F).uv(maxX / 32.0F, minY / 32.0F).color(red, green, blue, startAlpha).endVertex(); - buffer.vertex(matrix, minX, minY, 0.0F).uv(minX / 32.0F, minY / 32.0F).color(red, green, blue, startAlpha).endVertex(); - tesselator.end(); + buffer.addVertex(matrix, minX, maxY, 0.0F).setUv(minX / 32.0F, maxY / 32.0F).setColor(red, green, blue, endAlpha); + buffer.addVertex(matrix, maxX, maxY, 0.0F).setUv(maxX / 32.0F, maxY / 32.0F).setColor(red, green, blue, endAlpha); + buffer.addVertex(matrix, maxX, minY, 0.0F).setUv(maxX / 32.0F, minY / 32.0F).setColor(red, green, blue, startAlpha); + buffer.addVertex(matrix, minX, minY, 0.0F).setUv(minX / 32.0F, minY / 32.0F).setColor(red, green, blue, startAlpha); + BufferUploader.drawWithShader(buffer.buildOrThrow()); } public int scrollHeight() { diff --git a/Common/src/main/java/com/hypherionmc/craterlib/nojang/resources/ResourceIdentifier.java b/Common/src/main/java/com/hypherionmc/craterlib/nojang/resources/ResourceIdentifier.java index 9b848f4..4cd88f3 100644 --- a/Common/src/main/java/com/hypherionmc/craterlib/nojang/resources/ResourceIdentifier.java +++ b/Common/src/main/java/com/hypherionmc/craterlib/nojang/resources/ResourceIdentifier.java @@ -7,11 +7,11 @@ public class ResourceIdentifier { private final ResourceLocation internal; public ResourceIdentifier(String namespace, String path) { - this.internal = new ResourceLocation(namespace, path); + this.internal = ResourceLocation.fromNamespaceAndPath(namespace, path); } public ResourceIdentifier(String path) { - this.internal = new ResourceLocation(path); + this.internal = ResourceLocation.withDefaultNamespace(path); } public String getNamespace() { diff --git a/Fabric/build.gradle b/Fabric/build.gradle index 4badf5c..5daf527 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -110,8 +110,8 @@ publisher { setVersionType("release") setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-fabric.md") setProjectVersion("${minecraft_version}-${project.version}") - setDisplayName("[FABRIC/QUILT 1.20.6] CraterLib - ${project.version}") - setGameVersions("1.20.6") + setDisplayName("[FABRIC/QUILT 1.21.0] CraterLib - ${project.version}") + setGameVersions("1.21") setLoaders("fabric", "quilt") setArtifact(remapJar) setCurseEnvironment("both") diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index 47a55c0..7d282ae 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -33,7 +33,7 @@ "depends": { "fabricloader": ">=0.15.0", "fabric-api": "*", - "minecraft": ">=1.20.6", + "minecraft": ">=1.21", "java": ">=21" } } diff --git a/NeoForge/build.gradle b/NeoForge/build.gradle index 877fe37..68d79e7 100644 --- a/NeoForge/build.gradle +++ b/NeoForge/build.gradle @@ -31,7 +31,7 @@ shadowJar { unimined.minecraft { neoForged { - loader neoforge_version + loader "net.neoforged:neoforge:${neoforge_version}:universal" mixinConfig("${mod_id}.mixins.json", "${mod_id}.neoforge.mixins.json") } } @@ -103,8 +103,8 @@ publisher { setVersionType("release") setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md") setProjectVersion("${minecraft_version}-${project.version}") - setDisplayName("[NeoForge 1.20.6] CraterLib - ${project.version}") - setGameVersions("1.20.6") + setDisplayName("[NeoForge 1.21.0] CraterLib - ${project.version}") + setGameVersions("1.21") setLoaders("neoforge") setArtifact(remapJar) setCurseEnvironment("both") diff --git a/NeoForge/src/main/resources/META-INF/neoforge.mods.toml b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml index b5afd9b..b47ba38 100644 --- a/NeoForge/src/main/resources/META-INF/neoforge.mods.toml +++ b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml @@ -19,13 +19,13 @@ issueTrackerURL = "https://github.com/firstdarkdev/craterLib/issues" [[dependencies.${ mod_id }]] modId = "neoforge" type="required" - versionRange = "[20.6,)" + versionRange = "[21.0,)" ordering = "NONE" side = "BOTH" [[dependencies.${ mod_id }]] modId = "minecraft" type="required" - versionRange = "[1.20.6,1.21)" + versionRange = "[*,)" ordering = "NONE" side = "BOTH" diff --git a/build.gradle b/build.gradle index 97cc00e..bd0ac10 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,7 @@ orion.setup { multiProject = true enableMirrorMaven = true enableReleasesMaven = true + enableSnapshotsMaven = true dopplerToken = System.getenv("DOPPLER_KEY") diff --git a/gradle.properties b/gradle.properties index 0e8bdfc..a3bdd0d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,18 +9,18 @@ mod_id=craterlib mod_name=CraterLib # Shared -minecraft_version=1.20.6 +minecraft_version=1.21-pre4 project_group=com.hypherionmc.craterlib # Fabric -fabric_loader=0.15.0 -fabric_api=0.97.8+1.20.6 +fabric_loader=0.15.11 +fabric_api=0.100.0+1.21 # Forge forge_version=50.0.6 # NeoForged -neoforge_version=41-beta +neoforge_version=21.0.0-alpha.1.21-pre4.20240608.221725 # Dependencies moon_config=1.0.9 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a595206..48c0a02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists