From b0c72f9579ce35fd7f60ccc4ae5b8b2c3c51dad2 Mon Sep 17 00:00:00 2001 From: Dianliang233 Date: Sat, 30 Mar 2024 15:18:17 +0800 Subject: [PATCH] Rename to be more appropriate --- gradle.properties | 2 +- .../mc/rtfw/ReadTheFuckingWikiClient.java | 75 ------------------ .../read-the-fucking-wiki.client.mixins.json | 10 --- .../assets/read-the-fucking-wiki/icon.png | Bin 6490 -> 0 bytes src/main/resources/fabric.mod.json | 2 +- 5 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 src/client/java/wiki/mc/rtfw/ReadTheFuckingWikiClient.java delete mode 100644 src/client/resources/read-the-fucking-wiki.client.mixins.json delete mode 100644 src/main/resources/assets/read-the-fucking-wiki/icon.png diff --git a/gradle.properties b/gradle.properties index 2453e3c4..dfd624c1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,6 +9,6 @@ loader_version=0.15.7 # Mod Properties mod_version=1.0.0 maven_group=wiki.mc.rtfw -archives_base_name=read-the-fucking-wiki +archives_base_name=rtfw # Dependencies fabric_version=0.96.11+1.20.4 \ No newline at end of file diff --git a/src/client/java/wiki/mc/rtfw/ReadTheFuckingWikiClient.java b/src/client/java/wiki/mc/rtfw/ReadTheFuckingWikiClient.java deleted file mode 100644 index a4a62db6..00000000 --- a/src/client/java/wiki/mc/rtfw/ReadTheFuckingWikiClient.java +++ /dev/null @@ -1,75 +0,0 @@ -package wiki.mc.rtfw; - -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.MinecraftClient; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.InputUtil; -import net.minecraft.util.Util; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.hit.EntityHitResult; -import org.jetbrains.annotations.Nullable; -import org.lwjgl.glfw.GLFW; - -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; - -public class ReadTheFuckingWikiClient implements ClientModInitializer { - public static void openBrowser(String pageName) { - try { - Util.getOperatingSystem().open(new URI("https://minecraft.wiki/w/" + URLEncoder.encode(pageName.replaceAll(" ", "_"), StandardCharsets.UTF_8))); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - } - - public static @Nullable String getPageNameByRaycast() { - - var client = MinecraftClient.getInstance(); - var hit = client.crosshairTarget; - - System.out.println("Raycast"); - - switch (hit.getType()) { - case MISS: - break; - case BLOCK: - var blockHit = (BlockHitResult) hit; - var blockPos = blockHit.getBlockPos(); - var blockState = client.world.getBlockState(blockPos); - var block = blockState.getBlock(); - return block.getName().getString(); - case ENTITY: - var entityHit = (EntityHitResult) hit; - var entity = entityHit.getEntity(); - return entity.getName().getString(); - } - return null; - } - - public static void triggerByRaycast() { - var pageName = getPageNameByRaycast(); - if (pageName != null) { - openBrowser(pageName); - } - } - - @Override - public void onInitializeClient() { - var readKey = KeyBindingHelper.registerKeyBinding(new KeyBinding( - "key.rtfw.open", // The translation key of the keybinding's name - InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse. - GLFW.GLFW_KEY_SEMICOLON, // The keycode of the key - "category.rtfw.rtfw" // The translation key of the keybinding's category. - )); - - ClientTickEvents.END_CLIENT_TICK.register(client -> { - while (readKey.wasPressed()) { - triggerByRaycast(); - } - }); - } -} \ No newline at end of file diff --git a/src/client/resources/read-the-fucking-wiki.client.mixins.json b/src/client/resources/read-the-fucking-wiki.client.mixins.json deleted file mode 100644 index 09536544..00000000 --- a/src/client/resources/read-the-fucking-wiki.client.mixins.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "required": true, - "package": "wiki.mc.rtfw.mixin.client", - "compatibilityLevel": "JAVA_17", - "client": [ - ], - "injectors": { - "defaultRequire": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/assets/read-the-fucking-wiki/icon.png b/src/main/resources/assets/read-the-fucking-wiki/icon.png dele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