mirror of
https://github.com/MiniDay/HamsterCurrency-Parent.git
synced 2025-08-22 20:25:30 +08:00
feat: 现在通过指令修改的货币也会触发事件了
This commit is contained in:
@@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'cn.hamster3'
|
group 'cn.hamster3'
|
||||||
version '2.2.2'
|
version '2.2.3'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package cn.hamster3.currency.command.currency;
|
package cn.hamster3.currency.command.currency;
|
||||||
|
|
||||||
|
import cn.hamster3.currency.api.CurrencyAPI;
|
||||||
import cn.hamster3.currency.core.IDataManager;
|
import cn.hamster3.currency.core.IDataManager;
|
||||||
import cn.hamster3.currency.data.CurrencyLog;
|
|
||||||
import cn.hamster3.currency.data.CurrencyType;
|
import cn.hamster3.currency.data.CurrencyType;
|
||||||
import cn.hamster3.currency.data.PlayerData;
|
import cn.hamster3.currency.data.PlayerData;
|
||||||
|
|
||||||
@@ -17,8 +17,7 @@ public class CurrencySetCommand extends CurrencyAdminSetCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doSet(PlayerData data, CurrencyType type, double amount) {
|
protected void doSet(PlayerData data, CurrencyType type, double amount) {
|
||||||
data.setPlayerCurrency(type.getId(), amount);
|
CurrencyAPI.setPlayerCurrency(data.getUuid(), type.getId(), amount);
|
||||||
dataManager.insertLog(new CurrencyLog(data.getUuid(), data.getPlayerName(), type.getId(), "set", amount, amount));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -50,4 +50,14 @@ public class CurrencyChangeEvent extends Event {
|
|||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlerList;
|
return handlerList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "CurrencyChangeEvent{" +
|
||||||
|
"playerUUID=" + playerUUID +
|
||||||
|
", currencyID='" + currencyID + '\'' +
|
||||||
|
", oldAmount=" + oldAmount +
|
||||||
|
", newAmount=" + newAmount +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user