Running the mod through intelliJ works perfectly fine. Using the exported jar initially opening the game gives me a resourcepack loading error and attempting to open a world causes a crash throwing the error: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_5944.method_34583(String, Object)" because "$$17" is null
I am using the fabric template mod as a base with split client and server code.
#[SOLVED] Mod doesn't work after building a jar
1 messages · Page 1 of 1 (latest)
wich jar are you using?
The shortest named non dev jar
could you send the full log?
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Variable modifier method modGlowCol(ILnet/minecraft/class_2338;Lnet/minecraft/class_8242;)I in dyebrary.client.mixins.json:SignRendererMixin from mod dyebrary failed injection check, (0/1) succeeded. Scanned 0 target(s). Using refmap client-dyebrary-refmap.json
what I'm trying to understand is why this works in my IDE but not as an independant jar
send the source of the mixin method
public class SignRendererMixin {
@ModifyVariable(method = "getColor", at = @At("STORE"), ordinal = 0)
private static int modCol(int i, SignText sign){
return ((ISignText)sign).dye_brary$getTextColour();
}
//hate to use "name" here, but I straight up don't think I can do without it
@ModifyVariable(method = "renderText", at = @At("STORE"), name = "k")
private static int modGlowCol(int k, BlockPos pos, SignText sign){
return ((ISignText)sign).dye_brary$getTextColour();
}
}```
send the entire renderText source method in a paste
BlockPos pos, SignText signText, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int lineHeight, int lineWidth, boolean front
) {
matrices.push();
this.setTextAngles(matrices, front, this.getTextOffset());
int i = getColor(signText);
int j = 4 * lineHeight / 2;
OrderedText[] orderedTexts = signText.getOrderedMessages(MinecraftClient.getInstance().shouldFilterText(), text -> {
List<OrderedText> list = this.textRenderer.wrapLines(text, lineWidth);
return list.isEmpty() ? OrderedText.EMPTY : (OrderedText)list.get(0);
});
int k;
boolean bl;
int l;
if (signText.isGlowing()) {
k = signText.getColor().getSignColor();
bl = shouldRender(pos, k);
l = 15728880;
} else {
k = i;
bl = false;
l = light;
}
for (int m = 0; m < 4; m++) {
OrderedText orderedText = orderedTexts[m];
float f = -this.textRenderer.getWidth(orderedText) / 2;
if (bl) {
this.textRenderer.drawWithOutline(orderedText, f, m * lineHeight - j, k, i, matrices.peek().getPositionMatrix(), vertexConsumers, l);
} else {
this.textRenderer
.draw(
orderedText,
f,
(float)(m * lineHeight - j),
k,
false,
matrices.peek().getPositionMatrix(),
vertexConsumers,
TextRenderer.TextLayerType.POLYGON_OFFSET,
0,
l
);
}
}
matrices.pop();
}```
use @WrapOperation (or @Redirect for hard fails) to wrap getSignColor() on invocation
any tips for avoiding this in the future?
this did work, thanks
don't use name 
ha yeah makes sense
iirc, names only exist in dev. For instance, you cannot use @Local(name="") because it'll work in dev, but crash when used by a player