inital 1.21.11
This commit is contained in:
25
build.gradle
25
build.gradle
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version "1.11-SNAPSHOT"
|
id 'fabric-loom' version "1.14-SNAPSHOT"
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,26 +106,26 @@ dependencies {
|
|||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
//TODO: this is to eventually not need sodium installed as atm its just used for parsing shaders
|
//TODO: this is to eventually not need sodium installed as atm its just used for parsing shaders
|
||||||
modRuntimeOnlyMsk "maven.modrinth:sodium:mc1.21.10-0.7.2-fabric"
|
modRuntimeOnlyMsk "maven.modrinth:sodium:mc1.21.11-0.8.0-fabric"
|
||||||
modCompileOnly "maven.modrinth:sodium:mc1.21.10-0.7.2-fabric"
|
modCompileOnly "maven.modrinth:sodium:mc1.21.11-0.8.0-fabric"
|
||||||
|
|
||||||
modImplementation("maven.modrinth:lithium:mc1.21.10-0.20.0-fabric")
|
modImplementation("maven.modrinth:lithium:mc1.21.11-0.21.0-fabric")
|
||||||
|
|
||||||
//modRuntimeOnlyMsk "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
|
//modRuntimeOnlyMsk "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
|
||||||
modCompileOnly "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
|
modCompileOnly "drouarb:nvidium:0.4.1-beta4:1.21.6@jar"
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:modmenu:15.0.0")
|
modCompileOnly("maven.modrinth:modmenu:17.0.0-alpha.1")
|
||||||
//modRuntimeOnlyMsk("maven.modrinth:modmenu:15.0.0")
|
modRuntimeOnlyMsk("maven.modrinth:modmenu:17.0.0-alpha.1")
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:iris:1.9.6+1.21.10-fabric")
|
modCompileOnly("maven.modrinth:iris:1.10.0+1.21.11-fabric")
|
||||||
modRuntimeOnlyMsk("maven.modrinth:iris:1.9.6+1.21.10-fabric")
|
modRuntimeOnlyMsk("maven.modrinth:iris:1.10.0+1.21.11-fabric")
|
||||||
|
|
||||||
//modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4")
|
//modCompileOnly("maven.modrinth:starlight:1.1.3+1.20.4")
|
||||||
|
|
||||||
//modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4")
|
//modCompileOnly("maven.modrinth:immersiveportals:v5.1.7-mc1.20.4")
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:sodium-extra:mc1.21.10-0.7.1+fabric")
|
modCompileOnly("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
||||||
modRuntimeOnlyMsk("maven.modrinth:sodium-extra:mc1.21.10-0.7.1+fabric")
|
modRuntimeOnlyMsk("maven.modrinth:sodium-extra:mc1.21.11-0.8.0+fabric")
|
||||||
|
|
||||||
modCompileOnly("maven.modrinth:chunky:1.4.40-fabric")
|
modCompileOnly("maven.modrinth:chunky:1.4.40-fabric")
|
||||||
//modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.40-fabric")
|
//modRuntimeOnlyMsk("maven.modrinth:chunky:1.4.40-fabric")
|
||||||
@@ -264,8 +264,9 @@ if (!isInGHA) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.1.0') {
|
/*
|
||||||
|
modRuntimeOnly('me.djtheredstoner:DevAuth-fabric:1.2.1') {
|
||||||
exclude group: 'net.fabricmc', module: 'fabric-loader'
|
exclude group: 'net.fabricmc', module: 'fabric-loader'
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,12 @@ org.gradle.daemon = false
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.21.10
|
minecraft_version=1.21.11
|
||||||
loader_version=0.17.2
|
loader_version=0.18.2
|
||||||
loom_version=1.11-SNAPSHOT
|
loom_version=1.14-SNAPSHOT
|
||||||
|
|
||||||
# Fabric API
|
# Fabric API
|
||||||
fabric_version=0.134.1+1.21.10
|
fabric_version=0.139.4+1.21.11
|
||||||
|
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import net.fabricmc.api.ClientModInitializer;
|
|||||||
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
|
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.client.gui.components.debug.DebugScreenEntries;
|
import net.minecraft.client.gui.components.debug.DebugScreenEntries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
@@ -39,7 +39,7 @@ public class VoxyClient implements ClientModInitializer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
DebugScreenEntries.register(ResourceLocation.fromNamespaceAndPath("voxy","debug"), new VoxyDebugScreenEntry());
|
DebugScreenEntries.register(Identifier.fromNamespaceAndPath("voxy","debug"), new VoxyDebugScreenEntry());
|
||||||
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
|
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
|
||||||
if (VoxyCommon.isAvailable()) {
|
if (VoxyCommon.isAvailable()) {
|
||||||
dispatcher.register(VoxyCommands.register());
|
dispatcher.register(VoxyCommands.register());
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ public class VoxyClientInstance extends VoxyInstance {
|
|||||||
public int version = 1;
|
public int version = 1;
|
||||||
public SectionStorageConfig sectionStorageConfig;
|
public SectionStorageConfig sectionStorageConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Config DEFAULT_STORAGE_CONFIG;
|
private static final Config DEFAULT_STORAGE_CONFIG;
|
||||||
static {
|
static {
|
||||||
var config = new Config();
|
var config = new Config();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import net.minecraft.ChatFormatting;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
|
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
|
||||||
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
|
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.chunk.LevelChunk;
|
import net.minecraft.world.level.chunk.LevelChunk;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -37,12 +37,12 @@ public class VoxyDebugScreenEntry implements DebugScreenEntry {
|
|||||||
//lines.addLineToSection();
|
//lines.addLineToSection();
|
||||||
List<String> instanceLines = new ArrayList<>();
|
List<String> instanceLines = new ArrayList<>();
|
||||||
instance.addDebug(instanceLines);
|
instance.addDebug(instanceLines);
|
||||||
lines.addToGroup(ResourceLocation.fromNamespaceAndPath("voxy", "instance_debug"), instanceLines);
|
lines.addToGroup(Identifier.fromNamespaceAndPath("voxy", "instance_debug"), instanceLines);
|
||||||
|
|
||||||
if (vrs != null) {
|
if (vrs != null) {
|
||||||
List<String> renderLines = new ArrayList<>();
|
List<String> renderLines = new ArrayList<>();
|
||||||
vrs.addDebugInfo(renderLines);
|
vrs.addDebugInfo(renderLines);
|
||||||
lines.addToGroup(ResourceLocation.fromNamespaceAndPath("voxy", "render_debug"), renderLines);
|
lines.addToGroup(Identifier.fromNamespaceAndPath("voxy", "render_debug"), renderLines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.moulberry.flashback.record.FlashbackMeta;
|
|||||||
import me.cortex.voxy.common.Logger;
|
import me.cortex.voxy.common.Logger;
|
||||||
import me.cortex.voxy.common.config.section.SectionStorageConfig;
|
import me.cortex.voxy.common.config.section.SectionStorageConfig;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.google.gson.GsonBuilder;
|
|||||||
import me.cortex.voxy.common.Logger;
|
import me.cortex.voxy.common.Logger;
|
||||||
import me.cortex.voxy.common.util.cpu.CpuLayout;
|
import me.cortex.voxy.common.util.cpu.CpuLayout;
|
||||||
import me.cortex.voxy.commonImpl.VoxyCommon;
|
import me.cortex.voxy.commonImpl.VoxyCommon;
|
||||||
import net.caffeinemc.mods.sodium.client.gui.options.storage.OptionStorage;
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
@@ -15,7 +14,7 @@ import java.lang.reflect.Modifier;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
public class VoxyConfig implements OptionStorage<VoxyConfig> {
|
public class VoxyConfig {
|
||||||
private static final Gson GSON = new GsonBuilder()
|
private static final Gson GSON = new GsonBuilder()
|
||||||
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
|
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
|
||||||
.setPrettyPrinting()
|
.setPrettyPrinting()
|
||||||
@@ -76,11 +75,6 @@ public class VoxyConfig implements OptionStorage<VoxyConfig> {
|
|||||||
.resolve("voxy-config.json");
|
.resolve("voxy-config.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public VoxyConfig getData() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isRenderingEnabled() {
|
public boolean isRenderingEnabled() {
|
||||||
return VoxyCommon.isAvailable() && this.enabled && this.enableRendering;
|
return VoxyCommon.isAvailable() && this.enabled && this.enableRendering;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import me.cortex.voxy.client.core.gl.GlBuffer;
|
|||||||
import me.cortex.voxy.client.core.gl.GlTexture;
|
import me.cortex.voxy.client.core.gl.GlTexture;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
|
|
||||||
import static org.lwjgl.opengl.GL11.*;
|
import static org.lwjgl.opengl.GL11.*;
|
||||||
import static org.lwjgl.opengl.GL11C.GL_NEAREST;
|
import static org.lwjgl.opengl.GL11C.GL_NEAREST;
|
||||||
@@ -32,8 +32,8 @@ public class ModelStore {
|
|||||||
|
|
||||||
//Limit the mips of the texture to match that of the terrain atlas
|
//Limit the mips of the texture to match that of the terrain atlas
|
||||||
int mipLvl = ((TextureAtlas) Minecraft.getInstance().getTextureManager()
|
int mipLvl = ((TextureAtlas) Minecraft.getInstance().getTextureManager()
|
||||||
.getTexture(ResourceLocation.fromNamespaceAndPath("minecraft", "textures/atlas/blocks.png")))
|
.getTexture(Identifier.fromNamespaceAndPath("minecraft", "textures/atlas/blocks.png")))
|
||||||
.mipLevel;
|
.maxMipLevel;
|
||||||
|
|
||||||
glSamplerParameteri(this.blockSampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
|
glSamplerParameteri(this.blockSampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
|
||||||
glSamplerParameteri(this.blockSampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glSamplerParameteri(this.blockSampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
/*
|
||||||
package me.cortex.voxy.client.core.model.bakery;
|
package me.cortex.voxy.client.core.model.bakery;
|
||||||
|
|
||||||
import me.cortex.voxy.common.Logger;
|
import me.cortex.voxy.common.Logger;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.Model;
|
import net.minecraft.client.model.Model;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
|
||||||
import net.minecraft.client.renderer.SubmitNodeStorage;
|
import net.minecraft.client.renderer.SubmitNodeStorage;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -19,6 +19,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class BakedBlockEntityModel {
|
public class BakedBlockEntityModel {
|
||||||
|
|
||||||
private record LayerConsumer(RenderType layer, ReuseVertexConsumer consumer) {}
|
private record LayerConsumer(RenderType layer, ReuseVertexConsumer consumer) {}
|
||||||
private final List<LayerConsumer> layers;
|
private final List<LayerConsumer> layers;
|
||||||
private BakedBlockEntityModel(List<LayerConsumer> layers) {
|
private BakedBlockEntityModel(List<LayerConsumer> layers) {
|
||||||
@@ -29,7 +30,7 @@ public class BakedBlockEntityModel {
|
|||||||
for (var layer : this.layers) {
|
for (var layer : this.layers) {
|
||||||
if (layer.consumer.isEmpty()) continue;
|
if (layer.consumer.isEmpty()) continue;
|
||||||
if (layer.layer instanceof RenderType.CompositeRenderType mp) {
|
if (layer.layer instanceof RenderType.CompositeRenderType mp) {
|
||||||
ResourceLocation textureId = mp.state.textureState.cutoutTexture().orElse(null);
|
Identifier textureId = mp.state.textureState.cutoutTexture().orElse(null);
|
||||||
if (textureId == null) {
|
if (textureId == null) {
|
||||||
Logger.error("ERROR: Empty texture id for layer: " + layer);
|
Logger.error("ERROR: Empty texture id for layer: " + layer);
|
||||||
} else {
|
} else {
|
||||||
@@ -71,7 +72,6 @@ public class BakedBlockEntityModel {
|
|||||||
entity.setLevel(Minecraft.getInstance().level);
|
entity.setLevel(Minecraft.getInstance().level);
|
||||||
if (renderer != null) {
|
if (renderer != null) {
|
||||||
try {
|
try {
|
||||||
/*
|
|
||||||
var rt = renderer.createRenderState();
|
var rt = renderer.createRenderState();
|
||||||
renderer.extractRenderState(entity, rt, 0.0f, new Vec3d(0,0,0), null);
|
renderer.extractRenderState(entity, rt, 0.0f, new Vec3d(0,0,0), null);
|
||||||
|
|
||||||
@@ -81,7 +81,6 @@ public class BakedBlockEntityModel {
|
|||||||
renderer.submit(rt, new MatrixStack(), queue, cstate);
|
renderer.submit(rt, new MatrixStack(), queue, cstate);
|
||||||
var qq = queue.order(0);
|
var qq = queue.order(0);
|
||||||
qq.
|
qq.
|
||||||
*/
|
|
||||||
//renderer.render(entity, 0.0f, new MatrixStack(), layer->map.computeIfAbsent(layer, rl -> new LayerConsumer(rl, new ReuseVertexConsumer().setDefaultMeta(getMetaFromLayer(rl)))).consumer, 0, 0, new Vec3d(0,0,0));
|
//renderer.render(entity, 0.0f, new MatrixStack(), layer->map.computeIfAbsent(layer, rl -> new LayerConsumer(rl, new ReuseVertexConsumer().setDefaultMeta(getMetaFromLayer(rl)))).consumer, 0, 0, new Vec3d(0,0,0));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("Unable to bake block entity: " + entity, e);
|
Logger.error("Unable to bake block entity: " + entity, e);
|
||||||
@@ -103,3 +102,4 @@ public class BakedBlockEntityModel {
|
|||||||
return new BakedBlockEntityModel(new ArrayList<>(map.values()));
|
return new BakedBlockEntityModel(new ArrayList<>(map.values()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@@ -5,7 +5,7 @@ import net.minecraft.client.renderer.ItemBlockRenderTypes;
|
|||||||
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
import net.minecraft.client.renderer.chunk.ChunkSectionLayer;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.level.BlockAndTintGetter;
|
import net.minecraft.world.level.BlockAndTintGetter;
|
||||||
import net.minecraft.world.level.ColorResolver;
|
import net.minecraft.world.level.ColorResolver;
|
||||||
import net.minecraft.world.level.LightLayer;
|
import net.minecraft.world.level.LightLayer;
|
||||||
@@ -48,16 +48,15 @@ public class ModelTextureBakery {
|
|||||||
|
|
||||||
public static int getMetaFromLayer(ChunkSectionLayer layer) {
|
public static int getMetaFromLayer(ChunkSectionLayer layer) {
|
||||||
boolean hasDiscard = layer == ChunkSectionLayer.CUTOUT ||
|
boolean hasDiscard = layer == ChunkSectionLayer.CUTOUT ||
|
||||||
layer == ChunkSectionLayer.CUTOUT_MIPPED ||
|
layer == ChunkSectionLayer.TRANSLUCENT||
|
||||||
layer == ChunkSectionLayer.TRIPWIRE;
|
layer == ChunkSectionLayer.TRIPWIRE;
|
||||||
|
|
||||||
boolean isMipped = layer == ChunkSectionLayer.CUTOUT_MIPPED ||
|
boolean isMipped = layer == ChunkSectionLayer.SOLID ||
|
||||||
layer == ChunkSectionLayer.SOLID ||
|
|
||||||
layer == ChunkSectionLayer.TRANSLUCENT ||
|
layer == ChunkSectionLayer.TRANSLUCENT ||
|
||||||
layer == ChunkSectionLayer.TRIPWIRE;
|
layer == ChunkSectionLayer.TRIPWIRE;
|
||||||
|
|
||||||
int meta = hasDiscard?1:0;
|
int meta = hasDiscard?1:0;
|
||||||
meta |= isMipped?2:0;
|
meta |= true?2:0;
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +170,7 @@ public class ModelTextureBakery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void renderToStream(BlockState state, int streamBuffer, int streamOffset) {
|
public boolean renderToStream(BlockState state, int streamBuffer, int streamOffset) {
|
||||||
this.capture.clear();
|
this.capture.clear();
|
||||||
boolean isBlock = true;
|
boolean isBlock = true;
|
||||||
ChunkSectionLayer layer;
|
ChunkSectionLayer layer;
|
||||||
@@ -187,9 +186,9 @@ public class ModelTextureBakery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: support block model entities
|
//TODO: support block model entities
|
||||||
BakedBlockEntityModel bbem = null;
|
//BakedBlockEntityModel bbem = null;
|
||||||
if (state.hasBlockEntity()) {
|
if (state.hasBlockEntity()) {
|
||||||
bbem = BakedBlockEntityModel.bake(state);
|
//bbem = BakedBlockEntityModel.bake(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Setup GL state
|
//Setup GL state
|
||||||
@@ -217,14 +216,15 @@ public class ModelTextureBakery {
|
|||||||
//Bind the capture framebuffer
|
//Bind the capture framebuffer
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id);
|
glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id);
|
||||||
|
|
||||||
var tex = Minecraft.getInstance().getTextureManager().getTexture(ResourceLocation.fromNamespaceAndPath("minecraft", "textures/atlas/blocks.png")).getTexture();
|
var tex = Minecraft.getInstance().getTextureManager().getTexture(Identifier.fromNamespaceAndPath("minecraft", "textures/atlas/blocks.png")).getTexture();
|
||||||
blockTextureId = ((com.mojang.blaze3d.opengl.GlTexture)tex).glId();
|
blockTextureId = ((com.mojang.blaze3d.opengl.GlTexture)tex).glId();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: fastpath for blocks
|
boolean isAnyShaded = false;
|
||||||
if (isBlock) {
|
if (isBlock) {
|
||||||
this.vc.reset();
|
this.vc.reset();
|
||||||
this.bakeBlockModel(state, layer);
|
this.bakeBlockModel(state, layer);
|
||||||
|
isAnyShaded |= this.vc.anyShaded;
|
||||||
if (!this.vc.isEmpty()) {//only render if there... is shit to render
|
if (!this.vc.isEmpty()) {//only render if there... is shit to render
|
||||||
|
|
||||||
//Setup for continual emission
|
//Setup for continual emission
|
||||||
@@ -266,6 +266,7 @@ public class ModelTextureBakery {
|
|||||||
this.vc.reset();
|
this.vc.reset();
|
||||||
this.bakeFluidState(state, layer, i);
|
this.bakeFluidState(state, layer, i);
|
||||||
if (this.vc.isEmpty()) continue;
|
if (this.vc.isEmpty()) continue;
|
||||||
|
isAnyShaded |= this.vc.anyShaded;
|
||||||
BudgetBufferRenderer.setup(this.vc.getAddress(), this.vc.quadCount(), blockTextureId);
|
BudgetBufferRenderer.setup(this.vc.getAddress(), this.vc.quadCount(), blockTextureId);
|
||||||
|
|
||||||
glViewport((i % 3) * this.width, (i / 3) * this.height, this.width, this.height);
|
glViewport((i % 3) * this.width, (i / 3) * this.height, this.width, this.height);
|
||||||
@@ -283,6 +284,7 @@ public class ModelTextureBakery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Render block model entity data if it exists
|
//Render block model entity data if it exists
|
||||||
|
/*
|
||||||
if (bbem != null) {
|
if (bbem != null) {
|
||||||
//Rerender everything again ;-; but is ok (is not)
|
//Rerender everything again ;-; but is ok (is not)
|
||||||
|
|
||||||
@@ -308,7 +310,7 @@ public class ModelTextureBakery {
|
|||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
|
||||||
bbem.release();
|
bbem.release();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -328,6 +330,8 @@ public class ModelTextureBakery {
|
|||||||
//reset the blend func
|
//reset the blend func
|
||||||
GL14.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
GL14.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return isAnyShaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||||||
@Mixin(value = FogRenderer.class,remap = true)
|
@Mixin(value = FogRenderer.class,remap = true)
|
||||||
public class MixinFogRenderer {
|
public class MixinFogRenderer {
|
||||||
@Inject(method = "setupFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;getDevice()Lcom/mojang/blaze3d/systems/GpuDevice;", remap = false))
|
@Inject(method = "setupFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;getDevice()Lcom/mojang/blaze3d/systems/GpuDevice;", remap = false))
|
||||||
private void voxy$modifyFog(Camera camera, int rdInt, boolean fogStuff, DeltaTracker tracker, float pTick, ClientLevel lvl, CallbackInfoReturnable<Vector4f> cir, @Local(type=FogData.class) FogData data) {
|
private void voxy$modifyFog(Camera camera, int rdInt, DeltaTracker tracker, float pTick, ClientLevel lvl, CallbackInfoReturnable<Vector4f> cir, @Local(type=FogData.class) FogData data) {
|
||||||
if (VoxyConfig.CONFIG.renderVanillaFog) {
|
if (VoxyConfig.CONFIG.renderVanillaFog) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package me.cortex.voxy.client.mixin.minecraft;
|
package me.cortex.voxy.client.mixin.minecraft;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.shaders.ShaderSource;
|
||||||
import com.mojang.blaze3d.shaders.ShaderType;
|
import com.mojang.blaze3d.shaders.ShaderType;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import me.cortex.voxy.client.VoxyClient;
|
import me.cortex.voxy.client.VoxyClient;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@@ -17,7 +18,7 @@ import java.util.function.BiFunction;
|
|||||||
public class MixinRenderSystem {
|
public class MixinRenderSystem {
|
||||||
//We need to inject before iris to initalize our systems
|
//We need to inject before iris to initalize our systems
|
||||||
@Inject(method = "initRenderer", order = 900, remap = false, at = @At("RETURN"))
|
@Inject(method = "initRenderer", order = 900, remap = false, at = @At("RETURN"))
|
||||||
private static void voxy$injectInit(long windowHandle, int debugVerbosity, boolean sync, BiFunction<ResourceLocation, ShaderType, String> shaderSourceGetter, boolean renderDebugLabels, CallbackInfo ci) {
|
private static void voxy$injectInit(long windowHandle, int debugVerbosity, boolean sync, ShaderSource source, boolean renderDebugLabels, CallbackInfo ci) {
|
||||||
VoxyClient.initVoxyClient();
|
VoxyClient.initVoxyClient();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ public class Mapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getIdForBiome(Holder<Biome> biome) {
|
public int getIdForBiome(Holder<Biome> biome) {
|
||||||
String biomeId = biome.unwrapKey().get().location().toString();
|
String biomeId = biome.unwrapKey().get().identifier().toString();
|
||||||
var entry = this.biome2biomeEntry.get(biomeId);
|
var entry = this.biome2biomeEntry.get(biomeId);
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
entry = this.registerNewBiome(biomeId);
|
entry = this.registerNewBiome(biomeId);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package me.cortex.voxy.commonImpl;
|
|||||||
import me.cortex.voxy.common.world.WorldEngine;
|
import me.cortex.voxy.common.world.WorldEngine;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.dimension.DimensionType;
|
import net.minecraft.world.level.dimension.DimensionType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -14,7 +14,7 @@ import java.security.MessageDigest;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
public class WorldIdentifier {
|
public class WorldIdentifier {
|
||||||
private static final ResourceKey<DimensionType> NULL_DIM_KEY = ResourceKey.create(Registries.DIMENSION_TYPE, ResourceLocation.parse("voxy:null_dimension_id"));
|
private static final ResourceKey<DimensionType> NULL_DIM_KEY = ResourceKey.create(Registries.DIMENSION_TYPE, Identifier.parse("voxy:null_dimension_id"));
|
||||||
|
|
||||||
public final ResourceKey<Level> key;
|
public final ResourceKey<Level> key;
|
||||||
public final long biomeSeed;
|
public final long biomeSeed;
|
||||||
@@ -53,7 +53,7 @@ public class WorldIdentifier {
|
|||||||
private static <T> boolean equal(ResourceKey<T> a, ResourceKey<T> b) {
|
private static <T> boolean equal(ResourceKey<T> a, ResourceKey<T> b) {
|
||||||
if (a == b) return true;
|
if (a == b) return true;
|
||||||
if (a == null || b == null) return false;
|
if (a == null || b == null) return false;
|
||||||
return a.registry().equals(b.registry()) && a.location().equals(b.location());
|
return a.registry().equals(b.registry()) && a.identifier().equals(b.identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Quick access utility method to get or create a world object in the current instance
|
//Quick access utility method to get or create a world object in the current instance
|
||||||
@@ -117,7 +117,7 @@ public class WorldIdentifier {
|
|||||||
|
|
||||||
private static long registryKeyHashCode(ResourceKey<?> key) {
|
private static long registryKeyHashCode(ResourceKey<?> key) {
|
||||||
var A = key.registry();
|
var A = key.registry();
|
||||||
var B = key.location();
|
var B = key.identifier();
|
||||||
int a = A==null?0:A.hashCode();
|
int a = A==null?0:A.hashCode();
|
||||||
int b = B==null?0:B.hashCode();
|
int b = B==null?0:B.hashCode();
|
||||||
return (Integer.toUnsignedLong(a)<<32)|Integer.toUnsignedLong(b);
|
return (Integer.toUnsignedLong(a)<<32)|Integer.toUnsignedLong(b);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import me.cortex.voxy.common.world.other.Mapper;
|
|||||||
import net.minecraft.core.Holder;
|
import net.minecraft.core.Holder;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.Identifier;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.biome.Biomes;
|
import net.minecraft.world.level.biome.Biomes;
|
||||||
@@ -205,7 +205,7 @@ public class DHImporter implements IDataImporter {
|
|||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
{
|
{
|
||||||
var biomeRes = ResourceLocation.parse(encEntry.substring(0, idx));
|
var biomeRes = Identifier.parse(encEntry.substring(0, idx));
|
||||||
var biome = this.biomeRegistry.get(biomeRes).orElse(this.defaultBiome);
|
var biome = this.biomeRegistry.get(biomeRes).orElse(this.defaultBiome);
|
||||||
biomeId = this.engine.getMapper().getIdForBiome(biome);
|
biomeId = this.engine.getMapper().getIdForBiome(biome);
|
||||||
}
|
}
|
||||||
@@ -219,7 +219,7 @@ public class DHImporter implements IDataImporter {
|
|||||||
if (sIdx != -1) {
|
if (sIdx != -1) {
|
||||||
bStateStr = encEntry.substring(sIdx + STATE_STRING_SEPARATOR.length());
|
bStateStr = encEntry.substring(sIdx + STATE_STRING_SEPARATOR.length());
|
||||||
}
|
}
|
||||||
var bId = ResourceLocation.parse(encEntry.substring(b, sIdx != -1 ? sIdx : encEntry.length()));
|
var bId = Identifier.parse(encEntry.substring(b, sIdx != -1 ? sIdx : encEntry.length()));
|
||||||
var maybeBlock = this.blockRegistry.get(bId);
|
var maybeBlock = this.blockRegistry.get(bId);
|
||||||
Block block = Blocks.AIR;
|
Block block = Blocks.AIR;
|
||||||
if (maybeBlock.isPresent()) {
|
if (maybeBlock.isPresent()) {
|
||||||
|
|||||||
@@ -35,10 +35,10 @@
|
|||||||
"common.voxy.mixins.json"
|
"common.voxy.mixins.json"
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"minecraft": ["1.21.9", "1.21.10"],
|
"minecraft": ["1.21.11"],
|
||||||
"fabricloader": ">=0.14.22",
|
"fabricloader": ">=0.14.22",
|
||||||
"fabric-api": ">=0.91.1",
|
"fabric-api": ">=0.91.1",
|
||||||
"sodium": "=0.7.*"
|
"sodium": "=0.8.*"
|
||||||
},
|
},
|
||||||
"accessWidener": "voxy.accesswidener"
|
"accessWidener": "voxy.accesswidener"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ accessible class com/mojang/blaze3d/opengl/GlDebug$LogEntry
|
|||||||
accessible field net/minecraft/client/multiplayer/ClientLevel levelRenderer Lnet/minecraft/client/renderer/LevelRenderer;
|
accessible field net/minecraft/client/multiplayer/ClientLevel levelRenderer Lnet/minecraft/client/renderer/LevelRenderer;
|
||||||
accessible field com/mojang/blaze3d/opengl/GlBuffer handle I
|
accessible field com/mojang/blaze3d/opengl/GlBuffer handle I
|
||||||
accessible field net/minecraft/client/color/block/BlockColors blockColors Lnet/minecraft/core/IdMapper;
|
accessible field net/minecraft/client/color/block/BlockColors blockColors Lnet/minecraft/core/IdMapper;
|
||||||
accessible field net/minecraft/client/renderer/texture/TextureAtlas mipLevel I
|
accessible field net/minecraft/client/renderer/texture/TextureAtlas maxMipLevel I
|
||||||
accessible field net/minecraft/client/gui/components/BossHealthOverlay events Ljava/util/Map;
|
accessible field net/minecraft/client/gui/components/BossHealthOverlay events Ljava/util/Map;
|
||||||
accessible field net/minecraft/client/multiplayer/MultiPlayerGameMode connection Lnet/minecraft/client/multiplayer/ClientPacketListener;
|
accessible field net/minecraft/client/multiplayer/MultiPlayerGameMode connection Lnet/minecraft/client/multiplayer/ClientPacketListener;
|
||||||
|
|
||||||
@@ -14,11 +14,6 @@ accessible field net/minecraft/world/level/chunk/PalettedContainer data Lnet/min
|
|||||||
accessible field net/minecraft/world/level/chunk/PalettedContainer$Data palette Lnet/minecraft/world/level/chunk/Palette;
|
accessible field net/minecraft/world/level/chunk/PalettedContainer$Data palette Lnet/minecraft/world/level/chunk/Palette;
|
||||||
accessible field net/minecraft/world/level/chunk/PalettedContainer$Data storage Lnet/minecraft/util/BitStorage;
|
accessible field net/minecraft/world/level/chunk/PalettedContainer$Data storage Lnet/minecraft/util/BitStorage;
|
||||||
|
|
||||||
accessible field net/minecraft/client/renderer/RenderType$CompositeRenderType state Lnet/minecraft/client/renderer/RenderType$CompositeState;
|
|
||||||
accessible field net/minecraft/client/renderer/RenderType$CompositeState textureState Lnet/minecraft/client/renderer/RenderStateShard$EmptyTextureStateShard;
|
|
||||||
accessible method net/minecraft/client/renderer/RenderStateShard$EmptyTextureStateShard cutoutTexture ()Ljava/util/Optional;
|
|
||||||
|
|
||||||
accessible method net/minecraft/client/renderer/texture/MipmapGenerator alphaBlend (IIIIZ)I
|
|
||||||
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)F
|
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)F
|
||||||
|
|
||||||
accessible method net/minecraft/client/multiplayer/ClientChunkCache$Storage getChunk (I)Lnet/minecraft/world/level/chunk/LevelChunk;
|
accessible method net/minecraft/client/multiplayer/ClientChunkCache$Storage getChunk (I)Lnet/minecraft/world/level/chunk/LevelChunk;
|
||||||
|
|||||||
Reference in New Issue
Block a user