mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-03 09:10:01 +01:00
Cleanup
This commit is contained in:
parent
410d07a64c
commit
fb6303bf4a
@ -24,7 +24,6 @@ import fr.xephi.authme.listener.AuthMeInventoryPacketAdapter;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener16;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener18;
|
||||
import fr.xephi.authme.listener.AuthMePlayerListener19;
|
||||
import fr.xephi.authme.listener.AuthMeServerListener;
|
||||
import fr.xephi.authme.listener.AuthMeTabCompletePacketAdapter;
|
||||
import fr.xephi.authme.listener.AuthMeTablistPacketAdapter;
|
||||
@ -374,13 +373,6 @@ public class AuthMe extends JavaPlugin {
|
||||
pluginManager.registerEvents(initializer.get(AuthMePlayerListener18.class), this);
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
}
|
||||
|
||||
// Try to register 1.9 player listeners
|
||||
try {
|
||||
Class.forName("org.spigotmc.event.player.PlayerSpawnLocationEvent");
|
||||
pluginManager.registerEvents(initializer.get(AuthMePlayerListener19.class), this);
|
||||
} catch (ClassNotFoundException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
private void reloadSupportHook() {
|
||||
|
@ -129,10 +129,9 @@ public class AuthMePlayerListener implements Listener {
|
||||
sendLoginOrRegisterMessage(event.getPlayer());
|
||||
}
|
||||
|
||||
// I think it should be sync! -sgdc3
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
|
||||
public void onPlayerNormalChat(PlayerChatEvent event) {
|
||||
public void onPlayerChat(PlayerChatEvent event) {
|
||||
if (settings.getProperty(RestrictionSettings.ALLOW_CHAT)) {
|
||||
return;
|
||||
}
|
||||
@ -141,7 +140,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (shouldCancelEvent(player)) {
|
||||
event.setCancelled(true);
|
||||
// TODO: a spambot calls this too often, too many threads checking if auth is available.
|
||||
// Possible solution: add a cooldown.
|
||||
// Possible solution: add a cooldown. -sgdc3
|
||||
// sendLoginOrRegisterMessage(player);
|
||||
} else if (settings.getProperty(RestrictionSettings.HIDE_CHAT)) {
|
||||
Set<Player> recipients = event.getRecipients();
|
||||
@ -178,7 +177,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (!settings.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT)) {
|
||||
event.setTo(event.getFrom());
|
||||
// sgdc3 TODO: remove this, maybe we should set the effect every x ticks, idk!
|
||||
if (settings.getProperty(RestrictionSettings.REMOVE_SPEED)) {
|
||||
player.setFlySpeed(0.0f);
|
||||
player.setWalkSpeed(0.0f);
|
||||
|
@ -1,36 +0,0 @@
|
||||
package fr.xephi.authme.listener;
|
||||
|
||||
/*
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import javax.inject.Inject;
|
||||
*/
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Listener of player events for events introduced in Minecraft 1.9.
|
||||
*/
|
||||
public class AuthMePlayerListener19 implements Listener {
|
||||
|
||||
/*
|
||||
@Inject
|
||||
private SpawnLoader spawnLoader;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
*/
|
||||
|
||||
/* WTF was that? We need to check all the settings before moving the player to the spawn!
|
||||
*
|
||||
* TODO: fixme please!
|
||||
*
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerSpawn(PlayerSpawnLocationEvent event) {
|
||||
if(settings.getProperty(RestrictionSettings.NO_TELEPORT)) {
|
||||
return;
|
||||
}
|
||||
event.setSpawnLocation(spawnLoader.getSpawnLocation(event.getPlayer()));
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user