generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Migrant to MagicLib 0.8 - Refactored package structure Signed-off-by: Hendrix-Shen <[email protected]>
- Loading branch information
1 parent
632e6ea
commit e3c09dd
Showing
143 changed files
with
4,305 additions
and
3,359 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
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,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"versions": [ | ||
"1.14.4", | ||
"1.15.2", | ||
"1.16.5", | ||
"1.17.1", | ||
"1.18.2", | ||
"1.19.2", | ||
"1.19.3", | ||
"1.19.4", | ||
"1.20.1", | ||
"1.20.2", | ||
"1.20.4", | ||
"1.20.6" | ||
] | ||
} |
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,61 +1,73 @@ | ||
package com.plusls.MasaGadget; | ||
|
||
import com.plusls.MasaGadget.config.Configs; | ||
import com.plusls.MasaGadget.generic.entityInfo.EntityInfoRenderer; | ||
import com.plusls.MasaGadget.generic.entityTrace.EntityTraceRenderer; | ||
import com.plusls.MasaGadget.util.HitResultUtil; | ||
import com.plusls.MasaGadget.tweakeroo.inventoryPreviewSupportSelect.MouseScrollInputHandler; | ||
import com.plusls.MasaGadget.game.Configs; | ||
import com.plusls.MasaGadget.impl.feature.entityInfo.EntityInfoRenderer; | ||
import com.plusls.MasaGadget.impl.feature.entityTrace.EntityTraceRenderer; | ||
import com.plusls.MasaGadget.impl.mod_tweak.malilib.fastSwitchMasaConfigGui.FastMasaGuiSwitcher; | ||
import com.plusls.MasaGadget.impl.mod_tweak.malilib.favoritesSupport.MalilibFavoritesData; | ||
import com.plusls.MasaGadget.impl.generic.HitResultHandler; | ||
import com.plusls.MasaGadget.impl.mod_tweak.tweakeroo.inventoryPreviewSupportComparator.ComparatorInfo; | ||
import com.plusls.MasaGadget.impl.mod_tweak.tweakeroo.inventoryPreviewSupportSelect.MouseScrollInputHandler; | ||
import com.plusls.MasaGadget.util.PcaSyncProtocol; | ||
import fi.dy.masa.malilib.config.ConfigManager; | ||
import fi.dy.masa.malilib.event.InitializationHandler; | ||
import fi.dy.masa.malilib.event.InputEventHandler; | ||
import fi.dy.masa.malilib.hotkeys.IKeybindProvider; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import top.hendrixshen.magiclib.dependency.api.annotation.Dependencies; | ||
import top.hendrixshen.magiclib.dependency.api.annotation.Dependency; | ||
import top.hendrixshen.magiclib.malilib.impl.ConfigHandler; | ||
import top.hendrixshen.magiclib.malilib.impl.ConfigManager; | ||
import top.hendrixshen.magiclib.MagicLib; | ||
import top.hendrixshen.magiclib.api.dependency.annotation.Dependencies; | ||
import top.hendrixshen.magiclib.api.dependency.annotation.Dependency; | ||
import top.hendrixshen.magiclib.api.event.minecraft.MinecraftListener; | ||
|
||
public class MasaGadgetMod implements ClientModInitializer { | ||
private static final int CONFIG_VERSION = 1; | ||
|
||
@Dependencies(and = { | ||
public class MasaGadgetMod implements ClientModInitializer, MinecraftListener { | ||
@Dependencies(require = { | ||
//#if MC > 11701 | ||
@Dependency(value = "itemscoller", versionPredicate = ">=0.16.0", optional = true), | ||
@Dependency(value = "litematica", versionPredicate = ">=0.11.0", optional = true), | ||
@Dependency(value = "minihud", versionPredicate = ">=0.22.0", optional = true), | ||
@Dependency(value = "tweakeroo", versionPredicate = ">=0.13.1", optional = true) | ||
@Dependency(value = "itemscroller", versionPredicates = ">=0.16.0", optional = true), | ||
@Dependency(value = "litematica", versionPredicates = ">=0.11.0", optional = true), | ||
@Dependency(value = "minihud", versionPredicates = ">=0.22.0", optional = true), | ||
@Dependency(value = "tweakeroo", versionPredicates = ">=0.13.1", optional = true) | ||
//#elseif MC > 11605 | ||
//$$ @Dependency(value = "itemscoller", versionPredicate = ">=0.15.0-dev.20211201.010054", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicate = ">=0.9.0", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicate = ">=0.20.0", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicate = ">=0.11.0", optional = true) | ||
//$$ @Dependency(value = "itemscroller", versionPredicates = ">=0.15.0-dev.20211201.010054", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicates = ">=0.9.0", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicates = ">=0.20.0", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicates = ">=0.11.0", optional = true) | ||
//#elseif MC > 11502 | ||
//$$ @Dependency(value = "itemscoller", versionPredicate = ">=0.15.0-dev.20210917.191808", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicate = ">=0.0.0-dev.20210917.192300", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicate = ">=0.19.0-dev.20210917.191825", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicate = ">=0.10.0-dev.20210917.191839", optional = true) | ||
//$$ @Dependency(value = "itemscroller", versionPredicates = ">=0.15.0-dev.20210917.191808", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicates = ">=0.0.0-dev.20210917.192300", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicates = ">=0.19.0-dev.20210917.191825", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicates = ">=0.10.0-dev.20210917.191839", optional = true) | ||
//#elseif MC > 11404 | ||
//$$ @Dependency(value = "itemscoller", versionPredicate = ">=0.15.0-dev.20200212.183513", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicate = ">=0.0.0-dev.20200515.184506", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicate = ">=0.19.0-dev.20200427.222110", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicate = ">=0.10.0-dev.20200424.222527", optional = true) | ||
//$$ @Dependency(value = "itemscroller", versionPredicates = ">=0.15.0-dev.20200212.183513", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicates = ">=0.0.0-dev.20200515.184506", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicates = ">=0.19.0-dev.20200427.222110", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicates = ">=0.10.0-dev.20200424.222527", optional = true) | ||
//#else | ||
//$$ @Dependency(value = "itemscoller", versionPredicate = ">=0.15.0-dev.20190720.190250", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicate = ">=0.0.0-dev.20191222.014040", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicate = ">=0.19.0-dev.20191007.003640", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicate = ">=0.10.0-dev.20190903.193019", optional = true) | ||
//$$ @Dependency(value = "itemscroller", versionPredicates = ">=0.15.0-dev.20190720.190250", optional = true), | ||
//$$ @Dependency(value = "litematica", versionPredicates = ">=0.0.0-dev.20191222.014040", optional = true), | ||
//$$ @Dependency(value = "minihud", versionPredicates = ">=0.19.0-dev.20191007.003640", optional = true), | ||
//$$ @Dependency(value = "tweakeroo", versionPredicates = ">=0.10.0-dev.20190903.193019", optional = true) | ||
//#endif | ||
}) | ||
@Override | ||
public void onInitializeClient() { | ||
ConfigManager cm = ConfigManager.get(ModInfo.MOD_ID); | ||
cm.parseConfigClass(Configs.class); | ||
ModInfo.configHandler = new ConfigHandler(ModInfo.MOD_ID, cm, CONFIG_VERSION); | ||
ModInfo.configHandler.preDeserializeCallback = Configs::preDeserialize; | ||
ModInfo.configHandler.postSerializeCallback = Configs::postSerialize; | ||
ConfigHandler.register(ModInfo.configHandler); | ||
Configs.init(cm); | ||
InitializationHandler.getInstance().registerInitializationHandler(() -> | ||
ConfigManager.getInstance().registerConfigHandler(SharedConstants.getModIdentifier(), | ||
SharedConstants.getConfigHandler())); | ||
Configs.init(); | ||
InputEventHandler.getKeybindManager().registerKeybindProvider( | ||
(IKeybindProvider) SharedConstants.getConfigManager()); | ||
PcaSyncProtocol.init(); | ||
MouseScrollInputHandler.register(); | ||
EntityInfoRenderer.init(); | ||
EntityTraceRenderer.init(); | ||
HitResultUtil.init(); | ||
MouseScrollInputHandler.getInstance().init(); | ||
EntityInfoRenderer.getInstance().init(); | ||
EntityTraceRenderer.getInstance().init(); | ||
HitResultHandler.getInstance().init(); | ||
ComparatorInfo.getInstance().init(); | ||
MagicLib.getInstance().getEventManager().register(MinecraftListener.class, this); | ||
} | ||
|
||
@Override | ||
public void postInit() { | ||
FastMasaGuiSwitcher.getInstance().init(); | ||
SharedConstants.getConfigHandler().registerExternalData("malilib_favorites", MalilibFavoritesData.getInstance()); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.plusls.MasaGadget; | ||
|
||
import lombok.Getter; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.hendrixshen.magiclib.api.malilib.config.MagicConfigManager; | ||
import top.hendrixshen.magiclib.impl.malilib.config.GlobalConfigManager; | ||
import top.hendrixshen.magiclib.impl.malilib.config.MagicConfigHandler; | ||
import top.hendrixshen.magiclib.util.VersionUtil; | ||
|
||
public class SharedConstants { | ||
@Getter | ||
private static final String modIdentifier = "@MOD_IDENTIFIER@"; | ||
@Getter | ||
private static final String modName = "@MOD_NAME@"; | ||
@Getter | ||
private static final String modVersion = "@MOD_VERSION@"; | ||
@Getter | ||
private static final String modVersionType = VersionUtil.getVersionType(SharedConstants.modVersion); | ||
@Getter | ||
private static final MagicConfigManager configManager = GlobalConfigManager | ||
.getConfigManager(SharedConstants.getModIdentifier()); | ||
@Getter | ||
private static final MagicConfigHandler configHandler = new MagicConfigHandler(configManager, 1); | ||
@Getter | ||
private static final Logger logger = LogManager.getLogger(SharedConstants.modIdentifier); | ||
|
||
public static @NotNull String getTranslatedModVersionType() { | ||
return VersionUtil.translateVersionType(SharedConstants.modVersion); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/plusls/MasaGadget/api/event/DisconnectListener.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,7 @@ | ||
package com.plusls.MasaGadget.api.event; | ||
|
||
import top.hendrixshen.magiclib.api.event.Listener; | ||
|
||
public interface DisconnectListener extends Listener { | ||
void onDisconnect(); | ||
} |
Oops, something went wrong.