mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-03 14:38:56 +00:00
v0.31:
- Update for the Bukkit move to AsyncPlayerChatEvent. - Fix in onPlayerCommandPreprocess for an empty message error.
This commit is contained in:
1 parent
7b32543574
commit
b173b7507a
6 files changed
+17
-13
No files matched your search
+4
-1
@@ -122,4 +122,7 @@ v0.29:
|
||||
- Fix a duplicating chat issue when relaying via craftIRC.
|
||||
- Reload TownyChat if we detect craftIRC perform a reload (no more unregistered tags after reloading craftIRC).
|
||||
v0.30:
|
||||
- Stop adding extra logs now that chat is being passed back to bukkit.
|
||||
- Stop adding extra logs now that chat is being passed back to bukkit.
|
||||
v0.31:
|
||||
- Update for the Bukkit move to AsyncPlayerChatEvent.
|
||||
- Fix in onPlayerCommandPreprocess for an empty message error.
|
||||
@@ -2,7 +2,7 @@ package com.palmergames.bukkit.TownyChat.channels;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
public abstract class Channel {
|
||||
|
||||
@@ -116,6 +116,6 @@ public abstract class Channel {
|
||||
/**
|
||||
* @param event the event to process
|
||||
*/
|
||||
public abstract void chatProcess(PlayerChatEvent event);
|
||||
public abstract void chatProcess(AsyncPlayerChatEvent event);
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.dynmap.DynmapAPI;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
@@ -33,7 +33,7 @@ public class StandardChannel extends Channel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chatProcess(PlayerChatEvent event) {
|
||||
public void chatProcess(AsyncPlayerChatEvent event) {
|
||||
|
||||
channelTypes exec = channelTypes.valueOf(getType().name());
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.palmergames.bukkit.TownyChat.listener;
|
||||
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
|
||||
public class LocalTownyChatEvent {
|
||||
private PlayerChatEvent event;
|
||||
private AsyncPlayerChatEvent event;
|
||||
private Resident resident;
|
||||
|
||||
public LocalTownyChatEvent(PlayerChatEvent event, Resident resident) {
|
||||
public LocalTownyChatEvent(AsyncPlayerChatEvent event, Resident resident) {
|
||||
this.event = event;
|
||||
this.resident = resident;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class LocalTownyChatEvent {
|
||||
*
|
||||
* @return the PlayerChatEvent
|
||||
*/
|
||||
public PlayerChatEvent getEvent() {
|
||||
public AsyncPlayerChatEvent getEvent() {
|
||||
return event;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
|
||||
import com.palmergames.bukkit.towny.TownyMessaging;
|
||||
@@ -53,7 +53,6 @@ public class TownyChatPlayerListener implements Listener {
|
||||
Channel channel = plugin.getChannelsHandler().getChannel(player, command);
|
||||
if (channel != null) {
|
||||
|
||||
event.setMessage(message);
|
||||
|
||||
/*
|
||||
* If there is no message toggle the chat mode.
|
||||
@@ -68,6 +67,8 @@ public class TownyChatPlayerListener implements Listener {
|
||||
/*
|
||||
* Flag this as directed chat and trigger a player chat event
|
||||
*/
|
||||
event.setMessage(message);
|
||||
|
||||
directedChat.put(player, command);
|
||||
player.chat(message);
|
||||
}
|
||||
@@ -77,7 +78,7 @@ public class TownyChatPlayerListener implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerChat(PlayerChatEvent event) {
|
||||
public void onPlayerChat(AsyncPlayerChatEvent event) {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
name: TownyChat
|
||||
main: com.palmergames.bukkit.TownyChat.Chat
|
||||
version: 0.30
|
||||
version: 0.31
|
||||
author: ElgarL, Shade, phrstbrn
|
||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||
description: >
|
||||
|
||||
Reference in new issue
Block a user