Skip to content

Commit

Permalink
fix: clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagggpixel committed Jun 20, 2024
1 parent b3ab3e1 commit 3d2b847
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/plugily/projects/murdermystery/arena/Arena.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class Arena extends PluginArena {
private boolean hideChances;
private boolean goldVisuals = false;
private final Map<CharacterType, Player> gameCharacters = new EnumMap<>(CharacterType.class);
private MapRestorerManager mapRestorerManager;
private final MapRestorerManager mapRestorerManager;
private ArmorStandHologram bowHologram;

public Arena(String id) {
Expand Down Expand Up @@ -391,8 +391,8 @@ public void adjustContributorValue(Role role, IUser user, int number) {
user.adjustStatistic("CONTRIBUTION_" + role.name(), number);
}

private Map<IUser, Integer> murdererContributions = new HashMap<>();
private Map<IUser, Integer> detectiveContributions = new HashMap<>();
private final Map<IUser, Integer> murdererContributions = new HashMap<>();
private final Map<IUser, Integer> detectiveContributions = new HashMap<>();

public Map<IUser, Integer> getMurdererContributions() {
return murdererContributions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void onMurdererDamage(EntityDamageByEntityEvent e) {
plugin.getRewardsHandler().performReward(attacker, plugin.getRewardsHandler().getRewardType("KILL_DETECTIVE"));
}

XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation(), 50, 1);
XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation());
victim.damage(100.0);

IUser user = plugin.getUserManager().getUser(attacker);
Expand Down Expand Up @@ -308,11 +308,14 @@ public void onArrowDamage(EntityDamageByEntityEvent e) {
return;
}
Arena arena = plugin.getArenaRegistry().getArena(attacker);
if (arena == null) {
return;
}
//we need to set it before the victim die, because of hero character
if(Role.isRole(Role.MURDERER, userVictim)) {
arena.setCharacter(Arena.CharacterType.HERO, attacker);
}
XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation(), 50, 1);
XSound.ENTITY_PLAYER_DEATH.play(victim.getLocation());
victim.damage(100.0);


Expand Down

0 comments on commit 3d2b847

Please sign in to comment.