mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 07:53:22 +02:00
reload files on /reload
This commit is contained in:
parent
2bffecf784
commit
512cfcacb4
2 changed files with 19 additions and 0 deletions
18
src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java
Normal file
18
src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java
Normal file
|
@ -0,0 +1,18 @@
|
|||
package one.oth3r.sit.mixin;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.minecraft.server.command.ReloadCommand;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import one.oth3r.sit.file.FileData;
|
||||
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(ReloadCommand.class)
|
||||
public class ReloadCommandMixin {
|
||||
@Inject(at = @At("TAIL"), method = "register")
|
||||
private static void register(CommandDispatcher<ServerCommandSource> dispatcher, CallbackInfo ci) {
|
||||
FileData.loadFiles();
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@
|
|||
"package": "one.oth3r.sit.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"ReloadCommandMixin",
|
||||
"TextDisplayDismountMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue