generated from Turnip-Labs/bta-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update to BTA 7.1-pre1a * Fix shifted button offsets
- Loading branch information
Showing
11 changed files
with
86 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
org.gradle.jvmargs=-Xmx2G | ||
|
||
# BTA | ||
bta_version=1.7.7.0_02 | ||
bta_version=7.1-pre1a | ||
|
||
# Loader | ||
loader_version=0.14.19-babric.1-bta | ||
|
||
# HalpLibe | ||
# halplibe_version=2.3.0 | ||
halplibe_version=3.2.1 | ||
|
||
# Mod | ||
mod_version=1.1.0 | ||
mod_version=1.1.1 | ||
mod_group=rootenginear | ||
mod_name=sortchest |
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
67 changes: 40 additions & 27 deletions
67
src/main/java/rootenginear/sortchest/gui/GuiModMenuOptionsPage.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 |
---|---|---|
@@ -1,33 +1,46 @@ | ||
package rootenginear.sortchest.gui; | ||
|
||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.client.gui.options.GuiOptionsPageControls; | ||
import net.minecraft.client.option.GameSettings; | ||
import net.minecraft.client.gui.options.GuiOptions; | ||
import net.minecraft.client.gui.options.components.KeyBindingComponent; | ||
import net.minecraft.client.gui.options.data.OptionsPage; | ||
import net.minecraft.client.gui.options.data.OptionsPages; | ||
import rootenginear.sortchest.interfaces.ISortChestSettings; | ||
import rootenginear.sortchest.mixin.accessor.GuiOptionsPageControlsAccessor; | ||
import rootenginear.sortchest.mixin.accessor.GuiOptionsPageOptionBaseAccessor; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class GuiModMenuOptionsPage extends GuiOptionsPageControls { | ||
public GuiModMenuOptionsPage(GuiScreen parent, GameSettings settings) { | ||
super(parent, settings); | ||
|
||
GuiOptionsPageOptionBaseAccessor opobThis = (GuiOptionsPageOptionBaseAccessor) this; | ||
opobThis.setCategoryKeys(new ArrayList<>()); | ||
opobThis.setOptions(new ArrayList<>()); | ||
opobThis.setButtons(new ArrayList<>()); | ||
|
||
GuiOptionsPageControlsAccessor opcThis = (GuiOptionsPageControlsAccessor) this; | ||
opcThis.setKeyBindings(new ArrayList<>()); | ||
|
||
ISortChestSettings iSortChestSettings = (ISortChestSettings) settings; | ||
this.addKeyBindingsCategory( | ||
"options.category.sortchest", | ||
iSortChestSettings.bta_rootenginear_mods$getKeySort(), | ||
iSortChestSettings.bta_rootenginear_mods$getKeyRefill(), | ||
iSortChestSettings.bta_rootenginear_mods$getKeyFill(), | ||
iSortChestSettings.bta_rootenginear_mods$getKeyDump() | ||
); | ||
import turniplabs.halplibe.helper.ModVersionHelper; | ||
import turniplabs.halplibe.util.ClientStartEntrypoint; | ||
|
||
import static rootenginear.sortchest.SortChest.LOGGER; | ||
|
||
|
||
public class GuiModMenuOptionsPage implements ClientStartEntrypoint { | ||
public static ISortChestSettings modSettings; | ||
public static OptionsPage sortOptions; | ||
|
||
public static GuiOptions getOptionsScreen(GuiScreen parent){ | ||
return new GuiOptions(parent, Minecraft.getMinecraft(Minecraft.class).gameSettings, sortOptions); | ||
} | ||
|
||
@Override | ||
public void beforeClientStart() { | ||
|
||
} | ||
|
||
@Override | ||
public void afterClientStart() { | ||
modSettings = (ISortChestSettings) Minecraft.getMinecraft(Minecraft.class).gameSettings; | ||
sortOptions = new OptionsPage("options.category.sortchest") | ||
.withComponent(new KeyBindingComponent(modSettings.bta_rootenginear_mods$getKeyDump())) | ||
.withComponent(new KeyBindingComponent(modSettings.bta_rootenginear_mods$getKeyFill())) | ||
.withComponent(new KeyBindingComponent(modSettings.bta_rootenginear_mods$getKeyRefill())) | ||
.withComponent(new KeyBindingComponent(modSettings.bta_rootenginear_mods$getKeySort())); | ||
|
||
|
||
if(ModVersionHelper.isModPresent("modmenu")){ | ||
OptionsPages.register(sortOptions); | ||
} | ||
//OptionsPages.CONTROLS.withComponent(keybindCategory); | ||
|
||
} | ||
} |
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
14 changes: 0 additions & 14 deletions
14
src/main/java/rootenginear/sortchest/mixin/accessor/GuiOptionsPageControlsAccessor.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/rootenginear/sortchest/mixin/accessor/GuiOptionsPageOptionBaseAccessor.java
This file was deleted.
Oops, something went wrong.
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