Fix back, migrate config to snbt, implement cooldowns

This commit is contained in:
zontreck 2024-01-15 20:33:16 -07:00
parent 21c349ef3c
commit ca869f6d2b
43 changed files with 953 additions and 189 deletions

View file

@ -3,11 +3,13 @@ package dev.zontreck.essentials.commands.gui;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.BoolArgumentType;
import dev.zontreck.essentials.Messages;
import dev.zontreck.essentials.events.CommandExecutionEvent;
import dev.zontreck.essentials.networking.ModMessages;
import dev.zontreck.essentials.networking.packets.s2c.S2CUpdateHearts;
import dev.zontreck.libzontreck.util.ChatHelpers;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraftforge.common.MinecraftForge;
public class HeartsCommand
{
@ -18,6 +20,11 @@ public class HeartsCommand
private static int hearts(CommandSourceStack stack, boolean compressHearts)
{
var exec = new CommandExecutionEvent(stack.getPlayer(), "hearts");
if(MinecraftForge.EVENT_BUS.post(exec))
{
return 0;
}
// Send the state to the client, then update the config
// Send feedback to the user
ChatHelpers.broadcastTo(stack.getPlayer().getUUID(), ChatHelpers.macro(Messages.HEARTS_UPDATED), stack.getServer());