homing tnt texture & homing tnt particle change & moved tnt/arrow particle spawning into tick() logic
This commit is contained in:
10 files changed
+27
-20
No files matched your search
@@ -104,7 +104,7 @@ public class baseArrow extends AbstractArrow {
|
||||
this.makeParticle(1);
|
||||
}
|
||||
} else {
|
||||
this.makeParticle(2);
|
||||
spawnParticles(0);
|
||||
}
|
||||
this.tick++;
|
||||
} else if (this.inGround && this.inGroundTime != 0 && !this.effects.isEmpty() && this.inGroundTime >= 600) {
|
||||
|
||||
@@ -35,10 +35,6 @@ public class BaseTNTRenderer<T extends basePrimedTNT> extends EntityRenderer<T>
|
||||
float f1 = 1.0F + f * 0.3F;
|
||||
pPoseStack.scale(f1, f1, f1);
|
||||
}
|
||||
if (ConfigClient.tntParticles) {
|
||||
pEntity.spawnParticles(pPartialTicks);
|
||||
}
|
||||
pEntity.spawnParticles(pPartialTicks);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.world.level.block.Blocks;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class TNTArrowRenderer extends EntityRenderer<baseArrow> {
|
||||
private final boolean renderParticles = ConfigClient.arrowParticles;
|
||||
private final BlockRenderDispatcher blockRenderer;
|
||||
|
||||
public TNTArrowRenderer(EntityRendererProvider.Context pContext) {
|
||||
@@ -27,6 +26,7 @@ public class TNTArrowRenderer extends EntityRenderer<baseArrow> {
|
||||
}
|
||||
|
||||
public void render(@NotNull baseArrow pEntity, float pEntityYaw, float pPartialTicks, PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight) {
|
||||
|
||||
pPoseStack.pushPose();
|
||||
pPoseStack.translate(0.0F, 0.5F, 0.0F);
|
||||
pPoseStack.scale(0.5f, 0.5f, 0.5f);
|
||||
@@ -34,9 +34,6 @@ public class TNTArrowRenderer extends EntityRenderer<baseArrow> {
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-90.0F));
|
||||
pPoseStack.translate(-0.5F, -0.5F, 0.5F);
|
||||
pPoseStack.mulPose(Axis.YP.rotationDegrees(90.0F));
|
||||
if (renderParticles) {
|
||||
pEntity.spawnParticles(pPartialTicks);
|
||||
}
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, Blocks.TNT.defaultBlockState(), pPoseStack, pBuffer, pPackedLight, i / 5 % 2 == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
|
||||
@@ -65,6 +65,9 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (level().isClientSide) {
|
||||
spawnParticles(0);
|
||||
}
|
||||
if (!this.isNoGravity()) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.jenny.enhancedexplosives.entities.tnt;
|
||||
|
||||
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||
import com.jenny.enhancedexplosives.entities.entities;
|
||||
import com.jenny.enhancedexplosives.config.ConfigClient;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
@@ -11,6 +13,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
@@ -94,8 +97,14 @@ public class homingPrimedTNT extends basePrimedTNT {
|
||||
|
||||
@Override
|
||||
public void spawnParticles(float partialTicks) {
|
||||
for (int i = 1; i <= ConfigClient.calcPCount(30); i++) {
|
||||
level().addParticle(ParticleTypes.FALLING_OBSIDIAN_TEAR, getX(), getY(), getZ(), this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z);
|
||||
Vec3 pos = getPosition(partialTicks);
|
||||
for (int i = 1; i <= ConfigClient.calcPCount(1); i++) {
|
||||
level().addParticle(ParticleTypes.FLAME, pos.x, pos.y, pos.z, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block renderBlock() {
|
||||
return blocks.TNT_HOMING.get();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user