mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-23 02:19:05 +00:00
Merged in hardolaf/venturechat (pull request #6)
Update VentureChat to have distance chat take into account the Y dimension as well.
This commit is contained in:
commit
88b348d12d
@ -212,7 +212,7 @@ public class Chwho extends MineverseCommand {
|
||||
locreceip = p2.getLocation();
|
||||
if(locreceip.getWorld() == p1.getWorld()) {
|
||||
diff = locreceip.subtract(locsender);
|
||||
if(Math.abs(diff.getX()) > chDistance || Math.abs(diff.getZ()) > chDistance) {
|
||||
if(Math.abs(diff.getX()) > chDistance || Math.abs(diff.getZ()) > chDistance || Math.abs(diff.getY()) > chDistance) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class ChatListener implements Listener {
|
||||
}
|
||||
|
||||
// this event isn't always asynchronous even though the event's name starts with "Async"
|
||||
// blame md_5 for that one (•_•)
|
||||
// blame md_5 for that one (<EFBFBD>_<EFBFBD>)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent event) {
|
||||
event.setCancelled(true);
|
||||
@ -422,7 +422,7 @@ public class ChatListener implements Listener {
|
||||
locreceip = p.getPlayer().getLocation();
|
||||
if(locreceip.getWorld() == mcp.getPlayer().getWorld()) {
|
||||
diff = locreceip.subtract(locsender);
|
||||
if(Math.abs(diff.getX()) > chDistance || Math.abs(diff.getZ()) > chDistance) {
|
||||
if(Math.abs(diff.getX()) > chDistance || Math.abs(diff.getZ()) > chDistance || Math.abs(diff.getY()) > chDistance) {
|
||||
recipients.remove(p.getPlayer());
|
||||
recipientCount--;
|
||||
continue;
|
||||
@ -464,7 +464,7 @@ public class ChatListener implements Listener {
|
||||
|
||||
String globalJSON = Format.convertToJson(mcp, format, chat);
|
||||
String consoleChat = format + chat;
|
||||
String message = consoleChat.replaceAll("(§([a-z0-9]))", "");
|
||||
String message = consoleChat.replaceAll("(<EFBFBD>([a-z0-9]))", "");
|
||||
int hash = message.hashCode();
|
||||
|
||||
//Create VentureChatEvent
|
||||
|
Loading…
x
Reference in New Issue
Block a user