Fix compile errors

This commit is contained in:
Zontreck 2024-02-13 22:47:07 -07:00
parent c5316a2763
commit 8c9fa42619
3 changed files with 6 additions and 7 deletions

View file

@ -143,7 +143,7 @@ public class Bank
protected static boolean postTx(Transaction tx) throws InvalidSideException, InvocationTargetException, IllegalAccessException { protected static boolean postTx(Transaction tx) throws InvalidSideException, InvocationTargetException, IllegalAccessException {
if(ServerUtilities.isClient())return false; if(ServerUtilities.isClient())return false;
TransactionEvent ev = new TransactionEvent(tx); TransactionEvent ev = new TransactionEvent(tx);
if(Bus.Post(ev)) if(MinecraftForge.EVENT_BUS.post(ev))
{ {
// Send the list of reasons to the user // Send the list of reasons to the user
String reasonStr = String.join("\n", ev.reasons); String reasonStr = String.join("\n", ev.reasons);

View file

@ -1,15 +1,13 @@
package dev.zontreck.libzontreck.currency.events; package dev.zontreck.libzontreck.currency.events;
import dev.zontreck.eventsbus.Cancellable;
import dev.zontreck.eventsbus.Event;
import dev.zontreck.libzontreck.currency.Transaction; import dev.zontreck.libzontreck.currency.Transaction;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List; import java.util.List;
@Cancellable @Cancelable
public class TransactionEvent extends Event public class TransactionEvent extends Event
{ {
public Transaction tx; public Transaction tx;

View file

@ -6,6 +6,7 @@ import dev.zontreck.libzontreck.currency.events.WalletUpdatedEvent;
import dev.zontreck.libzontreck.util.ServerUtilities; import dev.zontreck.libzontreck.util.ServerUtilities;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.network.NetworkDirection; import net.minecraftforge.network.NetworkDirection;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.simple.SimpleChannel;
@ -63,7 +64,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() {
Bus.Post(new WalletUpdatedEvent(ID, oldBal, balance, tx)); MinecraftForge.EVENT_BUS.post(new WalletUpdatedEvent(ID, oldBal, balance, tx));
} }
}); });