-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
3,088 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'fabric-loom' version '0.10-SNAPSHOT' | ||
id 'fabric-loom' version '1.0-SNAPSHOT' | ||
id 'maven-publish' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
48 changes: 48 additions & 0 deletions
48
remappedSrc/net/stone_labs/strainsofascension/ClientWarning.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package net.stone_labs.strainsofascension; | ||
|
||
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.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.option.KeyBinding; | ||
import net.minecraft.client.util.InputUtil; | ||
import net.minecraft.text.KeybindText; | ||
import net.minecraft.text.LiteralText; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class ClientWarning implements ClientModInitializer | ||
{ | ||
public static boolean hide = false; | ||
@Override | ||
public void onInitializeClient() | ||
{ | ||
// Yes, the translation key is hacky as fuck but whatever, this is only a client warning. | ||
// If you're seeing this message you are not using the mod correctly so it should be fine. | ||
// I can't be bothered to add a lang file for a screen you only see if you install the mod incorrectly. | ||
|
||
HudRenderCallback.EVENT.register((stack, delta) -> { | ||
if (hide) | ||
return; | ||
|
||
MinecraftClient.getInstance().textRenderer.draw(stack, Text.literal("§4Warning: Strains of Ascension is a dedicated server only mod."), 2, 2, 1); | ||
MinecraftClient.getInstance().textRenderer.drawWithShadow(stack, Text.literal("§fIt will not work when installed on client minecraft."), 2, 12, 1); | ||
MinecraftClient.getInstance().textRenderer.drawWithShadow(stack, Text.literal("§fThis might change in the future. For updates and questions"), 2, 27, 1); | ||
MinecraftClient.getInstance().textRenderer.drawWithShadow(stack, Text.literal("§frefer to https://github.com/StoneLabs/strains-of-ascension."), 2, 37, 1); | ||
MinecraftClient.getInstance().textRenderer.drawWithShadow(stack, Text.literal("§fPress ").append(new KeybindText("Hide client warning")).append(Text.literal(" §fto hide this warning.")), 2, 50, 1); | ||
|
||
}); | ||
var keyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding( | ||
"Hide client warning", | ||
InputUtil.Type.KEYSYM, | ||
GLFW.GLFW_KEY_K, | ||
"Strains of Ascension" | ||
)); | ||
|
||
ClientTickEvents.END_CLIENT_TICK.register(client -> { | ||
while (keyBinding.wasPressed()) { | ||
hide = !hide; | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.