Added holograms to TileMasterRitualStone and TileAltar (#810)
* Added holograms to TileMasterRitualStone and TileAltar -Right click with either Ritual Diviner or (name pending) Sanguine Sanctum to show up the hologram -Ritual hologram disappears once ritual is activated -Altar hologram disappears once altar reaches specified tier -Fixed the Sigil of Holding configs -Someone still needs to add in a recipe for the Sigil of Holding -Disabled the Sanguine Sanctum right-click effect for now -Kept the hologram from holding the Ritual Diviner in hand -Someone needs to fix the lighting for the ritual hologram! * Getters and formatting changes * Re-implement commented out feature * Moved the rendering completely to client-side Have the Sanguine Book work again Make it actually work Tidy things up * Cycles through tier when right clicked * Re put onItemUse * Add IAltarReader to ItemSigilHolding
This commit is contained in:
parent
ebe428a89b
commit
6a2c30834e
10 changed files with 340 additions and 50 deletions
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import WayofTime.bloodmagic.util.handler.event.ClientHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -73,7 +74,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (addRuneToRitual(stack, world, pos, player))
|
||||
if (trySetDisplayedRitual(stack, world, pos) && addRuneToRitual(stack, world, pos, player))
|
||||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
|
@ -89,7 +90,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
|
||||
/**
|
||||
* Adds a single rune to the ritual.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* - The Ritual Diviner stack
|
||||
* @param world
|
||||
|
@ -98,7 +99,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
* - Block Position of the MRS.
|
||||
* @param player
|
||||
* - The Player attempting to place the ritual
|
||||
*
|
||||
*
|
||||
* @return - True if a rune was successfully added
|
||||
*/
|
||||
public boolean addRuneToRitual(ItemStack stack, World world, BlockPos pos, EntityPlayer player)
|
||||
|
@ -145,7 +146,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
} else
|
||||
{
|
||||
return false; // TODO: Possibly replace the block with a
|
||||
// ritual stone
|
||||
// ritual stone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,6 +155,25 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean trySetDisplayedRitual(ItemStack itemStack, World world, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
if (tile instanceof TileMasterRitualStone)
|
||||
{
|
||||
Ritual ritual = RitualRegistry.getRitualForId(this.getCurrentRitual(itemStack));
|
||||
TileMasterRitualStone masterRitualStone = (TileMasterRitualStone) tile;
|
||||
|
||||
if (ritual != null)
|
||||
{
|
||||
EnumFacing direction = getDirection(itemStack);
|
||||
return ClientHandler.setRitualHolo(masterRitualStone, ritual, direction, true);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Make this work for any IRitualStone
|
||||
public boolean consumeStone(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
|
@ -357,7 +377,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
|
||||
public void notifyDirectionChange(EnumFacing direction, EntityPlayer player)
|
||||
{
|
||||
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentDirection", direction.getName()));
|
||||
ChatUtil.sendNoSpam(player, TextHelper.localize(tooltipBase + "currentDirection", Utils.toFancyCasing(direction.getName())));
|
||||
}
|
||||
|
||||
public void setDirection(ItemStack stack, EnumFacing direction)
|
||||
|
@ -393,7 +413,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
|
||||
/**
|
||||
* Cycles the selected ritual to the next available ritual that is enabled.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* - The ItemStack of the ritual diviner
|
||||
* @param player
|
||||
|
@ -446,7 +466,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider
|
|||
|
||||
/**
|
||||
* Does the same as cycleRitual but instead cycles backwards.
|
||||
*
|
||||
*
|
||||
* @param stack
|
||||
* @param player
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue