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> <groupId>com.projectkorra</groupId>
<artifactId>projectkorra</artifactId> <artifactId>projectkorra</artifactId>
<version>1.8.1</version> <version>1.8.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>ProjectKorra</name> <name>ProjectKorra</name>

View file

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

View file

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