This commit is contained in:
tanyaofei 2024-07-27 23:03:42 +08:00
parent 83c7f3031c
commit 28e5b32d7b
34 changed files with 46 additions and 44 deletions

View File

@ -3,9 +3,9 @@ package io.github.hello09x.fakeplayer.core;
import com.google.inject.AbstractModule;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.devtools.database.jdbc.JdbcTemplate;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSBridge;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;
import io.github.hello09x.fakeplayer.core.manager.invsee.DefaultInvseeImpl;
@ -17,7 +17,7 @@ import javax.sql.DataSource;
import java.io.File;
import java.util.ServiceLoader;
public class FakeplayerGuiceModule extends AbstractModule {
public class GuiceModule extends AbstractModule {
@Override
@ -42,6 +42,7 @@ public class FakeplayerGuiceModule extends AbstractModule {
config.setDriverClassName("org.sqlite.JDBC");
config.setMaximumPoolSize(1);
config.setJdbcUrl("jdbc:sqlite:" + new File(Main.getInstance().getDataFolder(), "data.db").getAbsolutePath());
config.setConnectionTimeout(1000L);
return new HikariDataSource(config);
}

View File

@ -25,7 +25,7 @@ public final class Main extends RegistrablePlugin {
@Override
public void onLoad() {
instance = this;
injector = Guice.createInjector(new FakeplayerGuiceModule());
injector = Guice.createInjector(new GuiceModule());
}
@Override

View File

@ -4,7 +4,7 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import dev.jorel.commandapi.CommandPermission;
import io.github.hello09x.bedrock.command.Usage;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.core.command.impl.*;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;

View File

@ -5,7 +5,7 @@ import dev.jorel.commandapi.arguments.Argument;
import dev.jorel.commandapi.arguments.ArgumentSuggestions;
import dev.jorel.commandapi.arguments.CustomArgument;
import dev.jorel.commandapi.arguments.StringArgument;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.command.impl.ActionCommand;

View File

@ -4,8 +4,8 @@ import com.google.inject.Inject;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSBridge;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;

View File

@ -5,7 +5,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import dev.jorel.commandapi.executors.CommandExecutor;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.core.manager.action.ActionManager;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;

View File

@ -5,7 +5,7 @@ import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import dev.jorel.commandapi.wrappers.CommandResult;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.command.Permission;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

View File

@ -6,7 +6,7 @@ import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.bedrock.util.Components;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.manager.UserConfigManager;
import io.github.hello09x.fakeplayer.core.repository.model.Config;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.util.Mth;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.entity.Player;

View File

@ -4,8 +4,8 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.utils.ExperienceUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.utils.ExperienceUtils;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -4,7 +4,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.bedrock.page.Page;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.command.Permission;
import io.github.hello09x.fakeplayer.core.util.Mth;
import org.apache.commons.lang3.StringUtils;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

View File

@ -4,7 +4,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;

View File

@ -2,7 +2,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -4,7 +4,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.CommandAPI;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.repository.model.Config;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.command.CommandSender;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.util.Skins;
import org.apache.commons.lang3.mutable.MutableInt;

View File

@ -3,7 +3,7 @@ package io.github.hello09x.fakeplayer.core.command.impl;
import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.devtools.utils.BlockUtils;
import io.github.hello09x.devtools.core.utils.BlockUtils;
import org.bukkit.block.data.type.Bed;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;

View File

@ -4,7 +4,7 @@ import com.google.common.base.Throwables;
import com.google.inject.Singleton;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.bedrock.command.MessageException;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.util.Mth;
import net.kyori.adventure.text.Component;

View File

@ -4,7 +4,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.bedrock.io.Experiences;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.core.command.Permission;
import io.github.hello09x.fakeplayer.core.repository.model.Config;
import io.github.hello09x.fakeplayer.core.util.Mth;

View File

@ -4,7 +4,7 @@ import com.google.inject.Singleton;
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
import dev.jorel.commandapi.executors.CommandArguments;
import io.github.hello09x.bedrock.util.Teleportor;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -2,10 +2,10 @@ package io.github.hello09x.fakeplayer.core.entity;
import io.github.hello09x.bedrock.command.MessageException;
import io.github.hello09x.bedrock.task.CompletableTask;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.utils.EntityUtils;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.utils.EntityUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.event.FakePlayerSpawnEvent;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.api.spi.NMSBridge;

View File

@ -3,8 +3,8 @@ package io.github.hello09x.fakeplayer.core.listener;
import com.google.common.base.Throwables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.utils.ComponentUtils;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.utils.ComponentUtils;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;
import io.github.hello09x.fakeplayer.core.constant.FakePlayerStatus;

View File

@ -4,7 +4,7 @@ package io.github.hello09x.fakeplayer.core.listener;
import com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.github.hello09x.devtools.utils.BlockUtils;
import io.github.hello09x.devtools.core.utils.BlockUtils;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.command.Permission;
import io.github.hello09x.fakeplayer.core.manager.FakeplayerManager;
@ -225,6 +225,7 @@ public class ReplenishListener implements Listener {
return;
}
}
target.closeInventory(InventoryCloseEvent.Reason.PLAYER);
}, 20);
return;
}

View File

@ -4,8 +4,8 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.github.hello09x.bedrock.command.MessageException;
import io.github.hello09x.bedrock.util.AddressUtils;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.transaction.TranslatorUtils;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.TranslatorUtils;
import io.github.hello09x.fakeplayer.api.spi.Action;
import io.github.hello09x.fakeplayer.api.spi.NMSBridge;
import io.github.hello09x.fakeplayer.core.Main;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.core.manager.invsee;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.utils.ComponentUtils;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.utils.ComponentUtils;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;

View File

@ -1,6 +1,6 @@
package io.github.hello09x.fakeplayer.core.manager.invsee;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

View File

@ -2,7 +2,7 @@ package io.github.hello09x.fakeplayer.core.manager.naming;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.github.hello09x.devtools.transaction.PluginTranslator;
import io.github.hello09x.devtools.core.transaction.PluginTranslator;
import io.github.hello09x.fakeplayer.core.Main;
import io.github.hello09x.fakeplayer.core.config.FakeplayerConfig;
import io.github.hello09x.fakeplayer.core.manager.naming.exception.IllegalCustomNameException;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.v1_20_R1.spi;
import com.mojang.authlib.GameProfile;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSServer;
import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
import lombok.Getter;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.v1_20_R2.spi;
import com.mojang.authlib.GameProfile;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSServer;
import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
import lombok.Getter;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.v1_20_R3_R4.spi;
import com.mojang.authlib.GameProfile;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSServer;
import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
import lombok.Getter;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.v1_20_R5_R6.spi;
import com.mojang.authlib.GameProfile;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSServer;
import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
import lombok.Getter;

View File

@ -1,7 +1,7 @@
package io.github.hello09x.fakeplayer.v1_21_R1.spi;
import com.mojang.authlib.GameProfile;
import io.github.hello09x.devtools.utils.WorldUtils;
import io.github.hello09x.devtools.core.utils.WorldUtils;
import io.github.hello09x.fakeplayer.api.spi.NMSServer;
import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
import lombok.Getter;