-
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.
- Loading branch information
Showing
10 changed files
with
85 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/run/media/eva/External Storage/prism/instances/1.20.1/.minecraft |
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,5 @@ | ||
package pm.n2.tangerine.extension | ||
|
||
import net.fabricmc.loader.api.ModContainer | ||
|
||
class Extension(val container: ModContainer, val entrypoint: TangerineEntrypoint) |
15 changes: 15 additions & 0 deletions
15
src/main/kotlin/pm/n2/tangerine/extension/TangerineEntrypoint.kt
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,15 @@ | ||
package pm.n2.tangerine.extension | ||
|
||
import pm.n2.tangerine.commands.TangerineCommand | ||
import pm.n2.tangerine.modules.Module | ||
import pm.n2.tangerine.modules.ModuleCategory | ||
|
||
abstract class TangerineEntrypoint { | ||
abstract fun onInitialize() | ||
|
||
open fun getModules(): List<Module> = listOf() | ||
|
||
open fun getCommands(): List<TangerineCommand> = listOf() | ||
|
||
open fun getCategories(): List<ModuleCategory> = listOf() | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/pm/n2/tangerine/managers/ExtensionManager.kt
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,25 @@ | ||
package pm.n2.tangerine.managers | ||
|
||
import net.fabricmc.loader.api.FabricLoader | ||
import org.slf4j.LoggerFactory | ||
import pm.n2.tangerine.core.Manager | ||
import pm.n2.tangerine.extension.Extension | ||
import pm.n2.tangerine.extension.TangerineEntrypoint | ||
|
||
object ExtensionManager: Manager { | ||
private val logger = LoggerFactory.getLogger("Tangerine ExtensionManager") | ||
val extensions = findExtensions().toMutableList() | ||
|
||
override fun init() { | ||
logger.debug("Found ${extensions.size} extensions") | ||
|
||
extensions.forEach { | ||
it.entrypoint.onInitialize() | ||
} | ||
} | ||
|
||
fun findExtensions(): List<Extension> { | ||
val mods = FabricLoader.getInstance().getEntrypointContainers("tangerine", TangerineEntrypoint::class.java) | ||
return mods.map { Extension(it.provider, it.entrypoint) } | ||
} | ||
} |
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,9 +1,11 @@ | ||
package pm.n2.tangerine.modules | ||
|
||
enum class ModuleCategory { | ||
MOVEMENT, | ||
VISUALS, | ||
PLAYER, | ||
COMBAT, | ||
MISC | ||
class ModuleCategory(val id: String) { | ||
companion object { | ||
val MOVEMENT = ModuleCategory("movement") | ||
val VISUALS = ModuleCategory("visuals") | ||
val PLAYER = ModuleCategory("player") | ||
val COMBAT = ModuleCategory("combat") | ||
val MISC = ModuleCategory("misc") | ||
} | ||
} |
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