Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikos3k committed Jan 5, 2021
1 parent aac94d9 commit 369975a
Show file tree
Hide file tree
Showing 51 changed files with 184 additions and 257 deletions.
8 changes: 4 additions & 4 deletions src/main/java/me/ANONIMUS/proxy/BetterProxy.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package me.ANONIMUS.proxy;

import lombok.Data;
import me.ANONIMUS.proxy.protocol.ProxyServer;
import me.ANONIMUS.proxy.threads.MemoryFreeThread;
import me.ANONIMUS.proxy.threads.MessageThread;
import me.ANONIMUS.proxy.command.CommandManager;
import me.ANONIMUS.proxy.config.ConfigManager;
import me.ANONIMUS.proxy.objects.Account;
import me.ANONIMUS.proxy.protocol.ProxyServer;
import me.ANONIMUS.proxy.protocol.packet.PacketRegistry;
import me.ANONIMUS.proxy.threads.MemoryFreeThread;
import me.ANONIMUS.proxy.threads.MessageThread;
import me.ANONIMUS.proxy.threads.TitleLagThread;
import me.ANONIMUS.proxy.utils.java.FileUtil;
import me.ANONIMUS.proxy.utils.FileUtil;

import java.io.File;
import java.util.ArrayList;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/me/ANONIMUS/proxy/command/CommandManager.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command;

import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.ScoreboardUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.enums.GroupType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.ScoreboardUtil;
import org.reflections.Reflections;

import java.util.ArrayList;
Expand All @@ -18,7 +18,7 @@ public class CommandManager {
private final List<Command> commands = new ArrayList<>();

public void init() {
new Reflections("me.AlshainTeam.proxy.command.impl").getSubTypesOf(Command.class).forEach(cmd -> {
new Reflections("me.ANONIMUS.proxy.command.impl").getSubTypesOf(Command.class).forEach(cmd -> {
try {
commands.add(cmd.newInstance());
} catch (InstantiationException | IllegalAccessException e) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/me/ANONIMUS/proxy/command/impl/CommandHelp.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerChatPacket;
import me.ANONIMUS.proxy.BetterProxy;
import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerChatPacket;
import me.ANONIMUS.proxy.utils.ChatUtil;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent;
Expand All @@ -16,7 +16,7 @@

public class CommandHelp extends Command {
public CommandHelp() {
super("help", "pomoc", "helpful commands", "[page]", null, ConnectedType.NONE);
super("help", null, "helpful commands", "[page]", null, ConnectedType.NONE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.ANONIMUS.proxy.command.impl;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.WorldUtil;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.WorldUtil;

public class CommandLogin extends Command {
public CommandLogin() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.admins;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.managers.PlayerManager;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.managers.PlayerManager;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandAlert extends Command {
public CommandAlert() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandFree extends Command {
public CommandFree() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.admins;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.managers.PlayerManager;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.managers.PlayerManager;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandKick extends Command {
public CommandKick() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.ANONIMUS.proxy.command.impl.admins;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

import javax.management.Attribute;
import javax.management.AttributeList;
Expand Down Expand Up @@ -58,7 +58,7 @@ private String humanReadableByteCount(long bytes) {
if (bytes < 1536L) {
return bytes + " B";
}
int exp = (int) (Math.log((double) bytes) / Math.log((double) 1536.0));
int exp = (int) (Math.log((double) bytes) / Math.log(1536.0));
String pre = String.valueOf("KMGTPE".charAt(exp - 1));
return String.format("%.2f %sB", (double) bytes / Math.pow(1024.0, exp), pre);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.ANONIMUS.proxy.command.impl.admins;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.bots;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Bot;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Bot;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandBotQuit extends Command {
public CommandBotQuit() {
Expand All @@ -32,7 +32,7 @@ public void onCommand(Player sender, String cmd, String[] args) throws Exception
}
}
if (b == null) {
ChatUtil.sendChatMessage("&cThe bot you provided with the nickname &4" + args[1] + " &cdoes not exist", sender, true);
ChatUtil.sendChatMessage("&cThe bot with a nickname &4" + args[1] + " &cdoes not exist", sender, true);
return;
}
b.getSession().getChannel().close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package me.ANONIMUS.proxy.command.impl.bots;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandMother extends Command {
public CommandMother() {
Expand All @@ -13,5 +14,6 @@ public CommandMother() {
@Override
public void onCommand(Player sender, String cmd, String[] args) throws Exception {
sender.setMother(!sender.isMother());
ChatUtil.sendTitle(sender, "[MOTHER]", String.valueOf(sender.isMother()));
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.cheats;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.PacketUtil;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.PacketUtil;

public class CommandFly extends Command {
public CommandFly() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.cheats;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.PacketUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.PacketUtil;

public class CommandSpeed extends Command {
public CommandSpeed() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.WorldUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.WorldUtil;

public class CommandLobby extends Command {
public CommandLobby() { super("lobby", null, "teleport to lobby", "", CommandType.MORE, ConnectedType.DISCONNECTED); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientChatPacket;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientChatPacket;
import me.ANONIMUS.proxy.utils.ChatUtil;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.data.ItemStack;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerOpenWindowPacket;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerWindowItemsPacket;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.ItemUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.objects.Option;
import me.ANONIMUS.proxy.protocol.data.ItemStack;
import me.ANONIMUS.proxy.protocol.data.WindowType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerOpenWindowPacket;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerWindowItemsPacket;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.ItemUtil;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientTabCompletePacket;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientTabCompletePacket;
import me.ANONIMUS.proxy.utils.ChatUtil;

import javax.json.*;
import java.io.BufferedReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientTabCompletePacket;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.client.play.ClientTabCompletePacket;
import me.ANONIMUS.proxy.utils.ChatUtil;

public class CommandPlugins extends Command {
public CommandPlugins() { super("plugins", "pl", null, "[tabcomplete]", CommandType.MORE, ConnectedType.CONNECTED); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.ChatUtil;

import java.net.InetSocketAddress;
import java.net.Socket;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.ANONIMUS.proxy.command.impl.more;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.enums.TimeType;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.protocol.packet.impl.server.play.ServerTimeUpdatePacket;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.utils.ChatUtil;

import java.util.Arrays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import me.ANONIMUS.proxy.protocol.connection.PlayerConnection;
import me.ANONIMUS.proxy.protocol.connection.ServerPinger;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.SRVResolver;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.SRVResolver;

import java.net.InetSocketAddress;
import java.net.Proxy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package me.ANONIMUS.proxy.command.impl.normal;

import me.ANONIMUS.proxy.command.Command;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.enums.ConnectedType;
import me.ANONIMUS.proxy.protocol.connection.BotConnection;
import me.ANONIMUS.proxy.protocol.connection.ServerPinger;
import me.ANONIMUS.proxy.protocol.objects.Bot;
import me.ANONIMUS.proxy.protocol.objects.Player;
import me.ANONIMUS.proxy.utils.proxy.ChatUtil;
import me.ANONIMUS.proxy.utils.proxy.SRVResolver;
import me.ANONIMUS.proxy.enums.CommandType;
import me.ANONIMUS.proxy.utils.ChatUtil;
import me.ANONIMUS.proxy.utils.SRVResolver;

import java.net.InetSocketAddress;
import java.net.Proxy;
Expand Down
Loading

0 comments on commit 369975a

Please sign in to comment.