public abstract class CommonEntryPoint extends java.lang.Object implements CoreStateAccessor
| Modifier and Type | Field and Description |
|---|---|
protected ClientEntryPoint |
delegatedClientHandle |
protected CommonEntryPoint |
delegatedCustomHandle |
protected CommonEntryPoint |
delegatedServerHandle |
protected java.lang.Object |
extraData |
protected CommonEntryPoint |
parent |
BOOLEAN_VALUES, FABRIC, FORGE, FORGE_OR_NEOFORGE, GAME_VERSION, JAVA_17, JAVA_21, JAVA_8, JAVA_MODULES, JAVA_VERSION, JAVA_VERSION_ASM, LEGACY, MOD_LOADER, NAMED_ENV, NEOFORGE, SRG_ENV, V12, V16, V16_OR_EARLIER, V16_OR_LATER, V18, V18_OR_EARLIER, V18_OR_LATER, V19, V19_2_OR_EARLIER, V19_4_OR_LATER, V19_OR_EARLIER, V19_OR_LATER, V20, V20_4_OR_EARLIER, V20_6_OR_LATER, V20_OR_EARLIER, V20_OR_LATER, V21, V21_OR_LATER| Modifier | Constructor and Description |
|---|---|
protected |
CommonEntryPoint() |
protected |
CommonEntryPoint(boolean root) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkClientSetup() |
protected void |
checkClientSetupInner()
Runs after CoreAPI#isClient is verified
|
void |
checkDedicatedServerSetup() |
protected void |
checkDedicatedServerSetupInner()
Runs after CoreAPI#isServer is verified
|
protected abstract java.lang.String |
getModID() |
protected abstract java.lang.String |
getModName() |
protected void |
handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle)
Handles a CommonEntryPoint method on this and all known handles other than this.
|
protected void |
handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle,
boolean ignoreThis)
Handles a CommonEntryPoint method on this and all known handles.
|
protected void |
handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle,
java.util.function.Consumer<ClientEntryPoint> clientHandle)
Handles a CommonEntryPoint method on this and all known handles other than this via the commonHandle input.
|
protected void |
handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle,
java.util.function.Consumer<ClientEntryPoint> clientHandle,
boolean ignoreThis)
Handles a CommonEntryPoint method on this and all known handles via the commonHandle input.
|
protected void |
handleEither(@Nullable CommonEntryPoint delegate,
java.util.function.Consumer<CommonEntryPoint> commonHandle,
java.util.function.Consumer<ClientEntryPoint> clientHandle)
Handles either a CommonEntryPoint or ClientEntryPoint method on the input delegate, depending on whether it is
an instance of ClientEntryPoint.
|
protected void |
handleWithClient(java.util.function.Consumer<ClientEntryPoint> clientHandle)
Handles a ClientEntryPoint method on the delegatedClientHandle if it exists.
|
protected void |
handleWithClient(java.util.function.Consumer<ClientEntryPoint> clientHandle,
boolean strict)
Handles a ClientEntryPoint method on only this object if is an isntance of ClientEntryPoint and the
delegatedClientHandle if it exists.
|
protected void |
handleWithClientCustom(java.util.function.Consumer<ClientEntryPoint> clientHandle)
Handles a ClientEntryPoint method on the delegatedClientHandle if it exists
and the delegatedCustomHandle if it exists and is an instance of ClientEntryPoint.
|
protected void |
handleWithClientCustom(java.util.function.Consumer<ClientEntryPoint> clientHandle,
boolean strict)
Handles a ClientEntryPoint method on only this object, the delegatedClientHandle if it exists, and the
delegatedCustomHandle if it exists and is an instance of ClientEntryPoint.
|
protected void |
handleWithCustom(java.util.function.Consumer<CommonEntryPoint> customHandle)
Handles a CommonEntryPoint method on only this object and the delegatedCustomHandle if it exists.
|
protected void |
handleWithCustom(java.util.function.Consumer<CommonEntryPoint> customHandle,
boolean strict)
Handles a CommonEntryPoint method on only this object and the delegatedCustomHandle if it exists.
|
protected void |
handleWithServer(java.util.function.Consumer<CommonEntryPoint> serverHandle)
Handles a CommonEntryPoint method on the delegatedServerHandle if it exists.
|
protected void |
handleWithServer(java.util.function.Consumer<CommonEntryPoint> serverHandle,
boolean strict)
Handles a CommonEntryPoint method on only this object and the delegatedServerHandle if it exists.
|
protected void |
handleWithServerCustom(java.util.function.Consumer<CommonEntryPoint> serverHandle)
Handles a CommonEntryPoint method on the delegatedServerHandle if it exists
and the delegatedCustomHandle if it exists.
|
protected void |
handleWithServerCustom(java.util.function.Consumer<CommonEntryPoint> serverHandle,
boolean strict)
Handles a CommonEntryPoint method on only this object, the delegatedServerHandle if it exists, and the
delegatedCustomHandle if it exists.
|
void |
onCommonSetup() |
void |
onConstructed() |
protected void |
onDedicatedServerSetup() |
protected void |
onHandleAdded(CommonEntryPoint handle) |
void |
onInterModEnqueue() |
void |
onInterModProcess() |
void |
onLoadComplete() |
void |
onPreRegistration() |
void |
onServerAboutToStart() |
void |
onServerStarted() |
void |
onServerStarting() |
void |
onServerStopped() |
void |
onServerStopping() |
@Nullable ClientEntryPoint |
setDelegatedClientHandle()
Defines a delegate for handling client stuff specific to ClientEntryPoint
|
@Nullable CommonEntryPoint |
setDelegatedCustomHandle()
Defines a delegate for handling a custom extension of CommonEntryPoint.
|
@Nullable CommonEntryPoint |
setDelegatedServerHandle()
Defines a delegate for handling CommonEntryPoint stuff that only runs on servers
|
void |
setExtraData(java.lang.Object data)
Called via ASM or a parent delegator
|
protected boolean |
verifyNoDuplicates(@Nullable CommonEntryPoint handler)
Extra guardrail against the same handler trying to get defined more than once in an entrypoint chain.
|
protected boolean |
verifyNoDuplicatesInner(CommonEntryPoint handler)
Assumes all the parents are null or have all been checked and that the handler is not null
|
protected final ClientEntryPoint delegatedClientHandle
protected final CommonEntryPoint delegatedCustomHandle
protected final CommonEntryPoint delegatedServerHandle
protected CommonEntryPoint parent
protected java.lang.Object extraData
protected CommonEntryPoint()
protected CommonEntryPoint(boolean root)
protected final void onHandleAdded(CommonEntryPoint handle)
public final void checkClientSetup()
protected final void checkClientSetupInner()
public final void checkDedicatedServerSetup()
protected final void checkDedicatedServerSetupInner()
protected abstract java.lang.String getModID()
protected abstract java.lang.String getModName()
protected final void handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle, java.util.function.Consumer<ClientEntryPoint> clientHandle)
protected final void handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle, java.util.function.Consumer<ClientEntryPoint> clientHandle, boolean ignoreThis)
protected final void handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle)
protected final void handleAll(java.util.function.Consumer<CommonEntryPoint> commonHandle, boolean ignoreThis)
protected final void handleEither(@Nullable
@Nullable CommonEntryPoint delegate,
java.util.function.Consumer<CommonEntryPoint> commonHandle,
java.util.function.Consumer<ClientEntryPoint> clientHandle)
protected final void handleWithClient(java.util.function.Consumer<ClientEntryPoint> clientHandle)
protected final void handleWithClient(java.util.function.Consumer<ClientEntryPoint> clientHandle, boolean strict)
protected final void handleWithClientCustom(java.util.function.Consumer<ClientEntryPoint> clientHandle)
protected final void handleWithClientCustom(java.util.function.Consumer<ClientEntryPoint> clientHandle, boolean strict)
protected final void handleWithCustom(java.util.function.Consumer<CommonEntryPoint> customHandle)
protected final void handleWithCustom(java.util.function.Consumer<CommonEntryPoint> customHandle, boolean strict)
protected final void handleWithServer(java.util.function.Consumer<CommonEntryPoint> serverHandle)
protected final void handleWithServer(java.util.function.Consumer<CommonEntryPoint> serverHandle, boolean strict)
protected final void handleWithServerCustom(java.util.function.Consumer<CommonEntryPoint> serverHandle)
protected final void handleWithServerCustom(java.util.function.Consumer<CommonEntryPoint> serverHandle, boolean strict)
public void onConstructed()
public void onPreRegistration()
public void onCommonSetup()
protected void onDedicatedServerSetup()
public void onInterModEnqueue()
public void onInterModProcess()
public void onLoadComplete()
public void onServerAboutToStart()
public void onServerStarting()
public void onServerStarted()
public void onServerStopping()
public void onServerStopped()
@Nullable public @Nullable ClientEntryPoint setDelegatedClientHandle()
@Nullable public @Nullable CommonEntryPoint setDelegatedCustomHandle()
@Nullable public @Nullable CommonEntryPoint setDelegatedServerHandle()
public void setExtraData(java.lang.Object data)
protected boolean verifyNoDuplicates(@Nullable
@Nullable CommonEntryPoint handler)
protected boolean verifyNoDuplicatesInner(CommonEntryPoint handler)