geforkt von Mirrors/Paper
Implements the ability to customise and disable Player death messages.
By: Rigby <rigby@onarandombox.com>
Dieser Commit ist enthalten in:
Ursprung
e66d7aba10
Commit
039898c280
@ -1,6 +1,7 @@
|
|||||||
package org.bukkit.event.entity;
|
package org.bukkit.event.entity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@ -9,10 +10,30 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
*/
|
*/
|
||||||
public class PlayerDeathEvent extends EntityDeathEvent {
|
public class PlayerDeathEvent extends EntityDeathEvent {
|
||||||
private int newExp = 0;
|
private int newExp = 0;
|
||||||
|
private String deathMessage = "";
|
||||||
|
|
||||||
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp) {
|
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) {
|
||||||
super(player, drops, droppedExp);
|
super(player, drops, droppedExp);
|
||||||
this.newExp = newExp;
|
this.newExp = newExp;
|
||||||
|
this.deathMessage = deathMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the death message that will appear to everyone on the server.
|
||||||
|
*
|
||||||
|
* @param deathMessage Message to appear to other players on the server.
|
||||||
|
*/
|
||||||
|
public void setDeathMessage(String deathMessage) {
|
||||||
|
this.deathMessage = deathMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the death message that will appear to everyone on the server.
|
||||||
|
*
|
||||||
|
* @return Message to appear to other players on the server.
|
||||||
|
*/
|
||||||
|
public String getDeathMessage() {
|
||||||
|
return this.deathMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren