Skip to content

Commit

Permalink
fix: 修复生命显示穿墙的bug 以及生命显示关不掉的bug
Browse files Browse the repository at this point in the history
删除cheaterdetector
close #27
  • Loading branch information
SuperSkidder committed Jul 5, 2024
1 parent 3ab61d6 commit 16b5b81
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 158 deletions.
4 changes: 2 additions & 2 deletions shared/java/top/fpsmaster/features/impl/utility/ChatBot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import top.fpsmaster.features.settings.impl.BooleanSetting
import top.fpsmaster.features.settings.impl.ModeSetting
import top.fpsmaster.features.settings.impl.NumberSetting
import top.fpsmaster.features.settings.impl.TextSetting
import top.fpsmaster.ui.notification.addNotification
import top.fpsmaster.utils.Utility
import top.fpsmaster.utils.math.MathTimer
import top.fpsmaster.utils.thirdparty.openai.OpenAi
import top.fpsmaster.utils.thirdparty.openai.requestClientAI
import top.fpsmaster.interfaces.ProviderManager
import top.fpsmaster.ui.notification.NotificationManager
import java.util.regex.Pattern
import kotlin.math.min

Expand Down Expand Up @@ -68,7 +68,7 @@ class ChatBot : Module("ChatBot", Category.Utility) {
val matcher = pattern.matcher(formattedText)
if (matcher.find()) {
val openAi: OpenAi
addNotification("ChatGPT", formattedText, 1f)
NotificationManager.addNotification("ChatGPT", formattedText, 1f)
val s: String
val userRole = JsonObject()
userRole.addProperty("role", "user")
Expand Down
143 changes: 0 additions & 143 deletions shared/java/top/fpsmaster/features/impl/utility/CheatersDetector.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import top.fpsmaster.features.settings.impl.ModeSetting

class LevelTag : Module("Nametags", Category.Utility) {
init {
addSettings(showSelf)
addSettings(showSelf, health)
}

override fun onEnable() {
Expand Down
6 changes: 3 additions & 3 deletions shared/java/top/fpsmaster/features/manager/Module.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import top.fpsmaster.event.EventDispatcher.registerListener
import top.fpsmaster.event.EventDispatcher.unregisterListener
import top.fpsmaster.features.settings.Setting
import top.fpsmaster.features.settings.impl.*
import top.fpsmaster.ui.notification.addNotification
import top.fpsmaster.interfaces.ProviderManager
import top.fpsmaster.ui.notification.NotificationManager
import java.util.*

open class Module {
Expand Down Expand Up @@ -76,7 +76,7 @@ open class Module {
if (state) {
onEnable()
if (ProviderManager.mcProvider.getPlayer() != null)
addNotification(
NotificationManager.addNotification(
FPSMaster.i18n["notification.module.enable"],
FPSMaster.i18n["notification.module.enable.desc"].replace(
"%s",
Expand All @@ -87,7 +87,7 @@ open class Module {
} else {
onDisable()
if (ProviderManager.mcProvider.getPlayer() != null)
addNotification(
NotificationManager.addNotification(
FPSMaster.i18n["notification.module.disable"],
FPSMaster.i18n["notification.module.disable.desc"].replace(
"%s",
Expand Down
3 changes: 1 addition & 2 deletions shared/java/top/fpsmaster/features/manager/ModuleManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ModuleManager {
}

// 提醒一下lowiq怎么组队
if (ProviderManager.mcProvider.getServerAddress()?.contains("hytpc") == true) {
if (ProviderManager.mcProvider.getPlayer() != null && ProviderManager.mcProvider.getServerAddress()?.contains("hytpc") == true) {
if (e.key == Keyboard.KEY_K) {
Utility.sendClientMessage("花雨庭组队提示:")
Utility.sendClientMessage("创建队伍并邀请玩家:/组队 玩家名")
Expand Down Expand Up @@ -105,7 +105,6 @@ class ModuleManager {
modules.add(CoordsDisplay())
modules.add(ModsList())
modules.add(ClientCommand())
modules.add(CheatersDetector())
modules.add(MiniMap())

if (ProviderManager.constants.getVersion() == "1.12.2") {
Expand Down
2 changes: 0 additions & 2 deletions shared/java/top/fpsmaster/modules/client/GlobalTextFilter.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package top.fpsmaster.modules.client

import top.fpsmaster.features.impl.utility.CheatersDetector
import top.fpsmaster.features.impl.utility.IRC
import top.fpsmaster.features.impl.utility.NameProtect
import top.fpsmaster.wrapper.TextFormattingProvider
Expand All @@ -27,7 +26,6 @@ object GlobalTextFilter {
result.replace(start, start + s.key.length, replacement)
}

result = StringBuilder(CheatersDetector.filter(result.toString()))
result = StringBuilder(NameProtect.filter(result.toString()))
return result.toString()
}
Expand Down
8 changes: 4 additions & 4 deletions shared/java/top/fpsmaster/modules/music/PlayList.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package top.fpsmaster.modules.music

import top.fpsmaster.FPSMaster
import top.fpsmaster.ui.notification.addNotification
import top.fpsmaster.ui.notification.NotificationManager
import java.util.*

class PlayList {
Expand All @@ -16,7 +16,7 @@ class PlayList {


fun play() {
addNotification(
NotificationManager.addNotification(
FPSMaster.i18n["notification.music"],
FPSMaster.i18n["notification.music.next"].replace(
"%s",
Expand Down Expand Up @@ -60,7 +60,7 @@ class PlayList {
current = 0
}
}
addNotification(
NotificationManager.addNotification(
FPSMaster.i18n["notification.music"],
FPSMaster.i18n["notification.music.next"].replace(
"%s",
Expand All @@ -83,7 +83,7 @@ class PlayList {
current = musics.size - 1
}
}
addNotification(
NotificationManager.addNotification(
FPSMaster.i18n["notification.music"],
FPSMaster.i18n["notification.music.next"].replace(
"%s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void doRender(Entity entity, double x, double y, double z, float entityYa
protected void renderLivingLabel(Entity entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) {
if (LevelTag.health.getValue()) {
double d = entityIn.getDistanceSqToEntity(this.renderManager.livingPlayer);
if (!(d > (double) (maxDistance * maxDistance))) {
if (d < 20) {
float f = 1.6F;
float g = 0.016666668F * f;
GlStateManager.pushMatrix();
Expand Down

0 comments on commit 16b5b81

Please sign in to comment.