Merge pull request #480 from grasshopperMatt/master

Fixed EarthBlast / WaterManipulation being able to make moves off of eachothers blocks
This commit is contained in:
OmniCypher 2016-04-13 18:59:53 -07:00
commit d07ee18b94
2 changed files with 6 additions and 1 deletions

View file

@ -118,6 +118,7 @@ public class BlockSource {
* @return a valid bendable block, or null if none was found.
*/
public static BlockSourceInformation getBlockSourceInformation(Player player, BlockSourceType sourceType, ClickType clickType) {
if (!playerSources.containsKey(player)) {
return null;
} else if (!playerSources.get(player).containsKey(sourceType)) {
@ -155,6 +156,9 @@ public class BlockSource {
*/
public static Block getSourceBlock(Player player, double range, BlockSourceType sourceType, ClickType clickType) {
BlockSourceInformation info = getValidBlockSourceInformation(player, range, sourceType, clickType);
if (TempBlock.isTempBlock(info.getBlock())) {
return null;
}
return info != null ? info.getBlock() : null;
}
@ -288,6 +292,7 @@ public class BlockSource {
*/
public static Block getEarthSourceBlock(Player player, double range, ClickType clickType, boolean allowNearbySubstitute) {
Block sourceBlock = getSourceBlock(player, range, BlockSourceType.EARTH, clickType);
if (sourceBlock == null && allowNearbySubstitute) {
BlockSourceInformation blockInfo = getBlockSourceInformation(player, BlockSourceType.EARTH, clickType);

View file

@ -126,4 +126,4 @@ public class TempBlock {
block.setData(data);
}
}
}