mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'
This commit is contained in:
commit
5001585ba6
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue