Skip to content

Commit

Permalink
Merge pull request #5 from BluSpring/1.20.4
Browse files Browse the repository at this point in the history
Avoid nullable registry
  • Loading branch information
HellFirePvP authored Jun 16, 2024
2 parents 350437b + a61b1ee commit b3f021c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
public class RegistryProviders {

public static final ResourceKey<Registry<ObserverProvider>> REGISTRY_KEY = ResourceKey.createRegistryKey(ObserverLib.key("observer_providers"));
private static Registry<ObserverProvider> REGISTRY;
private static final Registry<ObserverProvider> REGISTRY = new RegistryBuilder<>(REGISTRY_KEY).create();

public static void initialize(NewRegistryEvent event) {
REGISTRY = event.create(new RegistryBuilder<>(REGISTRY_KEY));
event.register(REGISTRY);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
public class RegistryStructures {

public static final ResourceKey<Registry<MatchableStructure>> REGISTRY_KEY = ResourceKey.createRegistryKey(ObserverLib.key("matchable_structures"));
private static Registry<MatchableStructure> REGISTRY;
private static final Registry<MatchableStructure> REGISTRY = new RegistryBuilder<>(REGISTRY_KEY).create();

public static void initialize(NewRegistryEvent event) {
REGISTRY = event.create(new RegistryBuilder<>(REGISTRY_KEY));
event.register(REGISTRY);
}

@Nullable
Expand Down

0 comments on commit b3f021c

Please sign in to comment.