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 parchment_version=2023.09.03
# luckperms_api_version=5.4 # luckperms_api_version=5.4
libac=1.4.1 libac=1.4.3
eventsbus=1.0.16 eventsbus=1.0.29
## Environment Properties ## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact # 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 Commands());
MinecraftForge.EVENT_BUS.register(new NetworkEvents()); MinecraftForge.EVENT_BUS.register(new NetworkEvents());
Bus.Reset();
Bus.Register(CurrencyHelper.class, null); Bus.Register(CurrencyHelper.class, null);
Bus.Register(Bank.class, null); Bus.Register(Bank.class, null);

View file

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

View file

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

View file

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