Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Update dependencies packages by renovate (2022-09-30) (#962)
Browse files Browse the repository at this point in the history
* chore: Update dependencies packages by renovate

* chore(deps): update jetbrains/qodana-action action to v2022.2.2 (#960)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency com.jaoafa:jaosuperachievement2 to v2.5.29 (#957)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(deps): update dependency org.json:json to v20220924 (#956)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.0 (#944)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feat: JDA v5.0.0-alpha.20への対応 (#963)

* feat: cloud-paperとcloud-minecraft-extrasをv1.7.1に (#964)

* feat: cloud-paperとcloud-minecraft-extrasをv1.7.1に

* fix: インスペクションの適用

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tomachi <[email protected]>
  • Loading branch information
3 people authored Sep 30, 2022
1 parent d5ae31c commit 345b4b2
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qodana-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
distribution: adopt

- name: Qodana Scan
uses: JetBrains/[email protected].1
uses: JetBrains/[email protected].2
timeout-minutes: 30
with:
upload-result: true
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
<configuration>
<finalName>MyMaid4</finalName>
<relocations>
Expand Down Expand Up @@ -165,12 +165,12 @@
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-paper</artifactId>
<version>1.6.2</version>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-minecraft-extras</artifactId>
<version>1.6.2</version>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Expand All @@ -180,7 +180,7 @@
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.17</version>
<version>5.0.0-alpha.20</version>
<exclusions>
<exclusion>
<groupId>club.minnced</groupId>
Expand All @@ -204,7 +204,7 @@
<dependency>
<groupId>com.jaoafa</groupId>
<artifactId>jaosuperachievement2</artifactId>
<version>2.5.28</version>
<version>2.5.29</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -221,7 +221,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220320</version>
<version>20220924</version>
</dependency>
<dependency>
<groupId>us.myles</groupId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/jaoafa/mymaid4/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private void registerCommand() {
Function.identity(), Function.identity());

// case-insensitive support (大文字小文字を区別しない)
manager.setCommandSuggestionProcessor((context, strings) -> {
manager.commandSuggestionProcessor((context, strings) -> {
String input = context.getInputQueue().isEmpty() ? "" : context.getInputQueue().peek().toLowerCase();
return strings.stream()
.filter(s -> s.toLowerCase().startsWith(input))
Expand All @@ -157,12 +157,12 @@ private void registerCommand() {
);

// Mojangのコマンドパーサー、Brigadierを登録する
if (manager.queryCapability(CloudBukkitCapabilities.BRIGADIER)) {
if (manager.hasCapability(CloudBukkitCapabilities.BRIGADIER)) {
manager.registerBrigadier();
}

// 非同期の引数補完
if (manager.queryCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) {
if (manager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) {
manager.registerAsynchronousCompletions();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/command/Cmd_Bug.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class Cmd_Bug extends MyMaidLibrary implements CommandPremise {
static long sendTime = -1L;
static IssueManager.Repository repo = IssueManager.Repository.MyMaid4;
static final IssueManager.Repository repo = IssueManager.Repository.MyMaid4;

@Override
public MyMaidCommand.Detail details() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/command/Cmd_Feedback.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class Cmd_Feedback extends MyMaidLibrary implements CommandPremise {
static long sendTime = -1L;
static IssueManager.Repository repo = IssueManager.Repository.jaoMinecraftServer;
static final IssueManager.Repository repo = IssueManager.Repository.jaoMinecraftServer;

@Override
public MyMaidCommand.Detail details() {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_Player.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* jaoLicense
*
* Copyright (c) 2021 jao Minecraft Server
* Copyright (c) 2022 jao Minecraft Server
*
* The following license applies to this project: jaoLicense
*
Expand Down Expand Up @@ -57,7 +57,6 @@ public MyMaidCommand.Cmd register(Command.Builder<CommandSender> builder) {
);
}

@SuppressWarnings("deprecation")
void getPermGroup(CommandContext<CommandSender> context) {
OfflinePlayer player;
if (context.contains("player")) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_TpAlias.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void setAlias(CommandContext<CommandSender> context) {
SendMessage(context.getSender(), details(), "既に登録されているエイリアスです。");
return;
}
boolean result = TeleportAlias.setAlias(target, replacement);
SendMessage(context.getSender(), details(), "追加に" + (result ? "成功" : "失敗") + "しました。");
TeleportAlias.setAlias(target, replacement);
SendMessage(context.getSender(), details(), "追加に成功しました。");
}

void removeAlias(CommandContext<CommandSender> context) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/jaoafa/mymaid4/command/Cmd_Wire.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ void delWireWe(CommandContext<CommandSender> context) {

List<BlockVector2> polylist = polyRegion.getPoints();
int polyPosY = polyRegion.getMaximumY();
int wireRemoveCount = 0;

for (int i = 0; i < polylist.size() - 1; i++) {
Location loc1 = new Location(player.getWorld(), polylist.get(i).getX() + 0.5, polyPosY + 0.1725, polylist.get(i).getZ() + 0.5);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/command/Cmd_jaoBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import java.util.Objects;

public class Cmd_jaoBox extends MyMaidLibrary implements CommandPremise {
public static Component viewerTitleComponent = Component.text("jaoBox", NamedTextColor.YELLOW);
public static Component registerTitleComponent = Component.join(
public static final Component viewerTitleComponent = Component.text("jaoBox", NamedTextColor.YELLOW);
public static final Component registerTitleComponent = Component.join(
JoinConfiguration.noSeparators(),
Component.text("jaoBox"),
Component.space(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
import com.jaoafa.jaosuperachievement2.lib.Achievement;
import com.jaoafa.mymaid4.lib.MyMaidData;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.channel.ChannelType;
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.api.hooks.SubscribeEvent;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/event/Event_Antijaoium.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import com.jaoafa.mymaid4.Main;
import com.jaoafa.mymaid4.lib.*;
import com.jaoafa.mymaid4.tasks.Task_AutoRemoveJailByjaoium;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.utils.FileUpload;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.apache.commons.codec.digest.DigestUtils;
Expand Down Expand Up @@ -148,7 +149,7 @@ void saveItem(Player player, ItemStack is) {
hash,
exists,
isWarning ? String.format("\n**[警告]** jaoiumという文字列が含まれていません: `%s`", displayName) : "")).queue();
channel.sendFile(file, hash + ".txt").queue();
channel.sendFiles(FileUpload.fromData(file, hash + ".txt")).queue();
}

@EventHandler(priority = EventPriority.HIGHEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.jaoafa.mymaid4.lib.MyMaidData;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/event/Event_History.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.jaoafa.mymaid4.lib.Historyjao;
import com.jaoafa.mymaid4.lib.MyMaidData;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.apache.commons.lang.time.DateUtils;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* jaoLicense
*
* Copyright (c) 2021 jao Minecraft Server
* Copyright (c) 2022 jao Minecraft Server
*
* The following license applies to this project: jaoLicense
*
Expand All @@ -16,7 +16,7 @@
import com.jaoafa.mymaid4.lib.MyMaidData;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import com.jaoafa.mymaid4.lib.EventPremise;
import com.jaoafa.mymaid4.lib.MyMaidData;
import com.jaoafa.mymaid4.lib.MyMaidLibrary;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.utils.FileUpload;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
Expand Down Expand Up @@ -95,8 +96,8 @@ public void run() {
return;
}

channel.sendFile(body.byteStream(), player.getUniqueId() + ".png")
.append(String.format("新規プレイヤー「%s」のブロック編集マップ\nhttps://jaoafa.com/cp/?uuid=%s", player.getName(), player.getUniqueId())).queue(msg -> {
channel.sendFiles(FileUpload.fromData(body.byteStream(), player.getUniqueId() + ".png"))
.addContent(String.format("新規プレイヤー「%s」のブロック編集マップ\nhttps://jaoafa.com/cp/?uuid=%s", player.getName(), player.getUniqueId())).queue(msg -> {
Main.getMyMaidLogger().info("NewPlayerAutoBlMap: メッセージ送信完了 (" + msg.getJumpUrl() + ")");
response.close();
}, failure -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public String description() {
return "サバイバルモードなどでsitやlayコマンドを使えないようにします。";
}

static Set<String> targetCommands = Set.of("/sit", "/lay", "/gsit:sit", "/glay:lay");
static final Set<String> targetCommands = Set.of("/sit", "/lay", "/gsit:sit", "/glay:lay");

@EventHandler
public void onCommand(PlayerCommandPreprocessEvent event) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/event/Event_Vote.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.jaoafa.mymaid4.lib.*;
import com.vexsoftware.votifier.model.Vote;
import com.vexsoftware.votifier.model.VotifierEvent;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.JoinConfiguration;
import net.kyori.adventure.text.event.ClickEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/lib/ChatBan.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import com.jaoafa.mymaid4.Main;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.HoverEvent;
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/jaoafa/mymaid4/lib/ConvLoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
import java.util.regex.Pattern;

public class ConvLoc {
Pattern LOC_PATTERN = Pattern.compile("^(~?)(-?)([.\\d]+)$");
Pattern SELECTOR_PATTERN = Pattern.compile("^@[praes]\\[.*?]$");
Pattern XYZ_SELECTOR_PATTERN = Pattern.compile("[^d]([xyz])=([~.\\-0-9]+)");
final Pattern LOC_PATTERN = Pattern.compile("^(~?)(-?)([.\\d]+)$");
final Pattern SELECTOR_PATTERN = Pattern.compile("^@[praes]\\[.*?]$");
final Pattern XYZ_SELECTOR_PATTERN = Pattern.compile("[^d]([xyz])=([~.\\-0-9]+)");

public void replace(Player player, List<Block> blocks, boolean isRelative) {
List<Replacer> replacers = new ArrayList<>();
Expand Down Expand Up @@ -132,8 +132,8 @@ public void undo(Player player) {
}

class Replacer {
Block block;
boolean isRelative;
final Block block;
final boolean isRelative;

ReplacerResult result;
String oldCommand;
Expand All @@ -152,11 +152,11 @@ void dryRun() {
result = ReplacerResult.NOT_TARGET_MATERIAL;
return;
}
if (!(block.getState() instanceof CommandBlock cb)) {
if (!(block.getState() instanceof CommandBlock state)) {
result = ReplacerResult.FAILED_GET_STATE;
return;
}
this.cb = cb;
this.cb = state;
String command = cb.getCommand();
oldCommand = command;
if (command.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jaoafa/mymaid4/lib/EBan.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import com.jaoafa.mymaid4.Main;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.HoverEvent;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/lib/Historyjao.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.jaoafa.mymaid4.Main;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -85,7 +85,7 @@ private void addDiscordNotify(String message, CommandSender sender) {
EmbedBuilder builder = new EmbedBuilder()
.setTitle("HISTORY ADDED")
.setDescription("jaoHistoryに項目が追加されました。")
.addField("MinecraftID", player.getName(), false)
.addField("MinecraftID", player.getName() != null ? player.getName() : "NULL", false)
.addField("Message", message, false)
.setTimestamp(Instant.now())
.setColor(Color.YELLOW);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/lib/Jail.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.jaoafa.jaosuperachievement2.lib.Achievement;
import com.jaoafa.mymaid4.Main;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
Expand Down Expand Up @@ -51,7 +51,7 @@ public class Jail {

static final Map<UUID, Jail> cache = new HashMap<>();

public static Map<UUID, Boolean> hasWarned = new HashMap<>();
public static final Map<UUID, Boolean> hasWarned = new HashMap<>();

final OfflinePlayer player;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/jaoafa/mymaid4/lib/MyMaidCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public String getDescription() {
}
}

@SuppressWarnings("ClassCanBeRecord")
public static class Cmd {
private final Command<CommandSender>[] commands;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/jaoafa/mymaid4/lib/MyMaidData.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

package com.jaoafa.mymaid4.lib;

import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
Expand Down Expand Up @@ -273,7 +273,7 @@ public static List<ItemStack> getBoxPrevious(UUID uuid) {
return jaoBoxPrevious.get(uuid);
}

public static Location paradiseLocation = new Location(
public static final Location paradiseLocation = new Location(
Bukkit.getServer().getWorld("Jao_Afa"),
6050, 68, 6050
);
Expand Down
Loading

0 comments on commit 345b4b2

Please sign in to comment.