mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 12:29:40 +00:00
replace MixinBlockLiquid with non-mixin implementation (#642)
* replace MixinBlockLiquid with non-mixin implementation * Update GTNHLib --------- Co-authored-by: ah-OOG-ah <[email protected]>
This commit is contained in:
1 parent
ebcee499eb
commit
e3d1fedd48
8 files changed
+32
-58
No files matched your search
@@ -131,11 +131,6 @@ public enum Mixins {
|
||||
)
|
||||
),
|
||||
|
||||
// Required for Sodium's FluidRenderer, so it treats vanilla liquids as IFluidBlocks
|
||||
SODIUM_WISHLIST(new Builder("Sodiumer").addTargetedMod(TargetedMod.VANILLA).setSide(Side.BOTH)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableSodiumFluidRendering).addMixinClasses(
|
||||
"sodium.MixinBlockLiquid")),
|
||||
|
||||
IRIS_RENDERING(new Builder("Iris Shaders").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableIris).addMixinClasses(
|
||||
"shaders.MixinEntityRenderer"
|
||||
|
||||
+8
-4
@@ -1,6 +1,7 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.tasks;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.blockpos.BlockPos;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.util.WorldUtil;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.ChunkOcclusionDataBuilder;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
|
||||
@@ -32,7 +33,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -153,7 +153,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
if (rendersOffThread(block)) {
|
||||
// Do regular block rendering
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && (!AngelicaConfig.enableSodiumFluidRendering || !(block instanceof IFluidBlock))) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
final long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
@@ -169,7 +169,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
}
|
||||
|
||||
// Do fluid rendering without RenderBlocks
|
||||
if (AngelicaConfig.enableSodiumFluidRendering && block instanceof IFluidBlock) {
|
||||
if (shouldUseSodiumFluidRendering(block)) {
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal())) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
@@ -273,7 +273,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
|
||||
// Do regular block rendering
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && (!AngelicaConfig.enableSodiumFluidRendering || !(block instanceof IFluidBlock))) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
final long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
@@ -306,4 +306,8 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
+ translucencySorting
|
||||
+ '}';
|
||||
}
|
||||
|
||||
private static boolean shouldUseSodiumFluidRendering(Block block) {
|
||||
return AngelicaConfig.enableSodiumFluidRendering && WorldUtil.isFluidBlock(block);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -96,7 +95,8 @@ public class FluidRenderer {
|
||||
int posY = pos.y;
|
||||
int posZ = pos.z;
|
||||
|
||||
Fluid fluid = ((IFluidBlock) block).getFluid();
|
||||
|
||||
Fluid fluid = WorldUtil.getFluid(block);
|
||||
if (fluid == null) return false;
|
||||
|
||||
// Check for occluded sides; if everything is occluded, don't render
|
||||
@@ -437,7 +437,7 @@ public class FluidRenderer {
|
||||
|
||||
Block block = world.getBlock(x2, y + 1, z2);
|
||||
|
||||
if (block instanceof IFluidBlock && ((IFluidBlock) block).getFluid() == fluid) {
|
||||
if (WorldUtil.getFluid(block) == fluid) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ public class FluidRenderer {
|
||||
|
||||
block = world.getBlock(pos.x, pos.y, pos.z);
|
||||
int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
|
||||
Fluid fluid2 = block instanceof IFluidBlock ? ((IFluidBlock) world.getBlock(pos.x, pos.y, pos.z)).getFluid() : null;
|
||||
Fluid fluid2 = WorldUtil.getFluid(block);
|
||||
|
||||
if (fluid2 == fluid) {
|
||||
float height = WorldUtil.getFluidHeight(fluid2, meta);
|
||||
|
||||
Reference in new issue
Block a user