mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Remove deprecated Painting*Events
Replaced by Hanging*Events since October 2012. By: Matt <mattbdev@outlook.com>
This commit is contained in:
parent
d7d174c1fd
commit
b14702271e
5 changed files with 2 additions and 214 deletions
|
@ -1,7 +1,7 @@
|
|||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.Art;
|
||||
import org.bukkit.event.painting.PaintingBreakEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
|
||||
/**
|
||||
* Represents a Painting.
|
||||
|
@ -31,7 +31,7 @@ public interface Painting extends Hanging {
|
|||
* @param force If true, force the new art regardless of whether it fits
|
||||
* at the current location. Note that forcing it where it can't fit
|
||||
* normally causes it to drop as an item unless you override this by
|
||||
* catching the {@link PaintingBreakEvent}.
|
||||
* catching the {@link HangingBreakEvent}.
|
||||
* @return False if force was false and the new art won't fit at the
|
||||
* painting's current location
|
||||
*/
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package org.bukkit.event.painting;
|
||||
|
||||
import org.bukkit.Warning;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Painting;
|
||||
|
||||
/**
|
||||
* Triggered when a painting is removed by an entity
|
||||
*
|
||||
* @deprecated Use {@link org.bukkit.event.hanging.HangingBreakByEntityEvent}
|
||||
* instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Warning(reason="This event has been replaced by HangingBreakByEntityEvent")
|
||||
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
||||
private final Entity remover;
|
||||
|
||||
public PaintingBreakByEntityEvent(final Painting painting, final Entity remover) {
|
||||
super(painting, RemoveCause.ENTITY);
|
||||
this.remover = remover;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the entity that removed the painting
|
||||
*
|
||||
* @return the entity that removed the painting.
|
||||
*/
|
||||
public Entity getRemover() {
|
||||
return remover;
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package org.bukkit.event.painting;
|
||||
|
||||
import org.bukkit.Warning;
|
||||
import org.bukkit.entity.Painting;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Triggered when a painting is removed
|
||||
*
|
||||
* @deprecated Use {@link org.bukkit.event.hanging.HangingBreakEvent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Warning(reason="This event has been replaced by HangingBreakEvent")
|
||||
public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
private final RemoveCause cause;
|
||||
|
||||
public PaintingBreakEvent(final Painting painting, final RemoveCause cause) {
|
||||
super(painting);
|
||||
this.cause = cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cause for the painting's removal
|
||||
*
|
||||
* @return the RemoveCause for the painting's removal
|
||||
*/
|
||||
public RemoveCause getCause() {
|
||||
return cause;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* An enum to specify the cause of the removal
|
||||
*/
|
||||
public enum RemoveCause {
|
||||
/**
|
||||
* Removed by an entity
|
||||
*/
|
||||
ENTITY,
|
||||
/**
|
||||
* Removed by fire
|
||||
*/
|
||||
FIRE,
|
||||
/**
|
||||
* Removed by placing a block on it
|
||||
*/
|
||||
OBSTRUCTION,
|
||||
/**
|
||||
* Removed by water flowing over it
|
||||
*/
|
||||
WATER,
|
||||
/**
|
||||
* Removed by destroying the block behind it, etc
|
||||
*/
|
||||
PHYSICS,
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package org.bukkit.event.painting;
|
||||
|
||||
import org.bukkit.Warning;
|
||||
import org.bukkit.entity.Painting;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Represents a painting-related event.
|
||||
*
|
||||
* @deprecated Use {@link org.bukkit.event.hanging.HangingEvent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Warning(reason="This event has been replaced by HangingEvent")
|
||||
public abstract class PaintingEvent extends Event {
|
||||
protected Painting painting;
|
||||
|
||||
protected PaintingEvent(final Painting painting) {
|
||||
this.painting = painting;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the painting involved in this event.
|
||||
*
|
||||
* @return the painting
|
||||
*/
|
||||
public Painting getPainting() {
|
||||
return painting;
|
||||
}
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package org.bukkit.event.painting;
|
||||
|
||||
import org.bukkit.Warning;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Painting;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Triggered when a painting is created in the world
|
||||
*
|
||||
* @deprecated Use {@link org.bukkit.event.hanging.HangingPlaceEvent} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Warning(reason="This event has been replaced by HangingPlaceEvent")
|
||||
public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
private final Player player;
|
||||
private final Block block;
|
||||
private final BlockFace blockFace;
|
||||
|
||||
public PaintingPlaceEvent(final Painting painting, final Player player, final Block block, final BlockFace blockFace) {
|
||||
super(painting);
|
||||
this.player = player;
|
||||
this.block = block;
|
||||
this.blockFace = blockFace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the player placing the painting
|
||||
*
|
||||
* @return Entity returns the player placing the painting
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the block that the painting was placed on
|
||||
*
|
||||
* @return Block returns the block painting placed on
|
||||
*/
|
||||
public Block getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the face of the block that the painting was placed on
|
||||
*
|
||||
* @return BlockFace returns the face of the block the painting was placed
|
||||
* on
|
||||
*/
|
||||
public BlockFace getBlockFace() {
|
||||
return blockFace;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue