Break early if activation crystal isn't bound
Fixes annoying and usually false "not configured correctly" message.
https://redd.it/5vte95
(cherry picked from commit 32668f7
)
This commit is contained in:
parent
72bf53f8d3
commit
40bac68190
|
@ -5,6 +5,8 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.iface.IBindable;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import WayofTime.bloodmagic.block.base.BlockEnum;
|
import WayofTime.bloodmagic.block.base.BlockEnum;
|
||||||
import net.minecraft.block.SoundType;
|
import net.minecraft.block.SoundType;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
@ -64,10 +66,13 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> imple
|
||||||
{
|
{
|
||||||
if (heldItem.getItem() == ModItems.ACTIVATION_CRYSTAL)
|
if (heldItem.getItem() == ModItems.ACTIVATION_CRYSTAL)
|
||||||
{
|
{
|
||||||
|
IBindable bindable = (IBindable) heldItem.getItem();
|
||||||
|
if (Strings.isNullOrEmpty(bindable.getOwnerName(heldItem)))
|
||||||
|
return false;
|
||||||
|
|
||||||
String key = RitualHelper.getValidRitual(world, pos);
|
String key = RitualHelper.getValidRitual(world, pos);
|
||||||
EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, key);
|
EnumFacing direction = RitualHelper.getDirectionOfRitual(world, pos, key);
|
||||||
// TODO: Give a message stating that this ritual is not a valid
|
// TODO: Give a message stating that this ritual is not a valid ritual.
|
||||||
// ritual.
|
|
||||||
if (!key.isEmpty() && direction != null && RitualHelper.checkValidRitual(world, pos, key, direction))
|
if (!key.isEmpty() && direction != null && RitualHelper.checkValidRitual(world, pos, key, direction))
|
||||||
{
|
{
|
||||||
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, RitualRegistry.getRitualForId(key)))
|
if (((TileMasterRitualStone) tile).activateRitual(heldItem, player, RitualRegistry.getRitualForId(key)))
|
||||||
|
|
Loading…
Reference in a new issue