Add modmenu integration
This commit is contained in:
parent
bec6906b7e
commit
72456cf349
14
README.md
14
README.md
@ -1,8 +1,8 @@
|
|||||||
<img src="src/main/resources/assets/savecoords/icon.png" align="right" width="150px"/>
|
<img src="src/main/resources/assets/savecoords/icon.png" align="right" width="150px"/>
|
||||||
|
|
||||||
# Save Coordinates Fabric MC
|
# Save Coordinates Fabric Mod
|
||||||
|
|
||||||
<a href ="https://github.com/cool-mist/SaveCoordinates/releases"><img src = "https://img.shields.io/github/v/release/cool-mist/SaveCoordinates?style=flat-square" /></a>
|
<img src = "https://img.shields.io/github/v/release/cool-mist/SaveCoordinates?style=flat-square" /> <a href = "https://www.curseforge.com/minecraft/mc-mods/savecoordinates/files"><img src = "https://cf.way2muchnoise.eu/versions/savecoordinates_latest.svg"/> </a>
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
@ -14,8 +14,8 @@ Minecraft|1.16.5
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
- Press `H` for menu
|
- Press `H` for menu (This is the default keybinding to open the mod ui)
|
||||||
- Select `Save` to save the coordinate
|
- Select `SAVE` to save the coordinate
|
||||||
- Select `Ping` to ping the coordinate to other players
|
- Select `PING` to ping the coordinate to other players
|
||||||
- Select `List` to view saved coordinates
|
- Select `LIST` to view saved coordinates
|
||||||
- Select `+` to edit coordinate
|
- Select `CONF` to update default keybinding
|
||||||
@ -15,6 +15,11 @@ repositories {
|
|||||||
name = "CottonMC"
|
name = "CottonMC"
|
||||||
url = "https://server.bbkr.space/artifactory/libs-release"
|
url = "https://server.bbkr.space/artifactory/libs-release"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maven {
|
||||||
|
name = "TerraformersMC"
|
||||||
|
url = "https://maven.terraformersmc.com/releases"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@ -23,6 +28,7 @@ dependencies {
|
|||||||
|
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
|
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
modImplementation include("io.github.cottonmc:LibGui:${project.libgui_version}")
|
modImplementation include("io.github.cottonmc:LibGui:${project.libgui_version}")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
loader_version=0.11.3
|
loader_version=0.11.3
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.16.5-0.0.3
|
mod_version = 1.16.5-1.0.0
|
||||||
maven_group = me.bionicbeanie.mods.savecoords
|
maven_group = me.bionicbeanie.mods.savecoords
|
||||||
archives_base_name = save-coordinates
|
archives_base_name = save-coordinates
|
||||||
|
|
||||||
@ -19,4 +19,5 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# https://github.com/CottonMC/LibGui/wiki/Setup
|
# https://github.com/CottonMC/LibGui/wiki/Setup
|
||||||
libgui_version=3.4.0+1.16.5
|
libgui_version=3.4.0+1.16.5
|
||||||
|
|
||||||
clothconfig_version=4.11.26
|
#https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/
|
||||||
|
modmenu_version=1.16.9
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package me.bionicbeanie.mods.savecoords;
|
||||||
|
|
||||||
|
public interface IModGui{
|
||||||
|
void open();
|
||||||
|
}
|
||||||
@ -1,24 +1,17 @@
|
|||||||
package me.bionicbeanie.mods.savecoords;
|
package me.bionicbeanie.mods.savecoords;
|
||||||
|
|
||||||
import me.bionicbeanie.mods.savecoords.gui.IKeyBindConfiguration;
|
import me.bionicbeanie.mods.savecoords.gui.impl.ModDI;
|
||||||
import me.bionicbeanie.mods.savecoords.gui.impl.ModGui;
|
|
||||||
import me.bionicbeanie.mods.savecoords.impl.Factory;
|
|
||||||
import net.fabricmc.api.ClientModInitializer;
|
import net.fabricmc.api.ClientModInitializer;
|
||||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
|
|
||||||
public class SaveCoordinatesClient implements ClientModInitializer {
|
public class SaveCoordinatesClient implements ClientModInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
|
||||||
@SuppressWarnings("resource")
|
|
||||||
IFileStore fileStore = Factory.createFileStore(MinecraftClient.getInstance().runDirectory.getAbsolutePath());
|
|
||||||
IKeyBindConfiguration keyBindConfiguration = Factory.createKeyBindConfiguration(fileStore);
|
|
||||||
|
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||||
while (keyBindConfiguration.getDefaultKeyBinding().wasPressed()) {
|
while (ModDI.getKeyBindConfiguration().getDefaultKeyBinding().wasPressed()) {
|
||||||
ModGui.start(client, fileStore, keyBindConfiguration);
|
ModDI.getModGui().open();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class ConfigViewHandler extends ViewHandlerBase<ConfigData> {
|
|||||||
backButton = new WButton(new LiteralText("BACK"));
|
backButton = new WButton(new LiteralText("BACK"));
|
||||||
resetButton = new WButton(new LiteralText("RESET"));
|
resetButton = new WButton(new LiteralText("RESET"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Supplier<ConfigData> setupView(IRootPanel rootGridPanel, ConfigData state) {
|
protected Supplier<ConfigData> setupView(IRootPanel rootGridPanel, ConfigData state) {
|
||||||
|
|
||||||
|
|||||||
@ -78,8 +78,13 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
|||||||
private List<PlayerPosition> getPositions(IFileStore fileStore) {
|
private List<PlayerPosition> getPositions(IFileStore fileStore) {
|
||||||
try {
|
try {
|
||||||
List<PlayerPosition> positions = fileStore.listPositions();
|
List<PlayerPosition> positions = fileStore.listPositions();
|
||||||
Collections.sort(positions, (p1, p2) -> p2.getPositionMetadata().getLastModified()
|
Collections.sort(positions, (p1, p2) -> {
|
||||||
.compareTo(p1.getPositionMetadata().getLastModified()));
|
if(p1.getPositionMetadata() != null && p2.getPositionMetadata() != null) {
|
||||||
|
return p2.getPositionMetadata().getLastModified().compareTo(p1.getPositionMetadata().getLastModified());
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
});
|
||||||
return positions;
|
return positions;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -140,7 +145,7 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
|||||||
private WButton createDeleteButton() {
|
private WButton createDeleteButton() {
|
||||||
TexturedButton button = new TexturedButton(new LiteralText("x"));
|
TexturedButton button = new TexturedButton(new LiteralText("x"));
|
||||||
button.setTexture(ResourceUtils.CreateIdentifier("close"));
|
button.setTexture(ResourceUtils.CreateIdentifier("close"));
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,8 +153,11 @@ class ListViewHandler extends ViewHandlerBase<Void> {
|
|||||||
this.icon.setImage(ResourceUtils.CreateWorldIconIdentifier(position.getWorldDimension()));
|
this.icon.setImage(ResourceUtils.CreateWorldIconIdentifier(position.getWorldDimension()));
|
||||||
this.location.setText(new LiteralText(position.getLocationName()));
|
this.location.setText(new LiteralText(position.getLocationName()));
|
||||||
this.location.setColor(0x3939ac);
|
this.location.setColor(0x3939ac);
|
||||||
this.world.setText(new LiteralText("[" + position.getPositionMetadata().getWorldName() + "]"));
|
if(position.getPositionMetadata() != null) {
|
||||||
this.world.setColor(0xb80000);
|
this.world.setText(new LiteralText("[" + position.getPositionMetadata().getWorldName() + "]"));
|
||||||
|
this.world.setColor(0xb80000);
|
||||||
|
}
|
||||||
|
|
||||||
this.coordinates
|
this.coordinates
|
||||||
.setText(new LiteralText(position.getX() + ", " + position.getY() + ", " + position.getZ()));
|
.setText(new LiteralText(position.getX() + ", " + position.getY() + ", " + position.getZ()));
|
||||||
this.deleteButton.setOnClick(() -> onDelete.accept(position));
|
this.deleteButton.setOnClick(() -> onDelete.accept(position));
|
||||||
|
|||||||
@ -0,0 +1,73 @@
|
|||||||
|
package me.bionicbeanie.mods.savecoords.gui.impl;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||||
|
|
||||||
|
import me.bionicbeanie.mods.savecoords.IFileStore;
|
||||||
|
import me.bionicbeanie.mods.savecoords.IModGui;
|
||||||
|
import me.bionicbeanie.mods.savecoords.IPlayerLocator;
|
||||||
|
import me.bionicbeanie.mods.savecoords.gui.IKeyBindConfiguration;
|
||||||
|
import me.bionicbeanie.mods.savecoords.impl.Factory;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
|
||||||
|
//All of this works because single-threaded initialization!! Sed lyf :(
|
||||||
|
public class ModDI {
|
||||||
|
|
||||||
|
private static boolean initialized = false;
|
||||||
|
private static IFileStore fileStore;
|
||||||
|
private static IKeyBindConfiguration keyBindConfiguration;
|
||||||
|
private static GuiController guiController;
|
||||||
|
private static IPlayerLocator playerLocator;
|
||||||
|
private static IModGui modGui;
|
||||||
|
private static ConfigScreenFactory<Screen> modMenuScreenFactory;
|
||||||
|
|
||||||
|
public static IKeyBindConfiguration getKeyBindConfiguration() {
|
||||||
|
initialize();
|
||||||
|
return keyBindConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IModGui getModGui() {
|
||||||
|
initialize();
|
||||||
|
return modGui;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ConfigScreenFactory<Screen> getModMenuScreenFactory(){
|
||||||
|
if(modMenuScreenFactory == null) {
|
||||||
|
modMenuScreenFactory = (parent) -> {
|
||||||
|
ConfigViewHandler handler = new ConfigViewHandler();
|
||||||
|
|
||||||
|
handler.onSave(() -> {
|
||||||
|
new SaveConfigsOperation(keyBindConfiguration, handler::getState).run();
|
||||||
|
guiController.openScreen(parent);
|
||||||
|
});
|
||||||
|
|
||||||
|
handler.onBack(() -> guiController.openScreen(parent));
|
||||||
|
|
||||||
|
try {
|
||||||
|
return handler.createView(fileStore.readConfigData());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return modMenuScreenFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initialize() {
|
||||||
|
if(!initialized) {
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
|
|
||||||
|
MinecraftClient minecraftClient = MinecraftClient.getInstance();
|
||||||
|
fileStore = Factory.createFileStore(minecraftClient.runDirectory.getAbsolutePath());
|
||||||
|
keyBindConfiguration = Factory.createKeyBindConfiguration(fileStore);
|
||||||
|
guiController = new GuiController(minecraftClient);
|
||||||
|
playerLocator = Factory.CreatePlayerLocator(minecraftClient);
|
||||||
|
modGui = new SaveCoordinatesGui(fileStore, playerLocator, keyBindConfiguration, guiController);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package me.bionicbeanie.mods.savecoords.gui.impl;
|
|
||||||
|
|
||||||
import me.bionicbeanie.mods.savecoords.IFileStore;
|
|
||||||
import me.bionicbeanie.mods.savecoords.IPlayerLocator;
|
|
||||||
import me.bionicbeanie.mods.savecoords.gui.IGuiController;
|
|
||||||
import me.bionicbeanie.mods.savecoords.gui.IKeyBindConfiguration;
|
|
||||||
import me.bionicbeanie.mods.savecoords.impl.Factory;
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
|
||||||
|
|
||||||
public class ModGui {
|
|
||||||
|
|
||||||
public static void start(MinecraftClient client, IFileStore fileStore, IKeyBindConfiguration keyBindConfiguration) {
|
|
||||||
IGuiController controller = new GuiController(client);
|
|
||||||
IPlayerLocator locator = Factory.CreatePlayerLocator(client);
|
|
||||||
|
|
||||||
new SaveCoordinatesGui(fileStore, locator, keyBindConfiguration, controller);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -10,15 +10,14 @@ public class SaveConfigsOperation extends ViewOperationBase<ConfigData>{
|
|||||||
|
|
||||||
private IKeyBindConfiguration keyBindConfiguration;
|
private IKeyBindConfiguration keyBindConfiguration;
|
||||||
|
|
||||||
public SaveConfigsOperation(IFileStore fileStore, IKeyBindConfiguration keyBindConfiguration, Supplier<ConfigData> stateSupplier) {
|
public SaveConfigsOperation(IKeyBindConfiguration keyBindConfiguration, Supplier<ConfigData> stateSupplier) {
|
||||||
super(fileStore, stateSupplier);
|
super(null, stateSupplier);
|
||||||
|
|
||||||
this.keyBindConfiguration = keyBindConfiguration;
|
this.keyBindConfiguration = keyBindConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void executeOperation(IFileStore fileStore, ConfigData state) throws Exception {
|
protected void executeOperation(IFileStore fileStore, ConfigData state) throws Exception {
|
||||||
fileStore.writeConfigs(state);
|
|
||||||
this.keyBindConfiguration.setDefaultKeyBinding(state.getDefaultKeyBindingCode());
|
this.keyBindConfiguration.setDefaultKeyBinding(state.getDefaultKeyBindingCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package me.bionicbeanie.mods.savecoords.gui.impl;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import me.bionicbeanie.mods.savecoords.IFileStore;
|
import me.bionicbeanie.mods.savecoords.IFileStore;
|
||||||
|
import me.bionicbeanie.mods.savecoords.IModGui;
|
||||||
import me.bionicbeanie.mods.savecoords.IPlayerLocator;
|
import me.bionicbeanie.mods.savecoords.IPlayerLocator;
|
||||||
import me.bionicbeanie.mods.savecoords.gui.IGuiController;
|
import me.bionicbeanie.mods.savecoords.gui.IGuiController;
|
||||||
import me.bionicbeanie.mods.savecoords.gui.IKeyBindConfiguration;
|
import me.bionicbeanie.mods.savecoords.gui.IKeyBindConfiguration;
|
||||||
@ -10,8 +11,9 @@ import me.bionicbeanie.mods.savecoords.gui.IViewHandler;
|
|||||||
import me.bionicbeanie.mods.savecoords.model.ConfigData;
|
import me.bionicbeanie.mods.savecoords.model.ConfigData;
|
||||||
import me.bionicbeanie.mods.savecoords.model.PlayerPosition;
|
import me.bionicbeanie.mods.savecoords.model.PlayerPosition;
|
||||||
import me.bionicbeanie.mods.savecoords.model.PlayerRawPosition;
|
import me.bionicbeanie.mods.savecoords.model.PlayerRawPosition;
|
||||||
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
|
|
||||||
public class SaveCoordinatesGui {
|
public class SaveCoordinatesGui implements IModGui {
|
||||||
|
|
||||||
private IGuiController screenController;
|
private IGuiController screenController;
|
||||||
private IFileStore fileStore;
|
private IFileStore fileStore;
|
||||||
@ -32,9 +34,23 @@ public class SaveCoordinatesGui {
|
|||||||
this.listHandler = CreateListViewHandler();
|
this.listHandler = CreateListViewHandler();
|
||||||
this.configHandler = CreateConfigHandler();
|
this.configHandler = CreateConfigHandler();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void open() {
|
||||||
showDefaultView(null);
|
showDefaultView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Screen createConfigScreen() {
|
||||||
|
try {
|
||||||
|
return this.configHandler.createView(fileStore.readConfigData());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private IViewHandler<PlayerPosition> CreateDefaultViewHandler() {
|
private IViewHandler<PlayerPosition> CreateDefaultViewHandler() {
|
||||||
DefaultViewHandler handler = new DefaultViewHandler(fileStore, locator);
|
DefaultViewHandler handler = new DefaultViewHandler(fileStore, locator);
|
||||||
|
|
||||||
@ -84,7 +100,7 @@ public class SaveCoordinatesGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onSaveConfigs() {
|
private void onSaveConfigs() {
|
||||||
new SaveConfigsOperation(fileStore, keyBindConfiguration, configHandler::getState).run();
|
new SaveConfigsOperation(keyBindConfiguration, configHandler::getState).run();
|
||||||
showDefaultView(null);
|
showDefaultView(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,10 +113,7 @@ public class SaveCoordinatesGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showConfigView() {
|
private void showConfigView() {
|
||||||
try {
|
screenController.openScreen(createConfigScreen());
|
||||||
screenController.openScreen(this.configHandler.createView(fileStore.readConfigData()));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,8 @@ class FileStore implements IFileStore {
|
|||||||
public ConfigData readConfigData() throws IOException {
|
public ConfigData readConfigData() throws IOException {
|
||||||
ModData data = load();
|
ModData data = load();
|
||||||
|
|
||||||
return data.getConfigData();
|
ConfigData ret = data.getConfigData();
|
||||||
|
return ret != null ? ret : new ConfigData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,11 +10,13 @@ import net.minecraft.client.util.InputUtil;
|
|||||||
|
|
||||||
class KeyBindConfiguration implements IKeyBindConfiguration {
|
class KeyBindConfiguration implements IKeyBindConfiguration {
|
||||||
|
|
||||||
KeyBinding defaultKeyBinding;
|
private KeyBinding defaultKeyBinding;
|
||||||
|
private IFileStore fileStore;
|
||||||
|
|
||||||
KeyBindConfiguration(IFileStore fileStore) {
|
KeyBindConfiguration(IFileStore fileStore) {
|
||||||
|
this.fileStore = fileStore;
|
||||||
try {
|
try {
|
||||||
defaultKeyBinding = createDefaultKeyBinding(fileStore);
|
this.defaultKeyBinding = createDefaultKeyBinding(fileStore);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new RuntimeException();
|
throw new RuntimeException();
|
||||||
@ -28,10 +30,22 @@ class KeyBindConfiguration implements IKeyBindConfiguration {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDefaultKeyBinding(int keyCode) {
|
public void setDefaultKeyBinding(int keyCode) {
|
||||||
|
writeConfigs(keyCode);
|
||||||
defaultKeyBinding.setBoundKey(InputUtil.Type.KEYSYM.createFromCode(keyCode));
|
defaultKeyBinding.setBoundKey(InputUtil.Type.KEYSYM.createFromCode(keyCode));
|
||||||
KeyBinding.updateKeysByCode();
|
KeyBinding.updateKeysByCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void writeConfigs(int keyCode) {
|
||||||
|
try {
|
||||||
|
ConfigData data = fileStore.readConfigData();
|
||||||
|
data.setDefaultKeyBindingCode(keyCode);
|
||||||
|
|
||||||
|
fileStore.writeConfigs(data);
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private KeyBinding createDefaultKeyBinding(IFileStore fileStore) throws IOException {
|
private KeyBinding createDefaultKeyBinding(IFileStore fileStore) throws IOException {
|
||||||
|
|
||||||
ConfigData configData = fileStore.readConfigData();
|
ConfigData configData = fileStore.readConfigData();
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package me.bionicbeanie.mods.savecoords.modmenu;
|
||||||
|
|
||||||
|
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||||
|
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||||
|
|
||||||
|
import me.bionicbeanie.mods.savecoords.gui.impl.ModDI;
|
||||||
|
|
||||||
|
public class SaveCoordinatesModMenu implements ModMenuApi {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||||
|
return ModDI.getModMenuScreenFactory();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ public class ResourceUtils {
|
|||||||
public static Identifier CreateWorldIconIdentifier(String dimension) {
|
public static Identifier CreateWorldIconIdentifier(String dimension) {
|
||||||
|
|
||||||
if (dimension == null)
|
if (dimension == null)
|
||||||
return CreateIdentifier("nonExistent");
|
return CreateIdentifier("nonexistent");
|
||||||
if (dimension.contains("overworld"))
|
if (dimension.contains("overworld"))
|
||||||
return CreateIdentifier("overworld");
|
return CreateIdentifier("overworld");
|
||||||
if (dimension.contains("nether"))
|
if (dimension.contains("nether"))
|
||||||
@ -23,7 +23,7 @@ public class ResourceUtils {
|
|||||||
if (dimension.contains("end"))
|
if (dimension.contains("end"))
|
||||||
return CreateIdentifier("end");
|
return CreateIdentifier("end");
|
||||||
|
|
||||||
return CreateIdentifier("nonExistent");
|
return CreateIdentifier("nonexistent");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 208 B |
@ -1,36 +1,35 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "savecoords",
|
"id": "savecoords",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
|
"name": "Save Coordinates",
|
||||||
"name": "Save Coordinates",
|
"description": "SaveCoordinates is a client side coordinate manager mod. This helps to avoid context switching when looking for or sharing in-game coordinates",
|
||||||
"description": "Fabric mod to store the current coordinates",
|
"authors": [
|
||||||
"authors": [
|
"cool-mist"
|
||||||
"cool-mist"
|
],
|
||||||
],
|
"contact": {
|
||||||
"contact": {
|
"homepage": "https://github.com/cool-mist/SaveCoordinates",
|
||||||
"homepage": "https://mods.bionicbeanie.me/SaveCoordinates",
|
"sources": "https://github.com/cool-mist/SaveCoordinates",
|
||||||
"sources": "https://github.com/cool-mist/SaveCoordinates"
|
"issues" : "https://github.com/cool-mist/SaveCoordinates/issues"
|
||||||
},
|
},
|
||||||
|
"license": "LGPLv3",
|
||||||
"license": "CC0-1.0",
|
"icon": "assets/savecoords/icon.png",
|
||||||
"icon": "assets/savecoords/icon.png",
|
"environment": "client",
|
||||||
|
"entrypoints": {
|
||||||
"environment": "*",
|
"client": [
|
||||||
"entrypoints": {
|
"me.bionicbeanie.mods.savecoords.SaveCoordinatesClient"
|
||||||
"client": [
|
],
|
||||||
"me.bionicbeanie.mods.savecoords.SaveCoordinatesClient"
|
"modmenu": [
|
||||||
]
|
"me.bionicbeanie.mods.savecoords.modmenu.SaveCoordinatesModMenu"
|
||||||
},
|
]
|
||||||
"mixins": [
|
},
|
||||||
],
|
"mixins": [],
|
||||||
|
"depends": {
|
||||||
"depends": {
|
"fabricloader": ">=0.7.4",
|
||||||
"fabricloader": ">=0.7.4",
|
"fabric": ">=0.34.2",
|
||||||
"fabric": "*",
|
"minecraft": "1.16.5"
|
||||||
"minecraft": "1.16.x"
|
},
|
||||||
},
|
"suggests": {
|
||||||
"suggests": {
|
"another-mod": "modmenu"
|
||||||
"another-mod": "*"
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user