Skip to content

Commit d2a1f49

Browse files
committed
Local chat incorrect behavior when ranged chat disabled fixed.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent 0da384b commit d2a1f49

File tree

1 file changed

+16
-14
lines changed
  • src/main/kotlin/com/mairwunnx/projectessentials/chat

1 file changed

+16
-14
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/chat/EntryPoint.kt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,24 @@ class EntryPoint : EssBase() {
274274
}
275275
}
276276

277-
if (!ChatUtils.isGlobalChat(event)) {
278-
val players = event.player.serverWorld.getEntitiesWithinAABB(
279-
event.player.entity.javaClass, AxisAlignedBB(
280-
event.player.posX - ChatModelUtils.chatModel.messaging.localChatRange / 2,
281-
event.player.posY - ChatModelUtils.chatModel.messaging.localChatRange / 2,
282-
event.player.posZ - ChatModelUtils.chatModel.messaging.localChatRange / 2,
283-
event.player.posX + ChatModelUtils.chatModel.messaging.localChatRange / 2,
284-
event.player.posY + ChatModelUtils.chatModel.messaging.localChatRange / 2,
285-
event.player.posZ + ChatModelUtils.chatModel.messaging.localChatRange / 2
277+
if (ChatModelUtils.chatModel.messaging.enableRangedChat) {
278+
if (!ChatUtils.isGlobalChat(event)) {
279+
val players = event.player.serverWorld.getEntitiesWithinAABB(
280+
event.player.entity.javaClass, AxisAlignedBB(
281+
event.player.posX - ChatModelUtils.chatModel.messaging.localChatRange / 2,
282+
event.player.posY - ChatModelUtils.chatModel.messaging.localChatRange / 2,
283+
event.player.posZ - ChatModelUtils.chatModel.messaging.localChatRange / 2,
284+
event.player.posX + ChatModelUtils.chatModel.messaging.localChatRange / 2,
285+
event.player.posY + ChatModelUtils.chatModel.messaging.localChatRange / 2,
286+
event.player.posZ + ChatModelUtils.chatModel.messaging.localChatRange / 2
287+
)
286288
)
287-
)
288-
players.forEach {
289-
it.sendMessage(event.component)
289+
players.forEach {
290+
it.sendMessage(event.component)
291+
}
292+
event.isCanceled = true
293+
return
290294
}
291-
event.isCanceled = true
292-
return
293295
}
294296
}
295297
}

0 commit comments

Comments
 (0)