Skip to content

Commit

Permalink
Update BoatRendererMixin.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Nov 22, 2024
1 parent 3f4985a commit 0c2f0fc
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.frozenblock.trailiertales.TTConstants;
import net.frozenblock.trailiertales.impl.client.AbstractBoatRendererInterface;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.renderer.entity.BoatRenderer;
Expand All @@ -18,12 +19,18 @@ public class BoatRendererMixin {
@Inject(method = "<init>", at = @At("TAIL"))
public void trailierTales$init(EntityRendererProvider.Context context, ModelLayerLocation modelLayerLocation, CallbackInfo info) {
if (BoatRenderer.class.cast(this) instanceof AbstractBoatRendererInterface abstractBoatRendererInterface) {
abstractBoatRendererInterface.trailierTales$setBannerBaseTexture(
modelLayerLocation.model().withPath((string) -> {
string = string.substring(Math.max(0, string.indexOf("/")));
return "textures/entity/boat/banner_base/" + string + ".png";
})
);
try {
abstractBoatRendererInterface.trailierTales$setBannerBaseTexture(
modelLayerLocation.model().withPath((string) -> {
string = string.substring(Math.max(0, string.indexOf("/")));
return "textures/entity/boat/banner_base/" + string + ".png";
})
);
} catch (Exception ignored) {
abstractBoatRendererInterface.trailierTales$setBannerBaseTexture(
TTConstants.vanillaId("textures/entity/boat/banner_base/oak.png")
);
}
}
}
}

0 comments on commit 0c2f0fc

Please sign in to comment.