Compatibility with DungeonsXL build 939 and up

This commit is contained in:
PikaMug 2020-04-27 05:18:51 -04:00
parent a4914d99b4
commit 83b391315f

View File

@ -17,34 +17,34 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import de.erethon.dungeonsxl.event.dgroup.DGroupCreateEvent; import de.erethon.dungeonsxl.api.event.group.GroupCreateEvent;
import de.erethon.dungeonsxl.event.dgroup.DGroupDisbandEvent; import de.erethon.dungeonsxl.api.event.group.GroupDisbandEvent;
import de.erethon.dungeonsxl.event.dplayer.DPlayerJoinDGroupEvent; import de.erethon.dungeonsxl.api.event.group.GroupPlayerJoinEvent;
import de.erethon.dungeonsxl.event.dplayer.DPlayerLeaveDGroupEvent; import de.erethon.dungeonsxl.api.event.group.GroupPlayerLeaveEvent;
import me.blackvein.quests.util.Lang; import me.blackvein.quests.util.Lang;
public class DungeonsListener implements Listener { public class DungeonsListener implements Listener {
@EventHandler @EventHandler
public void onGroupCreate(DGroupCreateEvent event) { public void onGroupCreate(GroupCreateEvent event) {
if (Lang.get("questDungeonsCreate").length() > 0) { if (Lang.get("questDungeonsCreate").length() > 0) {
event.getCreator().sendMessage(ChatColor.YELLOW + Lang.get("questDungeonsCreate")); event.getCreator().sendMessage(ChatColor.YELLOW + Lang.get("questDungeonsCreate"));
} }
} }
@EventHandler @EventHandler
public void onGroupDisbandEvent(DGroupDisbandEvent event) { public void onGroupDisbandEvent(GroupDisbandEvent event) {
if (Lang.get("questDungeonsDisband").length() > 0) { if (Lang.get("questDungeonsDisband").length() > 0) {
event.getDisbander().sendMessage(ChatColor.RED + Lang.get("questDungeonsDisband")); event.getDisbander().sendMessage(ChatColor.RED + Lang.get("questDungeonsDisband"));
} }
} }
@EventHandler @EventHandler
public void onPlayerJoinEvent(DPlayerJoinDGroupEvent event) { public void onPlayerJoinEvent(GroupPlayerJoinEvent event) {
if (event.getDGroup() != null && event.getDPlayer() != null) { if (event.getGroup() != null && event.getPlayer() != null) {
Player i = event.getDGroup().getLeader(); Player i = event.getGroup().getLeader();
Player p = event.getDPlayer().getPlayer(); Player p = event.getPlayer().getPlayer();
if (i != null && p != null) { if (i != null && p != null) {
if (Lang.get("questDungeonsInvite").length() > 0) { if (Lang.get("questDungeonsInvite").length() > 0) {
i.sendMessage(ChatColor.GREEN + Lang.get(i, "questDungeonsInvite") i.sendMessage(ChatColor.GREEN + Lang.get(i, "questDungeonsInvite")
@ -58,10 +58,10 @@ public class DungeonsListener implements Listener {
} }
@EventHandler @EventHandler
public void onPlayerLeaveEvent(DPlayerLeaveDGroupEvent event) { public void onPlayerLeaveEvent(GroupPlayerLeaveEvent event) {
if (event.getDGroup() != null && event.getDPlayer() != null) { if (event.getGroup() != null && event.getPlayer() != null) {
Player k = event.getDGroup().getLeader(); Player k = event.getGroup().getLeader();
Player p = event.getDPlayer().getPlayer(); Player p = event.getPlayer().getPlayer();
if (k != null && p != null) { if (k != null && p != null) {
if (Lang.get("questDungeonsKicked").length() > 0) { if (Lang.get("questDungeonsKicked").length() > 0) {
k.sendMessage(ChatColor.RED + Lang.get(k, "questDungeonsKicked").replace("<player>", k.getName())); k.sendMessage(ChatColor.RED + Lang.get(k, "questDungeonsKicked").replace("<player>", k.getName()));