Skip to content
Open
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
8 changes: 0 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ dependencies {

sourceSets {
main {
def generatedJava = layout.buildDirectory.dir("generated/reglass/main/java")
def generatedResources = layout.buildDirectory.dir("generated/reglass/main/resources")
java.setSrcDirs(files(generatedJava))
resources.setSrcDirs(files(generatedResources))
if (!project.minecraft_version.startsWith("1.")) {
java {
Expand Down Expand Up @@ -163,18 +161,12 @@ def preprocessReglassTree = { File input, File output, String minecraftVersion -
}

def preprocessReglassSources = tasks.register('preprocessReglassSources') {
def generatedJava = layout.buildDirectory.dir("generated/reglass/main/java")
def generatedResources = layout.buildDirectory.dir("generated/reglass/main/resources")
inputs.dir(rootProject.file('src/main/java'))
inputs.dir(rootProject.file('src/main/resources'))
outputs.dir(generatedJava)
outputs.dir(generatedResources)
doLast {
def javaOutput = generatedJava.get().asFile
def resourcesOutput = generatedResources.get().asFile
javaOutput.deleteDir()
resourcesOutput.deleteDir()
preprocessReglassTree(rootProject.file('src/main/java'), javaOutput, project.minecraft_version)
preprocessReglassTree(rootProject.file('src/main/resources'), resourcesOutput, project.minecraft_version)
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.configuration-cache=false
dev.kikugie.stonecutter.hard_mode=true

# Build Plugins
stonecutter_version=0.9.3
stonecutter_version=0.9.6

# Mod Properties
mod_version=2.0
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 10 additions & 21 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ pluginManagement {
}
mavenCentral()
gradlePluginPortal()
maven {
url = "https://maven.kikugie.dev/snapshots"
name = "KikuGie Snapshots"
}
}
}

Expand All @@ -16,7 +20,11 @@ plugins {
rootProject.name = 'ReGlass'

stonecutter {
// Enable Groovy DSL, as Stonecutter uses Kotlin by default
kotlinController = false
centralScript = "build.gradle"

create(getRootProject()) {
versions '26.2', '26.1', '1.21.11'
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package restudio.reglass.client;

//#if MC >= 26
//? if >= 26 {
import net.minecraft.world.item.DyeColor;
//#else
import net.minecraft.util.DyeColor;
//#endif
//? } else {
/*import net.minecraft.util.DyeColor;
*///? }

public final class ContainerColorContext {
private static DyeColor lastShulkerColor;
Expand Down
52 changes: 26 additions & 26 deletions src/main/java/restudio/reglass/client/LiquidGlassPipelines.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package restudio.reglass.client;

import com.mojang.blaze3d.pipeline.RenderPipeline;
//#if MC >= 26.2
//? if >= 26.2 {
import com.mojang.blaze3d.PrimitiveTopology;
import com.mojang.blaze3d.pipeline.BindGroupLayout;
import com.mojang.blaze3d.pipeline.ColorTargetState;
//#elseif MC >= 26
import com.mojang.blaze3d.pipeline.DepthStencilState;
//? } elif >= 26 {
/*import com.mojang.blaze3d.pipeline.DepthStencilState;
import com.mojang.blaze3d.platform.CompareOp;
//#else
import com.mojang.blaze3d.platform.DepthTestFunction;
//#endif
*///? } else {
/*import com.mojang.blaze3d.platform.DepthTestFunction;
*///? }
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexFormat;
//#if MC >= 26
//? if >= 26 {
import com.mojang.blaze3d.shaders.UniformType;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.resources.Identifier;
//#else
import net.minecraft.client.gl.UniformType;
//? } else {
/*import net.minecraft.client.gl.UniformType;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.util.Identifier;
//#endif
*///? }

public final class LiquidGlassPipelines {
private static RenderPipeline LIQUID_GLASS_GUI;
Expand All @@ -31,16 +31,16 @@ private LiquidGlassPipelines() {}
public static synchronized RenderPipeline getGuiPipeline() {
if (LIQUID_GLASS_GUI == null) {
RenderPipeline.Builder b = RenderPipeline.builder()
//#if MC >= 26
//? if >= 26 {
.withLocation(Identifier.fromNamespaceAndPath("reglass", "pipeline/liquid_glass_gui"))
.withVertexShader(Identifier.fromNamespaceAndPath("reglass", "core/blit_fullscreen"))
.withFragmentShader(Identifier.fromNamespaceAndPath("reglass", "program/liquid_glass_gui"))
//#else
.withLocation(Identifier.of("reglass", "pipeline/liquid_glass_gui"))
//? } else {
/*.withLocation(Identifier.of("reglass", "pipeline/liquid_glass_gui"))
.withVertexShader(Identifier.of("reglass", "core/blit_fullscreen"))
.withFragmentShader(Identifier.of("reglass", "program/liquid_glass_gui"))
//#endif
//#if MC >= 26.2
*///? }
//? if >= 26.2 {
//Vulkan requires pipeline layouts to match actual shader bindings
//unused entries can break pipeline creation
.withBindGroupLayout(
Expand All @@ -62,8 +62,8 @@ public static synchronized RenderPipeline getGuiPipeline() {
//Minecraft leaves the no-depth Vulkan pipeline variant invalid, which can crash when bound.
//the blend attachment still has to match the color target format
.withColorTargetState(ColorTargetState.DEFAULT);
//#else
.withUniform("Projection", UniformType.UNIFORM_BUFFER)
//? } else {
/*.withUniform("Projection", UniformType.UNIFORM_BUFFER)
.withUniform("SamplerInfo", UniformType.UNIFORM_BUFFER)
.withUniform("CustomUniforms", UniformType.UNIFORM_BUFFER)
.withUniform("WidgetInfo", UniformType.UNIFORM_BUFFER)
Expand All @@ -74,22 +74,22 @@ public static synchronized RenderPipeline getGuiPipeline() {
.withSampler("Sampler3")
.withSampler("Sampler4")
.withSampler("Sampler5")
//#if MC >= 26
//? if >= 26 {
.withDepthStencilState(new DepthStencilState(CompareOp.ALWAYS_PASS, false))
.withVertexFormat(DefaultVertexFormat.POSITION, VertexFormat.Mode.QUADS);
//#else
.withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
//? } else {
/^.withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
.withDepthWrite(false)
.withVertexFormat(VertexFormats.POSITION, VertexFormat.DrawMode.QUADS);
//#endif
//#endif
^///? }
*///? }

LIQUID_GLASS_GUI = b.build();
//#if MC >= 26.2
//? if >= 26.2 {
RenderSystem.getDevice().precompilePipeline(LIQUID_GLASS_GUI);
//#else
RenderSystem.getDevice().precompilePipeline(LIQUID_GLASS_GUI, null);
//#endif
//? } else {
/*RenderSystem.getDevice().precompilePipeline(LIQUID_GLASS_GUI, null);
*///? }
}
return LIQUID_GLASS_GUI;
}
Expand Down
Loading