Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
Jill | b47af1e7d7 | ||
Jill | fbd01e4e8b | ||
Jill | 6a52c401e5 |
|
@ -33,10 +33,6 @@ processResources {
|
|||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/supersecretrevival.accesswidener")
|
||||
}
|
||||
|
||||
def targetJavaVersion = 17
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
|
|
|
@ -6,7 +6,7 @@ minecraft_version=1.16.4
|
|||
yarn_mappings=1.16.4+build.9
|
||||
loader_version=0.14.10
|
||||
# Mod Properties
|
||||
mod_version=1.1+1.16
|
||||
mod_version=1.3+1.16
|
||||
maven_group=zone.oat.supersecretrevival
|
||||
archives_base_name=super-secret-revival
|
||||
# Dependencies
|
||||
|
|
|
@ -3,6 +3,7 @@ package zone.oat.supersecretrevival;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import zone.oat.supersecretrevival.mixin.GameRendererAccessorMixin;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -11,9 +12,9 @@ public class ShaderControls {
|
|||
private static final Random RANDOM = new Random();
|
||||
|
||||
public static void setRandomShader() {
|
||||
Identifier shader = GameRenderer.SHADERS_LOCATIONS[RANDOM.nextInt(GameRenderer.SHADER_COUNT)];
|
||||
Identifier shader = GameRendererAccessorMixin.getShaderLocations()[RANDOM.nextInt(GameRenderer.SHADER_COUNT)];
|
||||
Mod.LOGGER.info("Loading shader " + shader.getPath());
|
||||
renderer.loadShader(shader);
|
||||
((GameRendererAccessorMixin) renderer).invokeLoadShader(shader);
|
||||
}
|
||||
|
||||
public static void disableShader() {
|
||||
|
|
|
@ -16,6 +16,6 @@ public class CancelClickSoundMixin {
|
|||
|
||||
@Inject(method = "playDownSound", at = @At(value = "HEAD"), cancellable = true)
|
||||
private void injected(SoundManager soundManager, CallbackInfo ci) {
|
||||
if (this.message.equals(Mod.BUTTON_TEXT)) ci.cancel();
|
||||
if (this.message != null && this.message.equals(Mod.BUTTON_TEXT)) ci.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package zone.oat.supersecretrevival.mixin;
|
||||
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public interface GameRendererAccessorMixin {
|
||||
@Accessor("SHADERS_LOCATIONS")
|
||||
public static Identifier[] getShaderLocations() {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Invoker("loadShader")
|
||||
public void invokeLoadShader(Identifier id);
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
accessWidener v1 named
|
||||
|
||||
# Lnet/minecraft/client/render/GameRenderer;SHADERS_LOCATIONS:[Lnet/minecraft/util/Identifier;
|
||||
accessible field net/minecraft/client/render/GameRenderer SHADERS_LOCATIONS [Lnet/minecraft/util/Identifier;
|
||||
# Lnet/minecraft/client/render/GameRenderer;random:Lnet/minecraft/util/math/random/Random;
|
||||
accessible field net/minecraft/client/render/GameRenderer random Ljava/util/Random;
|
||||
# Lnet/minecraft/client/render/GameRenderer;loadShader(Lnet/minecraft/util/Identifier;)V
|
||||
accessible method net/minecraft/client/render/GameRenderer loadShader (Lnet/minecraft/util/Identifier;)V
|
|
@ -6,6 +6,7 @@
|
|||
"mixins": [],
|
||||
"client": [
|
||||
"CancelClickSoundMixin",
|
||||
"GameRendererAccessorMixin",
|
||||
"SecretSettingsButtonMixin"
|
||||
],
|
||||
"server": [],
|
||||
|
|
Loading…
Reference in a new issue