Skip to content

Commit

Permalink
🐛 修复由 opPlayerNoCheatExtra 引起的游戏崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Nov 11, 2023
1 parent 37de74a commit 451e634
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ private static void executeGet(CallbackInfoReturnable<Integer> cir) {
}
}

//#if MC<11900
@Inject(method = "executeInsert", at = @At("HEAD"))
private static void executeInsert(CallbackInfoReturnable<Integer> cir) {
if (AmsServerSettings.opPlayerNoCheatExtra) {
cir.cancel();
}
}
//#endif

@Inject(method = "executeMerge", at = @At("HEAD"))
private static void executeMerge(CallbackInfoReturnable<Integer> cir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@

@Mixin(EffectCommand.class)
public abstract class EffectCommandMixin {
//#if MC<11900
@Inject(method = "executeClear(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/entity/effect/StatusEffect;)I", at = @At("HEAD"))
//#else
//$$ @Inject(method = "executeClear(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/registry/entry/RegistryEntry;)I", at = @At("HEAD"))
//#endif
private static void executeClear1(CallbackInfoReturnable<Integer> cir) {
if (AmsServerSettings.opPlayerNoCheatExtra) {
cir.cancel();
Expand Down

0 comments on commit 451e634

Please sign in to comment.