-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85f6c4a
commit 69dd07c
Showing
6 changed files
with
81 additions
and
4 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
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
56 changes: 56 additions & 0 deletions
56
src/main/java/us/mytheria/bloblib/events/TranslatableItemCloneEvent.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,56 @@ | ||
package us.mytheria.bloblib.events; | ||
|
||
import org.bukkit.event.HandlerList; | ||
import org.bukkit.inventory.ItemStack; | ||
import us.mytheria.bloblib.entities.translatable.TranslatableItem; | ||
|
||
/** | ||
* Called when a TranslatableItem is cloned. | ||
*/ | ||
public class TranslatableItemCloneEvent extends TranslatableItemEvent { | ||
private ItemStack clone; | ||
|
||
/** | ||
* Called when a TranslatableItem is cloned. | ||
* | ||
* @param translatableItem The TranslatableItem. | ||
* @param clone The clone. | ||
*/ | ||
public TranslatableItemCloneEvent(TranslatableItem translatableItem, ItemStack clone) { | ||
super(translatableItem); | ||
this.clone = clone; | ||
} | ||
|
||
private static final HandlerList HANDLERS_LIST = new HandlerList(); | ||
|
||
public TranslatableItemCloneEvent(TranslatableItem translatableItem) { | ||
super(translatableItem); | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return HANDLERS_LIST; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return HANDLERS_LIST; | ||
} | ||
|
||
/** | ||
* Will get the clone. | ||
* | ||
* @return The clone. | ||
*/ | ||
public ItemStack getClone() { | ||
return clone; | ||
} | ||
|
||
/** | ||
* Will set the clone. | ||
* | ||
* @param clone The clone. | ||
*/ | ||
public void setClone(ItemStack clone) { | ||
this.clone = clone; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/us/mytheria/bloblib/events/TranslatableItemEvent.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,16 @@ | ||
package us.mytheria.bloblib.events; | ||
|
||
import org.bukkit.event.Event; | ||
import us.mytheria.bloblib.entities.translatable.TranslatableItem; | ||
|
||
public abstract class TranslatableItemEvent extends Event { | ||
public TranslatableItemEvent(TranslatableItem translatableItem) { | ||
this.translatableItem = translatableItem; | ||
} | ||
|
||
private final TranslatableItem translatableItem; | ||
|
||
public TranslatableItem getTranslatableItem() { | ||
return translatableItem; | ||
} | ||
} |