diff --git a/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java b/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java index 8faa133..619e483 100644 --- a/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java +++ b/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java @@ -6,6 +6,7 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.Map; @@ -34,7 +35,7 @@ public final class ParticleSpawner implements Runnable { * @param blocks

The blocks to spawn particles on

*/ public ParticleSpawner(@NotNull ParticleConfig particleConfig, - @NotNull Map materialConfigs, @NotNull Collection blocks) { + @Nullable Map materialConfigs, @NotNull Collection blocks) { this.particleConfig = particleConfig; this.materialConfigs = materialConfigs; this.blocks = blocks; @@ -51,7 +52,7 @@ public final class ParticleSpawner implements Runnable { * @param blockSupplier

The supplier supplying the blocks to spawn particles on

*/ public ParticleSpawner(@NotNull ParticleConfig particleConfig, - @NotNull Map materialConfigs, + @Nullable Map materialConfigs, @NotNull Supplier> blockSupplier) { this.particleConfig = particleConfig; this.materialConfigs = materialConfigs; @@ -132,6 +133,9 @@ public final class ParticleSpawner implements Runnable { * @return

The particle config to use

*/ private @NotNull ParticleConfig getParticleConfig() { + if (this.materialConfigs == null) { + return this.particleConfig; + } ParticleConfig materialConfig = this.materialConfigs.get(processingBlock.getType()); if (materialConfig != null) { return materialConfig;