mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Merge pull request #480 from grasshopperMatt/master
Fixed EarthBlast / WaterManipulation being able to make moves off of eachothers blocks
This commit is contained in:
commit
d07ee18b94
2 changed files with 6 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -126,4 +126,4 @@ public class TempBlock {
|
|||
block.setData(data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue