package net.mcreator.puzzle_code.procedures;

import org.checkerframework.checker.units.qual.s;

import net.minecraft.world.level.LevelAccessor;
import net.minecraft.client.gui.components.EditBox;

import java.util.HashMap;

public class ApplyTimeProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, HashMap guistate) {
		if (guistate == null)
			return;
		SetNBTNumberSystemProcedure.execute(world, x, y, z, new Object() {
			double convert(String s) {
				try {
					return Double.parseDouble(s.trim());
				} catch (Exception e) {
				}
				return 0;
			}
		}.convert(guistate.containsKey("text:timeField") ? ((EditBox) guistate.get("text:timeField")).getValue() : ""), "time");
	}
}
