45 lines
1.9 KiB
Java
45 lines
1.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer.entity;
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import net.minecraft.client.model.WindChargeModel;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
|
import net.minecraft.client.renderer.entity.EntityRenderer;
|
|
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
|
import net.minecraft.client.renderer.entity.state.EntityRenderState;
|
|
import net.minecraft.client.renderer.rendertype.RenderTypes;
|
|
import net.minecraft.client.renderer.state.CameraRenderState;
|
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge;
|
|
|
|
public class WindChargeRenderer
|
|
extends EntityRenderer<AbstractWindCharge, EntityRenderState> {
|
|
private static final Identifier TEXTURE_LOCATION = Identifier.withDefaultNamespace("textures/entity/projectiles/wind_charge.png");
|
|
private final WindChargeModel model;
|
|
|
|
public WindChargeRenderer(EntityRendererProvider.Context context) {
|
|
super(context);
|
|
this.model = new WindChargeModel(context.bakeLayer(ModelLayers.WIND_CHARGE));
|
|
}
|
|
|
|
@Override
|
|
public void submit(EntityRenderState state, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, CameraRenderState camera) {
|
|
submitNodeCollector.submitModel(this.model, state, poseStack, RenderTypes.breezeWind(TEXTURE_LOCATION, this.xOffset(state.ageInTicks) % 1.0f, 0.0f), state.lightCoords, OverlayTexture.NO_OVERLAY, state.outlineColor, null);
|
|
super.submit(state, poseStack, submitNodeCollector, camera);
|
|
}
|
|
|
|
protected float xOffset(float t) {
|
|
return t * 0.03f;
|
|
}
|
|
|
|
@Override
|
|
public EntityRenderState createRenderState() {
|
|
return new EntityRenderState();
|
|
}
|
|
}
|
|
|