commit
c45192a348
@ -3,7 +3,7 @@ machine:
|
|||||||
version: oraclejdk7
|
version: oraclejdk7
|
||||||
general:
|
general:
|
||||||
artifacts:
|
artifacts:
|
||||||
- "target/*.jar"
|
- "target/AuthMe-*.jar"
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- mvn clean install
|
- mvn clean install
|
||||||
|
|||||||
16
pom.xml
16
pom.xml
@ -24,10 +24,10 @@
|
|||||||
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
<bukkitVersion>1.8.7-R0.1-SNAPSHOT</bukkitVersion>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Official Build Server ALLERT: sometimes jenkins is offline, no panic! -->
|
<!-- Official Build Server -->
|
||||||
<ciManagement>
|
<ciManagement>
|
||||||
<system>jenkins</system>
|
<system>jenkins</system>
|
||||||
<url>http://ci.xephi.fr</url>
|
<url>http://ci.xephi.fr/job/AuthMeReloaded/</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
@ -116,16 +116,16 @@
|
|||||||
<!-- SpigotMC Repo (Bukkit and SpigotAPI) -->
|
<!-- SpigotMC Repo (Bukkit and SpigotAPI) -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Mcstats.org Metrics Repo -->
|
<!-- Mcstats.org Metrics Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>Plugin Metrics</id>
|
<id>Plugin Metrics</id>
|
||||||
<url>http://repo.mcstats.org/content/repositories/public</url>
|
<url>http://repo.mcstats.org/content/repositories/releases</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Vault Repo (Already in ess repo!) -->
|
<!-- Vault Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
<url>http://nexus.theyeticave.net/content/repositories/pub_releases</url>
|
||||||
@ -152,19 +152,19 @@
|
|||||||
<!-- XAuth Repo -->
|
<!-- XAuth Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>luricos-releases</id>
|
<id>luricos-releases</id>
|
||||||
<url>http://repo.luricos.de/content/repositories/releases/</url>
|
<url>http://repo.luricos.de/content/repositories/bukkit-plugins</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Attribute Repo -->
|
<!-- Attribute Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>comphenix-snapshots</id>
|
<id>comphenix-snapshots</id>
|
||||||
<url>http://repo.comphenix.net/content/repositories/snapshots/</url>
|
<url>http://repo.comphenix.net/content/repositories/snapshots</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<!-- Multiverse Repo -->
|
<!-- Multiverse Repo -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>onarandombox</id>
|
<id>onarandombox</id>
|
||||||
<url>http://repo.onarandombox.com/content/groups/public</url>
|
<url>http://repo.onarandombox.com/content/repositories/multiverse</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|||||||
@ -460,7 +460,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public void savePlayer(Player player)
|
public void savePlayer(Player player)
|
||||||
throws IllegalStateException, NullPointerException {
|
throws IllegalStateException, NullPointerException {
|
||||||
try {
|
try {
|
||||||
if ((citizens.isNPC(player, this)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
|
if ((citizens.isNPC(player)) || (Utils.getInstance().isUnrestricted(player)) || (CombatTagComunicator.isNPC(player))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -566,8 +566,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
Location spawnLoc = world.getSpawnLocation();
|
Location spawnLoc = world.getSpawnLocation();
|
||||||
for (int i = spawnPriority.length - 1; i >= 0; i--) {
|
for (int i = spawnPriority.length - 1; i >= 0; i--) {
|
||||||
String s = spawnPriority[i];
|
String s = spawnPriority[i];
|
||||||
if (s.equalsIgnoreCase("default") && getDefaultSpawn(world) != null)
|
if (s.equalsIgnoreCase("default") && getDefaultSpawn() != null)
|
||||||
spawnLoc = getDefaultSpawn(world);
|
spawnLoc = getDefaultSpawn();
|
||||||
if (s.equalsIgnoreCase("multiverse") && getMultiverseSpawn(world) != null)
|
if (s.equalsIgnoreCase("multiverse") && getMultiverseSpawn(world) != null)
|
||||||
spawnLoc = getMultiverseSpawn(world);
|
spawnLoc = getMultiverseSpawn(world);
|
||||||
if (s.equalsIgnoreCase("essentials") && getEssentialsSpawn() != null)
|
if (s.equalsIgnoreCase("essentials") && getEssentialsSpawn() != null)
|
||||||
@ -580,8 +580,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return spawnLoc;
|
return spawnLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Location getDefaultSpawn(World world) {
|
private Location getDefaultSpawn() {
|
||||||
return world.getSpawnLocation();
|
return this.getServer().getWorld(Settings.defaultWorld).getSpawnLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Location getMultiverseSpawn(World world) {
|
private Location getMultiverseSpawn(World world) {
|
||||||
@ -607,7 +607,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return Spawn.getInstance().getFirstSpawn();
|
return Spawn.getInstance().getFirstSpawn();
|
||||||
if (Spawn.getInstance().getSpawn() != null)
|
if (Spawn.getInstance().getSpawn() != null)
|
||||||
return Spawn.getInstance().getSpawn();
|
return Spawn.getInstance().getSpawn();
|
||||||
return null;
|
return this.getServer().getWorld(Settings.defaultWorld).getSpawnLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadGeoIp() {
|
public void downloadGeoIp() {
|
||||||
|
|||||||
33
src/main/java/fr/xephi/authme/ImageGenerator.java
Normal file
33
src/main/java/fr/xephi/authme/ImageGenerator.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package fr.xephi.authme;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.GradientPaint;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class ImageGenerator {
|
||||||
|
|
||||||
|
private String pass;
|
||||||
|
private AuthMe plugin;
|
||||||
|
|
||||||
|
public ImageGenerator(AuthMe plugin, String pass) {
|
||||||
|
this.pass = pass;
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BufferedImage generateImage() {
|
||||||
|
BufferedImage image = new BufferedImage(200, 60, BufferedImage.TYPE_BYTE_INDEXED);
|
||||||
|
Graphics2D graphics = image.createGraphics();
|
||||||
|
graphics.setColor(Color.BLACK);
|
||||||
|
graphics.fillRect(0, 0, 200, 40);
|
||||||
|
GradientPaint gradientPaint = new GradientPaint(10, 5, Color.WHITE, 20, 10, Color.WHITE, true);
|
||||||
|
graphics.setPaint(gradientPaint);
|
||||||
|
Font font = new Font("Comic Sans MS", Font.BOLD, 30);
|
||||||
|
graphics.setFont(font);
|
||||||
|
graphics.drawString(pass, 5, 30);
|
||||||
|
graphics.dispose();
|
||||||
|
image.flush();
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,14 @@
|
|||||||
package fr.xephi.authme;
|
package fr.xephi.authme;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import javax.activation.DataHandler;
|
||||||
|
import javax.activation.DataSource;
|
||||||
|
import javax.activation.FileDataSource;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
import javax.mail.BodyPart;
|
import javax.mail.BodyPart;
|
||||||
import javax.mail.Message;
|
import javax.mail.Message;
|
||||||
import javax.mail.Multipart;
|
import javax.mail.Multipart;
|
||||||
@ -46,9 +51,8 @@ public class SendMailSSL {
|
|||||||
final String subject = Settings.getMailSubject;
|
final String subject = Settings.getMailSubject;
|
||||||
final String smtp = Settings.getmailSMTP;
|
final String smtp = Settings.getmailSMTP;
|
||||||
final String password = Settings.getmailPassword;
|
final String password = Settings.getmailPassword;
|
||||||
final String mailText = Settings.getMailText;
|
final String mailText = Settings.getMailText.replace("<playername>", auth.getNickname()).replace("<servername>", plugin.getServer().getServerName()).replace("<generatedpass>", newPass);
|
||||||
final String mail = auth.getEmail();
|
final String mail = auth.getEmail();
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -74,10 +78,26 @@ public class SendMailSSL {
|
|||||||
messageBodyPart.setText(mailText);
|
messageBodyPart.setText(mailText);
|
||||||
Multipart multipart = new MimeMultipart();
|
Multipart multipart = new MimeMultipart();
|
||||||
multipart.addBodyPart(messageBodyPart);
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
|
||||||
|
// Generate an image ?
|
||||||
|
File file = null;
|
||||||
|
if (Settings.generateImage) {
|
||||||
|
ImageGenerator gen = new ImageGenerator(plugin, newPass);
|
||||||
|
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||||
|
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||||
|
messageBodyPart = new MimeBodyPart();
|
||||||
|
DataSource source = new FileDataSource(file);
|
||||||
|
messageBodyPart.setDataHandler(new DataHandler(source));
|
||||||
|
messageBodyPart.setFileName(auth.getNickname() + "_new_pass.jpg");
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
}
|
||||||
|
|
||||||
message.setContent(multipart);
|
message.setContent(multipart);
|
||||||
Transport transport = session.getTransport("smtp");
|
Transport transport = session.getTransport("smtp");
|
||||||
transport.connect(smtp, acc, password);
|
transport.connect(smtp, acc, password);
|
||||||
transport.sendMessage(message, message.getAllRecipients());
|
transport.sendMessage(message, message.getAllRecipients());
|
||||||
|
if (file != null)
|
||||||
|
file.delete();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Some error occured while trying to send a mail to " + mail);
|
System.out.println("Some error occured while trying to send a mail to " + mail);
|
||||||
|
|||||||
@ -67,25 +67,13 @@ public class API {
|
|||||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param player
|
|
||||||
* @return true if player is a npc
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public boolean isaNPC(Player player) {
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
|
||||||
return true;
|
|
||||||
return CombatTagComunicator.isNPC(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param player
|
* @param player
|
||||||
* @return true if player is a npc
|
* @return true if player is a npc
|
||||||
*/
|
*/
|
||||||
public boolean isNPC(Player player) {
|
public boolean isNPC(Player player) {
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return true;
|
return true;
|
||||||
return CombatTagComunicator.isNPC(player);
|
return CombatTagComunicator.isNPC(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class LimboCache {
|
|||||||
boolean flying = false;
|
boolean flying = false;
|
||||||
|
|
||||||
if (playerData.doesCacheExist(player)) {
|
if (playerData.doesCacheExist(player)) {
|
||||||
StoreInventoryEvent event = new StoreInventoryEvent(player, playerData);
|
final StoreInventoryEvent event = new StoreInventoryEvent(player, playerData);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled() && event.getInventory() != null && event.getArmor() != null) {
|
if (!event.isCancelled() && event.getInventory() != null && event.getArmor() != null) {
|
||||||
inv = event.getInventory();
|
inv = event.getInventory();
|
||||||
@ -90,6 +90,9 @@ public class LimboCache {
|
|||||||
player.sendMessage("Your inventory has been cleaned!");
|
player.sendMessage("Your inventory has been cleaned!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (gameMode == GameMode.CREATIVE) {
|
||||||
|
flying = false;
|
||||||
|
}
|
||||||
gameMode = GameMode.SURVIVAL;
|
gameMode = GameMode.SURVIVAL;
|
||||||
}
|
}
|
||||||
if (player.isDead()) {
|
if (player.isDead()) {
|
||||||
|
|||||||
@ -0,0 +1,40 @@
|
|||||||
|
package fr.xephi.authme.events;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Called if a player is teleported to the authme first spawn
|
||||||
|
*
|
||||||
|
* @author Xephi59
|
||||||
|
*/
|
||||||
|
public class FirstSpawnTeleportEvent extends CustomEvent {
|
||||||
|
|
||||||
|
private Player player;
|
||||||
|
private Location to;
|
||||||
|
private Location from;
|
||||||
|
|
||||||
|
public FirstSpawnTeleportEvent(Player player, Location from, Location to) {
|
||||||
|
this.player = player;
|
||||||
|
this.from = from;
|
||||||
|
this.to = to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer() {
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTo(Location to) {
|
||||||
|
this.to = to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getTo() {
|
||||||
|
return to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Location getFrom() {
|
||||||
|
return from;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -5,8 +5,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.event.entity.EntityInteractEvent;
|
import org.bukkit.event.entity.EntityInteractEvent;
|
||||||
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
import org.bukkit.event.entity.EntityRegainHealthEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
@ -29,7 +29,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler (priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onEntityDamage(EntityDamageEvent event) {
|
public void onEntityDamage(EntityDamageEvent event) {
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
@ -44,7 +44,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(entity, instance))
|
if (instance.citizens.isNPC(entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
@ -67,7 +67,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler (priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onEntityTarget(EntityTargetEvent event) {
|
public void onEntityTarget(EntityTargetEvent event) {
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
@ -79,7 +79,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(entity, instance))
|
if (instance.citizens.isNPC(entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
@ -99,19 +99,19 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onDmg(EntityDamageByEntityEvent event) {
|
public void onDmg(EntityDamageByEntityEvent event) {
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity entity = event.getDamager();
|
Entity entity = event.getDamager();
|
||||||
|
|
||||||
if (entity == null || !(entity instanceof Player)) {
|
if (entity == null || !(entity instanceof Player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
String name = player.getName().toLowerCase();
|
String name = player.getName().toLowerCase();
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||||
return;
|
return;
|
||||||
@ -124,9 +124,9 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler (priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
public void onFoodLevelChange(FoodLevelChangeEvent event) {
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
@ -137,7 +137,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(entity, instance))
|
if (instance.citizens.isNPC(entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
@ -168,7 +168,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(entity, instance))
|
if (instance.citizens.isNPC(entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
@ -205,7 +205,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(player, instance))
|
if (instance.citizens.isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName())) {
|
||||||
@ -237,7 +237,7 @@ public class AuthMeEntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.citizens.isNPC(player, instance))
|
if (instance.citizens.isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName())) {
|
||||||
|
|||||||
@ -50,7 +50,6 @@ import fr.xephi.authme.settings.Settings;
|
|||||||
|
|
||||||
public class AuthMePlayerListener implements Listener {
|
public class AuthMePlayerListener implements Listener {
|
||||||
|
|
||||||
public static GameMode gm = GameMode.SURVIVAL;
|
|
||||||
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
public static ConcurrentHashMap<String, GameMode> gameMode = new ConcurrentHashMap<String, GameMode>();
|
||||||
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
public static ConcurrentHashMap<String, String> joinMessage = new ConcurrentHashMap<String, String>();
|
||||||
private Messages m = Messages.getInstance();
|
private Messages m = Messages.getInstance();
|
||||||
@ -328,7 +327,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String name = player.getName().toLowerCase();
|
String name = player.getName().toLowerCase();
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,7 +406,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
boolean isAuthAvailable = data.isAuthAvailable(name);
|
boolean isAuthAvailable = data.isAuthAvailable(name);
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,7 +615,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||||
@ -644,7 +643,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||||
@ -673,7 +672,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||||
@ -702,7 +701,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||||
@ -727,7 +726,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String name = player.getName().toLowerCase();
|
String name = player.getName().toLowerCase();
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -755,7 +754,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||||
@ -827,7 +826,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player))
|
if (Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||||
@ -855,8 +854,6 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (event.getPlayer() == null || event == null)
|
if (event.getPlayer() == null || event == null)
|
||||||
return;
|
return;
|
||||||
if (!Settings.isForceSurvivalModeEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
@ -868,7 +865,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
if (Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player))
|
if (Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin))
|
if (plugin.getCitizensCommunicator().isNPC(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PlayerCache.getInstance().isAuthenticated(name))
|
if (PlayerCache.getInstance().isAuthenticated(name))
|
||||||
@ -880,6 +877,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
|
|
||||||
if (causeByAuthMe.containsKey(name) && causeByAuthMe.get(name))
|
if (causeByAuthMe.containsKey(name) && causeByAuthMe.get(name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public class CitizensCommunicator {
|
|||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNPC(final Entity player, AuthMe instance) {
|
public boolean isNPC(final Entity player) {
|
||||||
if (!this.instance.isCitizensActive)
|
if (!this.instance.isCitizensActive)
|
||||||
return false;
|
return false;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -22,12 +22,14 @@ import fr.xephi.authme.cache.backup.FileCache;
|
|||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
|
import fr.xephi.authme.events.FirstSpawnTeleportEvent;
|
||||||
import fr.xephi.authme.events.ProtectInventoryEvent;
|
import fr.xephi.authme.events.ProtectInventoryEvent;
|
||||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||||
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
import fr.xephi.authme.plugin.manager.CombatTagComunicator;
|
||||||
import fr.xephi.authme.settings.Messages;
|
import fr.xephi.authme.settings.Messages;
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
import fr.xephi.authme.settings.Spawn;
|
||||||
import fr.xephi.authme.task.MessageTask;
|
import fr.xephi.authme.task.MessageTask;
|
||||||
import fr.xephi.authme.task.TimeoutTask;
|
import fr.xephi.authme.task.TimeoutTask;
|
||||||
|
|
||||||
@ -53,7 +55,7 @@ public class AsyncronousJoin {
|
|||||||
AuthMePlayerListener.gameMode.put(name, player.getGameMode());
|
AuthMePlayerListener.gameMode.put(name, player.getGameMode());
|
||||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||||
|
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +151,7 @@ public class AsyncronousJoin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Settings.noTeleport)
|
if (!Settings.noTeleport)
|
||||||
if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName()))) {
|
if (!needFirstspawn() && Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName()))) {
|
||||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -216,7 +218,7 @@ public class AsyncronousJoin {
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (player.isOp())
|
if (player.isOp())
|
||||||
player.setOp(false);
|
player.setOp(false);
|
||||||
if (!Settings.isMovementAllowed) {
|
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
|
||||||
player.setAllowFlight(true);
|
player.setAllowFlight(true);
|
||||||
player.setFlying(true);
|
player.setFlying(true);
|
||||||
}
|
}
|
||||||
@ -249,6 +251,31 @@ public class AsyncronousJoin {
|
|||||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean needFirstspawn() {
|
||||||
|
if (database.isAuthAvailable(player.getName().toLowerCase()) && player.hasPlayedBefore())
|
||||||
|
return false;
|
||||||
|
else {
|
||||||
|
if (Spawn.getInstance().getFirstSpawn() == null || Spawn.getInstance().getFirstSpawn().getWorld() == null)
|
||||||
|
return false;
|
||||||
|
final Location loc = Spawn.getInstance().getFirstSpawn();
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
FirstSpawnTeleportEvent tpEvent = new FirstSpawnTeleportEvent(player, player.getLocation(), loc);
|
||||||
|
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||||
|
if (!tpEvent.isCancelled()) {
|
||||||
|
if (player != null && player.isOnline() && tpEvent.getTo() != null && tpEvent.getTo().getWorld() != null) {
|
||||||
|
player.teleport(tpEvent.getTo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void placePlayerSafely(final Player player,
|
private void placePlayerSafely(final Player player,
|
||||||
final Location spawnLoc) {
|
final Location spawnLoc) {
|
||||||
Location loc = null;
|
Location loc = null;
|
||||||
@ -258,14 +285,16 @@ public class AsyncronousJoin {
|
|||||||
return;
|
return;
|
||||||
if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
if (Settings.isTeleportToSpawnEnabled || (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())))
|
||||||
return;
|
return;
|
||||||
|
if (!database.isAuthAvailable(player.getName().toLowerCase()) || !player.hasPlayedBefore())
|
||||||
|
return;
|
||||||
Block b = player.getLocation().getBlock();
|
Block b = player.getLocation().getBlock();
|
||||||
if (b.getType() == Material.PORTAL || b.getType() == Material.ENDER_PORTAL || b.getType() == Material.LAVA || b.getType() == Material.STATIONARY_LAVA) {
|
if (b.getType() == Material.PORTAL || b.getType() == Material.ENDER_PORTAL) {
|
||||||
m.send(player, "unsafe_spawn");
|
m.send(player, "unsafe_spawn");
|
||||||
if (spawnLoc.getWorld() != null)
|
if (spawnLoc.getWorld() != null)
|
||||||
loc = spawnLoc;
|
loc = spawnLoc;
|
||||||
} else {
|
} else {
|
||||||
Block c = player.getLocation().add(0D, 1D, 0D).getBlock();
|
Block c = player.getLocation().add(0D, 1D, 0D).getBlock();
|
||||||
if (c.getType() == Material.PORTAL || c.getType() == Material.ENDER_PORTAL || c.getType() == Material.LAVA || c.getType() == Material.STATIONARY_LAVA) {
|
if (c.getType() == Material.PORTAL || c.getType() == Material.ENDER_PORTAL) {
|
||||||
m.send(player, "unsafe_spawn");
|
m.send(player, "unsafe_spawn");
|
||||||
if (spawnLoc.getWorld() != null)
|
if (spawnLoc.getWorld() != null)
|
||||||
loc = spawnLoc;
|
loc = spawnLoc;
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.Utils;
|
import fr.xephi.authme.Utils;
|
||||||
import fr.xephi.authme.Utils.groupType;
|
import fr.xephi.authme.Utils.groupType;
|
||||||
import fr.xephi.authme.api.API;
|
|
||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.backup.FileCache;
|
import fr.xephi.authme.cache.backup.FileCache;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
@ -53,8 +52,13 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
protected void restoreOpState() {
|
protected void restoreOpState() {
|
||||||
player.setOp(limbo.getOperator());
|
player.setOp(limbo.getOperator());
|
||||||
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
|
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
|
||||||
player.setAllowFlight(limbo.isFlying());
|
if (limbo.getGameMode() != GameMode.CREATIVE) {
|
||||||
player.setFlying(limbo.isFlying());
|
player.setAllowFlight(limbo.isFlying());
|
||||||
|
player.setFlying(limbo.isFlying());
|
||||||
|
} else {
|
||||||
|
player.setAllowFlight(false);
|
||||||
|
player.setFlying(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,8 +124,8 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
* ProtectInventoryEvent after Teleporting Also it's the current
|
* ProtectInventoryEvent after Teleporting Also it's the current
|
||||||
* world inventory !
|
* world inventory !
|
||||||
*/
|
*/
|
||||||
|
player.setGameMode(limbo.getGameMode());
|
||||||
if (!Settings.forceOnlyAfterLogin) {
|
if (!Settings.forceOnlyAfterLogin) {
|
||||||
player.setGameMode(limbo.getGameMode());
|
|
||||||
// Inventory - Make it after restore GameMode , cause we need to
|
// Inventory - Make it after restore GameMode , cause we need to
|
||||||
// restore the
|
// restore the
|
||||||
// right inventory in the right gamemode
|
// right inventory in the right gamemode
|
||||||
@ -146,7 +150,8 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
|
|||||||
} else {
|
} else {
|
||||||
teleportBackFromSpawn();
|
teleportBackFromSpawn();
|
||||||
}
|
}
|
||||||
} else if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
} else
|
||||||
|
if (Settings.isForceSpawnLocOnJoinEnabled && Settings.getForcedWorlds.contains(player.getWorld().getName())) {
|
||||||
teleportToSpawn();
|
teleportToSpawn();
|
||||||
} else if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
|
} else if (Settings.isSaveQuitLocationEnabled && auth.getQuitLocY() != 0) {
|
||||||
packQuitLocation();
|
packQuitLocation();
|
||||||
|
|||||||
@ -51,8 +51,10 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
|||||||
if (Settings.applyBlindEffect)
|
if (Settings.applyBlindEffect)
|
||||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||||
player.setOp(false);
|
player.setOp(false);
|
||||||
player.setAllowFlight(true);
|
if (!Settings.isMovementAllowed) {
|
||||||
player.setFlying(true);
|
player.setAllowFlight(true);
|
||||||
|
player.setFlying(true);
|
||||||
|
}
|
||||||
// Player is now logout... Time to fire event !
|
// Player is now logout... Time to fire event !
|
||||||
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public class AsyncronousQuit {
|
|||||||
|
|
||||||
public void process() {
|
public void process() {
|
||||||
final Player player = p;
|
final Player player = p;
|
||||||
if (plugin.getCitizensCommunicator().isNPC(player, plugin) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
if (plugin.getCitizensCommunicator().isNPC(player) || Utils.getInstance().isUnrestricted(player) || CombatTagComunicator.isNPC(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -70,7 +70,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
purgePermissions, enableProtection, enableAntiBot, recallEmail,
|
purgePermissions, enableProtection, enableAntiBot, recallEmail,
|
||||||
useWelcomeMessage, broadcastWelcomeMessage, forceRegKick,
|
useWelcomeMessage, broadcastWelcomeMessage, forceRegKick,
|
||||||
forceRegLogin, checkVeryGames, delayJoinMessage, noTeleport,
|
forceRegLogin, checkVeryGames, delayJoinMessage, noTeleport,
|
||||||
applyBlindEffect, customAttributes;
|
applyBlindEffect, customAttributes, generateImage;
|
||||||
|
|
||||||
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
|
public static String getNickRegex, getUnloggedinGroup, getMySQLHost,
|
||||||
getMySQLPort, getMySQLUsername, getMySQLPassword, getMySQLDatabase,
|
getMySQLPort, getMySQLUsername, getMySQLPassword, getMySQLDatabase,
|
||||||
@ -269,6 +269,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
forceRegisterCommands = (List<String>) configFile.getList("settings.forceRegisterCommands", new ArrayList<String>());
|
forceRegisterCommands = (List<String>) configFile.getList("settings.forceRegisterCommands", new ArrayList<String>());
|
||||||
forceRegisterCommandsAsConsole = (List<String>) configFile.getList("settings.forceRegisterCommandsAsConsole", new ArrayList<String>());
|
forceRegisterCommandsAsConsole = (List<String>) configFile.getList("settings.forceRegisterCommandsAsConsole", new ArrayList<String>());
|
||||||
customAttributes = configFile.getBoolean("Hooks.customAttributes");
|
customAttributes = configFile.getBoolean("Hooks.customAttributes");
|
||||||
|
generateImage = configFile.getBoolean("Email.generateImage", true);
|
||||||
|
|
||||||
// Load the welcome message
|
// Load the welcome message
|
||||||
getWelcomeMessage(plugin);
|
getWelcomeMessage(plugin);
|
||||||
@ -435,6 +436,7 @@ public final class Settings extends YamlConfiguration {
|
|||||||
forceRegisterCommands = (List<String>) configFile.getList("settings.forceRegisterCommands", new ArrayList<String>());
|
forceRegisterCommands = (List<String>) configFile.getList("settings.forceRegisterCommands", new ArrayList<String>());
|
||||||
forceRegisterCommandsAsConsole = (List<String>) configFile.getList("settings.forceRegisterCommandsAsConsole", new ArrayList<String>());
|
forceRegisterCommandsAsConsole = (List<String>) configFile.getList("settings.forceRegisterCommandsAsConsole", new ArrayList<String>());
|
||||||
customAttributes = configFile.getBoolean("Hooks.customAttributes");
|
customAttributes = configFile.getBoolean("Hooks.customAttributes");
|
||||||
|
generateImage = configFile.getBoolean("Email.generateImage", true);
|
||||||
|
|
||||||
// Reload the welcome message
|
// Reload the welcome message
|
||||||
getWelcomeMessage(AuthMe.getInstance());
|
getWelcomeMessage(AuthMe.getInstance());
|
||||||
@ -587,6 +589,10 @@ public final class Settings extends YamlConfiguration {
|
|||||||
}
|
}
|
||||||
if (contains("Hooks.notifications"))
|
if (contains("Hooks.notifications"))
|
||||||
set("Hooks.notifications", null);
|
set("Hooks.notifications", null);
|
||||||
|
if (!contains("Email.generateImage")) {
|
||||||
|
set("Email.generateImage", true);
|
||||||
|
changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (changes) {
|
if (changes) {
|
||||||
plugin.getLogger().warning("Merge new Config Options - I'm not an error, please don't report me");
|
plugin.getLogger().warning("Merge new Config Options - I'm not an error, please don't report me");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user