Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/java/cc/aabss/eventutils/commands/CommandRegister.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cc.aabss.eventutils.commands;

import cc.aabss.eventutils.EventType;
import cc.aabss.eventutils.skins.SkinFinderOverlay;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.IntegerArgumentType;
Expand Down Expand Up @@ -77,11 +78,27 @@ public static void register(@NotNull CommandDispatcher<FabricClientCommandSource
return 0;
}).build();

// eventutils skin <prompt>
final LiteralCommandNode<FabricClientCommandSource> skin = ClientCommandManager
.literal("skin")
.then(ClientCommandManager.argument("prompt", StringArgumentType.greedyString())
.executes(context -> {
final String prompt = StringArgumentType.getString(context, "prompt");
SkinFinderOverlay.open(prompt);
return 0;
}))
.executes(context -> {
// If no prompt provided, show help message
HelpCmd.help(context);
return 0;
}).build();

// Build command tree
dispatcher.getRoot().addChild(main);
main.addChild(config);
main.addChild(teleport);
main.addChild(priority);
main.addChild(priorityTop);
main.addChild(skin);
}
}
5 changes: 5 additions & 0 deletions src/main/java/cc/aabss/eventutils/config/EventConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public String getWebsocketHost() {
return useTestingApi ? "ws://localhost:9090" : "wss://eventalerts.gg";
}

@NotNull
public String getEventSkinsAPIHost() {
return "https://eventskins.piscies.pvtylabs.com";
}

@NotNull
public NotificationSound getNotificationSound(@NotNull EventType type) {
return notificationSounds.getOrDefault(type, NotificationSound.ALERT);
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/cc/aabss/eventutils/mixin/InGameHudMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cc.aabss.eventutils.mixin;

import cc.aabss.eventutils.skins.SkinFinderOverlay;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.hud.InGameHud;

import net.minecraft.client.render.RenderTickCounter;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;


@Mixin(InGameHud.class)
public class InGameHudMixin {
@Inject(method = "renderCrosshair", at = @At("HEAD"), cancellable = true)
private void eventutils$hideCrosshair(DrawContext drawContext, RenderTickCounter renderTickCounter, CallbackInfo ci) {
if (SkinFinderOverlay.isOpen()) ci.cancel();
}
}


Loading