Skip to content

Commit

Permalink
Fix failing builds due to Vintagium (#2519)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechLord22 authored Jul 5, 2024
1 parent 5dceed5 commit 837b2ab
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 16 deletions.
14 changes: 0 additions & 14 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,9 @@ dependencies {
compileOnly rfg.deobf("curse.maven:baubles-227083:2518667") // Baubles 1.5.2
compileOnly rfg.deobf("curse.maven:forestry-59751:2684780") // Forestry 5.8.2.387
compileOnly rfg.deobf("curse.maven:chisel-235279:2915375") // Chisel 1.0.2.45

// Special Vintagium Hackery
// Vintagium is currently only distributed as a .zip containing the reobf and -dev jars on Github Actions, which is not ideal
// Using a fake Ivy repo to download it does not work, as nightly.link does not support http HEAD requests, which Gradle wants
mkdir("libs")
// Using Gradle's Ant integration seems to be the least hacky way to download an arbitrary file without a plugin
ant.get(src: "https://nightly.link/Asek3/sodium-1.12/workflows/gradle/12.x%2Fforge/Vintagium.zip",
dest: "libs",
skipexisting: 'true')
ant.unzip(src: "libs/Vintagium.zip",
dest: "libs")
compileOnly(files("libs/vintagium-mc1.12.2-0.1-dev.jar"))

compileOnly rfg.deobf("curse.maven:littletiles-257818:4750222") // LittleTiles 1.5.82-1.12.2
compileOnly rfg.deobf("curse.maven:creativecore-257814:4722163") // Creative Core 1.10.71


// Mods with Soft compat but which have no need to be in code, such as isModLoaded() checks and getModItem() recipes.
// Uncomment any of these to test them in-game.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package me.jellysquid.mods.sodium.client.render.chunk.passes;

/**
* Adapted and minimized from <a href="https://github.com/Asek3/sodium-1.12/blob/12.x/forge/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/passes/BlockRenderPass.java">BlockRenderPass.java</a>
*/
public enum BlockRenderPass {
;

public static BlockRenderPass[] VALUES;
public static int COUNT;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package me.jellysquid.mods.sodium.client.render.chunk.passes;

import net.minecraft.util.BlockRenderLayer;

/**
* Adapted and minimized from <a href="https://github.com/Asek3/sodium-1.12/blob/12.x/forge/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/passes/BlockRenderPassManager.java">BlockRenderPassManager.java</a>
*/
public class BlockRenderPassManager {

private void addMapping(BlockRenderLayer layer, BlockRenderPass type) {}

/**
* Creates a set of render pass mappings to vanilla render layers which closely mirrors the rendering
* behavior of vanilla.
*/
public static BlockRenderPassManager createDefaultMappings() {
return new BlockRenderPassManager();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.jellysquid.mods.sodium.client.util;

import net.minecraft.util.BlockRenderLayer;

import java.util.HashMap;
import java.util.Map;

/**
* Adapted and minimized from <a href="https://github.com/Asek3/sodium-1.12/blob/12.x/forge/src/main/java/me/jellysquid/mods/sodium/client/util/BufferSizeUtil.java">BufferSizeUtil.java</a>
*/
public class BufferSizeUtil {

public static final Map<BlockRenderLayer, Integer> BUFFER_SIZES = new HashMap<>();
}
12 changes: 12 additions & 0 deletions src/api/java/me/jellysquid/mods/sodium/client/util/EnumUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package me.jellysquid.mods.sodium.client.util;

import net.minecraft.util.BlockRenderLayer;

/**
* Adapted and minimized from <a href="https://github.com/Asek3/sodium-1.12/blob/12.x/forge/src/main/java/me/jellysquid/mods/sodium/client/util/EnumUtil.java">EnumUtil.java</a>
*/
public class EnumUtil {

public static BlockRenderLayer[] LAYERS = BlockRenderLayer.values();

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import me.jellysquid.mods.sodium.client.render.chunk.passes.BlockRenderPassManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
Expand All @@ -21,7 +20,7 @@ public abstract class BlockRenderManagerMixin {
@Shadow(remap = false)
protected abstract void addMapping(BlockRenderLayer layer, BlockRenderPass type);

@Unique
@SuppressWarnings("UnresolvedMixinReference")
@Inject(method = "createDefaultMappings",
at = @At(value = "RETURN"),
remap = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public abstract class BlockRenderPassMixin {
@Shadow(remap = false)
public static int COUNT;

@SuppressWarnings("UnresolvedMixinReference")
@Inject(method = "<clinit>",
at = @At(value = "TAIL"),
remap = false)
Expand Down

0 comments on commit 837b2ab

Please sign in to comment.