Skip to content

Commit 97f08a5

Browse files
committed
Ongoing deprecation cleanup
1 parent 31f3bea commit 97f08a5

9 files changed

Lines changed: 15 additions & 17 deletions

File tree

‎bukkit/src/main/java/dev/kitteh/factions/Faction.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.bukkit.World;
1616
import org.bukkit.entity.Player;
1717
import org.jetbrains.annotations.ApiStatus;
18-
import org.jspecify.annotations.NonNull;
1918
import org.jspecify.annotations.NullMarked;
2019
import org.jspecify.annotations.Nullable;
2120

@@ -565,7 +564,7 @@ default int memberLimit() {
565564
void defaultRole(Role role);
566565

567566
@Override
568-
default void sendMessage(@NonNull Component component) {
567+
default void sendMessage(Component component) {
569568
for (FPlayer fplayer : this.membersOnline(true)) {
570569
fplayer.sendMessage(component);
571570
}

‎bukkit/src/main/java/dev/kitteh/factions/command/defaults/CmdBan.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void handle(CommandContext<Sender> context) {
6868

6969
if (event.isCancelled()) {
7070
// if someone cancels a ban, we'll get people complaining here. So lets log it.
71-
AbstractFactionsPlugin.instance().log(Level.WARNING, "Attempted to ban {0} but a plugin cancelled the kick event.", target.name());
71+
AbstractFactionsPlugin.instance().log(Level.WARNING, "Attempted to ban " + target.name() + " but a plugin cancelled the kick event.");
7272
return;
7373
}
7474

‎bukkit/src/main/java/dev/kitteh/factions/command/defaults/admin/force/CmdForceDisband.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import dev.kitteh.factions.tagresolver.FPlayerResolver;
1818
import dev.kitteh.factions.tagresolver.FactionResolver;
1919
import dev.kitteh.factions.util.Permission;
20-
import dev.kitteh.factions.util.TL;
2120
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
2221
import org.bukkit.Bukkit;
2322
import org.incendo.cloud.Command;

‎bukkit/src/main/java/dev/kitteh/factions/config/file/MainConfig.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ public boolean isRelationToTeleportOut(Relation relation, Faction faction) {
13641364
return relations.contains(relation);
13651365
}
13661366

1367-
@Deprecated
1367+
@Deprecated(forRemoval = true, since = "4.0.0")
13681368
public boolean isRelationToTeleportOut(Relation relation) {
13691369
if (relations == null) {
13701370
relations = new HashSet<>();

‎bukkit/src/main/java/dev/kitteh/factions/data/MemoryFPlayer.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.bukkit.metadata.MetadataValue;
4444
import org.bukkit.scheduler.BukkitRunnable;
4545
import org.jetbrains.annotations.ApiStatus;
46-
import org.jspecify.annotations.NonNull;
4746
import org.jspecify.annotations.NullMarked;
4847
import org.jspecify.annotations.Nullable;
4948

@@ -973,7 +972,7 @@ public boolean attemptClaim(Faction forFaction, FLocation flocation, boolean not
973972
Board.board().claim(flocation, forFaction);
974973

975974
if (FactionsPlugin.instance().conf().logging().isLandClaims()) {
976-
AbstractFactionsPlugin.instance().log(TL.CLAIM_CLAIMEDLOG.toString(), this.name(), flocation.asCoordString(), forFaction.tag());
975+
AbstractFactionsPlugin.instance().log(String.format(TL.CLAIM_CLAIMEDLOG.toString(), this.name(), flocation.asCoordString(), forFaction.tag()));
977976
}
978977

979978
return true;
@@ -1103,7 +1102,7 @@ public boolean shouldBeSaved() {
11031102
}
11041103

11051104
@Override
1106-
public void msgLegacy(@NonNull String str, @NonNull Object @NonNull ... args) {
1105+
public void msgLegacy(String str, Object... args) {
11071106
this.sendMessageLegacy(TextUtil.parse(str, args));
11081107
}
11091108

@@ -1253,7 +1252,7 @@ public void flyTrailEffect(String effect) {
12531252
}
12541253

12551254
@Override
1256-
public void sendMessage(@NonNull Component component) {
1255+
public void sendMessage(Component component) {
12571256
if (this.asPlayer() instanceof Player player) {
12581257
ComponentDispatcher.send(player, component);
12591258
}

‎bukkit/src/main/java/dev/kitteh/factions/integration/Essentials.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public void onLeave(FPlayerLeaveEvent event) throws Exception {
110110
// We're only going to remove homes in territory that belongs to THEIR faction.
111111
if (factionAt == faction && factionAt.isNormal()) {
112112
user.delHome(homeName);
113-
AbstractFactionsPlugin.instance().log(Level.INFO, "FactionLeaveEvent: Removing EssX home %s, player %s, in territory of %s",
114-
homeName, event.getFPlayer().name(), faction.tag());
113+
AbstractFactionsPlugin.instance().log(Level.INFO, String.format("FactionLeaveEvent: Removing EssX home %s, player %s, in territory of %s",
114+
homeName, event.getFPlayer().name(), faction.tag()));
115115
}
116116
}
117117
}

‎bukkit/src/main/java/dev/kitteh/factions/listener/ListenEnterExit.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ private void initPlayer(Player player) {
197197

198198
if (me.spyingChat() && !player.hasPermission(Permission.CHATSPY.node)) {
199199
me.spyingChat(false);
200-
this.plugin.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName());
200+
this.plugin.log(Level.INFO, "Found " + player.getName() + " spying chat without permission on login. Disabled their chat spying.");
201201
}
202202

203203
if (me.adminBypass() && !player.hasPermission(Permission.BYPASS.node)) {
204204
me.adminBypass(false);
205-
this.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName());
205+
this.plugin.log(Level.INFO, "Found " + player.getName() + " on admin Bypass without permission on login. Disabled it for them.");
206206
}
207207

208208
if (WorldUtil.isEnabled(player)) {

‎bukkit/src/main/java/dev/kitteh/factions/upgrade/LeveledValueProvider.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public BigDecimal get(int level) {
5050
* @param levels levels available
5151
*/
5252
record LevelMap(Int2ObjectArrayMap<BigDecimal> levels) implements LeveledValueProvider {
53-
@Deprecated(since = "4.2.2", forRemoval = true)
53+
@Deprecated(forRemoval = true, since = "4.2.2")
5454
public static LevelMap of(int level1, BigDecimal val1) {
5555
Int2ObjectArrayMap<BigDecimal> levels = new Int2ObjectArrayMap<>();
5656
levels.put(level1, val1);
@@ -69,7 +69,7 @@ public static LevelMap of(BigDecimal val1) {
6969
return new LevelMap(levels);
7070
}
7171

72-
@Deprecated(since = "4.2.2", forRemoval = true)
72+
@Deprecated(forRemoval = true, since = "4.2.2")
7373
public static LevelMap of(int level1, BigDecimal val1, int level2, BigDecimal val2) {
7474
Int2ObjectArrayMap<BigDecimal> levels = new Int2ObjectArrayMap<>();
7575
levels.put(level1, val1);
@@ -91,7 +91,7 @@ public static LevelMap of(BigDecimal val1, BigDecimal val2) {
9191
return new LevelMap(levels);
9292
}
9393

94-
@Deprecated(since = "4.2.2", forRemoval = true)
94+
@Deprecated(forRemoval = true, since = "4.2.2")
9595
public static LevelMap of(int level1, BigDecimal val1, int level2, BigDecimal val2, int level3, BigDecimal val3) {
9696
Int2ObjectArrayMap<BigDecimal> levels = new Int2ObjectArrayMap<>();
9797
levels.put(level1, val1);
@@ -116,7 +116,7 @@ public static LevelMap of(BigDecimal val1, BigDecimal val2, BigDecimal val3) {
116116
return new LevelMap(levels);
117117
}
118118

119-
@Deprecated(since = "4.2.2", forRemoval = true)
119+
@Deprecated(forRemoval = true, since = "4.2.2")
120120
public static LevelMap of(int level1, BigDecimal val1, int level2, BigDecimal val2, int level3, BigDecimal val3, int level4, BigDecimal val4) {
121121
Int2ObjectArrayMap<BigDecimal> levels = new Int2ObjectArrayMap<>();
122122
levels.put(level1, val1);

‎paper/src/main/java/dev/kitteh/factions/command/paper/CmdWarp.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import java.util.List;
3232

33+
@SuppressWarnings("UnstableApiUsage")
3334
public class CmdWarp implements Cmd {
3435
private static final ClickCallback.Options OPT = ClickCallback.Options.builder().build();
3536

0 commit comments

Comments
 (0)