Advertisement
CreativeMasterBonin

PurifyingVehicleRenderer class

Feb 17th, 2025
104
0
1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.61 KB | None | 0 0
  1. package net.rk.addon.render;
  2.  
  3. import com.mojang.blaze3d.vertex.PoseStack;
  4. import com.mojang.math.Axis;
  5. import net.minecraft.client.renderer.MultiBufferSource;
  6. import net.minecraft.client.renderer.RenderType;
  7. import net.minecraft.client.renderer.entity.*;
  8. import net.minecraft.client.renderer.texture.OverlayTexture;
  9. import net.minecraft.resources.ResourceLocation;
  10. import net.rk.addon.entity.PurifyingBoat;
  11. import net.rk.addon.entity.model.PurifyingVehicleModel;
  12.  
  13. @SuppressWarnings("deprecated")
  14. public class PurifyingBoatRenderer extends EntityRenderer<PurifyingBoat>{
  15.     private PurifyingVehicleModel model;
  16.  
  17.     public PurifyingBoatRenderer(EntityRendererProvider.Context context){
  18.         super(context);
  19.         model = new PurifyingVehicleModel(context.bakeLayer(PurifyingVehicleModel.LAYER_LOCATION));
  20.     }
  21.  
  22.     @Override
  23.     public ResourceLocation getTextureLocation(PurifyingBoat purifyingBoat) {
  24.         return ResourceLocation.parse("thingamajigsgoodies:block/combiner_bottom.png");
  25.     }
  26.  
  27.     @Override
  28.     public void render(PurifyingBoat boat, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
  29.         poseStack.pushPose();
  30.         poseStack.translate(0,0,0);
  31.  
  32.         poseStack.mulPose(Axis.YP.rotationDegrees(0.0F - entityYaw));
  33.  
  34.         this.model.setupAnim(boat);
  35.         this.model.renderToBuffer(poseStack,
  36.                 bufferSource.getBuffer(RenderType.entityTranslucent(PurifyingVehicleModel.LAYER_LOCATION.getModel(),true))
  37.                 ,packedLight,OverlayTexture.NO_OVERLAY);
  38.         poseStack.popPose();
  39.     }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement