Skip to content

Commit

Permalink
0.6.17
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Dec 25, 2024
1 parent 03a01d4 commit 8ce5872
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Sign Me Up
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=BSD-3-Clause
# The mod version. See https://semver.org/
mod_version=0.6.16
mod_version=0.6.17
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
2 changes: 1 addition & 1 deletion run/config/SignMeUp/MiniMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"coverRange": 101,
"followPlayerRotation": false,
"ssaaRatio": 1.5,
"visible": true,
"visible": false,
"refreshRate": "EVERY_FRAME"
}
6 changes: 5 additions & 1 deletion src/main/java/org/teacon/signmeup/hud/HudListener.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.teacon.signmeup.hud;

import cn.ussshenzhou.t88.config.ConfigHelper;
import cn.ussshenzhou.t88.gui.HudManager;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent;
import org.teacon.signmeup.config.MiniMap;

/**
* @author USS_Shenzhou
Expand All @@ -13,7 +15,9 @@
public class HudListener {
@SubscribeEvent
public static void onJoinWorld(ClientPlayerNetworkEvent.LoggingIn event) {
HudManager.add(new MiniMapPanel());
if (ConfigHelper.getConfigRead(MiniMap.class).visible) {
HudManager.add(new MiniMapPanel());
}
}

}
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
package org.teacon.signmeup.mixin;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.mojang.blaze3d.pipeline.RenderTarget;
import net.irisshaders.iris.pipeline.programs.SodiumShader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.teacon.signmeup.hud.InnerMiniMapPanel;

/**
* @author USS_Shenzhou
*/
@Mixin(value = SodiumShader.class, remap = false)
public class IrisSodiumShaderMixin {

@Redirect(method = "resetState", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderTarget;bindWrite(Z)V"))
private void cancelBindWhenRenderingMiniMap(RenderTarget instance, boolean setViewport) {
if (!InnerMiniMapPanel.rendering) {
instance.bindWrite(setViewport);
}
@WrapWithCondition(method = "resetState", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderTarget;bindWrite(Z)V"))
private boolean cancelBindWhenRenderingMiniMap(RenderTarget instance, boolean setViewport) {
return !InnerMiniMapPanel.rendering;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @author USS_Shenzhou
*/
@Mixin(value = VectorCachedUniform.class,remap = false)
@Mixin(value = VectorCachedUniform.class, remap = false)
public interface IrisVectorCachedUniformAccessor {
@Accessor
Object getCached();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
package org.teacon.signmeup.mixin;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.caffeinemc.mods.sodium.client.render.chunk.ChunkUpdateType;
import net.caffeinemc.mods.sodium.client.render.chunk.RenderSectionManager;
import net.caffeinemc.mods.sodium.client.render.chunk.compile.executor.ChunkJobCollector;
import org.spongepowered.asm.mixin.Mixin;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.teacon.signmeup.hud.InnerMiniMapPanel;

/**
* @author USS_Shenzhou
*/
@Mixin(value = RenderSectionManager.class, remap = false)
public abstract class SodiumRenderSectionManagerMixin {

@Shadow
protected abstract float getSearchDistance();

@Shadow protected abstract void submitSectionTasks(ChunkJobCollector collector, ChunkUpdateType type, boolean ignoreEffortCategory);

@Redirect(method = "createTerrainRenderList", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/RenderSectionManager;getSearchDistance()F"), require = 0)
private float disableDistanceLimitWhenRenderingMiniMap(RenderSectionManager instance) {
@WrapOperation(method = "createTerrainRenderList", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/RenderSectionManager;getSearchDistance()F"), require = 0)
private float disableDistanceLimitWhenRenderingMiniMap(RenderSectionManager instance, Operation<Float> original) {
if (InnerMiniMapPanel.rendering) {
return 1000;
}
return this.getSearchDistance();
return original.call(instance);
}

@Inject(method = "submitSectionTasks(Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;)V", at = @At("HEAD"), cancellable = true)
private void takeOverSectionTasksWhenRenderingMiniMap(ChunkJobCollector importantCollector, ChunkJobCollector semiImportantCollector, ChunkJobCollector deferredCollector, CallbackInfo ci) {
if (InnerMiniMapPanel.rendering) {
//this.submitSectionTasks(importantCollector, ChunkUpdateType.IMPORTANT_SORT, true);
this.submitSectionTasks(semiImportantCollector, ChunkUpdateType.IMPORTANT_REBUILD, true);
this.submitSectionTasks(deferredCollector, ChunkUpdateType.REBUILD, false);
this.submitSectionTasks(deferredCollector, ChunkUpdateType.INITIAL_BUILD, false);
//this.submitSectionTasks(deferredCollector, ChunkUpdateType.SORT, true);
ci.cancel();
@WrapWithCondition(
method = "submitSectionTasks(Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;)V",
at = @At(
value = "INVOKE",
target = "Lnet/caffeinemc/mods/sodium/client/render/chunk/RenderSectionManager;submitSectionTasks(Lnet/caffeinemc/mods/sodium/client/render/chunk/compile/executor/ChunkJobCollector;Lnet/caffeinemc/mods/sodium/client/render/chunk/ChunkUpdateType;Z)V"
)
)
private boolean takeOverSectionTasksWhenRenderingMiniMap(RenderSectionManager instance, ChunkJobCollector result, ChunkUpdateType job, boolean section) {
if (!InnerMiniMapPanel.rendering) {
return true;
}
return switch (job) {
case IMPORTANT_SORT, SORT -> false;
default -> true;
};
}
}

0 comments on commit 8ce5872

Please sign in to comment.