mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
Seal most event hierarchies (#10515)
Most events in Forge are not designed to be extended by mod devs but technically allowed it before this PR, leading to a risk of unintentional breaking changes for those that do. If you need to extend a Forge event, please let us know so that we can explicitly support that and design it with extending in mind. Note that this change does not affect making your own events that directly extend from EventBus' `Event` class.
This commit is contained in:
1 parent
81f7f029c3
commit
504dcad849
174 files changed
+371
-371
No files matched your search
@@ -10,7 +10,7 @@ import net.minecraftforge.fml.config.IConfigEvent;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.IModBusEvent;
|
||||
|
||||
public class ModConfigEvent extends Event implements IModBusEvent, IConfigEvent {
|
||||
public sealed class ModConfigEvent extends Event implements IModBusEvent, IConfigEvent {
|
||||
private final ModConfig config;
|
||||
|
||||
ModConfigEvent(final ModConfig config) {
|
||||
@@ -26,7 +26,7 @@ public class ModConfigEvent extends Event implements IModBusEvent, IConfigEvent
|
||||
* Fired during mod and server loading, depending on {@link ModConfig.Type} of config file.
|
||||
* Any Config objects associated with this will be valid and can be queried directly.
|
||||
*/
|
||||
public static class Loading extends ModConfigEvent {
|
||||
public static final class Loading extends ModConfigEvent {
|
||||
public Loading(final ModConfig config) {
|
||||
super(config);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class ModConfigEvent extends Event implements IModBusEvent, IConfigEvent
|
||||
* and may not even be on the server or client threads. Ensure you properly synchronize
|
||||
* any resultant changes.
|
||||
*/
|
||||
public static class Reloading extends ModConfigEvent {
|
||||
public static final class Reloading extends ModConfigEvent {
|
||||
public Reloading(final ModConfig config) {
|
||||
super(config);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class ModConfigEvent extends Event implements IModBusEvent, IConfigEvent
|
||||
* server goes away, though it will fire on the dedicated server as well.
|
||||
* The config file will be saved after this event has fired.
|
||||
*/
|
||||
public static class Unloading extends ModConfigEvent {
|
||||
public static final class Unloading extends ModConfigEvent {
|
||||
public Unloading(final ModConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraftforge.fml.ModLoadingStage;
|
||||
*
|
||||
* This is a parallel dispatch event.
|
||||
*/
|
||||
public class FMLClientSetupEvent extends ParallelDispatchEvent {
|
||||
public final class FMLClientSetupEvent extends ParallelDispatchEvent {
|
||||
public FMLClientSetupEvent(ModContainer container, ModLoadingStage stage) {
|
||||
super(container, stage);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.function.Consumer;
|
||||
* @see DeferredWorkQueue to enqueue work to run on the main game thread after this event has
|
||||
* completed dispatch
|
||||
*/
|
||||
public class FMLCommonSetupEvent extends ParallelDispatchEvent
|
||||
public final class FMLCommonSetupEvent extends ParallelDispatchEvent
|
||||
{
|
||||
public FMLCommonSetupEvent(final ModContainer container, final ModLoadingStage stage)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraftforge.fml.ModLoadingStage;
|
||||
* Supplied as a param to your mod's constructor to get access
|
||||
* to the mod EventBus and various mod-specific objects.
|
||||
*/
|
||||
public class FMLConstructModEvent extends ParallelDispatchEvent {
|
||||
public final class FMLConstructModEvent extends ParallelDispatchEvent {
|
||||
public FMLConstructModEvent(final ModContainer container, final ModLoadingStage stage) {
|
||||
super(container, stage);
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.ModLoadingStage;
|
||||
*
|
||||
* This is a parallel dispatch event.
|
||||
*/
|
||||
public class FMLDedicatedServerSetupEvent extends ParallelDispatchEvent
|
||||
public final class FMLDedicatedServerSetupEvent extends ParallelDispatchEvent
|
||||
{
|
||||
public FMLDedicatedServerSetupEvent(ModContainer container, ModLoadingStage stage)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.minecraftforge.fml.ModLoadingStage;
|
||||
*
|
||||
* @author cpw
|
||||
*/
|
||||
public class FMLLoadCompleteEvent extends ParallelDispatchEvent
|
||||
public final class FMLLoadCompleteEvent extends ParallelDispatchEvent
|
||||
{
|
||||
public FMLLoadCompleteEvent(final ModContainer container, final ModLoadingStage stage)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraftforge.fml.ModLoadingStage;
|
||||
*
|
||||
* This is a parallel dispatch event.
|
||||
*/
|
||||
public class InterModEnqueueEvent extends ParallelDispatchEvent
|
||||
public final class InterModEnqueueEvent extends ParallelDispatchEvent
|
||||
{
|
||||
|
||||
public InterModEnqueueEvent(final ModContainer container, final ModLoadingStage stage)
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.function.Predicate;
|
||||
* @see #getIMCStream()
|
||||
* @see #getIMCStream(Predicate)
|
||||
*/
|
||||
public class InterModProcessEvent extends ParallelDispatchEvent
|
||||
public final class InterModProcessEvent extends ParallelDispatchEvent
|
||||
{
|
||||
public InterModProcessEvent(final ModContainer container, final ModLoadingStage stage)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user