Break early if activation crystal isn't bound
Fixes annoying and usually false "not configured correctly" message. https://redd.it/5vte95
This commit is contained in:
parent
970acd4e69
commit
32668f70ca
|
@ -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 net.minecraft.block.SoundType;
|
import net.minecraft.block.SoundType;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
@ -63,10 +65,13 @@ public class BlockRitualController extends BlockEnumContainer<EnumRitualControll
|
||||||
{
|
{
|
||||||
if (heldItem != null && heldItem.getItem() == ModItems.ACTIVATION_CRYSTAL)
|
if (heldItem != null && 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