Migrate Carpet Mixin names to mojang mappings
This commit is contained in:
1 parent
2c3871b90e
commit
a547677597
154 files changed
+422
-501
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.SystemReport;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import carpet.CarpetServer;
|
||||
|
||||
@Mixin(SystemReport.class)
|
||||
public abstract class SystemReport_addScarpetAppsMixin
|
||||
{
|
||||
@Shadow public abstract void setDetail(String name, Supplier<String> valueSupplier);
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void fillSystemDetails(CallbackInfo info) {
|
||||
if (CarpetServer.scriptServer == null || CarpetServer.scriptServer.modules.isEmpty()) return;
|
||||
setDetail("Loaded Scarpet Apps", () -> {
|
||||
return CarpetServer.scriptServer.modules.keySet().stream().collect(Collectors.joining("\n\t\t", "\n\t\t", ""));
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user