vanilla-fixes

Minecraft: Better than Adventure! mod that fixes some issues
git clone git://memoryshards.xyz/vanilla-fixes.git
Log | Files | Refs | README | LICENSE

commit 17fce458b9bc81343bfd20f0abb08df137aa1f54
parent b39b034dd37521b345d78bce445bc7e4f054538d
Author: Amb0s <ambos@disroot.org>
Date:   Sat,  5 Nov 2022 01:59:34 +0100

Removed useless mixins

Diffstat:
Dsrc/main/java/ambos/vanillafixes/mixin/ThreadCheckHasPaidMixin.java | 15---------------
Dsrc/main/java/ambos/vanillafixes/mixin/ThreadDownloadResourcesMixin.java | 48------------------------------------------------
Msrc/main/resources/vanillafixes.mixins.json | 4+---
3 files changed, 1 insertion(+), 66 deletions(-)

diff --git a/src/main/java/ambos/vanillafixes/mixin/ThreadCheckHasPaidMixin.java b/src/main/java/ambos/vanillafixes/mixin/ThreadCheckHasPaidMixin.java @@ -1,15 +0,0 @@ -package ambos.vanillafixes.mixin; - -import net.minecraft.src.ThreadCheckHasPaid; -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(value = ThreadCheckHasPaid.class, remap = false) -final class ThreadCheckHasPaidMixin { - @Inject(method = "run", at = @At("HEAD"), cancellable = true, require = 0) - private void onRun(CallbackInfo ci) { - ci.cancel(); - } -} diff --git a/src/main/java/ambos/vanillafixes/mixin/ThreadDownloadResourcesMixin.java b/src/main/java/ambos/vanillafixes/mixin/ThreadDownloadResourcesMixin.java @@ -1,48 +0,0 @@ -package ambos.vanillafixes.mixin; - -import net.minecraft.src.ThreadDownloadResources; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; - -@Mixin(value = ThreadDownloadResources.class, remap = false) -final class ThreadDownloadResourcesMixin { - private final static ArrayList<String> RESOURCES_DOMAINS = new ArrayList<>(Arrays.asList( - "http://mcresources.modification-station.net/MinecraftResources/", - "http://resourceproxy.pymcl.net/MinecraftResources/" - )); - - private static boolean isDown(String url) { - try { - URL urlObject = new URL(url); - HttpURLConnection httpURLConnection = (HttpURLConnection) urlObject.openConnection(); - httpURLConnection.connect(); - - int statusCode = httpURLConnection.getResponseCode(); - if (!(statusCode == 404)) { - return false; - } - } catch (Exception ignored) { - - } - - return true; - } - - private static String getResources() { - for (String url : RESOURCES_DOMAINS) { - if (!isDown(url)) { - return url; - } - } - - return null; - } - - @Shadow - public static String resourceDomain = getResources(); -} diff --git a/src/main/resources/vanillafixes.mixins.json b/src/main/resources/vanillafixes.mixins.json @@ -8,9 +8,7 @@ "client": [ "GuiGameOverMixin", "GuiMainMenuMixin", - "RenderListMixin", - "ThreadCheckHasPaidMixin", - "ThreadDownloadResourcesMixin" + "RenderListMixin" ], "injectors": { "defaultRequire": 1