mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
warp player when move to water portal
This commit is contained in:
parent
c44ec86f20
commit
0c4ffbe2cf
@ -366,6 +366,8 @@ public class PlayerListener implements Listener {
|
|||||||
dportal.teleport(player);
|
dportal.teleport(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onTeleport(PlayerTeleportEvent event) {
|
public void onTeleport(PlayerTeleportEvent event) {
|
||||||
@ -581,6 +583,13 @@ public class PlayerListener implements Listener {
|
|||||||
public void onMove(PlayerMoveEvent event) {
|
public void onMove(PlayerMoveEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
DLootInventory inventory = DLootInventory.getByPlayer(player);
|
DLootInventory inventory = DLootInventory.getByPlayer(player);
|
||||||
|
|
||||||
|
DPortal dportal = DPortal.getByLocation(player.getLocation());
|
||||||
|
|
||||||
|
if (plugin.getMainConfig().useWaterPortal() && dportal != null && DGroup.getByPlayer(player) != null){
|
||||||
|
dportal.teleport(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (inventory == null) {
|
if (inventory == null) {
|
||||||
return;
|
return;
|
||||||
@ -596,6 +605,7 @@ public class PlayerListener implements Listener {
|
|||||||
inventory.setInventoryView(inventory.getPlayer().openInventory(inventory.getInventory()));
|
inventory.setInventoryView(inventory.getPlayer().openInventory(inventory.getInventory()));
|
||||||
inventory.setTime(System.currentTimeMillis());
|
inventory.setTime(System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user