Compare commits
No commits in common. "9f2fb2158f329642d0e809eee8e6e3bbae68a071" and "339c466c88a7ae891571a7c001d2fdb3c8571b87" have entirely different histories.
9f2fb2158f
...
339c466c88
@ -38,7 +38,7 @@ mod_name=Enhanced Explosives
|
|||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=0.9.4
|
mod_version=0.9.0
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
@ -11,9 +11,8 @@ import net.minecraft.world.phys.Vec3;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class tunnelArrow extends baseArrow{
|
public class tunnelArrow extends baseArrow{
|
||||||
protected static int explosionCount = 12;
|
public static int explosionCount = 16;
|
||||||
protected static int spacing = 2;
|
public static int spacing = 2;
|
||||||
protected static float power = 8;
|
|
||||||
|
|
||||||
public tunnelArrow(EntityType<tunnelArrow> pEntityType, Level pLevel) {
|
public tunnelArrow(EntityType<tunnelArrow> pEntityType, Level pLevel) {
|
||||||
super(pEntityType, pLevel);
|
super(pEntityType, pLevel);
|
||||||
@ -27,29 +26,22 @@ public class tunnelArrow extends baseArrow{
|
|||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
if (inGround) {
|
if (inGround) {
|
||||||
if (!level().isClientSide) {
|
|
||||||
explode();
|
explode();
|
||||||
}
|
|
||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||||
if (!level().isClientSide) {
|
|
||||||
explode();
|
explode();
|
||||||
}
|
this.discard();
|
||||||
discard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void explode() {
|
protected void explode() {
|
||||||
// sync();
|
|
||||||
Vec3 rot = getTargetVec( - getXRot(), - getYRot(), 0);
|
Vec3 rot = getTargetVec( - getXRot(), - getYRot(), 0);
|
||||||
for (int i = 0; i < explosionCount; i++) {
|
for (int i = 0; i < explosionCount; i++) {
|
||||||
Vec3 pos = position().add(rot.multiply(i * spacing, i * spacing, i * spacing));
|
Vec3 pos = position().add(rot.multiply(i * spacing, i * spacing, i * spacing));
|
||||||
System.out.println(level().isClientSide + "|" + i + "|" + pos + "|" + getXRot() + "|" + getYRot());
|
this.level().explode(this, pos.x, pos.y, pos.z, 8.0f, Level.ExplosionInteraction.TNT);
|
||||||
level().explode(this, pos.x, pos.y, pos.z,
|
|
||||||
power, Level.ExplosionInteraction.TNT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ public class dynamite extends basePrimedTNT {
|
|||||||
} else {
|
} else {
|
||||||
this.updateInWaterStateAndDoFluidPushing();
|
this.updateInWaterStateAndDoFluidPushing();
|
||||||
if (this.level().isClientSide) {
|
if (this.level().isClientSide) {
|
||||||
spawnParticles();
|
this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.jenny.enhancedexplosives.entities.tnt;
|
package com.jenny.enhancedexplosives.entities.tnt;
|
||||||
|
|
||||||
|
import com.jenny.enhancedexplosives.blocks.blocks;
|
||||||
import com.jenny.enhancedexplosives.entities.entities;
|
import com.jenny.enhancedexplosives.entities.entities;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.LivingEntity;
|
import net.minecraft.world.entity.LivingEntity;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.jenny.enhancedexplosives.entities.tnt;
|
package com.jenny.enhancedexplosives.entities.tnt;
|
||||||
|
|
||||||
import com.jenny.enhancedexplosives.config.ConfigClient;
|
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||||
@ -67,9 +66,7 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
|||||||
|
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (level().isClientSide) {
|
if (level().isClientSide) {
|
||||||
if (ConfigClient.tntParticles) {
|
spawnParticles(0);
|
||||||
spawnParticles();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!this.isNoGravity()) {
|
if (!this.isNoGravity()) {
|
||||||
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
|
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -0.04D, 0.0D));
|
||||||
@ -90,6 +87,9 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.updateInWaterStateAndDoFluidPushing();
|
this.updateInWaterStateAndDoFluidPushing();
|
||||||
|
if (this.level().isClientSide) {
|
||||||
|
this.level().addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,5 @@ public abstract class basePrimedTNT extends Entity implements TraceableEntity {
|
|||||||
return this.fuse;
|
return this.fuse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spawnParticles() {
|
public void spawnParticles(float partialTicks) {}
|
||||||
level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -96,9 +96,10 @@ public class homingPrimedTNT extends basePrimedTNT {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void spawnParticles() {
|
public void spawnParticles(float partialTicks) {
|
||||||
|
Vec3 pos = getPosition(partialTicks);
|
||||||
for (int i = 1; i <= ConfigClient.calcPCount(1); i++) {
|
for (int i = 1; i <= ConfigClient.calcPCount(1); i++) {
|
||||||
level().addParticle(ParticleTypes.FLAME, getX(), getY(), getZ(), 0, 0, 0);
|
level().addParticle(ParticleTypes.FLAME, pos.x, pos.y, pos.z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user