Adds missing @NotNull annotations
All checks were successful
EpicKnarvik97/KnarLib/pipeline/head This commit looks good

This commit is contained in:
2023-07-08 17:22:56 +02:00
parent 2c8182e552
commit 94d74e7794
14 changed files with 99 additions and 88 deletions

View File

@@ -70,8 +70,9 @@ public final class ParticleConfig {
* @param offsetZ <p>The z-offset/spread of the spawned particles</p>
* @param extra <p>Extra data for the particle. Usage depends on the particle type.</p>
*/
public ParticleConfig(ParticleMode particleMode, Particle particleType, int particleAmount, double particleDensity,
double heightOffset, double offsetX, double offsetY, double offsetZ, double extra) {
public ParticleConfig(@NotNull ParticleMode particleMode, @NotNull Particle particleType, int particleAmount,
double particleDensity, double heightOffset, double offsetX, double offsetY, double offsetZ,
double extra) {
this.particleMode = particleMode;
this.particleType = particleType;
this.particleAmount = particleAmount;
@@ -88,7 +89,7 @@ public final class ParticleConfig {
*
* @return <p>The particle mode</p>
*/
public ParticleMode getParticleMode() {
public @NotNull ParticleMode getParticleMode() {
return particleMode;
}
@@ -97,7 +98,7 @@ public final class ParticleConfig {
*
* @return <p>The particle type</p>
*/
public Particle getParticleType() {
public @NotNull Particle getParticleType() {
return particleType;
}

View File

@@ -69,7 +69,7 @@ public final class ParticleSpawner implements Runnable {
*
* @return <p>The id used for stored calculations</p>
*/
public UUID getStoredCalculationId() {
public @NotNull UUID getStoredCalculationId() {
return this.storedCalculationId;
}
@@ -131,7 +131,7 @@ public final class ParticleSpawner implements Runnable {
*
* @return <p>The particle config to use</p>
*/
private ParticleConfig getParticleConfig() {
private @NotNull ParticleConfig getParticleConfig() {
ParticleConfig materialConfig = this.materialConfigs.get(processingBlock.getType());
if (materialConfig != null) {
return materialConfig;

View File

@@ -85,7 +85,7 @@ public final class ParticleTrailSpawner implements Runnable {
*
* @param playerId <p>The id of the player to remove the trail for</p>
*/
public void removeTrail(UUID playerId) {
public void removeTrail(@NotNull UUID playerId) {
this.playersWithTrails.remove(playerId);
this.playerParticles.remove(playerId);
}
@@ -95,7 +95,7 @@ public final class ParticleTrailSpawner implements Runnable {
*
* @param playerId <p>The id of the player to add the trail to</p>
*/
public void startTrail(UUID playerId) {
public void startTrail(@NotNull UUID playerId) {
this.playerParticles.put(playerId, randomParticle());
this.playersWithTrails.add(playerId);
}
@@ -105,7 +105,7 @@ public final class ParticleTrailSpawner implements Runnable {
*
* @return <p>A random particle</p>
*/
private Particle randomParticle() {
private @NotNull Particle randomParticle() {
Particle spawnParticle = null;
while (spawnParticle == null || spawnParticle.getDataType() != Void.class) {
spawnParticle = randomTrailTypes.get(random.nextInt(randomTrailTypes.size()));