Skip to content

Commit 05ec40e

Browse files
committed
chore: remove last of jb nullability annotations
1 parent 2c4e881 commit 05ec40e

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

src/main/java/me/machinemaker/papertweaks/adventure/TranslationRegistry.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
import java.util.ResourceBundle;
2727
import net.kyori.adventure.key.Key;
2828
import net.kyori.adventure.translation.GlobalTranslator;
29-
import org.jetbrains.annotations.NotNull;
30-
import org.jetbrains.annotations.Nullable;
29+
import org.checkerframework.checker.nullness.qual.Nullable;
3130

3231
public final class TranslationRegistry {
3332

@@ -49,7 +48,7 @@ public static void registerAll(final Locale locale, final ResourceBundle bundle)
4948
});
5049
}
5150

52-
public static @NotNull Optional<String> translate(final @NotNull String key, final @NotNull Locale locale) {
51+
public static Optional<String> translate(final String key, final Locale locale) {
5352
final Translation translation = TRANSLATIONS.get(key);
5453
if (translation == null) {
5554
return Optional.empty();
@@ -66,11 +65,11 @@ private Translation(final String key) {
6665
this.key = key;
6766
}
6867

69-
void register(final @NotNull Locale locale, final @NotNull String message) {
68+
void register(final Locale locale, final String message) {
7069
this.messages.put(locale, message);
7170
}
7271

73-
@Nullable String translate(final @NotNull Locale locale) {
72+
@Nullable String translate(final Locale locale) {
7473
String message = this.messages.get(locale);
7574
if (message == null) {
7675
message = this.messages.get(new Locale(locale.getLanguage()));

src/main/java/me/machinemaker/papertweaks/integrations/Interactions.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.util.Set;
2424
import org.bukkit.block.Block;
2525
import org.bukkit.entity.Player;
26-
import org.jetbrains.annotations.NotNull;
2726

2827
public final class Interactions {
2928

@@ -36,13 +35,13 @@ public static void registerHandler(final Handler handler) {
3635
HANDLERS.add(handler);
3736
}
3837

39-
public static boolean isAllowedInteraction(final @NotNull Player player, final @NotNull Block clickedBlock) {
38+
public static boolean isAllowedInteraction(final Player player, final Block clickedBlock) {
4039
return HANDLERS.stream().allMatch(handler -> handler.checkBlock(player, clickedBlock));
4140
}
4241

4342
@FunctionalInterface
4443
public interface Handler {
4544

46-
boolean checkBlock(@NotNull Player player, @NotNull Block clickedBlock);
45+
boolean checkBlock(Player player, Block clickedBlock);
4746
}
4847
}

src/main/java/me/machinemaker/papertweaks/integrations/griefprevention/GPInteractionHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.bukkit.ChatColor;
3131
import org.bukkit.block.Block;
3232
import org.bukkit.entity.Player;
33-
import org.jetbrains.annotations.NotNull;
3433

3534
public class GPInteractionHandler implements Interactions.Handler {
3635

@@ -39,7 +38,7 @@ public class GPInteractionHandler implements Interactions.Handler {
3938

4039
@SuppressWarnings("deprecation") // GP api uses ChatColor
4140
@Override
42-
public boolean checkBlock(final @NotNull Player player, final @NotNull Block clickedBlock) {
41+
public boolean checkBlock(final Player player, final Block clickedBlock) {
4342
final PlayerData playerData = DATA_STORE.get().getPlayerData(player.getUniqueId());
4443
final Claim claim = DATA_STORE.get().getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
4544
if (claim != null) {

src/main/java/me/machinemaker/papertweaks/menus/MergedMenus.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import net.kyori.adventure.text.Component;
2525
import net.kyori.adventure.text.ComponentLike;
2626
import net.kyori.adventure.text.TextComponent;
27-
import org.jetbrains.annotations.NotNull;
2827

2928
import static net.kyori.adventure.text.Component.text;
3029

@@ -50,7 +49,7 @@ public ComponentLike build(final S1 object1, final S2 object2) {
5049
return this.addExtras(builder, this.extra1.build(object2));
5150
}
5251

53-
public ComponentLike addExtras(final ComponentLike builder, final ComponentLike @NotNull ... components) {
52+
public ComponentLike addExtras(final ComponentLike builder, final ComponentLike ... components) {
5453
final List<Component> children = new ArrayList<>(builder.asComponent().children());
5554
final int offset = children.size() - 1;
5655
for (int i = 0; i < components.length; i++) {

src/main/java/me/machinemaker/papertweaks/modules/ModuleLifecycle.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.bukkit.event.HandlerList;
3535
import org.bukkit.inventory.Recipe;
3636
import org.bukkit.plugin.java.JavaPlugin;
37-
import org.jetbrains.annotations.NotNull;
3837

3938
public abstract class ModuleLifecycle {
4039

@@ -75,7 +74,7 @@ protected final JavaPlugin getPlugin() {
7574
return this.plugin;
7675
}
7776

78-
public @NotNull ModuleInfo moduleInfo() {
77+
public ModuleInfo moduleInfo() {
7978
return this.moduleInfo;
8079
}
8180

0 commit comments

Comments
 (0)