Compare commits

..

8 Commits
1.18 ... 1.16

8 changed files with 19 additions and 31 deletions

View File

@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.4
minecraft_version=1.16.4
yarn_mappings=1.16.4+build.9
loader_version=0.14.10
# Mod Properties
mod_version=1.3+1.18
mod_version=1.3+1.16
maven_group=zone.oat.supersecretrevival
archives_base_name=super-secret-revival
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.59.1+1.18.2
fabric_version=0.42.0+1.16

View File

@ -3,16 +3,16 @@ package zone.oat.supersecretrevival;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Mod implements ClientModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("super-secret-revival");
public static final Logger LOGGER = LogManager.getLogger("super-secret-revival");
// also used for identifying the button (Don't Worry about it)
public static final Text BUTTON_TEXT = new TranslatableText("options.supersecretrevival.super_secret_settings");

View File

@ -38,23 +38,14 @@ public class RandomSoundPlayer {
SoundEvents.MUSIC_DISC_STRAD,
SoundEvents.MUSIC_DISC_WAIT,
SoundEvents.MUSIC_DISC_WARD,
SoundEvents.MUSIC_DISC_OTHERSIDE,
SoundEvents.MUSIC_DRAGON,
SoundEvents.MUSIC_END,
SoundEvents.MUSIC_GAME,
SoundEvents.MUSIC_MENU,
SoundEvents.MUSIC_NETHER_BASALT_DELTAS,
SoundEvents.MUSIC_NETHER_CRIMSON_FOREST,
SoundEvents.MUSIC_OVERWORLD_DRIPSTONE_CAVES,
SoundEvents.MUSIC_OVERWORLD_GROVE,
SoundEvents.MUSIC_OVERWORLD_JAGGED_PEAKS,
SoundEvents.MUSIC_OVERWORLD_LUSH_CAVES,
SoundEvents.MUSIC_OVERWORLD_MEADOW,
SoundEvents.MUSIC_NETHER_NETHER_WASTES,
SoundEvents.MUSIC_OVERWORLD_FROZEN_PEAKS,
SoundEvents.MUSIC_OVERWORLD_SNOWY_SLOPES,
SoundEvents.MUSIC_NETHER_SOUL_SAND_VALLEY,
SoundEvents.MUSIC_OVERWORLD_STONY_PEAKS,
SoundEvents.MUSIC_NETHER_WARPED_FOREST,
SoundEvents.MUSIC_UNDER_WATER,
@ -85,9 +76,9 @@ public class RandomSoundPlayer {
private static SoundEvent getRandomSound(Random random) {
SoundEvent event;
Registry<SoundEvent> registry = Registry.SOUND_EVENT;
int size = registry.getEntries().size();
do {
Registry<SoundEvent> registry = Registry.SOUND_EVENT;
int size = registry.size();
int rand = random.nextInt(size);
event = registry.get(rand);
} while (Arrays.asList(soundBlocklist).contains(event));

View File

@ -5,11 +5,14 @@ import net.minecraft.client.render.GameRenderer;
import net.minecraft.util.Identifier;
import zone.oat.supersecretrevival.mixin.GameRendererAccessorMixin;
import java.util.Random;
public class ShaderControls {
private static final GameRenderer renderer = MinecraftClient.getInstance().gameRenderer;
private static final Random RANDOM = new Random();
public static void setRandomShader() {
Identifier shader = GameRendererAccessorMixin.getShaderLocations()[((GameRendererAccessorMixin) renderer).getRandom().nextInt(GameRenderer.SHADER_COUNT)];
Identifier shader = GameRendererAccessorMixin.getShaderLocations()[RANDOM.nextInt(GameRenderer.SHADER_COUNT)];
Mod.LOGGER.info("Loading shader " + shader.getPath());
((GameRendererAccessorMixin) renderer).invokeLoadShader(shader);
}

View File

@ -1,6 +1,6 @@
package zone.oat.supersecretrevival.mixin;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.gui.widget.AbstractButtonWidget;
import net.minecraft.client.sound.SoundManager;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import zone.oat.supersecretrevival.Mod;
@Mixin(ClickableWidget.class)
@Mixin(AbstractButtonWidget.class)
public class CancelClickSoundMixin {
@Shadow private Text message;

View File

@ -6,13 +6,8 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
import java.util.Random;
@Mixin(GameRenderer.class)
public interface GameRendererAccessorMixin {
@Accessor
Random getRandom();
@Accessor("SHADERS_LOCATIONS")
public static Identifier[] getShaderLocations() {
throw new AssertionError();

View File

@ -1,10 +1,9 @@
package zone.oat.supersecretrevival.mixin;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.OptionsScreen;
import net.minecraft.client.gui.screen.options.OptionsScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@ -29,6 +28,6 @@ public class SecretSettingsButtonMixin extends Screen {
Mod.triggerSuperSecretSettings();
}
);
this.addDrawableChild(b);
this.addButton(b);
}
}

View File

@ -30,6 +30,6 @@
"depends": {
"fabricloader": ">=0.14.10",
"fabric": "*",
"minecraft": "~1.18"
"minecraft": ["1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4"]
}
}