-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CurrencyDropCallback in order to allow for modify currency drops.
- Loading branch information
1 parent
f714ec8
commit c6d64d0
Showing
5 changed files
with
124 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
71 changes: 71 additions & 0 deletions
71
Core/src/net/tnemc/core/api/callback/currency/CurrencyDropCallback.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,71 @@ | ||
package net.tnemc.core.api.callback.currency; | ||
/* | ||
* The New Economy | ||
* Copyright (C) 2022 - 2024 Daniel "creatorfromhell" Vidmar | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import net.tnemc.core.currency.Currency; | ||
import net.tnemc.item.AbstractItemStack; | ||
import net.tnemc.plugincore.core.api.callback.Callback; | ||
|
||
import java.util.Collection; | ||
import java.util.UUID; | ||
|
||
/** | ||
* CurrencyDropCallback | ||
* | ||
* @author creatorfromhell | ||
* @since 0.1.2.0 | ||
*/ | ||
public class CurrencyDropCallback implements Callback { | ||
|
||
private final UUID player; | ||
private Currency currency; | ||
|
||
private final Collection<AbstractItemStack<Object>> drops; | ||
|
||
public CurrencyDropCallback(UUID player, Currency currency, Collection<AbstractItemStack<Object>> drops) { | ||
this.player = player; | ||
this.currency = currency; | ||
this.drops = drops; | ||
} | ||
|
||
/** | ||
* The name of this callback. | ||
* | ||
* @return The name of this callback. | ||
*/ | ||
@Override | ||
public String name() { | ||
return "currency_drop"; | ||
} | ||
|
||
public Collection<AbstractItemStack<Object>> getDrops() { | ||
return drops; | ||
} | ||
|
||
public Currency getCurrency() { | ||
return currency; | ||
} | ||
|
||
public UUID getPlayer() { | ||
return player; | ||
} | ||
|
||
public void setCurrency(Currency currency) { | ||
this.currency = currency; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |