Skip to content

Commit

Permalink
更新至1.19,优化部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
flben233 committed Jul 8, 2022
1 parent b88c002 commit 4edaafb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: mc2qc
main: mc2qc.mc2qc
version: 1.0
version: 1.1
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<type>jar</type>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/mc2qc/mc2qc.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void onEnable() {
class Process extends Thread implements Listener{
File ip = new File("." + File.separator + "plugins" + File.separator + "mc2qc" + File.separator + "ip");
DataOutputStream dos;
mc2qc plugin;
public mc2qc plugin;
public Process(mc2qc plugin){
this.plugin = plugin;
}
Expand All @@ -46,8 +46,7 @@ public void run() {
try {
getServer().getPluginManager().registerEvents(this,plugin);
Socket socket = new Socket(readFile(ip), 25555);
DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
this.dos = dos;
this.dos = new DataOutputStream(socket.getOutputStream());
}catch (IOException e){
e.printStackTrace();
}
Expand All @@ -61,16 +60,16 @@ public void onChat(AsyncPlayerChatEvent event) throws Exception{
}

public static String readFile(File file){
String str = "";
StringBuilder str = new StringBuilder();
try {
FileReader fr = new FileReader(file);
int i ;
while((i = fr.read()) != -1){
str += (char)i;
str.append((char) i);
}
}catch(IOException e){
e.printStackTrace();
}
return str;
return str.toString();
}
}

0 comments on commit 4edaafb

Please sign in to comment.