package luckyblock.action; import com.google.gson.JsonElement; import com.google.gson.annotations.SerializedName; import luckyblock.action.triggers.*; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.Level; import java.util.ArrayList; import java.util.List; public class LuckyActionHolder { private static final List cmdList = new ArrayList<>(); static { cmdList.add(new BroadcastTrigger()); cmdList.add(new SummonItemTrigger()); cmdList.add(new SummonTrigger()); cmdList.add(new TrappedRoomTrigger()); } public String type = ""; public int weight = -1; public List queue; @SerializedName("delay-queue") public List delay_queue; public JsonElement json; public List items; public List mobs; public int count = 1; public int height = 0; @SerializedName("is-powered") public boolean is_powered = false; @SerializedName("wall-block") public String wall_block = "minecraft:stone_bricks"; public int radius = 3; public void execute(Level level, BlockPos pos) { if (!(level instanceof ServerLevel serverLevel)) { return; } for (ILuckyTrigger c : cmdList) { if (this.type != null && this.type.equals(c.getName())) { c.execute(serverLevel, pos, this, level.getRandom()); break; } } if (this.queue != null && !this.queue.isEmpty()) { for (int i=0;i