|
49 | 49 | import org.spongepowered.api.event.EventContext; |
50 | 50 | import org.spongepowered.api.event.EventContextKey; |
51 | 51 | import org.spongepowered.api.event.EventContextKeys; |
| 52 | +import org.spongepowered.api.registry.RegistryHolder; |
52 | 53 | import org.spongepowered.api.scheduler.Task; |
53 | 54 | import org.spongepowered.api.util.Ticks; |
54 | 55 | import org.spongepowered.common.SpongeCommon; |
|
59 | 60 | import org.spongepowered.common.event.tracking.phase.plugin.PluginPhase; |
60 | 61 | import org.spongepowered.common.event.tracking.phase.tick.TickPhase; |
61 | 62 | import org.spongepowered.common.launch.Launch; |
| 63 | +import org.spongepowered.common.registry.SpongeRegistryHolder; |
62 | 64 | import org.spongepowered.common.util.Constants; |
63 | 65 | import org.spongepowered.common.util.Preconditions; |
64 | 66 | import org.spongepowered.common.util.PrettyPrinter; |
@@ -259,6 +261,7 @@ public static Block validateBlockForNeighborNotification(final ServerLevel world |
259 | 261 | private final Deque<PhaseContext<?>> phaseContextProviders = new ArrayDeque<>(); |
260 | 262 | final PhaseStack stack = new PhaseStack(); |
261 | 263 | private final SpongeCauseStackManager api = new SpongeCauseStackManager(); |
| 264 | + private @Nullable SpongeRegistryHolder startupRegistryHolder; |
262 | 265 |
|
263 | 266 | PhaseTracker() { |
264 | 267 | for (int i = 0; i < PhaseTracker.INITIAL_POOL_SIZE; i++) { |
@@ -868,6 +871,18 @@ public CauseStackManager apiAccess() { |
868 | 871 | return this.api; |
869 | 872 | } |
870 | 873 |
|
| 874 | + public void startupRegistryHolder(final RegistryHolder holder) { |
| 875 | + if (holder instanceof SpongeRegistryHolder srh) { |
| 876 | + this.startupRegistryHolder = srh; |
| 877 | + } else { |
| 878 | + this.startupRegistryHolder = null; |
| 879 | + } |
| 880 | + } |
| 881 | + |
| 882 | + public @Nullable SpongeRegistryHolder startupRegistryHolder() { |
| 883 | + return this.startupRegistryHolder; |
| 884 | + } |
| 885 | + |
871 | 886 | /** |
872 | 887 | * We insert implicit phases for plugin created frames. |
873 | 888 | */ |
|
0 commit comments