Skip to content

Commit

Permalink
Make the blast resistance indicate the cubic meters of TNT needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Oct 22, 2017
1 parent bd579d9 commit 33d01ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
@Override
public float getExplosionResistance(Entity expEntity, World world, int x, int y, int z, double explosionX, double p_explosionresistance, double explosionY) {
// TODO: Maybe do something withPriority these parameters.
return (float) getBlockInstance(world, new Vector3D(x, y, z)).getResistance() * 30;
return (float) getBlockInstance(world, new Vector3D(x, y, z)).getResistance() * 6;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public String getLocalizedName() {
@Override
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) {
// TODO: Maybe do something withPriority these parameters.
return (float) getBlockInstance(world, VectorConverter.instance().toNova(pos)).getResistance() * 30;
return (float) getBlockInstance(world, VectorConverter.instance().toNova(pos)).getResistance() * 6;
}

@Override
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/nova/core/block/component/BlockProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface BlockProperty {
* The breaking difficulty of a block, or how long it takes to break a block.
* Tools and armour may make the block break faster or slower than this.
* <p>
* The standard, regular block hardness is 1. {@code Double.POSITIVE_INFINITY} is unbreakable.
* The standard, regular block hardness is 1. {@link Double#POSITIVE_INFINITY} is unbreakable.
* </p>
*/
@UnsidedComponent
Expand Down Expand Up @@ -81,7 +81,7 @@ public double getHardness() {
}

/**
* The blast resistance of a block.
* The blast resistance of a block, indicates how many cubic meters of TNT are needed to explode it.
* <p>
* The standard, regular block resistance is 1. {@link Double#POSITIVE_INFINITY} is unexplodable.
* </p>
Expand All @@ -91,7 +91,8 @@ public static class Resistance extends Component implements BlockProperty {
private DoubleSupplier resistance = () -> 1;

/**
* Sets the blast resistance
* Sets the blast resistance, indicates how many cubic meters
* of TNT are needed to explode it.
*
* @param resistance The blast resistance.
* @return This instance for chaining if desired.
Expand All @@ -102,7 +103,8 @@ public Resistance setResistance(DoubleSupplier resistance) {
}

/**
* Sets the blast resistance
* Sets the blast resistance, indicates how many cubic meters
* of TNT are needed to explode it.
*
* @param resistance The blast resistance.
* @return This instance for chaining if desired.
Expand All @@ -112,7 +114,8 @@ public Resistance setResistance(double resistance) {
}

/**
* Gets the blast resistance.
* Gets the blast resistance, indicates how many cubic meters
* of TNT are needed to explode it.
*
* @return The blast resistance.
*/
Expand Down

0 comments on commit 33d01ed

Please sign in to comment.