Fixed EarthBlast / WaterManipulation being able to make moves off of eachothers blocks

This commit is contained in:
Matt 2016-04-12 21:01:10 -05:00
parent 7df77ee723
commit bc196a95e0
2 changed files with 6 additions and 1 deletions

View file

@ -115,6 +115,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)) {
@ -152,6 +153,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;
}
@ -282,6 +286,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);