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:
Paint_Ninja authored and GitHub committed 2025-04-19 13:18:48 +01:00
1 parent 81f7f029c3
commit 504dcad849
174 files changed
+371 -371

No files matched your search

@@ -25,7 +25,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
public class GatherDataEvent extends Event implements IModBusEvent
public final class GatherDataEvent extends Event implements IModBusEvent
{
private final DataGenerator dataGenerator;
private final DataGeneratorConfig config;
@@ -54,7 +54,7 @@ public class GatherDataEvent extends Event implements IModBusEvent
public boolean includeReports() { return this.config.reports; }
public boolean validate() { return this.config.validate; }
public static class DataGeneratorConfig {
public static final class DataGeneratorConfig {
private final Set<String> mods;
private final Path path;
private final Collection<Path> inputs;