rename to "Enhanced Explosives"
This commit is contained in:
88 files changed
+212
-218
No files matched your search
@@ -0,0 +1,53 @@
|
||||
package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.tnt.basePrimedTNT;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
import net.minecraft.client.renderer.entity.TntMinecartRenderer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class clusterTNTRenderer extends EntityRenderer<basePrimedTNT> {
|
||||
private final BlockRenderDispatcher blockRenderer;
|
||||
|
||||
public clusterTNTRenderer(EntityRendererProvider.Context pContext) {
|
||||
super(pContext);
|
||||
this.shadowRadius = 0.5F;
|
||||
this.blockRenderer = pContext.getBlockRenderDispatcher();
|
||||
}
|
||||
|
||||
public void render(basePrimedTNT pEntity, float pEntityYaw, float pPartialTicks, PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight) {
|
||||
pPoseStack.pushPose();
|
||||
pPoseStack.translate(0.0F, 0.5F, 0.0F);
|
||||
int i = pEntity.getFuse();
|
||||
if ((float)i - pPartialTicks + 1.0F < 10.0F) {
|
||||
float f = 1.0F - ((float)i - pPartialTicks + 1.0F) / 10.0F;
|
||||
f = Mth.clamp(f, 0.0F, 1.0F);
|
||||
f *= f;
|
||||
f *= f;
|
||||
float f1 = 0.5f + f * 0.3F;
|
||||
pPoseStack.scale(f1, f1, f1);
|
||||
}
|
||||
else {
|
||||
pPoseStack.scale(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, Blocks.TNT.defaultBlockState(), pPoseStack, pBuffer, pPackedLight, i / 5 % 2 == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
}
|
||||
|
||||
public @NotNull ResourceLocation getTextureLocation(@NotNull basePrimedTNT pEntity) {
|
||||
return TextureAtlas.LOCATION_BLOCKS;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user