Skip to content

Commit

Permalink
Fix SMP crash in ParticleConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jun 21, 2024
1 parent 6b53115 commit 9444311
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.neoforged.api.distmarker.OnlyIn;
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
import org.cyclops.cyclopscore.config.ConfigurableType;
import org.cyclops.cyclopscore.helper.MinecraftHelpers;
import org.cyclops.cyclopscore.init.ModBase;

import javax.annotation.Nullable;
Expand All @@ -31,7 +32,9 @@ public abstract class ParticleConfig<T extends ParticleOptions> extends Extended
*/
public ParticleConfig(ModBase mod, String namedId, Function<ParticleConfig<T>, ? extends ParticleType<T>> elementConstructor) {
super(mod, namedId, elementConstructor);
mod.getModEventBus().addListener(this::onParticleFactoryRegister);
if (MinecraftHelpers.isClientSide()) {
mod.getModEventBus().addListener(this::onParticleFactoryRegister);
}
}

@Override
Expand Down

0 comments on commit 9444311

Please sign in to comment.