Skip to content

Commit

Permalink
Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zelytra committed Sep 12, 2021
1 parent 3d5d4cb commit f441305
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void onCustomDeath(EntityDamageEvent e) {

}
if (e.getCause() == EntityDamageEvent.DamageCause.FALL) { //Kill by falling
if ((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent) {
if ((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) e.getEntity().getLastDamageCause()).getDamager() instanceof Player) {
Player killer = (Player) ((EntityDamageByEntityEvent) e.getEntity().getLastDamageCause()).getDamager();
killByAMino = daedalus.getGameManager().getFactionManager().getFactionOf(killer).getGodsEnum() == GodsEnum.MINOTAURE; //Tuer par un mino
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void deathFX(EntityDamageEvent e) {
return;

} else if (e.getCause() == EntityDamageEvent.DamageCause.FALL) {
if (!((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent)) {
if (!((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent)&& ((EntityDamageByEntityEvent) e.getEntity().getLastDamageCause()).getDamager() instanceof Player) {
Bukkit.broadcastMessage(faction.getType().getPrefix() + e.getEntity().getName() + GameSettings.LANG.textOf("death.definitive"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onPartielDeath(PartielDeathEvent e) {

player.setSaturation(20.0f);

player.getWorld().spawn(player.getLocation(), ExperienceOrb.class).setExperience((int) (player.getExp()/4.0));
player.getWorld().spawn(player.getLocation(), ExperienceOrb.class).setExperience((int) (player.getExp() / 4.0));
player.setLevel(0);

player.getInventory().clear();
Expand Down Expand Up @@ -139,7 +139,7 @@ private void respawnFX(EntityDamageEvent e) {
return;

} else if (e.getCause() == EntityDamageEvent.DamageCause.FALL) {
if (!((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent)) {
if (!((e.getEntity().getLastDamageCause()) instanceof EntityDamageByEntityEvent) && ((EntityDamageByEntityEvent) e.getEntity().getLastDamageCause()).getDamager() instanceof Player) {
Bukkit.broadcastMessage(faction.getType().getPrefix() + e.getEntity().getName() + GameSettings.LANG.textOf("death.default"));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void onItemMove(InventoryClickEvent e) {

if (e.getWhoClicked().getGameMode() != GameMode.SURVIVAL) return;

if (e.getWhoClicked().getOpenInventory().getType() == InventoryType.CRAFTING) return;
if (e.getWhoClicked().getOpenInventory().getType() == InventoryType.CRAFTING || e.getWhoClicked().getOpenInventory().getType() == InventoryType.ANVIL) return;

if (e.getCurrentItem() == null) return;

Expand Down

0 comments on commit f441305

Please sign in to comment.