minecraft-src/net/minecraft/client/renderer/entity/TippableArrowRenderer.java
2025-07-04 01:41:11 +03:00

23 lines
904 B
Java

package net.minecraft.client.renderer.entity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.projectile.Arrow;
@Environment(EnvType.CLIENT)
public class TippableArrowRenderer extends ArrowRenderer<Arrow> {
public static final ResourceLocation NORMAL_ARROW_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/projectiles/arrow.png");
public static final ResourceLocation TIPPED_ARROW_LOCATION = ResourceLocation.withDefaultNamespace("textures/entity/projectiles/tipped_arrow.png");
public TippableArrowRenderer(EntityRendererProvider.Context context) {
super(context);
}
/**
* Returns the location of an entity's texture.
*/
public ResourceLocation getTextureLocation(Arrow entity) {
return entity.getColor() > 0 ? TIPPED_ARROW_LOCATION : NORMAL_ARROW_LOCATION;
}
}