-
Notifications
You must be signed in to change notification settings - Fork 30
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
9 changed files
with
107 additions
and
26 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
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
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
22 changes: 22 additions & 0 deletions
22
fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinPlatformContextFabric.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,22 @@ | ||
package xaeroplus.fabric.mixin.client; | ||
|
||
import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; | ||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import xaero.common.PlatformContextFabric; | ||
|
||
@Mixin(value = PlatformContextFabric.class, remap = false) | ||
public class MixinPlatformContextFabric { | ||
@Redirect(method = "postLoadClient", at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/fabricmc/fabric/api/resource/ResourceManagerHelper;registerReloadListener(Lnet/fabricmc/fabric/api/resource/IdentifiableResourceReloadListener;)V" | ||
)) | ||
public void disableResourceListenerForDevIdkItBreaksRunClient(final ResourceManagerHelper instance, final IdentifiableResourceReloadListener identifiableResourceReloadListener) { | ||
if (!FabricLoader.getInstance().isDevelopmentEnvironment()) { | ||
instance.registerReloadListener(identifiableResourceReloadListener); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
fabric/src/main/java/xaeroplus/fabric/mixin/client/MixinWorldMapFabric.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,22 @@ | ||
package xaeroplus.fabric.mixin.client; | ||
|
||
import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; | ||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import xaero.map.WorldMapFabric; | ||
|
||
@Mixin(value = WorldMapFabric.class, remap = false) | ||
public class MixinWorldMapFabric { | ||
@Redirect(method = "loadClient", at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/fabricmc/fabric/api/resource/ResourceManagerHelper;registerReloadListener(Lnet/fabricmc/fabric/api/resource/IdentifiableResourceReloadListener;)V" | ||
)) | ||
public void disableResourceListenerForDevIdkItBreaksRunClient(final ResourceManagerHelper instance, final IdentifiableResourceReloadListener identifiableResourceReloadListener) { | ||
if (!FabricLoader.getInstance().isDevelopmentEnvironment()) { | ||
instance.registerReloadListener(identifiableResourceReloadListener); | ||
} | ||
} | ||
} |
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