mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-28 21:11:16 +00:00
d
This commit is contained in:
@@ -45,6 +45,9 @@ public final class IrisFabricClient implements ClientModInitializer {
|
||||
KeyMappingHelper.registerKeyMapping(IrisClientKeybinds.OPEN_MAP);
|
||||
KeyMappingHelper.registerKeyMapping(IrisClientKeybinds.TOGGLE_WHAT);
|
||||
HudElementRegistry.addLast(IrisClient.HUD_ELEMENT_ID, (graphics, delta) -> IrisClientHud.render(graphics));
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> IrisClientKeybinds.pollToggle());
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
IrisClient.tick();
|
||||
IrisClientKeybinds.pollToggle();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+12
-7
@@ -20,17 +20,22 @@ package art.arcane.iris.fabric.mixin;
|
||||
|
||||
import art.arcane.iris.fabric.FabricForcedDatapackSources;
|
||||
import net.minecraft.server.packs.repository.PackRepository;
|
||||
import net.minecraft.server.packs.repository.RepositorySource;
|
||||
import net.minecraft.server.packs.repository.ServerPacksSource;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
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.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ServerPacksSource.class)
|
||||
public class ServerPacksSourceMixin {
|
||||
@Inject(method = "createPackRepository(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;)Lnet/minecraft/server/packs/repository/PackRepository;", at = @At("RETURN"))
|
||||
private static void iris$addForcedDatapackSource(LevelStorageSource.LevelStorageAccess storage, CallbackInfoReturnable<PackRepository> info) {
|
||||
FabricForcedDatapackSources.attach(info.getReturnValue());
|
||||
@Mixin(PackRepository.class)
|
||||
public class PackRepositoryMixin {
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void iris$addForcedDatapackSource(RepositorySource[] sources, CallbackInfo info) {
|
||||
for (RepositorySource source : sources) {
|
||||
if (source instanceof ServerPacksSource) {
|
||||
FabricForcedDatapackSources.attach((PackRepository) (Object) this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,14 @@
|
||||
"license": "GPL-3.0",
|
||||
"environment": "*",
|
||||
"accessWidener": "irisworldgen.accesswidener",
|
||||
"mixins": ["irisworldgen.mixins.json", "irisworldgen.entity.mixins.json"],
|
||||
"mixins": [
|
||||
"irisworldgen.mixins.json",
|
||||
"irisworldgen.entity.mixins.json",
|
||||
{
|
||||
"config": "irisworldgen.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
"entrypoints": {
|
||||
"main": ["art.arcane.iris.fabric.IrisFabricBootstrap"],
|
||||
"client": ["art.arcane.iris.fabric.IrisFabricClient"]
|
||||
|
||||
@@ -4,4 +4,3 @@ accessible field net/minecraft/server/MinecraftServer executor Ljava/util/concur
|
||||
accessible field net/minecraft/server/MinecraftServer storageSource Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;
|
||||
accessible field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
mutable field net/minecraft/server/packs/repository/PackRepository sources Ljava/util/Set;
|
||||
accessible field net/minecraft/core/MappedRegistry frozen Z
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"mixins": [
|
||||
"BlockItemMixin",
|
||||
"BlockMixin",
|
||||
"ServerPacksSourceMixin"
|
||||
"PackRepositoryMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user