mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Update
- Makes removing elements remove avatar from the player
This commit is contained in:
parent
3a544c6537
commit
01f2748cb8
1 changed files with 24 additions and 16 deletions
|
@ -58,6 +58,7 @@ import com.projectkorra.projectkorra.earthbending.Tremorsense;
|
|||
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
||||
import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent;
|
||||
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent;
|
||||
import com.projectkorra.projectkorra.event.PlayerChangeElementEvent.Result;
|
||||
import com.projectkorra.projectkorra.firebending.Blaze;
|
||||
import com.projectkorra.projectkorra.firebending.BlazeArc;
|
||||
import com.projectkorra.projectkorra.firebending.BlazeRing;
|
||||
|
@ -96,6 +97,7 @@ import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
|||
import com.projectkorra.projectkorra.waterbending.WaterPassive;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterSpoutWave;
|
||||
import com.projectkorra.rpg.RPGMethods;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
|
@ -315,6 +317,8 @@ public class PKListener implements Listener {
|
|||
public void onElementChange(PlayerChangeElementEvent event) {
|
||||
Player player = event.getTarget();
|
||||
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
|
||||
boolean chatEnabled = ConfigManager.languageConfig.get().getBoolean("Chat.Enable");
|
||||
if (chatEnabled) {
|
||||
Element element = event.getElement();
|
||||
String prefix = "";
|
||||
|
||||
|
@ -322,7 +326,7 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
boolean chatEnabled = ConfigManager.languageConfig.get().getBoolean("Chat.Enable");
|
||||
|
||||
if (bPlayer.getElements().size() > 1) {
|
||||
prefix = Element.AVATAR.getPrefix();
|
||||
} else if (element != null){
|
||||
|
@ -330,11 +334,15 @@ public class PKListener implements Listener {
|
|||
} else {
|
||||
prefix = ChatColor.WHITE + "[Nonbender] ";
|
||||
}
|
||||
|
||||
if (chatEnabled) {
|
||||
player.setDisplayName(player.getName());
|
||||
player.setDisplayName(prefix + ChatColor.RESET + player.getDisplayName());
|
||||
}
|
||||
|
||||
if (event.getResult() == Result.REMOVE) {
|
||||
if (GeneralMethods.hasRPG()) {
|
||||
RPGMethods.revokeAvatar(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||
|
|
Loading…
Reference in a new issue