forked from FlashyReese/sodium-extra-fabric
-
Notifications
You must be signed in to change notification settings - Fork 10
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
1 parent
23cb4e4
commit 6289b93
Showing
5 changed files
with
82 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
src/main/java/me/flashyreese/mods/sodiumextra/mixin/SodiumExtraMixinConfigPlugin.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
29 changes: 29 additions & 0 deletions
29
src/main/java/me/flashyreese/mods/sodiumextra/mixin/sodium/embeddium/OptionGroupMixin.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,29 @@ | ||
package me.flashyreese.mods.sodiumextra.mixin.sodium.embeddium; | ||
|
||
import org.embeddedt.embeddium.api.options.OptionIdentifier; | ||
import org.embeddedt.embeddium.api.options.structure.OptionGroup; | ||
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(value = OptionGroup.Builder.class, remap = false) | ||
public abstract class OptionGroupMixin { | ||
@Shadow | ||
private OptionIdentifier<Void> id; | ||
@Shadow | ||
public abstract OptionGroup.Builder setId(OptionIdentifier<Void> id); | ||
|
||
@Inject( | ||
method = "build", | ||
at = @At( | ||
value = "HEAD" | ||
) | ||
) | ||
public void embeddiumextra$fixShit(CallbackInfoReturnable<OptionGroup> cir) { | ||
if (this.id == null) { | ||
setId(OptionIdentifier.EMPTY); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/me/flashyreese/mods/sodiumextra/mixin/sodium/embeddium/OptionImplMixin.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,31 @@ | ||
package me.flashyreese.mods.sodiumextra.mixin.sodium.embeddium; | ||
|
||
import org.embeddedt.embeddium.api.options.OptionIdentifier; | ||
import org.embeddedt.embeddium.api.options.structure.OptionGroup; | ||
import org.embeddedt.embeddium.api.options.structure.OptionImpl; | ||
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(value = OptionImpl.Builder.class, remap = false) | ||
public abstract class OptionImplMixin<S, T> { | ||
@Shadow | ||
private OptionIdentifier<T> id; | ||
|
||
@Shadow | ||
public abstract OptionImpl.Builder<S, T> setId(OptionIdentifier<T> id); | ||
|
||
@Inject( | ||
method = "build", | ||
at = @At( | ||
value = "HEAD" | ||
) | ||
) | ||
public void embeddiumextra$fixShit(CallbackInfoReturnable<OptionGroup> cir) { | ||
if (this.id == null) { | ||
setId((OptionIdentifier<T>) OptionIdentifier.EMPTY); | ||
} | ||
} | ||
} |
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