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:
Joseph Warner 2020-06-22 23:09:49 +00:00 committed by Aust1n46
commit 88b348d12d
2 changed files with 8 additions and 8 deletions

View File

@ -212,7 +212,7 @@ public class Chwho extends MineverseCommand {
locreceip = p2.getLocation(); locreceip = p2.getLocation();
if(locreceip.getWorld() == p1.getWorld()) { if(locreceip.getWorld() == p1.getWorld()) {
diff = locreceip.subtract(locsender); 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; return false;
} }
} }

View File

@ -43,7 +43,7 @@ public class ChatListener implements Listener {
} }
// this event isn't always asynchronous even though the event's name starts with "Async" // 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) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent event) { public void onAsyncPlayerChatEvent(AsyncPlayerChatEvent event) {
event.setCancelled(true); event.setCancelled(true);
@ -422,7 +422,7 @@ public class ChatListener implements Listener {
locreceip = p.getPlayer().getLocation(); locreceip = p.getPlayer().getLocation();
if(locreceip.getWorld() == mcp.getPlayer().getWorld()) { if(locreceip.getWorld() == mcp.getPlayer().getWorld()) {
diff = locreceip.subtract(locsender); 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()); recipients.remove(p.getPlayer());
recipientCount--; recipientCount--;
continue; continue;
@ -464,7 +464,7 @@ public class ChatListener implements Listener {
String globalJSON = Format.convertToJson(mcp, format, chat); String globalJSON = Format.convertToJson(mcp, format, chat);
String consoleChat = 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(); int hash = message.hashCode();
//Create VentureChatEvent //Create VentureChatEvent