mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-02 17:00:19 +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 attackedDGroup = null;
|
||||
|
||||
if (attackerEntity instanceof LivingEntity && attackedEntity instanceof LivingEntity) {
|
||||
if (attackerEntity instanceof Player && attackedEntity instanceof Player) {
|
||||
attackerPlayer = (Player) attackerEntity;
|
||||
attackedPlayer = (Player) attackedEntity;
|
||||
if (!(attackerEntity instanceof LivingEntity) || !(attackedEntity instanceof LivingEntity)) {
|
||||
return;
|
||||
}
|
||||
|
||||
attackerDGroup = DGroup.getByPlayer(attackerPlayer);
|
||||
attackedDGroup = DGroup.getByPlayer(attackedPlayer);
|
||||
if (attackerEntity instanceof Player && attackedEntity instanceof Player) {
|
||||
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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check Dogs
|
||||
if (attackerEntity instanceof Player || attackedEntity instanceof Player) {
|
||||
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);
|
||||
if (attackerEntity == dPlayer.getWolf() || attackedEntity == dPlayer.getWolf()) {
|
||||
event.setCancelled(true);
|
||||
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
|
||||
|
@ -698,6 +698,8 @@ public class DGamePlayer extends DInstancePlayer {
|
||||
respawn();
|
||||
}
|
||||
}
|
||||
|
||||
game.setStarted(true);
|
||||
}
|
||||
|
||||
public void respawn() {
|
||||
|
Loading…
Reference in New Issue
Block a user