0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Merge branch 'master' into 24w36a

This commit is contained in:
Alexander01998 2024-09-05 21:04:19 +02:00
commit 061c593067
5 changed files with 62 additions and 47 deletions

View File

@ -13,7 +13,7 @@ loader_version=0.16.4
fabric_version=0.103.2+1.21.2
# Mod Properties
mod_version = v7.45-MC24w36a
mod_version = v7.45.1-MC24w36a
maven_group = net.wurstclient
archives_base_name = Wurst-Client

View File

@ -50,7 +50,7 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;
public static final String VERSION = "7.45";
public static final String VERSION = "7.45.1";
public static final String MC_VERSION = "24w36a";
private WurstAnalytics analytics;

View File

@ -9,32 +9,35 @@ package net.wurstclient.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;
@Pseudo
@Mixin(targets = {
// current target
"me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache",
// < Sodium 0.5.0
"me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache"},
"net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache"},
remap = false)
public class SodiumBlockOcclusionCacheMixin
{
// Until Sodium updates to 1.21.2, there is no way to tell what this mixin
// needs to look like.
// /**
// * This mixin hides and shows regular full blocks when using X-Ray with
// * Sodium installed.
// */
// @Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true)
// public void shouldDrawSide(BlockState state, BlockView world, BlockPos
// pos,
// Direction side, CallbackInfoReturnable<Boolean> cir)
// {
// ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
// EventManager.fire(event);
//
// if(event.isRendered() != null)
// cir.setReturnValue(event.isRendered());
// }
/**
* This mixin hides and shows regular full blocks when using X-Ray with
* Sodium installed. Last updated for Sodium 0.6.0-beta.1+mc1.21.
*/
@Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true)
public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos,
Direction side, CallbackInfoReturnable<Boolean> cir)
{
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
EventManager.fire(event);
if(event.isRendered() != null)
cir.setReturnValue(event.isRendered());
}
}

View File

@ -9,33 +9,44 @@ package net.wurstclient.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
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;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.Fluid;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockRenderView;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;
@Pseudo
@Mixin(targets = {
// current target
"me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.FluidRenderer",
// < Sodium 0.4.9
"me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer"},
"net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.DefaultFluidRenderer"},
remap = false)
public class SodiumFluidRendererMixin
{
// Until Sodium updates to 1.21.2, there is no way to tell what this mixin
// needs to look like.
@Unique
private ThreadLocal<BlockPos.Mutable> mutablePosForExposedCheck =
ThreadLocal.withInitial(BlockPos.Mutable::new);
// /**
// * This mixin hides and shows fluids when using X-Ray with Sodium
// installed.
// */
// @Inject(at = @At("HEAD"), method = "isSideExposed", cancellable = true)
// private void isSideExposed(BlockRenderView world, int x, int y, int z,
// Direction dir, float height, CallbackInfoReturnable<Boolean> cir)
// {
// BlockPos pos = new BlockPos(x, y, z);
// BlockState state = world.getBlockState(pos);
// ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
// EventManager.fire(event);
//
// if(event.isRendered() != null)
// cir.setReturnValue(event.isRendered());
// }
/**
* This mixin hides and shows fluids when using X-Ray with Sodium installed.
* Last updated for Sodium 0.6.0-beta.1+mc1.21.
*/
@Inject(at = @At("HEAD"), method = "isFluidOccluded", cancellable = true)
private void onIsFluidOccluded(BlockRenderView world, int x, int y, int z,
Direction dir, BlockState state, Fluid fluid,
CallbackInfoReturnable<Boolean> cir)
{
BlockPos.Mutable pos = mutablePosForExposedCheck.get();
pos.set(x, y, z);
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
EventManager.fire(event);
if(event.isRendered() != null)
cir.setReturnValue(!event.isRendered());
}
}

View File

@ -36,7 +36,8 @@
"breaks": {
"wi_zoom": "*",
"wi-zoom": "*",
"vulkanmod": "*"
"vulkanmod": "*",
"sodium": "<0.6.0-beta.1"
},
"custom": {
"modmenu": {