Added CollisionManager world check - HeatControl solidify stone variation (#658)

This commit is contained in:
Sobki 2016-12-03 14:57:56 +10:00 committed by Christopher Martin
parent 4c226a6df8
commit 9f863cc0e9
3 changed files with 16 additions and 4 deletions

View file

@ -4,7 +4,7 @@
<groupId>com.projectkorra</groupId>
<artifactId>projectkorra</artifactId>
<version>1.8.1</version>
<version>1.8.2</version>
<packaging>jar</packaging>
<name>ProjectKorra</name>

View file

@ -132,6 +132,9 @@ public class CollisionManager {
continue;
}
if (locationFirst.getWorld() != locationSecond.getWorld()) {
return;
}
double distSquared = locationFirst.distanceSquared(locationSecond);
if (distSquared <= requiredDistSquared) {
collided = true;

View file

@ -320,12 +320,21 @@ public class HeatControl extends FireAbility {
@Override
public void run() {
if (tempBlock != null) {
boolean bool = Math.random() > .5 ? true : false;
if (solidifyRevert) {
tempBlock.setType(Material.STONE, (byte) 0);
if (bool) {
tempBlock.setType(Material.STONE, (byte) 0);
} else {
tempBlock.setType(Material.COBBLESTONE, (byte) 0);
}
tempBlock.setRevertTime(solidifyRevertTime);
} else {
tempBlock.revertBlock();
tempBlock.getBlock().setType(Material.STONE);
if (bool) {
tempBlock.getBlock().setType(Material.STONE);
} else {
tempBlock.getBlock().setType(Material.COBBLESTONE);
}
}
ParticleEffect.SMOKE.display(tempBlock.getBlock().getLocation().clone().add(0.5, 1, 0.5), 0.1F, 0.1F, 0.1F, 0.01F, 3);