Skip to content

Commit

Permalink
Added Resource Pack lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
VipCoder8 committed Nov 3, 2024
1 parent 7073b2f commit 16a5a4f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.fyoncle.elysiumdaystweaks.mixin;

import net.minecraft.resource.ResourcePackProfile;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(ResourcePackProfile.class)
public abstract class ResourcePackLock {
@Shadow public abstract String getName();

@Inject(at = @At("RETURN"), method = "isPinned", cancellable = true)
public void isPinned(CallbackInfoReturnable<Boolean> cir) {
if(this.getName().equals("elysium-days-tweaks:elysiumdaystweaks")) {
cir.setReturnValue(true);
}
}
}
29 changes: 15 additions & 14 deletions src/main/resources/elysium-days-tweaks.mixins.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"required": true,
"package": "net.fyoncle.elysiumdaystweaks.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"CustomIconMixin",
"CustomTitleMixin",
"EscapeMenuMixin",
"MainMenuMixin",
"MenuLogo"
],
"injectors": {
"defaultRequire": 1
"required": true,
"package": "net.fyoncle.elysiumdaystweaks.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"ResourcePackLock",
"CustomIconMixin",
"CustomTitleMixin",
"EscapeMenuMixin",
"MainMenuMixin",
"MenuLogo"
],
"injectors": {
"defaultRequire": 1
}
}

0 comments on commit 16a5a4f

Please sign in to comment.