generated from isXander/FabricModTemplate
-
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.
EntityViewDistanceCompat + better handling of incompat options
- Loading branch information
Showing
5 changed files
with
57 additions
and
12 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
22 changes: 22 additions & 0 deletions
22
src/main/java/dev/isxander/xso/compat/EntityViewDistanceCompat.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 dev.isxander.xso.compat; | ||
|
||
import dev.isxander.yacl.api.ButtonOption; | ||
import dev.isxander.yacl.gui.controllers.ActionController; | ||
import eu.pb4.entityviewdistance.modcompat.SodiumCompat; | ||
import me.jellysquid.mods.sodium.client.gui.options.Option; | ||
|
||
public class EntityViewDistanceCompat { | ||
public static boolean isFakeOption(Option<?> sodiumOption) { | ||
return sodiumOption instanceof SodiumCompat.FakeOptionImpl; | ||
} | ||
|
||
public static ButtonOption convertFakeOption(Option<?> sodiumOption) { | ||
SodiumCompat.FakeOptionImpl fakeOption = (SodiumCompat.FakeOptionImpl) sodiumOption; | ||
return ButtonOption.createBuilder() | ||
.name(sodiumOption.getName()) | ||
.tooltip(sodiumOption.getTooltip()) | ||
.controller(ActionController::new) | ||
.action(((yaclScreen, buttonOption) -> fakeOption.setValue(SodiumCompat.Void.VOID))) | ||
.build(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/resources/assets/xanders-sodium-options/lang/en_us.json
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,4 @@ | ||
{ | ||
"xso.incompatible.button": "Incompatible", | ||
"xso.incompatible.tooltip": "This option is currently incompatible with XSO. Please make an issue to get support!" | ||
} |