/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.google.common.collect.Maps * com.mojang.serialization.Codec * com.mojang.serialization.MapCodec */ package net.minecraft.server.dialog.action; import com.google.common.collect.Maps; import com.mojang.serialization.Codec; import com.mojang.serialization.MapCodec; import java.util.Map; import java.util.Optional; import java.util.function.Supplier; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.StringTag; import net.minecraft.nbt.Tag; import net.minecraft.network.chat.ClickEvent; public interface Action { public static final Codec CODEC = BuiltInRegistries.DIALOG_ACTION_TYPE.byNameCodec().dispatch(Action::codec, c -> c); public MapCodec codec(); public Optional createAction(Map var1); public static interface ValueGetter { public String asTemplateSubstitution(); public Tag asTag(); public static Map getAsTemplateSubstitutions(Map parameters) { return Maps.transformValues(parameters, ValueGetter::asTemplateSubstitution); } public static ValueGetter of(final String value) { return new ValueGetter(){ @Override public String asTemplateSubstitution() { return value; } @Override public Tag asTag() { return StringTag.valueOf(value); } }; } public static ValueGetter of(final Supplier value) { return new ValueGetter(){ @Override public String asTemplateSubstitution() { return (String)value.get(); } @Override public Tag asTag() { return StringTag.valueOf((String)value.get()); } }; } } }