shedaniel / cloth-config

Client-Sided API for Minecraft 1.14
Other
194 stars 71 forks source link

Support translatable config options in server-only compilation #141

Closed haykam821 closed 2 years ago

haykam821 commented 2 years ago

When setting serverOnlyMinecraftJar() with Loom 0.11+, classes implementing Translatable fail to compile:

./common/src/main/java/io/github/haykam821/collectater/config/ParasiteRenderMode.java:5: error: cannot access ParentElement
public enum ParasiteRenderMode implements Translatable {
       ^
  class file for net.minecraft.client.gui.ParentElement not found
warning: unknown enum constant Env.CLIENT
  reason: class file for com.demonwav.mcdev.annotations.Env not found
./common/src/main/java/io/github/haykam821/collectater/config/ParasiteRenderMode.java:18: error: method does not override or implement a method from a supertype
        @Override
        ^
shedaniel commented 2 years ago

don't care

haykam821 commented 2 years ago
@Mixin(value = ParasiteRenderMode.class, remap = false)
public class ParasiteRenderModeMixin implements Translatable {
    @Shadow
    @Final
    private String key;

    @Override
    public String getKey() {
        return this.key;
    }
}
shedaniel commented 2 years ago

shouldn't loom be the one to strip it??

shedaniel commented 2 years ago

I don't understand why you want to implement Translatable on a server only jar, it should be only used on the client config gui