001 package org.bukkit.event.painting; 002 003 import org.bukkit.Warning; 004 import org.bukkit.block.Block; 005 import org.bukkit.block.BlockFace; 006 import org.bukkit.entity.Painting; 007 import org.bukkit.entity.Player; 008 import org.bukkit.event.Cancellable; 009 import org.bukkit.event.HandlerList; 010 011 /** 012 * Triggered when a painting is created in the world 013 * 014 * @deprecated Use {@link org.bukkit.event.hanging.HangingPlaceEvent} instead. 015 */ 016 @Deprecated 017 @Warning(reason="This event has been replaced by HangingPlaceEvent") 018 public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { 019 private static final HandlerList handlers = new HandlerList(); 020 private boolean cancelled; 021 private final Player player; 022 private final Block block; 023 private final BlockFace blockFace; 024 025 public PaintingPlaceEvent(final Painting painting, final Player player, final Block block, final BlockFace blockFace) { 026 super(painting); 027 this.player = player; 028 this.block = block; 029 this.blockFace = blockFace; 030 } 031 032 /** 033 * Returns the player placing the painting 034 * 035 * @return Entity returns the player placing the painting 036 */ 037 public Player getPlayer() { 038 return player; 039 } 040 041 /** 042 * Returns the block that the painting was placed on 043 * 044 * @return Block returns the block painting placed on 045 */ 046 public Block getBlock() { 047 return block; 048 } 049 050 /** 051 * Returns the face of the block that the painting was placed on 052 * 053 * @return BlockFace returns the face of the block the painting was placed 054 * on 055 */ 056 public BlockFace getBlockFace() { 057 return blockFace; 058 } 059 060 public boolean isCancelled() { 061 return cancelled; 062 } 063 064 public void setCancelled(boolean cancel) { 065 this.cancelled = cancel; 066 } 067 068 @Override 069 public HandlerList getHandlers() { 070 return handlers; 071 } 072 073 public static HandlerList getHandlerList() { 074 return handlers; 075 } 076 }