-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: fix resource pack folder sometimes not opening on windows (#144)
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...ava/club/sk1er/patcher/mixins/bugfixes/GuiScreenResourcePacksMixin_FixOpenPackFolder.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,30 @@ | ||
package club.sk1er.patcher.mixins.bugfixes; | ||
|
||
import gg.essential.universal.UDesktop; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiScreenResourcePacks; | ||
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(GuiScreenResourcePacks.class) | ||
public class GuiScreenResourcePacksMixin_FixOpenPackFolder { | ||
|
||
@Inject( | ||
method = "actionPerformed", | ||
at = | ||
@At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/client/resources/ResourcePackRepository;getDirResourcepacks()Ljava/io/File;", | ||
shift = At.Shift.AFTER | ||
), | ||
cancellable = true | ||
) | ||
private void patcher$fixFolderOpening(CallbackInfo ci) { | ||
if (UDesktop.open(Minecraft.getMinecraft().getResourcePackRepository().getDirResourcepacks())) { | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
} |
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