forked from MCTown/DimensionalThreading
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e35f6a
commit 841cdce
Showing
3 changed files
with
39 additions
and
16 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
20 changes: 20 additions & 0 deletions
20
src/main/java/wearblackallday/dimthread/mixin/PerfCommandMixin.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,20 @@ | ||
package wearblackallday.dimthread.mixin; | ||
|
||
import com.mojang.brigadier.CommandDispatcher; | ||
import net.minecraft.server.command.ServerCommandSource; | ||
import net.minecraft.server.dedicated.command.PerfCommand; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(PerfCommand.class) | ||
public abstract class PerfCommandMixin { | ||
/** | ||
* Remove /perf because it's not thread-safe | ||
*/ | ||
@Inject(method = "register", at = @At("HEAD"), cancellable = true) | ||
private static void removePerfCommand(CommandDispatcher<ServerCommandSource> dispatcher, CallbackInfo ci) { | ||
ci.cancel(); | ||
} | ||
} |
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