mirror of
https://github.com/JonasunderscoreJones/NotEnoughCursedness.git
synced 2025-10-22 20:19:19 +02:00
added splashscreen easter-egg
This commit is contained in:
parent
cf620acfb7
commit
3962ff157f
6 changed files with 73 additions and 3 deletions
|
@ -0,0 +1,15 @@
|
|||
package me.jonasjones.nec;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import static me.jonasjones.nec.NotEnoughCursedness.MOD_ID;
|
||||
|
||||
public class NotEnoughCursednessClient implements ClientModInitializer {
|
||||
public static final Identifier NEW_LOGO = Identifier.of(MOD_ID, "textures/gui/mojangstudios.png");
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
// This code runs on the client side. In a real mod, you might do things like loading
|
||||
// mod settings, registering key bindings, or registering custom model loaders here.
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package me.jonasjones.nec.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import com.llamalad7.mixinextras.sugar.ref.LocalRef;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.SplashOverlay;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.resource.ResourceReload;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
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.CallbackInfo;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static com.mojang.text2speech.Narrator.LOGGER;
|
||||
import static me.jonasjones.nec.NotEnoughCursedness.MOD_ID;
|
||||
import static me.jonasjones.nec.NotEnoughCursednessClient.NEW_LOGO;
|
||||
|
||||
@Mixin(value = SplashOverlay.class)
|
||||
public class SplashScreenMixin {
|
||||
@Inject(method = "render", at = @At("TAIL"))
|
||||
private void injectRender(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
|
||||
context.drawTextWithShadow(textRenderer, Text.translatable("text.nec.splashscreen"), mouseX, mouseY, 0xFFFFFF);
|
||||
}
|
||||
}
|
11
src/client/resources/nec.client.mixins.json
Normal file
11
src/client/resources/nec.client.mixins.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"required": true,
|
||||
"package": "me.jonasjones.nec.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"client": [
|
||||
"SplashScreenMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
|
@ -33,5 +33,7 @@
|
|||
"item.nec.letter": "Brief",
|
||||
"item.nec.negative_flint": "Negativer Feuerstein",
|
||||
"item.nec.steel": "Zeug",
|
||||
"itemGroup.nec.not_enough_cursedness": "Nicht Genug Verfluchtheit"
|
||||
"itemGroup.nec.not_enough_cursedness": "Nicht Genug Verfluchtheit",
|
||||
|
||||
"text.nec.splashscreen": "Not Enough Cursedness"
|
||||
}
|
|
@ -33,5 +33,7 @@
|
|||
"item.nec.letter": "Letter",
|
||||
"item.nec.negative_flint": "Negative Flint",
|
||||
"item.nec.steel": "Steel",
|
||||
"itemGroup.nec.not_enough_cursedness": "Not Enough Cursedness"
|
||||
"itemGroup.nec.not_enough_cursedness": "Not Enough Cursedness",
|
||||
|
||||
"text.nec.splashscreen": "Not Enough Cursedness"
|
||||
}
|
|
@ -27,7 +27,11 @@
|
|||
]
|
||||
},
|
||||
"mixins": [
|
||||
"nec.mixins.json"
|
||||
"nec.mixins.json",
|
||||
{
|
||||
"config": "nec.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
|
||||
"depends": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue