Skip to content

Commit

Permalink
Merge branch '1.21/dev' into 1.21/stable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Jun 13, 2024
2 parents c68fc1d + e85902a commit 9df5a93
Show file tree
Hide file tree
Showing 55 changed files with 621 additions and 540 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ jobs:
java-version: 21
check-latest: true
- name: Upload assets to releases
run: ./gradlew build publishAllPublicationsToFlashyReeseReleasesRepository
run: ./gradlew build publishAllPublicationsToFlashyReeseReleasesRepository -Pbuild.release
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
BUILD_RELEASE: ${{ github.event.prerelease == false }}
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ jobs:
distribution: 'temurin'
java-version: 21
check-latest: true
- name: Build with Gradle
run: ./gradlew build
- name: Build and Publish with Gradle
run: ./gradlew build publishAllPublicationsToFlashyReeseSnapshotsRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Upload Auild Artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![Mod loader: Fabric](https://img.shields.io/badge/modloader-Fabric-1976d2?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlR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HhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MGVkYjFjMmMtZmY4Yy1lNDQxLTkzMWYtNDk1ZDRmMTRjNzYwIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDowZWRiMWMyYy1mZjhjLWU0NDEtOTMxZi00OTVkNGYxNGM3NjAiIHN0RXZ0OndoZW49IjIwMTgtMTItMTZUMTY6NTQ6MTctMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE4IChXaW5kb3dzKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4/HiGMAAAAtUlEQVRYw+XXrQqAMBQF4D2P2eBL+QIG8RnEJFaNBjEum+0+zMQLtwwv+wV3ZzhhMDgfJ0wUSinxZUQWgKos1JP/AbD4OneIDyQPwCFniA+EJ4CaXm4TxAXCC0BNHgLhAdAnx9hC8PwGSRtAFVMQjF7cNTWED8B1cgwW20yfJgAvrssAsZ1cB3g/xckAxr6FmCDU5N6f488BrpCQ4rQBJkiMYh4ACmLzwOQF0CExinkCsvw7vgGikl+OotaKRwAAAABJRU5ErkJggg==)
![Version](https://img.shields.io/github/v/tag/FlashyReese/sodium-extra-fabric?label=version&style=flat-square)
[![CurseForge](http://cf.way2muchnoise.eu/title/447673.svg)](https://www.curseforge.com/minecraft/mc-mods/sodium-extra)
[![Support Server](https://img.shields.io/discord/748363294749753484.svg?color=7289da&label=FlashyReese&logo=discord&style=flat-square)](https://discord.gg/MPHVG6MH4e)
[![Support Server](https://img.shields.io/discord/748363294749753484.svg?color=7289da&label=FlashyReese&logo=discord&style=flat-square)](https://flashyreese.me/discord)

Features that shouldn't be in Sodium.

Expand Down
40 changes: 23 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

archivesBaseName = project.archives_base_name
version = "${project.mod_version}${getVersionType(project.version_type, project.revision)}+mc${project.minecraft_version}-${getVersionMetadata()}"
version = createVersionString()
group = project.maven_group

loom {
Expand Down Expand Up @@ -58,7 +58,7 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

//modImplementation "me.jellysquid.mods:sodium-fabric:0.5.6+git.d2b4c1f"
//modImplementation "me.jellysquid.mods:sodium:0.5.9-snapshot+mc1.21-pre3-build.9"
modImplementation "maven.modrinth:sodium:${project.sodium_version}"
/*modImplementation("me.flashyreese.mods:reeses-sodium-options:${project.reeses_sodium_options}") {
exclude group: "net.coderbot.iris_mc1_19", module: "iris"
Expand Down Expand Up @@ -131,22 +131,28 @@ publishing {
}
}

static def getVersionMetadata() {
def build_id = System.getenv("GITHUB_RUN_NUMBER")
def createVersionString() {
def builder = new StringBuilder()

// CI builds only
if (build_id != null) {
return "build.${build_id}"
def isReleaseBuild = project.hasProperty("build.release")
def buildId = System.getenv("GITHUB_RUN_NUMBER")

if (isReleaseBuild) {
builder.append(mod_version)
} else {
builder.append(mod_version.split('-')[0])
builder.append("-snapshot")
}
// No tracking information could be found about the build
return "unknown"
}

static def getVersionType(String version_type, String revision) {
version_type = version_type.trim().toLowerCase()
revision = revision.trim().toLowerCase()
if (version_type != "release") {
return "-${version_type}${revision}"
builder.append("+mc").append(minecraft_version)

if (!isReleaseBuild) {
if (buildId != null) {
builder.append("-build.${buildId}")
} else {
builder.append("-local")
}
}
return ""
}

return builder.toString()
}
14 changes: 6 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11

# Mod Properties
version_type=release
revision=1
mod_version=0.5.5
mod_version=0.5.6
maven_group=me.flashyreese.mods
archives_base_name=sodium-extra

# Dependencies
reeses_sodium_options=1.7.3+mc1.20.5-build.74
sodium_version=mc1.20.6-0.5.8
fabric_version=0.97.8+1.20.6
sodium_version=mc1.21-0.5.9
fabric_version=0.100.1+1.21
crowdin_translate=1.4+1.19.3
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.Queue;

public class ClientTickHandler {
private int averageFps, lowestFps, highestFps;
private final Queue<Integer> fpsQueue = EvictingQueue.create(200);
private int averageFps, lowestFps, highestFps;

public void onClientInitialize() {
ClientTickEvents.START_CLIENT_TICK.register(minecraftClient -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.flashyreese.mods.sodiumextra.client;

import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraHud;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions;
import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraHud;
import net.caffeinemc.caffeineconfig.CaffeineConfig;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,13 @@ public static OptionPage extra() {
)
.build());
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
.setName(Text.translatable("sodium-extra.option.advanced_item_tooltips"))
.setTooltip(Text.translatable("sodium-extra.option.advanced_item_tooltips.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.advancedItemTooltips = value, opts -> opts.advancedItemTooltips)
.build()
)
.add(OptionImpl.createBuilder(boolean.class, vanillaOpts)
.setName(Text.translatable("sodium-extra.option.advanced_item_tooltips"))
.setTooltip(Text.translatable("sodium-extra.option.advanced_item_tooltips.tooltip"))
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.advancedItemTooltips = value, opts -> opts.advancedItemTooltips)
.build()
)
.build());
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(boolean.class, sodiumExtraOpts)
Expand Down Expand Up @@ -548,7 +548,6 @@ private static Text translatableTooltip(Identifier identifier, String category)

Text translatable = Text.translatable(key);
if (!Texts.hasTranslation(translatable)) {
System.out.println(key);
translatable = Text.translatable(
"sodium-extra.option.".concat(category).concat(".tooltips"),
translatableName(identifier, category)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.text.Text;
import net.minecraft.util.math.Vec3d;

Expand Down Expand Up @@ -46,8 +47,9 @@ public void onStartTick(MinecraftClient client) {
this.textList.add(text);
}
}

@Override
public void onHudRender(DrawContext drawContext, float tickDelta) {
public void onHudRender(DrawContext drawContext, RenderTickCounter renderTickCounter) {
if (!this.client.getDebugHud().shouldShowDebugHud() && !this.client.options.hudHidden) {
SodiumExtraGameOptions.OverlayCorner overlayCorner = SodiumExtraClientMod.options().extraSettings.overlayCorner;
// Calculate starting position based on the overlay corner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import org.lwjgl.system.MemoryUtil;

public class TextureColorVertex {
public static final VertexFormatDescription FORMAT = VertexFormatRegistry.instance().get(VertexFormats.POSITION_COLOR_TEXTURE);
public static final VertexFormatDescription FORMAT = VertexFormatRegistry.instance().get(VertexFormats.POSITION_TEXTURE_COLOR);

public static final int STRIDE = 24;

private static final int OFFSET_POSITION = 0;
private static final int OFFSET_COLOR = 12;
private static final int OFFSET_TEXTURE = 16;
private static final int OFFSET_TEXTURE = 12;
private static final int OFFSET_COLOR = 20;

public static void write(long ptr, Matrix4f matrix, float x, float y, float z, int color, float u, float v) {
float xt = MatrixHelper.transformPositionX(matrix, x, y, z);
Expand All @@ -29,9 +29,10 @@ public static void write(long ptr, float x, float y, float z, int color, float u
MemoryUtil.memPutFloat(ptr + OFFSET_POSITION + 4, y);
MemoryUtil.memPutFloat(ptr + OFFSET_POSITION + 8, z);

MemoryUtil.memPutInt(ptr + OFFSET_COLOR, color);

MemoryUtil.memPutFloat(ptr + OFFSET_TEXTURE, u);
MemoryUtil.memPutFloat(ptr + OFFSET_TEXTURE + 4, v);

MemoryUtil.memPutInt(ptr + OFFSET_COLOR, color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatDescription;
import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatRegistry;
import net.minecraft.client.render.VertexFormats;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;

public final class WeatherVertex {
Expand All @@ -18,14 +17,14 @@ public final class WeatherVertex {
private static final int OFFSET_COLOR = 20;
private static final int OFFSET_LIGHT = 24;

public static void put(long ptr, float x, float y, float z, int color, float u, float v, int light) {
public static void put(long ptr, float x, float y, float z, float u, float v, int color, int light) {
PositionAttribute.put(ptr + OFFSET_POSITION, x, y, z);
TextureAttribute.put(ptr + OFFSET_TEXTURE, u, v);
ColorAttribute.set(ptr + OFFSET_COLOR, color);
LightAttribute.set(ptr + OFFSET_LIGHT, light);
}

public static void put(long ptr, float x, float y, float z, int color, float u, float v, int lightU, int lightV) {
public static void put(long ptr, float x, float y, float z, float u, float v, int color, int lightU, int lightV) {
PositionAttribute.put(ptr + OFFSET_POSITION, x, y, z);
TextureAttribute.put(ptr + OFFSET_TEXTURE, u, v);
ColorAttribute.set(ptr + OFFSET_COLOR, color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class IrisCompat {
terrainFormat = (VertexFormat) terrainField.get(null);

irisPresent = true;
} catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InvocationTargetException e) {
} catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | IllegalAccessException |
InvocationTargetException e) {
irisPresent = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class ModelVertexToTerrainSerializer implements VertexSerializer {
@Override
public void serialize(long src, long dst, int vertexCount) {
for(int i = 0; i < vertexCount; ++i) {
for (int i = 0; i < vertexCount; ++i) {
MemoryUtil.memCopy(src, dst, 24); // Copies position, color and texture
// todo: overlay src + 24L
MemoryUtil.memCopy(src + 28L, dst + 24L, 8); // Copies light and normal
Expand Down
Loading

0 comments on commit 9df5a93

Please sign in to comment.