Skip to content

Commit

Permalink
23w05a
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Jan 31, 2024
1 parent 9fc5553 commit f58a43f
Show file tree
Hide file tree
Showing 20 changed files with 150 additions and 150 deletions.
8 changes: 5 additions & 3 deletions buildscript/src/main/java/Buildscript.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

Expand Down Expand Up @@ -34,6 +35,7 @@
import io.github.coolcrabs.brachyura.util.Lazy;
import io.github.coolcrabs.brachyura.util.Util;
import net.fabricmc.mappingio.MappingReader;
import net.fabricmc.mappingio.adapter.MappingNsRenamer;
import net.fabricmc.mappingio.format.MappingFormat;
import net.fabricmc.mappingio.tree.MappingTree;
import net.fabricmc.mappingio.tree.MemoryMappingTree;
Expand All @@ -45,8 +47,8 @@
public class Buildscript extends SimpleFabricProject {
static final boolean SODIUM = true;
static final boolean CUSTOM_SODIUM = true;
static final String MC_VERSION = "23w51b";
static final String customSodiumName = "sodium-fabric-mc23w51a-0.5.5+git.d8a1fda-dirty.jar";
static final String MC_VERSION = "24w05a";
static final String customSodiumName = "sodium-fabric-0.5.7-snapshot+mc24w05a-local.jar";

private static final String[] SOURCE_SETS = new String[] {
"main",
Expand All @@ -71,7 +73,7 @@ public MappingTree createMappings() {

@Override
public FabricLoader getLoader() {
return new FabricLoader(FabricMaven.URL, FabricMaven.loader("0.15.3"));
return new FabricLoader(FabricMaven.URL, FabricMaven.loader("0.15.6"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class MixinLevelRenderer {
private Groupable groupable;

@Inject(method = "renderLevel", at = @At("HEAD"))
private void batchedentityrendering$beginLevelRender(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$beginLevelRender(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
if (renderBuffers instanceof DrawCallTrackingRenderBuffers) {
((DrawCallTrackingRenderBuffers) renderBuffers).resetDrawCounts();
}
Expand All @@ -54,21 +54,21 @@ public class MixinLevelRenderer {
}

@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = RENDER_ENTITY))
private void batchedentityrendering$preRenderEntity(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$preRenderEntity(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
if (groupable != null) {
groupable.startGroup();
}
}

@Inject(method = "renderLevel", at = @At(value = "INVOKE", target = RENDER_ENTITY, shift = At.Shift.AFTER))
private void batchedentityrendering$postRenderEntity(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$postRenderEntity(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
if (groupable != null) {
groupable.endGroup();
}
}

@Inject(method = "renderLevel", at = @At(value = "CONSTANT", args = "stringValue=translucent"), locals = LocalCapture.CAPTURE_FAILHARD)
private void batchedentityrendering$beginTranslucents(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$beginTranslucents(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
if (renderBuffers.bufferSource() instanceof FullyBufferedMultiBufferSource fullyBufferedMultiBufferSource) {
fullyBufferedMultiBufferSource.readyUp();
}
Expand All @@ -89,14 +89,14 @@ public class MixinLevelRenderer {


@Inject(method = "renderLevel", at = @At(value = "CONSTANT", args = "stringValue=translucent", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD)
private void batchedentityrendering$endTranslucents(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$endTranslucents(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
if (BlockRenderingSettings.INSTANCE.shouldSeparateEntityDraws()) {
this.renderBuffers.bufferSource().endBatch();
}
}

@Inject(method = "renderLevel", at = @At("RETURN"))
private void batchedentityrendering$endLevelRender(PoseStack poseStack, float f, long l, boolean bl, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci) {
private void batchedentityrendering$endLevelRender(float pLevelRenderer0, long pLong1, boolean pBoolean2, Camera pCamera3, GameRenderer pGameRenderer4, LightTexture pLightTexture5, Matrix4f pMatrix4f6, Matrix4f pMatrix4f7, CallbackInfo ci) {
((RenderBuffersExt) renderBuffers).endLevelRendering();
groupable = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
Expand Down Expand Up @@ -304,7 +305,7 @@ protected void init() {
);

showHideButton.setTooltip(Tooltip.create(showOrHide));
showHideButton.setTooltipDelay(10);
showHideButton.setTooltipDelay(Duration.ofSeconds(10));

this.addRenderableWidget(showHideButton);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface LevelRendererAccessor {
EntityRenderDispatcher getEntityRenderDispatcher();

@Invoker("renderSectionLayer")
void invokeRenderSectionLayer(RenderType terrainLayer, PoseStack modelView, double cameraX, double cameraY, double cameraZ, Matrix4f projectionMatrix);
void invokeRenderSectionLayer(RenderType terrainLayer, double cameraX, double cameraY, double cameraZ, Matrix4f modelView, Matrix4f projectionMatrix);

@Invoker("setupRender")
void invokeSetupRender(Camera camera, Frustum frustum, boolean hasForcedFrustum, boolean spectator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

/**
* This Mixin implements support for the ambientOcclusionLevel value. This injection point was chosen because it's
Expand Down Expand Up @@ -39,11 +41,11 @@ public abstract class MixinBlockStateBehavior {
* @author IMS
* @reason ambientOcclusionLevel support. Semantically, we're completely changing the meaning of the method.
*/
@Overwrite
@Inject(method = "getShadeBrightness", at = @At("RETURN"), cancellable = true)
@SuppressWarnings("deprecation")
public float getShadeBrightness(BlockGetter blockGetter, BlockPos blockPos) {
float originalValue = this.getBlock().getShadeBrightness(this.asState(), blockGetter, blockPos);
public void getShadeBrightness(BlockGetter pBlockBehaviour$BlockStateBase0, BlockPos pBlockPos1, CallbackInfoReturnable<Float> cir) {
float originalValue = cir.getReturnValue();
float aoLightValue = BlockRenderingSettings.INSTANCE.getAmbientOcclusionLevel();
return 1.0F - aoLightValue * (1.0F - originalValue);
cir.setReturnValue(1.0F - aoLightValue * (1.0F - originalValue));
}
}
5 changes: 2 additions & 3 deletions src/main/java/net/coderbot/iris/mixin/MixinGameRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class MixinGameRenderer {
}

@Inject(method = "renderLevel", at = @At("TAIL"))
private void iris$runColorSpace(float pGameRenderer0, long pLong1, PoseStack pPoseStack2, CallbackInfo ci) {
private void iris$runColorSpace(float pGameRenderer0, long pLong1, CallbackInfo ci) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::finalizeGameRendering);
}

Expand Down Expand Up @@ -130,7 +130,7 @@ public class MixinGameRenderer {

// TODO: getPositionColorLightmapShader

@Inject(method = "getPositionTexColorNormalShader", at = @At("HEAD"), cancellable = true)
@Inject(method = "getRendertypeCloudsShader", at = @At("HEAD"), cancellable = true)
private static void iris$overridePositionTexColorNormalShader(CallbackInfoReturnable<ShaderInstance> cir) {
if (ShadowRenderer.ACTIVE) {
override(ShaderKey.SHADOW_CLOUDS, cir);
Expand Down Expand Up @@ -169,7 +169,6 @@ public class MixinGameRenderer {

@Inject(method = {
"getRendertypeTranslucentShader",
"getRendertypeTranslucentNoCrumblingShader",
"getRendertypeTranslucentMovingBlockShader",
"getRendertypeTripwireShader"
}, at = @At("HEAD"), cancellable = true)
Expand Down
Loading

0 comments on commit f58a43f

Please sign in to comment.