Skip to content

Commit

Permalink
Fix 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Toshimichi0915 committed Jun 23, 2022
1 parent c829230 commit f989006
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group 'net.toshimichi'
version '1.5'
version '1.6'

repositories {
mavenCentral()
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/toshimichi/packetanalyzer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ private void copyResource(String resource, String folder) throws IOException {
file.createNewFile();
byte[] buffer = new byte[2048];
try (InputStream in = getResource(resource); FileOutputStream out = new FileOutputStream(file)) {
while ((in.read(buffer)) != -1)
out.write(buffer);
int len;
while ((len = in.read(buffer)) != -1)
out.write(buffer, 0, len);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private Channel getChannel(Player player) {
Object handle = utils.invoke(player, "getHandle");
Object connection = utils.getValue(handle, "playerConnection", "b");
Object network = utils.getValue(connection, "networkManager", "a");
return (Channel) utils.getValue(network, "channel", "k");
return (Channel) utils.getValue(network, "channel", "k", "m");
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "PacketAnalyzer"
version: "1.5"
version: "1.6"
main: "net.toshimichi.packetanalyzer.Main"
commands:
frame1:
Expand Down

0 comments on commit f989006

Please sign in to comment.