Skip to content

Commit

Permalink
fixed registrars running even if not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 14, 2023
1 parent 7a08025 commit 6b324c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public static void onRegistration(RegistrationEvent event) {
}
INTERNAL_REGISTRAR.onRegistrationEvent(event, side);
List<IAntimatterRegistrar> list = all(IAntimatterRegistrar.class).stream()
.sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).toList();
.sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).filter(IAntimatterRegistrar::isEnabled).toList();
list.forEach(r -> r.onRegistrationEvent(event, side));
if (CALLBACKS.containsKey(event))
CALLBACKS.get(event).forEach(Runnable::run);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void onRegister(){
public static void onRegister(final String domain) {
if (domain.equals(Ref.ID)) {
AntimatterAPI.onRegistration(RegistrationEvent.DATA_INIT);
List<IAntimatterRegistrar> list = AntimatterAPI.all(IAntimatterRegistrar.class).stream().sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).toList();
List<IAntimatterRegistrar> list = AntimatterAPI.all(IAntimatterRegistrar.class).stream().sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).filter(IAntimatterRegistrar::isEnabled).toList();
MaterialEvent event = new MaterialEvent();
MaterialDataInit.onMaterialEvent(event);
list.forEach(r -> r.onMaterialEvent(event));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static void onRegister(final String domain, final RegistryEvent.Register<
ModLoadingContext.get().setActiveContainer(newContainer);
}
if (domain.equals(Ref.ID)) {
List<IAntimatterRegistrar> list = AntimatterAPI.all(IAntimatterRegistrar.class).stream().sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).toList();
List<IAntimatterRegistrar> list = AntimatterAPI.all(IAntimatterRegistrar.class).stream().sorted((c1, c2) -> Integer.compare(c2.getPriority(), c1.getPriority())).filter(IAntimatterRegistrar::isEnabled).toList();
if (e.getRegistry() == ForgeRegistries.BLOCKS) {
AntimatterAPI.onRegistration(RegistrationEvent.DATA_INIT);
AntimatterAPI.all(SoundEvent.class, t -> {
Expand Down

0 comments on commit 6b324c0

Please sign in to comment.