mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Various EarthTunnel fixes (#547)
-Fixed EarthTunnel dropping blocks -Fixed EarthTunnel not breaking blocks from certain moves -Fixed EarthTunnel on RaiseEarth leaving blocks behind
This commit is contained in:
parent
3c09394c53
commit
2a37e33864
1 changed files with 15 additions and 12 deletions
|
@ -1,9 +1,8 @@
|
||||||
package com.projectkorra.projectkorra.earthbending;
|
package com.projectkorra.projectkorra.earthbending;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import java.util.HashSet;
|
||||||
import com.projectkorra.projectkorra.ability.EarthAbility;
|
import java.util.Map;
|
||||||
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import com.projectkorra.projectkorra.util.TempBlock;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
@ -11,9 +10,10 @@ import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import java.util.Map;
|
import com.projectkorra.projectkorra.ability.EarthAbility;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import com.projectkorra.projectkorra.configuration.ConfigManager;
|
||||||
|
import com.projectkorra.projectkorra.util.TempBlock;
|
||||||
|
|
||||||
public class EarthTunnel extends EarthAbility {
|
public class EarthTunnel extends EarthAbility {
|
||||||
|
|
||||||
|
@ -97,13 +97,16 @@ public class EarthTunnel extends EarthAbility {
|
||||||
Vector vec = GeneralMethods.getOrthogonalVector(direction, angle, radius);
|
Vector vec = GeneralMethods.getOrthogonalVector(direction, angle, radius);
|
||||||
block = location.clone().add(direction.clone().normalize().multiply(depth)).add(vec).getBlock();
|
block = location.clone().add(direction.clone().normalize().multiply(depth)).add(vec).getBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.revert) {
|
if (revert) {
|
||||||
airBlocks.put(new TempBlock(block, Material.AIR, (byte) 0), System.currentTimeMillis());
|
if (getMovedEarth().containsKey(block)) {
|
||||||
|
block.setType(Material.AIR);
|
||||||
|
} else {
|
||||||
|
airBlocks.put(new TempBlock(block, Material.AIR, (byte) 0), System.currentTimeMillis());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
block.breakNaturally();
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue