Fix a mod crash

This commit is contained in:
zontreck 2023-11-19 05:12:23 -07:00
parent cd2a48bdfb
commit 29814e35b1
5 changed files with 6 additions and 27 deletions

View file

@ -7,8 +7,8 @@ org.gradle.daemon=false
parchment_version=2023.09.03
# luckperms_api_version=5.4
libac=1.4.1
eventsbus=1.0.16
libac=1.4.3
eventsbus=1.0.29
## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact

View file

@ -81,6 +81,7 @@ public class LibZontreck {
MinecraftForge.EVENT_BUS.register(new Commands());
MinecraftForge.EVENT_BUS.register(new NetworkEvents());
Bus.Reset();
Bus.Register(CurrencyHelper.class, null);
Bus.Register(Bank.class, null);

View file

@ -94,13 +94,7 @@ public class Account
LongTermTransactionHistoryRecord rec = LongTermTransactionHistoryRecord.of(player_id);
rec.addHistory(history);
rec.commit();
try {
Bus.Post(new TransactionHistoryFlushEvent(this, rec, history));
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
Bus.Post(new TransactionHistoryFlushEvent(this, rec, history));
rec = null;
history = new ArrayList<>();
}

View file

@ -84,10 +84,6 @@ public class Bank
Bus.Post(new BankReadyEvent());
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
@ -132,13 +128,7 @@ public class Bank
instance.accounts.add(new Account(ID));
instance.commit();
try {
Bus.Post(new BankAccountCreatedEvent(getAccount(ID)));
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
Bus.Post(new BankAccountCreatedEvent(getAccount(ID)));
}else {
}
}

View file

@ -63,13 +63,7 @@ public class S2CWalletUpdatedPacket implements IPacket
return ServerUtilities.handlePacket(supplier, new Runnable() {
@Override
public void run() {
try {
Bus.Post(new WalletUpdatedEvent(ID, oldBal, balance, tx));
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
Bus.Post(new WalletUpdatedEvent(ID, oldBal, balance, tx));
}
});