-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from AleksandarHaralanov/master
Add chest open event
- Loading branch information
Showing
4 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/org/bukkit/event/inventory/ChestOpenedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.bukkit.event.inventory; | ||
|
||
import net.minecraft.server.ItemStack; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
|
||
public class ChestOpenedEvent extends Event implements Cancellable { | ||
private boolean cancelled; | ||
private Player player; | ||
private ItemStack[] contents; | ||
|
||
public ChestOpenedEvent(Player player, ItemStack[] contents) { | ||
super(Type.CHEST_OPENED); | ||
this.player = player; | ||
this.contents = contents; | ||
} | ||
|
||
public Player getPlayer() { | ||
return player; | ||
} | ||
|
||
public ItemStack[] getContents() { | ||
return contents; | ||
} | ||
|
||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
public void setCancelled(boolean cancel) { | ||
this.cancelled = cancel; | ||
} | ||
} |