-
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
c24e372
commit 26281d2
Showing
4 changed files
with
48 additions
and
1 deletion.
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
36 changes: 36 additions & 0 deletions
36
src/main/java/net/azisaba/rcitemloggingintegration/integration/XConomyListener.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,36 @@ | ||
package net.azisaba.rcitemloggingintegration.integration; | ||
|
||
import me.yic.xconomy.api.event.PlayerAccountEvent; | ||
import net.azisaba.rcitemlogging.RcItemLogging; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
|
||
import java.util.logging.Logger; | ||
|
||
public class XConomyListener implements Listener { | ||
private Logger logger; | ||
|
||
public XConomyListener(Logger logger) { | ||
this.logger = logger; | ||
} | ||
|
||
@EventHandler | ||
public void onPlayerAccountEvent(PlayerAccountEvent e) { | ||
logger.info(String.format("AccountName: %s, balance: %s, amount: %s, isAdd: %b, method: %s, uuid: %s, reason: %s", | ||
e.getaccountname(), | ||
e.getbalance().toString(), | ||
e.getamount().toString(), | ||
e.getisadd(), | ||
e.getmethod(), | ||
e.getUniqueId(), | ||
e.getreason() | ||
)); | ||
RcItemLogging.getApi().put( | ||
"xconomy_player_money", | ||
"#none", | ||
e.getaccountname(), | ||
String.format("%s by %s (%s)", e.getreason(), e.getmethod(), e.getisadd() ? "add" : "non-add"), | ||
e.getUniqueId() | ||
); | ||
} | ||
} |
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