Skip to content

Commit 088a894

Browse files
committed
Updated dependencies
1 parent a04cc47 commit 088a894

File tree

14 files changed

+22
-40
lines changed

14 files changed

+22
-40
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PexNPC offers a few advantages over some other NPC plugins:
1111
- Lightweight and small in file size
1212
- Fast updates for new Minecraft versions. Most of the time, the updates arrive at the same day as the Paper API does
1313

14-
Please note, that this plugin only supports the latest version of Minecraft. Older versions may or may not work.
14+
Please note that this plugin only supports the latest version of Minecraft. Older versions may or may not work.
1515
## Building
1616
```
1717
./gradlew build

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repositories {
1616
}
1717

1818
dependencies {
19-
testImplementation(platform("org.junit:junit-bom:5.12.2"))
19+
testImplementation(platform("org.junit:junit-bom:5.13.0"))
2020
testImplementation("org.junit.jupiter:junit-jupiter")
2121
compileOnly("me.clip:placeholderapi:2.11.6")
2222
paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")

src/main/java/de/pascalpex/pexnpc/PexNPC.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import java.util.ArrayList;
1919
import java.util.List;
20-
import java.util.logging.Level;
2120
import java.util.logging.Logger;
2221

2322
public class PexNPC extends JavaPlugin {
@@ -53,11 +52,7 @@ public void onEnable() {
5352
loadAllNPCs();
5453

5554
for (Player player : Bukkit.getOnlinePlayers()) {
56-
try {
57-
packetReader.inject(player);
58-
} catch (NoSuchFieldException | IllegalAccessException e) {
59-
logger.log(Level.SEVERE, "Could not inject the PacketReader!");
60-
}
55+
packetReader.inject(player);
6156
}
6257

6358
// Listeners
@@ -137,12 +132,8 @@ public void reload() {
137132
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
138133

139134
for (Player player : Bukkit.getOnlinePlayers()) {
140-
try {
141-
packetReader.uninject(player);
142-
packetReader.inject(player);
143-
} catch (NoSuchFieldException | IllegalAccessException e) {
144-
logger.log(Level.SEVERE, "Could not inject the PacketReader!");
145-
}
135+
packetReader.uninject(player);
136+
packetReader.inject(player);
146137
}
147138

148139
NPCClickListener.inspectors.clear();

src/main/java/de/pascalpex/pexnpc/PexNPCLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
import io.papermc.paper.plugin.loader.PluginClasspathBuilder;
44
import io.papermc.paper.plugin.loader.PluginLoader;
5+
import org.jetbrains.annotations.NotNull;
56

67
public class PexNPCLoader implements PluginLoader {
78
@Override
8-
public void classloader(PluginClasspathBuilder pluginClasspathBuilder) {
9+
public void classloader(@NotNull PluginClasspathBuilder pluginClasspathBuilder) {
910

1011
}
1112
}

src/main/java/de/pascalpex/pexnpc/commands/subcommands/CreateSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.mojang.brigadier.Command;
44
import com.mojang.brigadier.arguments.StringArgumentType;
55
import com.mojang.brigadier.context.CommandContext;
6-
import com.mojang.brigadier.exceptions.CommandSyntaxException;
76
import de.pascalpex.pexnpc.PexNPC;
87
import de.pascalpex.pexnpc.files.NPCData;
98
import de.pascalpex.pexnpc.npc.NPC;
@@ -18,7 +17,7 @@
1817

1918
public class CreateSubcommand implements Command<CommandSourceStack> {
2019
@Override
21-
public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
20+
public int run(CommandContext<CommandSourceStack> context) {
2221
CommandSender sender = context.getSource().getSender();
2322
Entity executor = context.getSource().getExecutor();
2423

src/main/java/de/pascalpex/pexnpc/commands/subcommands/InspectSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.mojang.brigadier.Command;
44
import com.mojang.brigadier.context.CommandContext;
5-
import com.mojang.brigadier.exceptions.CommandSyntaxException;
65
import de.pascalpex.pexnpc.events.listener.NPCClickListener;
76
import de.pascalpex.pexnpc.util.MessageHandler;
87
import io.papermc.paper.command.brigadier.CommandSourceStack;
@@ -14,7 +13,7 @@
1413

1514
public class InspectSubcommand implements Command<CommandSourceStack> {
1615
@Override
17-
public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
16+
public int run(CommandContext<CommandSourceStack> context) {
1817
CommandSender sender = context.getSource().getSender();
1918
Entity executor = context.getSource().getExecutor();
2019

src/main/java/de/pascalpex/pexnpc/commands/subcommands/ReloadSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
import com.mojang.brigadier.Command;
44
import com.mojang.brigadier.context.CommandContext;
5-
import com.mojang.brigadier.exceptions.CommandSyntaxException;
65
import de.pascalpex.pexnpc.PexNPC;
76
import de.pascalpex.pexnpc.util.MessageHandler;
87
import io.papermc.paper.command.brigadier.CommandSourceStack;
98
import org.bukkit.command.CommandSender;
109

1110
public class ReloadSubcommand implements Command<CommandSourceStack> {
1211
@Override
13-
public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
12+
public int run(CommandContext<CommandSourceStack> context) {
1413
CommandSender sender = context.getSource().getSender();
1514

1615
PexNPC.getInstance().reload();

src/main/java/de/pascalpex/pexnpc/events/PacketReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
public class PacketReader {
1919

2020
Channel channel;
21-
public static Map<UUID, Channel> channels = new HashMap<>();
22-
public static Map<UUID, Boolean> clicking = new HashMap<>();
21+
public static final Map<UUID, Channel> channels = new HashMap<>();
22+
public static final Map<UUID, Boolean> clicking = new HashMap<>();
2323

2424
private static final String PACKET_INJECTOR_NAME = "PacketInjector";
2525

26-
public void inject(Player player) throws NoSuchFieldException, IllegalAccessException {
26+
public void inject(Player player) {
2727
CraftPlayer craftPlayer = (CraftPlayer) player;
2828
ServerGamePacketListenerImpl serverConnection = craftPlayer.getHandle().connection;
2929
channel = serverConnection.connection.channel;

src/main/java/de/pascalpex/pexnpc/events/listener/JoinEventListener.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import org.bukkit.event.Listener;
1111
import org.bukkit.event.player.PlayerJoinEvent;
1212

13-
import java.util.logging.Level;
14-
1513
public class JoinEventListener implements Listener {
1614

1715
@EventHandler(priority = EventPriority.HIGHEST)
@@ -24,11 +22,7 @@ public void onJoin(PlayerJoinEvent event) {
2422
}
2523

2624
PacketReader reader = new PacketReader();
27-
try {
28-
reader.inject(player);
29-
} catch (NoSuchFieldException | IllegalAccessException e) {
30-
PexNPC.logger().log(Level.SEVERE, "Could not inject the PacketReader!");
31-
}
25+
reader.inject(player);
3226
NPCSender.sendNpcsToPlayer(player);
3327
}
3428

src/main/java/de/pascalpex/pexnpc/files/Config.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
public class Config {
1414

15-
public static File configFile = new File("plugins/PexNPC", "config.yml");
16-
public static FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
15+
public static final File configFile = new File("plugins/PexNPC", "config.yml");
16+
public static final FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
1717

1818
public static void load() {
1919
try {

0 commit comments

Comments
 (0)