more particles & config
This commit is contained in:
7 files changed
+63
-4
No files matched your search
@@ -228,4 +228,8 @@ public class baseArrow extends AbstractArrow {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void spawnParticles() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,4 +42,14 @@ public class concussiveArrow extends baseArrow{
|
||||
protected ItemStack getPickupItem() {
|
||||
return new ItemStack(items.CONCUSSIVE_ARROW.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticles() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
double x = getX() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
double y = getY() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
double z = getZ() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
level().addParticle(ParticleTypes.WAX_ON, x, y, z, this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class tntArrow extends baseArrow {
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (level().isClientSide()) {
|
||||
level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY(), this.getZ(), 0.0D, 0.0D, 0.0D);
|
||||
//spawnParticles();
|
||||
}
|
||||
if (this.inGround) {
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT);
|
||||
@@ -31,6 +31,16 @@ public class tntArrow extends baseArrow {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnParticles() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
double x = getX() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
double y = getY() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
double z = getZ() + (double) level().getRandom().nextInt(-10, 11) / 10;
|
||||
level().addParticle(ParticleTypes.WAX_ON, x, y, z, this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.jenny.enhancedexplosives.entities.client;
|
||||
|
||||
import com.jenny.enhancedexplosives.entities.arrows.baseArrow;
|
||||
import com.jenny.enhancedexplosives.config.*;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Axis;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
@@ -15,6 +17,7 @@ import net.minecraft.world.level.block.Blocks;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class TNTArrowRenderer extends EntityRenderer<baseArrow> {
|
||||
private final boolean renderParticles = ConfigClient.ARROW_PARTICLES;
|
||||
private final BlockRenderDispatcher blockRenderer;
|
||||
private float i = 0;
|
||||
|
||||
@@ -32,6 +35,9 @@ 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();
|
||||
}
|
||||
TntMinecartRenderer.renderWhiteSolidBlock(this.blockRenderer, Blocks.TNT.defaultBlockState(), pPoseStack, pBuffer, pPackedLight, Math.round(Math.sin(i)) == 0);
|
||||
pPoseStack.popPose();
|
||||
super.render(pEntity, pEntityYaw, pPartialTicks, pPoseStack, pBuffer, pPackedLight);
|
||||
|
||||
Reference in new issue
Block a user