mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
add ReloadCommandMixin
This commit is contained in:
parent
f870dab568
commit
b4bee3a65d
@ -0,0 +1,25 @@
|
|||||||
|
package com.dfsek.terra.fabric.mixin;
|
||||||
|
|
||||||
|
import com.dfsek.terra.fabric.FabricEntryPoint;
|
||||||
|
|
||||||
|
import net.minecraft.server.command.ReloadCommand;
|
||||||
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import org.checkerframework.checker.units.qual.A;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
|
||||||
|
@Mixin(ReloadCommand.class)
|
||||||
|
public class ReloadCommandMixin {
|
||||||
|
@Inject(method = "tryReloadDataPacks", at = @At("HEAD"))
|
||||||
|
private static void inject(Collection<String> dataPacks, ServerCommandSource source, CallbackInfo ci) {
|
||||||
|
source.sendFeedback(Text.literal("Reloading Terra..."), true);
|
||||||
|
FabricEntryPoint.getPlatform().reload();
|
||||||
|
source.sendFeedback(Text.literal("Done."), true);
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
"package": "com.dfsek.terra.fabric.mixin",
|
"package": "com.dfsek.terra.fabric.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
"ReloadCommandMixin",
|
||||||
"access.MobSpawnerLogicAccessor",
|
"access.MobSpawnerLogicAccessor",
|
||||||
"access.StateAccessor",
|
"access.StateAccessor",
|
||||||
"access.StructureAccessorAccessor",
|
"access.StructureAccessorAccessor",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user