Package org.cyclops.cyclopscore.init
Class ModBase<T extends ModBase<T>>
java.lang.Object
org.cyclops.cyclopscore.helper.ModBaseCommon<T>
org.cyclops.cyclopscore.init.ModBase<T>
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IModBase
- Direct Known Subclasses:
ModBaseVersionable
public abstract class ModBase<T extends ModBase<T>>
extends org.cyclops.cyclopscore.helper.ModBaseCommon<T>
Base class for mods which adds a few convenience methods.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Unique references to values that can be registered inside a mod. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ModBase.EnumReferenceKey
<Boolean> static final ModBase.EnumReferenceKey
<Boolean> static final ModBase.EnumReferenceKey
<Boolean> static final ModBase.EnumReferenceKey
<Boolean> static final ModBase.EnumReferenceKey
<String> static final ModBase.EnumReferenceKey
<String> static final ModBase.EnumReferenceKey
<String> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mojang.brigadier.builder.LiteralArgumentBuilder
<net.minecraft.commands.CommandSourceStack> constructBaseCommand
(net.minecraft.commands.Commands.CommandSelection selection, net.minecraft.commands.CommandBuildContext context) protected CapabilityConstructorRegistry
protected abstract IClientProxy
protected abstract ICommonProxy
protected org.cyclops.cyclopscore.config.ConfigHandlerCommon
protected IMCHandler
protected org.cyclops.cyclopscore.helper.LoggerHelper
protected PacketHandler
boolean
static ModBase
Get the mod by id.net.neoforged.fml.ModContainer
org.cyclops.cyclopscore.helper.LoggerHelper
net.neoforged.bus.api.IEventBus
getModId()
getMods()
Deprecated.org.cyclops.cyclopscore.network.IPacketHandler
getProxy()
<T> T
Get the value for a generic reference key.int
hashCode()
protected void
loadModCompats
(org.cyclops.cyclopscore.modcompat.ModCompatLoader modCompatLoader) This is called only once to let the mod compatibilities register themselves.void
Log a new info message for this mod.void
Log a new message of the given level for this mod.protected void
onConfigsRegister
(ConfigHandler configHandler) Deprecated.protected void
onConfigsRegister
(org.cyclops.cyclopscore.config.ConfigHandlerCommon configHandler) Called when the configs should be registered.protected void
onRegisterCommands
(net.neoforged.neoforge.event.RegisterCommandsEvent event) protected void
onRegisterKeyMappings
(net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent event) protected void
onServerAboutToStart
(net.neoforged.neoforge.event.server.ServerAboutToStartEvent event) Register the things that are related to when the server is about to start.protected void
onServerStarted
(net.neoforged.neoforge.event.server.ServerStartedEvent event) Register the things that are related to server starting.protected void
onServerStarting
(net.neoforged.neoforge.event.server.ServerStartingEvent event) Register the things that are related to when the server is starting.protected void
onServerStopping
(net.neoforged.neoforge.event.server.ServerStoppingEvent event) Register the things that are related to server stopping, like persistent storage.<T> void
putGenericReference
(ModBase.EnumReferenceKey<T> key, T value) Save a mod value.void
registerWorldStorage
(WorldStorage worldStorage) Register a new world storage type.protected void
setup
(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent event) Called on the Forge setup lifecycle event.protected void
setupClient
(net.neoforged.fml.event.lifecycle.FMLClientSetupEvent event) Called on the Forge client setup lifecycle event.toString()
Methods inherited from class org.cyclops.cyclopscore.helper.ModBaseCommon
constructDefaultCreativeModeTab, constructDefaultCreativeModeTabConfig, constructModCompatLoader, constructRegistryManager, getCommon, getCommonMods, getDefaultCreativeTab, getDefaultCreativeTabEntries, getModCompatLoader, getRegistryManager, hasDefaultCreativeModeTab, registerDefaultCreativeTabEntry
-
Field Details
-
REFKEY_TEXTURE_PATH_GUI
-
REFKEY_TEXTURE_PATH_MODELS
-
REFKEY_TEXTURE_PATH_SKINS
-
REFKEY_RETROGEN
-
REFKEY_CRASH_ON_INVALID_RECIPE
-
REFKEY_CRASH_ON_MODCOMPAT_CRASH
-
REFKEY_INFOBOOK_REWARDS
-
-
Constructor Details
-
ModBase
-
-
Method Details
-
getModId
-
getModHelpers
-
getLoggerHelper
public org.cyclops.cyclopscore.helper.LoggerHelper getLoggerHelper() -
getProxy
-
getConfigHandler
-
getGenericReference
-
getWorldStorages
-
getKeyRegistry
-
getPacketHandler
Deprecated. -
getPacketHandlerCommon
public org.cyclops.cyclopscore.network.IPacketHandler getPacketHandlerCommon() -
getCapabilityConstructorRegistry
-
getImcHandler
-
getModName
-
getModEventBus
public net.neoforged.bus.api.IEventBus getModEventBus() -
getContainer
public net.neoforged.fml.ModContainer getContainer()- Returns:
- The mod container of this mod.
-
constructLoggerHelper
protected org.cyclops.cyclopscore.helper.LoggerHelper constructLoggerHelper() -
constructConfigHandler
protected org.cyclops.cyclopscore.config.ConfigHandlerCommon constructConfigHandler() -
constructPacketHandler
-
constructCapabilityConstructorRegistry
-
constructIMCHandler
-
constructBaseCommand
protected com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack> constructBaseCommand(net.minecraft.commands.Commands.CommandSelection selection, net.minecraft.commands.CommandBuildContext context) -
putGenericReference
Save a mod value.- Type Parameters:
T
- The value type.- Parameters:
key
- The key.value
- The value.
-
loadModCompats
protected void loadModCompats(org.cyclops.cyclopscore.modcompat.ModCompatLoader modCompatLoader) This is called only once to let the mod compatibilities register themselves. -
getReferenceValue
Get the value for a generic reference key. The default keys can be found inModBase
.- Type Parameters:
T
- The type of value.- Parameters:
key
- The key of a value.- Returns:
- The value for the given key.
-
log
Log a new info message for this mod.- Parameters:
message
- The message to show.
-
log
Log a new message of the given level for this mod.- Parameters:
level
- The level in which the message must be shown.message
- The message to show.
-
setup
protected void setup(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent event) Called on the Forge setup lifecycle event.- Parameters:
event
- The setup event.
-
setupClient
protected void setupClient(net.neoforged.fml.event.lifecycle.FMLClientSetupEvent event) Called on the Forge client setup lifecycle event.- Parameters:
event
- The setup event.
-
onRegisterKeyMappings
protected void onRegisterKeyMappings(net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent event) -
onServerStarting
protected void onServerStarting(net.neoforged.neoforge.event.server.ServerStartingEvent event) Register the things that are related to when the server is starting.- Parameters:
event
- The Forge server starting event.
-
onRegisterCommands
protected void onRegisterCommands(net.neoforged.neoforge.event.RegisterCommandsEvent event) -
onServerAboutToStart
protected void onServerAboutToStart(net.neoforged.neoforge.event.server.ServerAboutToStartEvent event) Register the things that are related to when the server is about to start.- Parameters:
event
- The Forge server about to start event.
-
onServerStarted
protected void onServerStarted(net.neoforged.neoforge.event.server.ServerStartedEvent event) Register the things that are related to server starting.- Parameters:
event
- The Forge server started event.
-
onServerStopping
protected void onServerStopping(net.neoforged.neoforge.event.server.ServerStoppingEvent event) Register the things that are related to server stopping, like persistent storage.- Parameters:
event
- The Forge server stopping event.
-
registerWorldStorage
Register a new world storage type. Make sure to call this at least before the eventServerStartedEvent
is called.- Parameters:
worldStorage
- The world storage to register.
-
constructClientProxy
-
constructCommonProxy
-
onConfigsRegister
protected void onConfigsRegister(org.cyclops.cyclopscore.config.ConfigHandlerCommon configHandler) Called when the configs should be registered. -
onConfigsRegister
Deprecated. -
toString
-
hashCode
public int hashCode() -
equals
-
get
Get the mod by id.- Parameters:
modId
- The mod id.- Returns:
- The mod instance or null.
-
getMods
-