Skip to content

Commit c2d50a4

Browse files
authored
Switched to JSpecify for annotations (#12)
2 parents 5ff67cf + 723a0ad commit c2d50a4

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@
3636
<scope>provided</scope>
3737
</dependency>
3838
<dependency>
39-
<groupId>org.jetbrains</groupId>
40-
<artifactId>annotations</artifactId>
41-
<version>26.0.2-1</version>
42-
<scope>compile</scope>
39+
<groupId>org.jspecify</groupId>
40+
<artifactId>jspecify</artifactId>
41+
<version>1.0.0</version>
4342
</dependency>
4443
</dependencies>
4544

src/main/java/pro/cloudnode/smp/anvilunlocker/AnvilUnlocker.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
import org.bukkit.inventory.AnvilInventory;
1515
import org.bukkit.inventory.ItemStack;
1616
import org.bukkit.plugin.java.JavaPlugin;
17-
import org.jetbrains.annotations.NotNull;
17+
import org.jspecify.annotations.NullMarked;
1818

19+
@NullMarked
1920
public class AnvilUnlocker extends JavaPlugin implements Listener {
20-
2121
private int maximumCost = Short.MAX_VALUE;
2222

2323
@Override
@@ -36,7 +36,7 @@ public void reloadConfig() {
3636
}
3737

3838
@EventHandler(priority = EventPriority.MONITOR)
39-
private void onInventoryClose(@NotNull InventoryCloseEvent event) {
39+
private void onInventoryClose(InventoryCloseEvent event) {
4040
if (event.getInventory() instanceof AnvilInventory
4141
&& event.getPlayer() instanceof Player
4242
&& event.getPlayer().getGameMode() != GameMode.CREATIVE) {
@@ -45,7 +45,7 @@ private void onInventoryClose(@NotNull InventoryCloseEvent event) {
4545
}
4646

4747
@EventHandler(priority = EventPriority.MONITOR)
48-
private void onPrepareAnvil(@NotNull PrepareAnvilEvent event) {
48+
private void onPrepareAnvil(PrepareAnvilEvent event) {
4949
if (!(event.getView().getPlayer() instanceof Player)
5050
|| event.getView().getPlayer().getGameMode() == GameMode.CREATIVE) {
5151
return;
@@ -65,7 +65,7 @@ private void onPrepareAnvil(@NotNull PrepareAnvilEvent event) {
6565
});
6666
}
6767

68-
public void setInstantBuild(@NotNull Player player, boolean instantBuild) {
68+
public void setInstantBuild(Player player, boolean instantBuild) {
6969
PacketContainer packet = new PacketContainer(PacketType.Play.Server.ABILITIES);
7070
packet.getBooleans().write(0, player.isInvulnerable());
7171
packet.getBooleans().write(1, player.isFlying());

0 commit comments

Comments
 (0)