mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-25 03:55:22 +01:00
Fix games not marked as started
This commit is contained in:
parent
ff7e8dbf5f
commit
cf557a61e2
@ -170,52 +170,56 @@ public class EntityListener implements Listener {
|
|||||||
DGroup attackerDGroup = null;
|
DGroup attackerDGroup = null;
|
||||||
DGroup attackedDGroup = null;
|
DGroup attackedDGroup = null;
|
||||||
|
|
||||||
if (attackerEntity instanceof LivingEntity && attackedEntity instanceof LivingEntity) {
|
if (!(attackerEntity instanceof LivingEntity) || !(attackedEntity instanceof LivingEntity)) {
|
||||||
if (attackerEntity instanceof Player && attackedEntity instanceof Player) {
|
return;
|
||||||
attackerPlayer = (Player) attackerEntity;
|
}
|
||||||
attackedPlayer = (Player) attackedEntity;
|
|
||||||
|
|
||||||
attackerDGroup = DGroup.getByPlayer(attackerPlayer);
|
if (attackerEntity instanceof Player && attackedEntity instanceof Player) {
|
||||||
attackedDGroup = DGroup.getByPlayer(attackedPlayer);
|
attackerPlayer = (Player) attackerEntity;
|
||||||
|
attackedPlayer = (Player) attackedEntity;
|
||||||
|
|
||||||
if (!pvp) {
|
attackerDGroup = DGroup.getByPlayer(attackerPlayer);
|
||||||
|
attackedDGroup = DGroup.getByPlayer(attackedPlayer);
|
||||||
|
|
||||||
|
if (!pvp) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attackerDGroup != null && attackedDGroup != null) {
|
||||||
|
if (!friendlyFire && attackerDGroup.equals(attackedDGroup)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
return;
|
||||||
|
|
||||||
if (attackerDGroup != null && attackedDGroup != null) {
|
|
||||||
if (!friendlyFire && attackerDGroup.equals(attackedDGroup)) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check Dogs
|
|
||||||
if (attackerEntity instanceof Player || attackedEntity instanceof Player) {
|
|
||||||
for (DGamePlayer dPlayer : DGamePlayer.getByWorld(gameWorld.getWorld())) {
|
|
||||||
if (dPlayer.getWolf() != null) {
|
|
||||||
if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check Dogs
|
||||||
|
if (attackerEntity instanceof Player || attackedEntity instanceof Player) {
|
||||||
for (DGamePlayer dPlayer : DGamePlayer.getByWorld(gameWorld.getWorld())) {
|
for (DGamePlayer dPlayer : DGamePlayer.getByWorld(gameWorld.getWorld())) {
|
||||||
if (dPlayer.getWolf() != null) {
|
if (dPlayer.getWolf() != null) {
|
||||||
if (attackerEntity instanceof Player || attackedEntity instanceof Player) {
|
if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
||||||
if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
|
||||||
event.setCancelled(false);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (DGamePlayer dPlayer : DGamePlayer.getByWorld(gameWorld.getWorld())) {
|
||||||
|
if (dPlayer.getWolf() != null) {
|
||||||
|
if (attackerEntity instanceof Player || attackedEntity instanceof Player) {
|
||||||
|
if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
||||||
|
event.setCancelled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deny food in Lobby
|
// Deny food in Lobby
|
||||||
|
@ -698,6 +698,8 @@ public class DGamePlayer extends DInstancePlayer {
|
|||||||
respawn();
|
respawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
game.setStarted(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void respawn() {
|
public void respawn() {
|
||||||
|
Loading…
Reference in New Issue
Block a user