feat: still not working.
This commit is contained in:
parent
4282b1f0cd
commit
b1d1570b39
7 changed files with 20 additions and 41 deletions
|
@ -2,6 +2,7 @@ package xyz.ineanto.nicko;
|
|||
|
||||
import com.github.retrooper.packetevents.PacketEvents;
|
||||
import com.github.retrooper.packetevents.manager.server.ServerVersion;
|
||||
import com.github.retrooper.packetevents.settings.PacketEventsSettings;
|
||||
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
|
@ -32,22 +33,23 @@ import java.io.IOException;
|
|||
public class Nicko extends JavaPlugin {
|
||||
private static Nicko plugin;
|
||||
|
||||
private MojangAPI mojangAPI;
|
||||
private final MojangAPI mojangApi = new MojangAPI();
|
||||
private final PlayerNameStore nameStore = new PlayerNameStore();
|
||||
private PlayerDataStore dataStore;
|
||||
private ConfigurationManager configurationManager;
|
||||
private Configuration configuration;
|
||||
private CustomLanguage customLanguage;
|
||||
private PlayerNameStore nameStore;
|
||||
private RandomNameFetcher nameFetcher;
|
||||
|
||||
public Nicko() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this));
|
||||
PacketEvents.getAPI().getSettings().checkForUpdates(false).kickOnPacketException(true);
|
||||
PacketEvents.setAPI(
|
||||
SpigotPacketEventsBuilder.build(this,
|
||||
new PacketEventsSettings()
|
||||
.checkForUpdates(true)
|
||||
.kickOnPacketException(true)
|
||||
)
|
||||
);
|
||||
PacketEvents.getAPI().load();
|
||||
}
|
||||
|
||||
|
@ -55,12 +57,13 @@ public class Nicko extends JavaPlugin {
|
|||
public void onEnable() {
|
||||
plugin = this;
|
||||
|
||||
PacketEvents.getAPI().init();
|
||||
|
||||
configurationManager = new ConfigurationManager(getDataFolder());
|
||||
configurationManager.saveDefaultConfig();
|
||||
|
||||
dataStore = new PlayerDataStore(mojangAPI, getNickoConfig());
|
||||
nameFetcher = new RandomNameFetcher(this);
|
||||
dataStore = new PlayerDataStore(mojangApi, getNickoConfig());
|
||||
|
||||
PacketEvents.getAPI().init();
|
||||
|
||||
if (PacketEvents.getAPI().getServerManager().getVersion().isOlderThan(ServerVersion.V_1_20)) {
|
||||
getLogger().severe("This version (" + PacketEvents.getAPI().getServerManager().getVersion() + ") is not officially supported by Nicko!");
|
||||
|
@ -95,10 +98,6 @@ public class Nicko extends JavaPlugin {
|
|||
dataStore.setCache(cache);
|
||||
}
|
||||
|
||||
nameStore = new PlayerNameStore();
|
||||
mojangAPI = new MojangAPI();
|
||||
nameFetcher = new RandomNameFetcher(this);
|
||||
|
||||
new ConfigurationMigrator(this).migrate();
|
||||
InvUI.getInstance().setPlugin(this);
|
||||
|
||||
|
@ -181,7 +180,7 @@ public class Nicko extends JavaPlugin {
|
|||
}
|
||||
|
||||
public MojangAPI getMojangAPI() {
|
||||
return mojangAPI;
|
||||
return mojangApi;
|
||||
}
|
||||
|
||||
public CustomLanguage getCustomLocale() {
|
||||
|
|
|
@ -60,8 +60,7 @@ public class AppearanceManager {
|
|||
}
|
||||
}
|
||||
|
||||
// Not needed, but still broken using PE.
|
||||
//packetSender.sendPlayerRespawn();
|
||||
packetSender.sendPlayerRespawn();
|
||||
|
||||
// Call the event.
|
||||
final PlayerDisguiseEvent event = new PlayerDisguiseEvent(player, profile.getSkin(), profile.getName());
|
||||
|
|
|
@ -14,7 +14,7 @@ public class NickoPluginLoader implements PluginLoader {
|
|||
final MavenLibraryResolver resolver = new MavenLibraryResolver();
|
||||
|
||||
resolver.addRepository(new RemoteRepository.Builder("xenondevs", "default", "https://repo.xenondevs.xyz/releases/").build());
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("xyz.xenondevs.invui:invui:pom:1.45"), null));
|
||||
resolver.addDependency(new Dependency(new DefaultArtifact("xyz.xenondevs.invui:invui:pom:1.46"), null));
|
||||
|
||||
pluginClasspathBuilder.addLibrary(resolver);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public record PacketEventsPacketSender(Player player, NickoProfile profile) impl
|
|||
Difficulty.getById(world.getDifficulty().ordinal()),
|
||||
world.getSeed(),
|
||||
SpigotConversionUtil.fromBukkitGameMode(player.getGameMode()),
|
||||
SpigotConversionUtil.fromBukkitGameMode(player.getPreviousGameMode()),
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
|
|
|
@ -6,15 +6,6 @@ author: Ineanto
|
|||
description: "The feature packed, next generation disguise plugin for Minecraft."
|
||||
api-version: "1.21"
|
||||
softdepend: [ PlaceholderAPI ]
|
||||
depend:
|
||||
- ProtocolLib
|
||||
|
||||
dependencies:
|
||||
server:
|
||||
ProtocolLib:
|
||||
load: BEFORE
|
||||
join-classpath: true
|
||||
|
||||
permissions:
|
||||
nicko.*:
|
||||
default: op
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue