Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
Xinecraft committed May 30, 2024
1 parent a189c78 commit ffe1898
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -39,7 +39,6 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command
MinetraxBukkit.getPlugin().getApiServerId()
);

// not-found
if (response.getCode() != 200) {
for (String line : MinetraxBukkit.getPlugin().getPlayerLinkErrorMessage()) {
line = line.replace("{ERROR_MESSAGE}", response.getMessage());
@@ -55,7 +54,7 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command
} catch (Exception e) {
for (String line : MinetraxBukkit.getPlugin().getPlayerLinkErrorMessage()) {
line = line.replace("{WEB_URL}", MinetraxBukkit.getPlugin().getApiHost());
line = line.replace("{ERROR_MESSAGE}", " ");
line = line.replace("{ERROR_MESSAGE}", "Unknown error! Please contact admin.");
MinetraxBukkit.getPlugin().adventure().player(player).sendMessage(MineDown.parse(line));
}
}
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
import com.xinecraft.minetrax.common.data.PlayerWorldStatsIntelData;
import com.xinecraft.minetrax.common.responses.GenericApiResponse;
import com.xinecraft.minetrax.common.utils.WhoisUtil;
import de.themoep.minedown.adventure.MineDown;
import net.skinsrestorer.api.PropertyUtils;
import net.skinsrestorer.api.SkinsRestorer;
import net.skinsrestorer.api.SkinsRestorerProvider;
@@ -113,8 +114,7 @@ private void broadcastWhoisForPlayer(Player player) {
);
if (sayList != null) {
for (String line : sayList) {
line = ChatColor.translateAlternateColorCodes('&', line);
Bukkit.getServer().broadcastMessage(line);
MinetraxBukkit.getPlugin().adventure().players().sendMessage(MineDown.parse(line));
}
}
});
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import com.xinecraft.minetrax.bukkit.MinetraxBukkit;
import com.xinecraft.minetrax.common.data.PlayerData;
import com.xinecraft.minetrax.common.utils.MinetraxHttpUtil;
import de.themoep.minedown.adventure.MineDown;
import org.bukkit.entity.Player;

@@ -14,6 +15,7 @@ public void run() {
if (playerData != null && playerData.is_verified) continue;

for (String line : MinetraxBukkit.getPlugin().getRemindPlayerToLinkMessage()) {
line = line.replace("{LINK_URL}", MinetraxHttpUtil.getUrl(MinetraxHttpUtil.ACCOUNT_LINK_ROUTE));
MinetraxBukkit.getPlugin().adventure().player(player).sendMessage(MineDown.parse(line));
}
}
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@ public static GenericApiResponse link(String playerUuid, String otpCode, String
String payloadString = MinetraxCommon.getInstance().getGson().toJson(payload);
HttpResponse resp = MinetraxHttpUtil.post(MinetraxHttpUtil.VERIFY_ACCOUNT_LINK_ROUTE, payloadString, null);
String body = resp.body();
if (!resp.isSuccessful()) {
throw new HttpException(resp, "LinkAccount.link");
}
if (body == null) {
throw new HttpException(resp, "LinkAccount.link");
}

0 comments on commit ffe1898

Please sign in to comment.