diff --git a/build.gradle b/build.gradle index b59e30e..0cabda9 100644 --- a/build.gradle +++ b/build.gradle @@ -62,12 +62,10 @@ repositories { } loom { - splitEnvironmentSourceSets() - + accessWidenerPath = file("src/main/resources/megalib.accesswidener") mods { - "megalib" { - sourceSet sourceSets.main - sourceSet sourceSets.client + register("megalib") { + sourceSet(sourceSets.main) } } diff --git a/src/main/java/com/megadoxs/megalib/MegalibClient.java b/src/main/java/com/megadoxs/megalib/MegalibClient.java index 95fe7b4..486c753 100644 --- a/src/main/java/com/megadoxs/megalib/MegalibClient.java +++ b/src/main/java/com/megadoxs/megalib/MegalibClient.java @@ -1,7 +1,10 @@ package com.megadoxs.megalib; import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +@Environment(EnvType.CLIENT) public class MegalibClient implements ClientModInitializer { @Override public void onInitializeClient() { diff --git a/src/main/java/com/megadoxs/megalib/mixin/ClientPlayerEntityMixin.java b/src/main/java/com/megadoxs/megalib/mixin/ClientPlayerEntityMixin.java index f33ba65..1cafbfe 100644 --- a/src/main/java/com/megadoxs/megalib/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/com/megadoxs/megalib/mixin/ClientPlayerEntityMixin.java @@ -6,8 +6,11 @@ import com.mojang.authlib.GameProfile; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.AbstractClientPlayerEntity; +import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.world.ClientWorld; +import org.spongepowered.asm.mixin.Mixin; +@Mixin(ClientPlayerEntity.class) public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity implements UserInterfaceViewer { public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile) { super(world, profile); diff --git a/src/main/resources/megalib.accesswidener b/src/main/resources/megalib.accesswidener new file mode 100644 index 0000000..65936c0 --- /dev/null +++ b/src/main/resources/megalib.accesswidener @@ -0,0 +1,3 @@ +accessWidener v1 named + +accessible class net/minecraft/client/screen/Screen \ No newline at end of file