Add a custom currency API

This commit is contained in:
Aria 2023-04-21 17:44:33 -07:00
parent c6ff1afbdc
commit 1842387ec8
23 changed files with 783 additions and 42 deletions

View file

@ -45,6 +45,9 @@ public class ChatHelpers {
public void run()
{
ServerPlayer play = server.getPlayerList().getPlayer(ID);
if(play==null)return;
play.displayClientMessage(message, actionBar);
LibZontreck.LOGGER.info("[SERVER] -> ["+play.getName().getContents()+"] "+message.getContents());

View file

@ -5,6 +5,7 @@ import java.util.function.Function;
import java.util.function.Supplier;
import dev.zontreck.libzontreck.LibZontreck;
import dev.zontreck.libzontreck.exceptions.InvalidSideException;
import dev.zontreck.libzontreck.networking.ModMessages;
import dev.zontreck.libzontreck.networking.packets.IPacket;
import net.minecraft.network.FriendlyByteBuf;
@ -39,7 +40,7 @@ public class ServerUtilities
channel.messageBuilder(type, ModMessages.id(), packet.getDirection())
.decoder(decoder)
.encoder(X::toBytes)
.consumer(X::handle)
.consumerMainThread(X::handle)
.add();
}
@ -74,4 +75,11 @@ public class ServerUtilities
{
return !isServer();
}
public static boolean playerIsOffline(UUID ID) throws InvalidSideException {
if(isClient())throw new InvalidSideException("This can only be called on the server");
if(LibZontreck.THE_SERVER.getPlayerList().getPlayer(ID) == null) return true;
else return false;
}
}