Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Remove fast regen and fix obs playing sounds when attacking
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablete1234 committed Mar 25, 2016
1 parent 19d5a70 commit c1232cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.PlayerAttackEntityEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
Expand Down Expand Up @@ -514,6 +515,13 @@ public void onEntityAttack(EntityDamageByEntityEvent event) {
}
}

@EventHandler
public void onEntityAttack(PlayerAttackEntityEvent event) {
if (testObserver(event.getPlayer())) {
event.setCancelled(true);
}
}

@EventHandler
public void onVehicleDamage(VehicleDamageEvent event) {
if (event.getAttacker() instanceof Player && testObserver((Player) event.getAttacker())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void unload() {
public void onMatchStartEvent(MatchStartEvent event) {
for (TeamModule team : Teams.getTeams()) {
Team scoreboardTeam = scoreboard.getTeam(team.getId());
if (!team.isObserver()) scoreboardTeam.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.ALWAYS);
if (!team.isObserver()) scoreboardTeam.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/in/twizmwaz/cardinal/util/Players.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public static void resetPlayer(Player player, boolean heal) {
player.setWalkSpeed(0.2F);
player.setFlySpeed(0.1F);

player.setFastNaturalRegeneration(false);

for (Attribute attribute : Attribute.values()) {
if (player.getAttribute(attribute) == null) continue;
for (AttributeModifier modifier : player.getAttribute(attribute).getModifiers()) {
Expand Down

0 comments on commit c1232cc

Please sign in to comment.