-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nextgen/1.20.4
- Loading branch information
Showing
45 changed files
with
846 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/top/infsky/cheatdetector/commands/SurroundCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package top.infsky.cheatdetector.commands; | ||
|
||
import com.mojang.brigadier.context.CommandContext; | ||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.world.entity.player.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import top.infsky.cheatdetector.CheatDetector; | ||
import top.infsky.cheatdetector.config.Advanced3Config; | ||
import top.infsky.cheatdetector.utils.LogUtils; | ||
import top.infsky.cheatdetector.utils.TRPlayer; | ||
|
||
public class SurroundCommand { | ||
public static int execute(@NotNull CommandContext<FabricClientCommandSource> context) { | ||
String name; | ||
|
||
try { | ||
name = context.getArgument("name", String.class); | ||
} catch (IllegalArgumentException e) { | ||
if (TRPlayer.CLIENT.crosshairPickEntity instanceof Player target) { | ||
name = target.getName().getString(); | ||
} else { | ||
name = Advanced3Config.surroundName; | ||
} | ||
} | ||
|
||
if (CheatDetector.CONFIG_HANDLER.configManager.setValue("surroundName", name)) { | ||
LogUtils.custom(ChatFormatting.GREEN + "已设置: " + ChatFormatting.WHITE + name); | ||
return 1; | ||
} else { | ||
return -1; | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/top/infsky/cheatdetector/compat/MinihudHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package top.infsky.cheatdetector.compat; | ||
|
||
import fi.dy.masa.minihud.util.DataStorage; | ||
|
||
public class MinihudHelper { | ||
public static double getServerTPS() { | ||
return DataStorage.getInstance().getServerTPS(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.