mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Merge remote branch 'upstream/master'
Conflicts: src/org/bukkit/event/block/BlockEvent.java src/org/bukkit/event/block/BlockListener.java src/org/bukkit/event/block/BlockPhysicsEvent.java By: durron597 <martin.jared@gmail.com>
This commit is contained in:
commit
d9184242dc
2 changed files with 64 additions and 26 deletions
|
@ -3,12 +3,15 @@ package org.bukkit.event.block;
|
|||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to a Block
|
||||
* Handles all events thrown in relation to Blocks
|
||||
*
|
||||
* @author durron597
|
||||
*/
|
||||
public class BlockListener implements Listener {
|
||||
public BlockListener() {
|
||||
/**
|
||||
* Default Constructor
|
||||
*/
|
||||
public BlockListener() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,6 +69,6 @@ public class BlockListener implements Listener {
|
|||
*
|
||||
* @param event Relevant event details
|
||||
*/
|
||||
public void onRedstoneChange(BlockFromToEvent event) {
|
||||
public void onRedstoneChange(BlockFromToEvent event) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,58 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.Block;
|
||||
|
||||
/**
|
||||
* @author jmartin
|
||||
*
|
||||
*/
|
||||
public class BlockPhysicsEvent extends BlockEvent {
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* @param theBlock
|
||||
*/
|
||||
public BlockPhysicsEvent(Type type, Block theBlock) {
|
||||
super(type, theBlock);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.Block;
|
||||
import org.bukkit.ItemStack;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Thrown when a block physics check is called
|
||||
*
|
||||
* @author Dinnerbone
|
||||
*/
|
||||
public class BlockPhysicsEvent extends BlockEvent {
|
||||
private final int changed;
|
||||
private boolean cancel = false;
|
||||
|
||||
public BlockPhysicsEvent(final Event.Type type, final Block block, final int changed) {
|
||||
super(type, block);
|
||||
this.changed = changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type of block that changed, causing this event
|
||||
*
|
||||
* @return Changed block's type ID
|
||||
*/
|
||||
public int getChangedTypeID() {
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type of block that changed, causing this event
|
||||
*
|
||||
* @return Changed block's type
|
||||
*/
|
||||
public ItemStack.Type getChangedType() {
|
||||
return ItemStack.Type.getType(changed); // TODO: Move type to its own file
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* be executed in the server, but will still pass to other plugins
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue