Search in sources :

Example 1 with Attachments

use of net.mcft.copy.betterstorage.attachment.Attachments in project BetterStorage by copygirl.

the class TileLockableDoor method onBlockClicked.

@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
    if (world.getBlockMetadata(x, y, z) > 0)
        y -= 1;
    Attachments attachments = WorldUtils.get(world, x, y, z, IHasAttachments.class).getAttachments();
    boolean abort = attachments.interact(WorldUtils.rayTrace(player, 1.0F), player, EnumAttachmentInteraction.attack);
}
Also used : Attachments(net.mcft.copy.betterstorage.attachment.Attachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments)

Example 2 with Attachments

use of net.mcft.copy.betterstorage.attachment.Attachments in project BetterStorage by copygirl.

the class ClientProxy method getAttachmentPointsHighlightBox.

private AxisAlignedBB getAttachmentPointsHighlightBox(EntityPlayer player, TileEntity tileEntity, MovingObjectPosition target) {
    Attachments attachments = ((IHasAttachments) tileEntity).getAttachments();
    Attachment attachment = attachments.get(target.subHit);
    if (attachment == null)
        return null;
    return attachment.getHighlightBox();
}
Also used : Attachment(net.mcft.copy.betterstorage.attachment.Attachment) Attachments(net.mcft.copy.betterstorage.attachment.Attachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments)

Example 3 with Attachments

use of net.mcft.copy.betterstorage.attachment.Attachments in project BetterStorage by copygirl.

the class TileLockable method onBlockClicked.

@Override
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
    // TODO: See if we can make a pull request to Forge to get PlayerInteractEvent to fire for left click on client.
    Attachments attachments = WorldUtils.get(world, x, y, z, IHasAttachments.class).getAttachments();
    boolean abort = attachments.interact(WorldUtils.rayTrace(player, 1.0F), player, EnumAttachmentInteraction.attack);
// TODO: Abort block breaking? playerController.resetBlockBreaking doesn't seem to do the job.
}
Also used : Attachments(net.mcft.copy.betterstorage.attachment.Attachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments) IHasAttachments(net.mcft.copy.betterstorage.attachment.IHasAttachments)

Aggregations

Attachments (net.mcft.copy.betterstorage.attachment.Attachments)3 IHasAttachments (net.mcft.copy.betterstorage.attachment.IHasAttachments)3 Attachment (net.mcft.copy.betterstorage.attachment.Attachment)1