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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Voxy is an LoD rendering mod for minecraft
# Voxy Backport for Minecraft 1.21.1
## PLEASE FOR THE LOVE OF GOD DON'T BOTHER THE FINE PEOPLE ON CORTEX DISCORD WITH BUGS RELATING TO THIS, NO SUPPORT FOR BACKPORTS WILL BE GIVEN
49 changes: 19 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ repositories {
includeGroup "maven.modrinth"
}
}

exclusiveContent {
forRepository {
maven {
name "caffeinemcRepository"
url "https://maven.caffeinemc.net/snapshots"
}
}
filter {
includeGroup "net.caffeinemc"
}
}



maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.terraformersmc.com/releases/" }

Expand Down Expand Up @@ -120,29 +105,33 @@ dependencies {

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

if (true) {
modImplementation "maven.modrinth:sodium:mc1.21.11-0.8.2-fabric"
} else {
modImplementation "net.caffeinemc:sodium-fabric:0.8.2-SNAPSHOT+mc1.21.11+"
}
//TODO: this is to eventually not need sodium installed as atm its just used for parsing shaders
modRuntimeOnlyMsk "maven.modrinth:sodium:mc1.21.1-0.6.13-fabric"
modCompileOnly "maven.modrinth:sodium:mc1.21.1-0.6.13-fabric"

modImplementation("maven.modrinth:lithium:mc1.21.11-0.21.0-fabric")
modImplementation("maven.modrinth:lithium:mc1.21.1-0.15.0-fabric")

//modRuntimeOnlyMsk "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
modCompileOnly "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
modRuntimeOnlyMsk "drouarb:nvidium:0.4.1-beta9:1.21-1.21.1@jar"
modCompileOnly "drouarb:nvidium:0.4.1-beta9:1.21-1.21.1@jar"

modCompileOnly("maven.modrinth:modmenu:17.0.0-alpha.1")
modRuntimeOnlyMsk("maven.modrinth:modmenu:17.0.0-alpha.1")
modCompileOnly("maven.modrinth:modmenu:11.0.3")
modRuntimeOnlyMsk("maven.modrinth:modmenu:11.0.3")

modCompileOnly("maven.modrinth:iris:1.10.4+1.21.11-fabric")
modRuntimeOnlyMsk("maven.modrinth:iris:1.10.4+1.21.11-fabric")
modCompileOnly("maven.modrinth:iris:1.8.8+1.21.1-fabric")
modRuntimeOnlyMsk("maven.modrinth:iris:1.8.8+1.21.1-fabric")
// iris needs these for some reason
modRuntimeOnlyMsk("io.github.douira:glsl-transformer:2.0.1")
modRuntimeOnlyMsk("org.anarres:jcpp:1.4.14")

//modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4")

//modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4")

modCompileOnly("maven.modrinth:chunky:1.4.54-fabric")
//modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.40-fabric")
modCompileOnly("maven.modrinth:sodium-extra:mc1.21.1-0.6.0+fabric")
modRuntimeOnlyMsk("maven.modrinth:sodium-extra:mc1.21.1-0.6.0+fabric")

modCompileOnly("maven.modrinth:chunky:1.4.23-fabric")
modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.23-fabric")

modRuntimeOnlyMsk("maven.modrinth:spark:1.10.152-fabric")
modRuntimeOnlyMsk("maven.modrinth:fabric-permissions-api:0.3.3")
Expand Down Expand Up @@ -278,7 +267,7 @@ if (!isInGHA) {
}

dependencies {
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.2.2') {
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.1.0') {
exclude group: 'net.fabricmc', module: 'fabric-loader'
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ org.gradle.daemon = false

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.11
minecraft_version=1.21.1
loader_version=0.18.2
loom_version=1.14-SNAPSHOT

# Fabric API
fabric_version=0.140.2+1.21.11
fabric_version=0.116.6+1.21.1


# Mod Properties
Expand Down
45 changes: 5 additions & 40 deletions src/main/java/me/cortex/voxy/client/VoxyClient.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package me.cortex.voxy.client;

import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
import me.cortex.voxy.client.core.VoxyRenderSystem;
import me.cortex.voxy.client.core.gl.Capabilities;
import me.cortex.voxy.client.core.model.bakery.BudgetBufferRenderer;
import me.cortex.voxy.client.core.rendering.util.SharedIndexBuffer;
Expand All @@ -10,16 +8,8 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
import net.minecraft.client.gui.components.debug.DebugScreenEntries;
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
import net.minecraft.resources.Identifier;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.LevelChunk;
import org.jspecify.annotations.Nullable;

// import net.minecraft.client.gui.components.debug.DebugScreenEntries;
import net.minecraft.resources.ResourceLocation;
import java.util.HashSet;
import java.util.function.Consumer;
import java.util.function.Function;
Expand All @@ -30,11 +20,7 @@ public class VoxyClient implements ClientModInitializer {
public static void initVoxyClient() {
Capabilities.init();//Ensure clinit is called

if (Capabilities.INSTANCE.hasBrokenDepthSampler) {
Logger.error("AMD broken depth sampler detected, voxy does not work correctly and has been disabled, this will hopefully be fixed in the future");
}

boolean systemSupported = Capabilities.INSTANCE.compute && Capabilities.INSTANCE.indirectParameters && !Capabilities.INSTANCE.hasBrokenDepthSampler;
boolean systemSupported = Capabilities.INSTANCE.compute && Capabilities.INSTANCE.indirectParameters;
if (systemSupported) {

SharedIndexBuffer.INSTANCE.id();
Expand All @@ -53,28 +39,7 @@ public static void initVoxyClient() {

@Override
public void onInitializeClient() {
DebugScreenEntries.register(Identifier.fromNamespaceAndPath("voxy", "version"), new DebugScreenEntry() {
@Override
public void display(DebugScreenDisplayer lines, @Nullable Level level, @Nullable LevelChunk levelChunk, @Nullable LevelChunk levelChunk2) {
if (!VoxyCommon.isAvailable()) {
lines.addLine(ChatFormatting.RED + "voxy-"+VoxyCommon.MOD_VERSION);//Voxy installed, not avalible
return;
}
var instance = VoxyCommon.getInstance();
if (instance == null) {
lines.addLine(ChatFormatting.YELLOW + "voxy-" + VoxyCommon.MOD_VERSION);//Voxy avalible, no instance active
return;
}
VoxyRenderSystem vrs = null;
var wr = Minecraft.getInstance().levelRenderer;
if (wr != null) vrs = ((IGetVoxyRenderSystem) wr).getVoxyRenderSystem();

//Voxy instance active
lines.addLine((vrs==null?ChatFormatting.DARK_GREEN:ChatFormatting.GREEN)+"voxy-"+VoxyCommon.MOD_VERSION);
}
});

DebugScreenEntries.register(Identifier.fromNamespaceAndPath("voxy","debug"), new VoxyDebugScreenEntry());
// DebugScreenEntries.register(ResourceLocation.fromNamespaceAndPath("voxy","debug"), new VoxyDebugScreenEntry());
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
if (VoxyCommon.isAvailable()) {
dispatcher.register(VoxyCommands.register());
Expand All @@ -99,6 +64,6 @@ public static int getOcclusionDebugState() {
}

public static boolean disableSodiumChunkRender() {
return false;// getOcclusionDebugState() != 0;
return getOcclusionDebugState() != 0;
}
}
37 changes: 4 additions & 33 deletions src/main/java/me/cortex/voxy/client/VoxyCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
import me.cortex.voxy.common.Logger;
import me.cortex.voxy.commonImpl.VoxyCommon;
import me.cortex.voxy.commonImpl.WorldIdentifier;
import me.cortex.voxy.commonImpl.importers.DHImporter;
Expand All @@ -15,18 +14,11 @@
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.Minecraft;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.dimension.DimensionType;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Locale;
import java.util.concurrent.CompletableFuture;


Expand Down Expand Up @@ -204,35 +196,14 @@ private static int importWorld(CommandContext<FabricClientCommandSource> ctx) {

var name = ctx.getArgument("world_name", String.class);
var file = new File("saves").toPath().resolve(name);
name = name.toLowerCase(Locale.ROOT);
name = name.toLowerCase();
if (name.endsWith("/")) {
name = name.substring(0, name.length()-1);
}
if (file.resolve("level.dat").toFile().exists()) {
var dimFile = DimensionType.getStorageFolder(Minecraft.getInstance().level.dimension(), file)
.resolve("region")
.toFile();
if (!dimFile.isDirectory()) return 1;
return fileBasedImporter(dimFile)?0:1;
//We are in a world directory, so import the current dimension we are in
/*
for (var dim : new String[]{"overworld", "the_nether", "the_end"}) {//This is so annoying that you cant loop through all the dimensions
var id = ResourceKey.create(Registries.DIMENSION, Identifier.withDefaultNamespace(dim));
var dimPath = DimensionType.getStorageFolder(id, file);
dimPath = dimPath.resolve("region");
var dimFile = dimPath.toFile();
if (dimFile.isDirectory()) {//exists and is a directory
if (!fileBasedImporter(dimFile)) {
Logger.error("Failed to import dimension: " + id);
}
}
}*/
} else {
if (!(name.endsWith("region"))) {
file = file.resolve("region");
}
return fileBasedImporter(file.toFile()) ? 0 : 1;
if (!(name.endsWith("region"))) {
file = file.resolve("region");
}
return fileBasedImporter(file.toFile())?0:1;
}

private static int importZip(CommandContext<FabricClientCommandSource> ctx) {
Expand Down
97 changes: 50 additions & 47 deletions src/main/java/me/cortex/voxy/client/VoxyDebugScreenEntry.java
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
package me.cortex.voxy.client;

import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
import me.cortex.voxy.client.core.VoxyRenderSystem;
import me.cortex.voxy.commonImpl.VoxyCommon;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
import net.minecraft.resources.Identifier;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.LevelChunk;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

public class VoxyDebugScreenEntry implements DebugScreenEntry {
@Override
public void display(DebugScreenDisplayer lines, @Nullable Level world, @Nullable LevelChunk clientChunk, @Nullable LevelChunk chunk) {
if (!VoxyCommon.isAvailable()) {
return;
}

var instance = VoxyCommon.getInstance();
if (instance == null) {
return;
}

VoxyRenderSystem vrs = null;
var wr = Minecraft.getInstance().levelRenderer;
if (wr != null) vrs = ((IGetVoxyRenderSystem) wr).getVoxyRenderSystem();

//lines.addLineToSection();
List<String> instanceLines = new ArrayList<>();
instance.addDebug(instanceLines);
lines.addToGroup(Identifier.fromNamespaceAndPath("voxy", "instance_debug"), instanceLines);

if (vrs != null) {
List<String> renderLines = new ArrayList<>();
vrs.addDebugInfo(renderLines);
lines.addToGroup(Identifier.fromNamespaceAndPath("voxy", "render_debug"), renderLines);
}
}


}
// package me.cortex.voxy.client;

// import me.cortex.voxy.client.core.IGetVoxyRenderSystem;
// import me.cortex.voxy.client.core.VoxyRenderSystem;
// import me.cortex.voxy.commonImpl.VoxyCommon;
// import net.minecraft.ChatFormatting;
// import net.minecraft.client.Minecraft;
// import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
// import net.minecraft.client.gui.components.debug.DebugScreenEntry;
// import net.minecraft.resources.ResourceLocation;
// import net.minecraft.world.level.Level;
// import net.minecraft.world.level.chunk.LevelChunk;
// import org.jetbrains.annotations.Nullable;

// import java.util.ArrayList;
// import java.util.List;

// public class VoxyDebugScreenEntry implements DebugScreenEntry {
// @Override
// public void display(DebugScreenDisplayer lines, @Nullable Level world, @Nullable LevelChunk clientChunk, @Nullable LevelChunk chunk) {
// if (!VoxyCommon.isAvailable()) {
// lines.addLine(ChatFormatting.RED + "voxy-"+VoxyCommon.MOD_VERSION);//Voxy installed, not avalible
// return;
// }
// var instance = VoxyCommon.getInstance();
// if (instance == null) {
// lines.addLine(ChatFormatting.YELLOW + "voxy-" + VoxyCommon.MOD_VERSION);//Voxy avalible, no instance active
// return;
// }
// VoxyRenderSystem vrs = null;
// var wr = Minecraft.getInstance().levelRenderer;
// if (wr != null) vrs = ((IGetVoxyRenderSystem) wr).getVoxyRenderSystem();

// //Voxy instance active
// lines.addLine((vrs==null?ChatFormatting.DARK_GREEN:ChatFormatting.GREEN)+"voxy-"+VoxyCommon.MOD_VERSION);

// //lines.addLineToSection();
// List<String> instanceLines = new ArrayList<>();
// instance.addDebug(instanceLines);
// lines.addToGroup(ResourceLocation.fromNamespaceAndPath("voxy", "instance_debug"), instanceLines);

// if (vrs != null) {
// List<String> renderLines = new ArrayList<>();
// vrs.addDebugInfo(renderLines);
// lines.addToGroup(ResourceLocation.fromNamespaceAndPath("voxy", "render_debug"), renderLines);
// }
// }


// }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import me.cortex.voxy.common.Logger;
import me.cortex.voxy.common.config.section.SectionStorageConfig;
import net.fabricmc.loader.api.FabricLoader;
import org.apache.commons.logging.Log;

import java.nio.file.Path;

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/me/cortex/voxy/client/compat/SodiumExtra.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package me.cortex.voxy.client.compat;

import net.fabricmc.loader.api.FabricLoader;

public class SodiumExtra {
public static final boolean HAS_SODIUM_EXTRA = FabricLoader.getInstance().isModLoaded("sodium-extra");
public static boolean useSodiumExtraCulling() {
return HAS_SODIUM_EXTRA;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.cortex.voxy.client.config;

import net.caffeinemc.mods.sodium.client.config.structure.OptionPage;
import net.caffeinemc.mods.sodium.client.config.structure.Page;

public interface IConfigPageSetter {
void voxy$setPageJump(OptionPage page);
}
//package me.cortex.voxy.client.config;
//
//import net.caffeinemc.mods.sodium.client.config.structure.OptionPage;
//import net.caffeinemc.mods.sodium.client.config.structure.Page;
//
//public interface IConfigPageSetter {
// void voxy$setPageJump(OptionPage page);
//}
Loading