fixed PlayerCommandPreprocessEvent inheritance

By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
Bukkit/Spigot 2011-03-28 17:15:41 -07:00
parent 7237d8aa07
commit 7e6d0bd531
2 changed files with 9 additions and 5 deletions

View File

@ -4,6 +4,7 @@ package org.bukkit.event.player;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@ -17,10 +18,13 @@ public class PlayerChatEvent extends PlayerEvent implements Cancellable {
private final Set<Player> recipients;
public PlayerChatEvent(final Player player, final String message) {
super(Type.PLAYER_CHAT, player);
this.message = message;
this(Type.PLAYER_CHAT, player, message);
}
protected PlayerChatEvent(final Type type, final Player player, final String message) {
super(type, player);
recipients = new HashSet<Player>(Arrays.asList(player.getServer().getOnlinePlayers()));
this.message = message;
}
/**

View File

@ -3,7 +3,7 @@ package org.bukkit.event.player;
import org.bukkit.entity.Player;
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
public PlayerCommandPreprocessEvent(Player player, String message) {
super(player, message);
public PlayerCommandPreprocessEvent(final Player player, final String message) {
super(Type.PLAYER_COMMAND_PREPROCESS, player, message);
}
}