mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-17 07:37:17 +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
|
@ -118,6 +118,7 @@ public class BlockSource {
|
||||||
* @return a valid bendable block, or null if none was found.
|
* @return a valid bendable block, or null if none was found.
|
||||||
*/
|
*/
|
||||||
public static BlockSourceInformation getBlockSourceInformation(Player player, BlockSourceType sourceType, ClickType clickType) {
|
public static BlockSourceInformation getBlockSourceInformation(Player player, BlockSourceType sourceType, ClickType clickType) {
|
||||||
|
|
||||||
if (!playerSources.containsKey(player)) {
|
if (!playerSources.containsKey(player)) {
|
||||||
return null;
|
return null;
|
||||||
} else if (!playerSources.get(player).containsKey(sourceType)) {
|
} 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) {
|
public static Block getSourceBlock(Player player, double range, BlockSourceType sourceType, ClickType clickType) {
|
||||||
BlockSourceInformation info = getValidBlockSourceInformation(player, range, sourceType, clickType);
|
BlockSourceInformation info = getValidBlockSourceInformation(player, range, sourceType, clickType);
|
||||||
|
if (TempBlock.isTempBlock(info.getBlock())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return info != null ? info.getBlock() : 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) {
|
public static Block getEarthSourceBlock(Player player, double range, ClickType clickType, boolean allowNearbySubstitute) {
|
||||||
Block sourceBlock = getSourceBlock(player, range, BlockSourceType.EARTH, clickType);
|
Block sourceBlock = getSourceBlock(player, range, BlockSourceType.EARTH, clickType);
|
||||||
|
|
||||||
if (sourceBlock == null && allowNearbySubstitute) {
|
if (sourceBlock == null && allowNearbySubstitute) {
|
||||||
BlockSourceInformation blockInfo = getBlockSourceInformation(player, BlockSourceType.EARTH, clickType);
|
BlockSourceInformation blockInfo = getBlockSourceInformation(player, BlockSourceType.EARTH, clickType);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue