1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

[CI skip] Added a few more annotations

This commit is contained in:
TheBusyBiscuit 2020-09-19 11:51:02 +02:00
parent 8fee7ad07d
commit 749bb972a3
4 changed files with 14 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AGenerator;
public interface EnergyNetProvider extends EnergyNetComponent {
@Override
@Nonnull
default EnergyNetComponentType getEnergyComponentType() {
return EnergyNetComponentType.GENERATOR;
}

View File

@ -2,6 +2,8 @@ package io.github.thebusybiscuit.slimefun4.core.attributes;
import java.util.Collection;
import javax.annotation.Nonnull;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -18,9 +20,11 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
*/
public interface Placeable {
@Nonnull
Collection<ItemStack> getDrops();
Collection<ItemStack> getDrops(Player p);
@Nonnull
Collection<ItemStack> getDrops(@Nonnull Player p);
/**
* This method determines how to treat this {@link Block} when it is broken.

View File

@ -1,5 +1,8 @@
package io.github.thebusybiscuit.slimefun4.core.attributes;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
@ -29,6 +32,7 @@ public interface ProtectiveArmor extends ItemAttribute {
*
* @return The {@link ProtectionType}s.
*/
@Nonnull
ProtectionType[] getProtectionTypes();
/**
@ -44,5 +48,6 @@ public interface ProtectiveArmor extends ItemAttribute {
*
* @return The set {@link NamespacedKey}, <code>null</code> if none is found.
*/
@Nullable
NamespacedKey getArmorSetId();
}

View File

@ -31,6 +31,7 @@ public final class FireworkUtils {
createFirework(l, color);
}
@Nonnull
public static Firework createFirework(@Nonnull Location l, @Nonnull Color color) {
Firework fw = (Firework) l.getWorld().spawnEntity(l, EntityType.FIREWORK);
FireworkMeta meta = fw.getFireworkMeta();
@ -56,10 +57,12 @@ public final class FireworkUtils {
}
}
@Nonnull
public static FireworkEffect getRandomEffect(@Nonnull Random random, @Nonnull Color color) {
return FireworkEffect.builder().flicker(random.nextBoolean()).withColor(color).with(random.nextBoolean() ? Type.BALL : Type.BALL_LARGE).trail(random.nextBoolean()).build();
}
@Nonnull
private static Color getRandomColor() {
return COLORS[ThreadLocalRandom.current().nextInt(COLORS.length)];
}